From c7b137fe856b1a11a2cecda7b8f77a027020bcbf Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 31 Dec 2017 15:24:12 +0100 Subject: [PATCH] Sketcher: Change nomenclature relating to Block constraint --- src/Mod/Sketcher/App/Constraint.h | 2 +- src/Mod/Sketcher/App/ConstraintPyImp.cpp | 6 +- src/Mod/Sketcher/App/Sketch.cpp | 5 +- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 94 +++++++++---------- src/Mod/Sketcher/Gui/Resources/Sketcher.qrc | 4 +- ...locked.svg => Sketcher_ConstrainBlock.svg} | 0 ...Blocked_sm.xpm => Constraint_Block_sm.xpm} | 2 +- .../Sketcher/Gui/TaskSketcherConstrains.cpp | 10 +- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 10 +- src/Mod/Sketcher/Gui/Workbench.cpp | 4 +- 10 files changed, 69 insertions(+), 68 deletions(-) rename src/Mod/Sketcher/Gui/Resources/icons/{Sketcher_ConstrainBlocked.svg => Sketcher_ConstrainBlock.svg} (100%) rename src/Mod/Sketcher/Gui/Resources/icons/small/{Constraint_Blocked_sm.xpm => Constraint_Block_sm.xpm} (89%) diff --git a/src/Mod/Sketcher/App/Constraint.h b/src/Mod/Sketcher/App/Constraint.h index 4ba36c11b0..a3898c1a9a 100644 --- a/src/Mod/Sketcher/App/Constraint.h +++ b/src/Mod/Sketcher/App/Constraint.h @@ -55,7 +55,7 @@ enum ConstraintType { Symmetric = 14, InternalAlignment = 15, SnellsLaw = 16, - Blocked = 17, + Block = 17, NumConstraintTypes // must be the last item! }; diff --git a/src/Mod/Sketcher/App/ConstraintPyImp.cpp b/src/Mod/Sketcher/App/ConstraintPyImp.cpp index 1ebd2f2aa3..a9f9e15a7d 100644 --- a/src/Mod/Sketcher/App/ConstraintPyImp.cpp +++ b/src/Mod/Sketcher/App/ConstraintPyImp.cpp @@ -72,8 +72,8 @@ int ConstraintPy::PyInit(PyObject* args, PyObject* /*kwd*/) this->getConstraintPtr()->First = FirstIndex; return 0; } - else if (strcmp("Blocked",ConstraintType) == 0) { - this->getConstraintPtr()->Type = Blocked; + else if (strcmp("Block",ConstraintType) == 0) { + this->getConstraintPtr()->Type = Block; this->getConstraintPtr()->First = FirstIndex; return 0; } @@ -489,7 +489,7 @@ std::string ConstraintPy::representation(void) const case Coincident : result << "'Coincident'>";break; case Horizontal : result << "'Horizontal' (" << getConstraintPtr()->First << ")>";break; case Vertical : result << "'Vertical' (" << getConstraintPtr()->First << ")>";break; - case Blocked : result << "'Blocked' (" << getConstraintPtr()->First << ")>";break; + case Block : result << "'Block' (" << getConstraintPtr()->First << ")>";break; case Radius : result << "'Radius'>";break; case Parallel : result << "'Parallel'>";break; case Tangent : diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 0e78b50940..56e1d8cae6 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -1310,6 +1310,7 @@ int Sketch::addConstraint(const Constraint *constraint) } break; case Sketcher::None: // ambiguous enum value + case Sketcher::Block: // handled separately while adding geometry case NumConstraintTypes: break; } @@ -1334,7 +1335,7 @@ int Sketch::addConstraints(const std::vector &ConstraintList, std: int cid = 0; for (std::vector::const_iterator it = ConstraintList.begin();it!=ConstraintList.end();++it,++cid) { - if (!unenforceableConstraints[cid] && (*it)->Type != Blocked) { + if (!unenforceableConstraints[cid] && (*it)->Type != Block) { rtn = addConstraint (*it); } else { @@ -1357,7 +1358,7 @@ void Sketch::getBlockedGeometry(std::vector & blockedGeometry, std::vector int i = 0; for (std::vector::const_iterator it = ConstraintList.begin();it!=ConstraintList.end();++it,++i) { switch((*it)->Type) { - case Blocked: + case Block: { int geoid = (*it)->First; diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 9d36ddc088..74c7a09131 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -258,7 +258,7 @@ bool SketcherGui::isPointOrSegmentFixed(const Sketcher::SketchObject* Obj, int G if (GeoId == Constraint::GeoUndef) return false; else - return checkConstraint(vals, Sketcher::Blocked, GeoId, Sketcher::none) || GeoId <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId); + return checkConstraint(vals, Sketcher::Block, GeoId, Sketcher::none) || GeoId <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId); } bool SketcherGui::areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2) @@ -268,8 +268,8 @@ bool SketcherGui::areBothPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj if (GeoId1 == Constraint::GeoUndef || GeoId2 == Constraint::GeoUndef) return false; else - return ( (checkConstraint(vals, Sketcher::Blocked, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId1)) && - (checkConstraint(vals, Sketcher::Blocked, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId2))); + return ( (checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId1)) && + (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId2))); } bool SketcherGui::areAllPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, int GeoId1, int GeoId2, int GeoId3) @@ -279,9 +279,9 @@ bool SketcherGui::areAllPointsOrSegmentsFixed(const Sketcher::SketchObject* Obj, if (GeoId1 == Constraint::GeoUndef || GeoId2 == Constraint::GeoUndef || GeoId3 == Constraint::GeoUndef) return false; else - return ( (checkConstraint(vals, Sketcher::Blocked, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId1)) && - (checkConstraint(vals, Sketcher::Blocked, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId2)) && - (checkConstraint(vals, Sketcher::Blocked, GeoId3, Sketcher::none) || GeoId3 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId3))); + return ( (checkConstraint(vals, Sketcher::Block, GeoId1, Sketcher::none) || GeoId1 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId1)) && + (checkConstraint(vals, Sketcher::Block, GeoId2, Sketcher::none) || GeoId2 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId2)) && + (checkConstraint(vals, Sketcher::Block, GeoId3, Sketcher::none) || GeoId3 <= Sketcher::GeoEnum::RefExt || isConstructionPoint(Obj,GeoId3))); } void SketcherGui::getIdsFromName(const std::string &name, const Sketcher::SketchObject* Obj, @@ -1218,8 +1218,8 @@ void CmdSketcherConstrainHorizontal::activated(int iMsg) QObject::tr("The selected edge has already a vertical constraint!")); return; } - // check if the edge has already a Blocked constraint - if ((*it)->Type == Sketcher::Blocked && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none) { + // check if the edge has already a Block constraint + if ((*it)->Type == Sketcher::Block && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), QObject::tr("The selected edge has already a Block constraint!")); return; @@ -1298,7 +1298,7 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel return; } - // check if the edge has already a Horizontal/Vertical/Blocked constraint + // check if the edge has already a Horizontal/Vertical/Block constraint for (std::vector< Sketcher::Constraint * >::const_iterator it= vals.begin(); it != vals.end(); ++it) { if ((*it)->Type == Sketcher::Horizontal && (*it)->First == CrvId){ @@ -1311,8 +1311,8 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel QObject::tr("The selected edge has already a vertical constraint!")); return; } - // check if the edge has already a Blocked constraint - if ((*it)->Type == Sketcher::Blocked && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { + // check if the edge has already a Block constraint + if ((*it)->Type == Sketcher::Block && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), QObject::tr("The selected edge has already a Block constraint!")); return; @@ -1465,8 +1465,8 @@ void CmdSketcherConstrainVertical::activated(int iMsg) QObject::tr("The selected edge has already a horizontral constraint!")); return; } - // check if the edge has already a Blocked constraint - if ((*it)->Type == Sketcher::Blocked && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none) { + // check if the edge has already a Block constraint + if ((*it)->Type == Sketcher::Block && (*it)->First == GeoId && (*it)->FirstPos == Sketcher::none) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), QObject::tr("The selected edge has already a Block constraint!")); return; @@ -1558,8 +1558,8 @@ void CmdSketcherConstrainVertical::applyConstraint(std::vector &selSe QObject::tr("The selected edge has already a vertical constraint!")); return; } - // check if the edge has already a Blocked constraint - if ((*it)->Type == Sketcher::Blocked && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { + // check if the edge has already a Block constraint + if ((*it)->Type == Sketcher::Block && (*it)->First == CrvId && (*it)->FirstPos == Sketcher::none) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Impossible constraint"), QObject::tr("The selected edge has already a Block constraint!")); return; @@ -1707,7 +1707,7 @@ void CmdSketcherConstrainLock::activated(int iMsg) if( GeoId.size() == 1 ) { // absolute mode - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint bool edgeisblocked = false; if ( isPointOrSegmentFixed(Obj, GeoId[0])) { @@ -1743,7 +1743,7 @@ void CmdSketcherConstrainLock::activated(int iMsg) Base::Vector3d pntr = Obj->getPoint(GeoId.back(),PosId.back()); - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint bool refpointfixed = false; if ( isPointOrSegmentFixed(Obj, GeoId.back())) @@ -1797,7 +1797,7 @@ void CmdSketcherConstrainLock::applyConstraint(std::vector &selSeq, i SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint bool pointfixed = false; if ( isPointOrSegmentFixed(Obj, selSeq.front().GeoId)) @@ -1854,7 +1854,7 @@ void CmdSketcherConstrainLock::updateAction(int mode) // ====================================================================================== /* XPM */ -static const char *cursor_createblocked[]={ +static const char *cursor_createblock[]={ "32 32 3 1", "+ c white", "# c red", @@ -1892,35 +1892,35 @@ static const char *cursor_createblocked[]={ ".................###............", "................................"}; -class CmdSketcherConstrainBlocked : public CmdSketcherConstraint +class CmdSketcherConstrainBlock : public CmdSketcherConstraint { public: - CmdSketcherConstrainBlocked(); - virtual ~CmdSketcherConstrainBlocked(){} + CmdSketcherConstrainBlock(); + virtual ~CmdSketcherConstrainBlock(){} virtual const char* className() const - { return "CmdSketcherConstrainBlocked"; } + { return "CmdSketcherConstrainBlock"; } protected: virtual void activated(int iMsg); virtual void applyConstraint(std::vector &selSeq, int seqIndex); }; -CmdSketcherConstrainBlocked::CmdSketcherConstrainBlocked() -:CmdSketcherConstraint("Sketcher_ConstrainBlocked") +CmdSketcherConstrainBlock::CmdSketcherConstrainBlock() +:CmdSketcherConstraint("Sketcher_ConstrainBlock") { sAppModule = "Sketcher"; sGroup = QT_TR_NOOP("Sketcher"); - sMenuText = QT_TR_NOOP("Constrain Blocked"); - sToolTipText = QT_TR_NOOP("Create a blocked constraint on the selected item"); - sWhatsThis = "Sketcher_ConstrainBlocked"; + sMenuText = QT_TR_NOOP("Constrain Block"); + sToolTipText = QT_TR_NOOP("Create a Block constraint on the selected item"); + sWhatsThis = "Sketcher_ConstrainBlock"; sStatusTip = sToolTipText; - sPixmap = "Sketcher_ConstrainBlocked"; + sPixmap = "Sketcher_ConstrainBlock"; eType = ForEdit; allowedSelSequences = {{SelEdge}}; - constraintCursor = cursor_createblocked; + constraintCursor = cursor_createblock; } -void CmdSketcherConstrainBlocked::activated(int iMsg) +void CmdSketcherConstrainBlock::activated(int iMsg) { Q_UNUSED(iMsg); @@ -1950,7 +1950,7 @@ void CmdSketcherConstrainBlocked::activated(int iMsg) // Check that the solver does not report redundant/conflicting constraints if(Obj->getLastSolverStatus()!=GCS::Success || Obj->getLastHasConflicts() || Obj->getLastHasRedundancies()) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong solver status"), - QObject::tr("A block constraint can not be added if the sketch is unsolved or there are redundant and/or conflicting constraints.")); + QObject::tr("A Block constraint can not be added if the sketch is unsolved or there are redundant and/or conflicting constraints.")); return; } @@ -1976,8 +1976,8 @@ void CmdSketcherConstrainBlocked::activated(int iMsg) return; } - // check if the edge has already a Blocked constraint - if ( checkConstraint(vals, Sketcher::Blocked, GeoIdt, Sketcher::none)) { + // check if the edge has already a Block constraint + if ( checkConstraint(vals, Sketcher::Block, GeoIdt, Sketcher::none)) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), QObject::tr("The selected edge has already a Block constraint!")); return; @@ -1988,12 +1988,12 @@ void CmdSketcherConstrainBlocked::activated(int iMsg) for (std::vector::iterator itg = GeoId.begin(); itg != GeoId.end(); ++itg) { // undo command open - openCommand("add blocked constraint"); + openCommand("add block constraint"); try { Gui::Command::doCommand( - Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Blocked',%d)) ", + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Block',%d)) ", selection[0].getFeatName(),(*itg)); } catch (const Base::Exception& e) { @@ -2016,29 +2016,29 @@ void CmdSketcherConstrainBlocked::activated(int iMsg) getSelection().clearSelection(); } -void CmdSketcherConstrainBlocked::applyConstraint(std::vector &selSeq, int seqIndex) +void CmdSketcherConstrainBlock::applyConstraint(std::vector &selSeq, int seqIndex) { switch (seqIndex) { case 0: // {Edge} // Create the constraints SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint const std::vector< Sketcher::Constraint * > &vals = static_cast(sketchgui->getObject())->Constraints.getValues(); - if ( checkConstraint(vals, Sketcher::Blocked, selSeq.front().GeoId, Sketcher::none)) { + if ( checkConstraint(vals, Sketcher::Block, selSeq.front().GeoId, Sketcher::none)) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Double constraint"), QObject::tr("The selected edge has already a Block constraint!")); return; } // undo command open - openCommand("add blocked constraint"); + openCommand("add block constraint"); try { Gui::Command::doCommand( - Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Blocked',%d)) ", + Doc,"App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('Block',%d)) ", sketchgui->getObject()->getNameInDocument(),selSeq.front().GeoId); } catch (const Base::Exception& e) { @@ -2282,7 +2282,7 @@ void CmdSketcherConstrainCoincident::activated(int iMsg) for (std::size_t i=1; i &sel int GeoId1 = selSeq.at(0).GeoId, GeoId2 = selSeq.at(1).GeoId; Sketcher::PointPos PosId1 = selSeq.at(0).PosId, PosId2 = selSeq.at(1).PosId; - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { showNoConstraintBetweenFixedGeometry(); return; @@ -4032,7 +4032,7 @@ void CmdSketcherConstrainPerpendicular::applyConstraint(std::vector & int GeoId1 = Constraint::GeoUndef, GeoId2 = Constraint::GeoUndef, GeoId3 = Constraint::GeoUndef; Sketcher::PointPos PosId1 = Sketcher::none, PosId2 = Sketcher::none, PosId3 = Sketcher::none; - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint if ( areBothPointsOrSegmentsFixed(Obj,GeoId1,GeoId2) ) { showNoConstraintBetweenFixedGeometry(); return; @@ -4618,7 +4618,7 @@ void CmdSketcherConstrainTangent::applyConstraint(std::vector &selSeq int GeoId1 = Constraint::GeoUndef, GeoId2 = Constraint::GeoUndef, GeoId3 = Constraint::GeoUndef; Sketcher::PointPos PosId1 = Sketcher::none, PosId2 = Sketcher::none, PosId3 = Sketcher::none; - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint if ( areBothPointsOrSegmentsFixed(Obj,GeoId1,GeoId2) ) { showNoConstraintBetweenFixedGeometry(); return; @@ -5997,7 +5997,7 @@ void CmdSketcherConstrainEqual::applyConstraint(std::vector &selSeq, { GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; - // check if the edge has already a Blocked constraint + // check if the edge has already a Block constraint if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { showNoConstraintBetweenFixedGeometry(); return; @@ -6999,7 +6999,7 @@ void CreateSketcherCommandsConstraints(void) rcCmdMgr.addCommand(new CmdSketcherConstrainHorizontal()); rcCmdMgr.addCommand(new CmdSketcherConstrainVertical()); rcCmdMgr.addCommand(new CmdSketcherConstrainLock()); - rcCmdMgr.addCommand(new CmdSketcherConstrainBlocked()); + rcCmdMgr.addCommand(new CmdSketcherConstrainBlock()); rcCmdMgr.addCommand(new CmdSketcherConstrainCoincident()); rcCmdMgr.addCommand(new CmdSketcherConstrainParallel()); rcCmdMgr.addCommand(new CmdSketcherConstrainPerpendicular()); diff --git a/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc b/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc index 1102e79e89..dee51a68f3 100644 --- a/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc +++ b/src/Mod/Sketcher/Gui/Resources/Sketcher.qrc @@ -59,7 +59,7 @@ icons/Sketcher_Conics_Ellipse_3points.svg icons/Sketcher_Conics_Ellipse_Center.svg icons/Sketcher_ConnectLines.svg - icons/Sketcher_ConstrainBlocked.svg + icons/Sketcher_ConstrainBlock.svg icons/Sketcher_ConstrainCoincident.svg icons/Sketcher_ConstrainDistance.svg icons/Sketcher_ConstrainHorizontal.svg @@ -176,7 +176,7 @@ icons/Sketcher_Toggle_Constraint_Driving.svg icons/Sketcher_Trimming.svg icons/Sketcher_ViewSketch.svg - icons/small/Constraint_Blocked_sm.xpm + icons/small/Constraint_Block_sm.xpm icons/small/Constraint_Concentric_sm.xpm icons/small/Constraint_EqualLength_sm.xpm icons/small/Constraint_ExternalAngle_sm.xpm diff --git a/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainBlocked.svg b/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainBlock.svg similarity index 100% rename from src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainBlocked.svg rename to src/Mod/Sketcher/Gui/Resources/icons/Sketcher_ConstrainBlock.svg diff --git a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Blocked_sm.xpm b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm similarity index 89% rename from src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Blocked_sm.xpm rename to src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm index ceae7335a7..ecdc6137ae 100644 --- a/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Blocked_sm.xpm +++ b/src/Mod/Sketcher/Gui/Resources/icons/small/Constraint_Block_sm.xpm @@ -1,5 +1,5 @@ /* XPM */ -static char * Constraint_Blocked_sm_xpm[] = { +static char * Constraint_Block_sm_xpm[] = { "15 16 4 1", " c None", ". c #CC0000", diff --git a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp index 64b66e1524..49db314f08 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherConstrains.cpp @@ -128,7 +128,7 @@ public: case Sketcher::Tangent: case Sketcher::Equal: case Sketcher::Symmetric: - case Sketcher::Blocked: + case Sketcher::Block: break; case Sketcher::Distance: case Sketcher::DistanceX: @@ -162,7 +162,7 @@ public: static QIcon horiz( Gui::BitmapFactory().pixmap("Constraint_Horizontal") ); static QIcon vert ( Gui::BitmapFactory().pixmap("Constraint_Vertical") ); static QIcon lock ( Gui::BitmapFactory().pixmap("Sketcher_ConstrainLock") ); - static QIcon block ( Gui::BitmapFactory().pixmap("Sketcher_ConstrainBlocked") ); + static QIcon block ( Gui::BitmapFactory().pixmap("Sketcher_ConstrainBlock") ); static QIcon coinc( Gui::BitmapFactory().pixmap("Constraint_PointOnPoint") ); static QIcon para ( Gui::BitmapFactory().pixmap("Constraint_Parallel") ); static QIcon perp ( Gui::BitmapFactory().pixmap("Constraint_Perpendicular") ); @@ -197,7 +197,7 @@ public: return vert; case Sketcher::Coincident: return coinc; - case Sketcher::Blocked: + case Sketcher::Block: return block; case Sketcher::PointOnObject: return pntoo; @@ -272,7 +272,7 @@ public: case Sketcher::Horizontal: case Sketcher::Vertical: case Sketcher::Coincident: - case Sketcher::Blocked: + case Sketcher::Block: case Sketcher::PointOnObject: case Sketcher::Parallel: case Sketcher::Perpendicular: @@ -771,7 +771,7 @@ void TaskSketcherConstrains::slotConstraintsChanged(void) case Sketcher::Tangent: case Sketcher::Equal: case Sketcher::Symmetric: - case Sketcher::Blocked: + case Sketcher::Block: visible = showNormal || showNamed; break; case Sketcher::Distance: diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 8b26338248..be2fde39d2 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -2743,8 +2743,8 @@ QString ViewProviderSketch::iconTypeFromConstraint(Constraint *constraint) return QString::fromLatin1("small/Constraint_Symmetric_sm"); case SnellsLaw: return QString::fromLatin1("small/Constraint_SnellsLaw_sm"); - case Blocked: - return QString::fromLatin1("small/Constraint_Blocked_sm"); + case Block: + return QString::fromLatin1("small/Constraint_Block_sm"); default: return QString(); } @@ -4052,12 +4052,12 @@ Restart: // distinquish different constraint types to build up switch (Constr->Type) { - case Blocked: + case Block: case Horizontal: // write the new position of the Horizontal constraint Same as vertical position. case Vertical: // write the new position of the Vertical constraint { assert(Constr->First >= -extGeoCount && Constr->First < intGeoCount); - bool alignment = Constr->Type!=Blocked && Constr->Second != Constraint::GeoUndef; + bool alignment = Constr->Type!=Block && Constr->Second != Constraint::GeoUndef; // get the geometry const Part::Geometry *geo = GeoById(*geomlist, Constr->First); @@ -5023,7 +5023,7 @@ void ViewProviderSketch::rebuildConstraintsVisual(void) break; case Horizontal: case Vertical: - case Blocked: + case Block: { // #define CONSTRAINT_SEPARATOR_INDEX_MATERIAL_OR_DATUMLABEL 0 sep->addChild(mat); diff --git a/src/Mod/Sketcher/Gui/Workbench.cpp b/src/Mod/Sketcher/Gui/Workbench.cpp index cf686a1c2c..4acb53db21 100644 --- a/src/Mod/Sketcher/Gui/Workbench.cpp +++ b/src/Mod/Sketcher/Gui/Workbench.cpp @@ -212,7 +212,7 @@ inline void SketcherAddWorkbenchConstraints(Gui::MenuItem& cons){ << "Sketcher_ConstrainTangent" << "Sketcher_ConstrainEqual" << "Sketcher_ConstrainSymmetric" - << "Sketcher_ConstrainBlocked" + << "Sketcher_ConstrainBlock" << "Separator" << "Sketcher_ConstrainLock" << "Sketcher_ConstrainDistanceX" @@ -237,7 +237,7 @@ inline void SketcherAddWorkbenchConstraints(Gui::ToolBarItem& << "Sketcher_ConstrainTangent" << "Sketcher_ConstrainEqual" << "Sketcher_ConstrainSymmetric" - << "Sketcher_ConstrainBlocked" + << "Sketcher_ConstrainBlock" << "Separator" << "Sketcher_ConstrainLock" << "Sketcher_ConstrainDistanceX"