diff --git a/src/Mod/Part/App/Geometry.h b/src/Mod/Part/App/Geometry.h index 44cc311bbb..4a00c13f61 100644 --- a/src/Mod/Part/App/Geometry.h +++ b/src/Mod/Part/App/Geometry.h @@ -94,7 +94,8 @@ public: /// construction geometry (means no impact on a later built topo) /// Note: In the Sketcher and only for the specific case of a point, it has a special meaning: /// a construction point has fixed coordinates for the solver (it has fixed parameters) - bool Construction; + inline bool getConstruction(void) const {return Construction;}; + inline void setConstruction(bool construction) {Construction = construction;}; /// returns the tag of the geometry object boost::uuids::uuid getTag() const; @@ -124,6 +125,9 @@ protected: private: Geometry(const Geometry&); Geometry& operator = (const Geometry&); + +protected: + bool Construction; }; class PartExport GeomPoint : public Geometry diff --git a/src/Mod/Part/App/GeometryPyImp.cpp b/src/Mod/Part/App/GeometryPyImp.cpp index a5dc0347cd..e6a2b36d3f 100644 --- a/src/Mod/Part/App/GeometryPyImp.cpp +++ b/src/Mod/Part/App/GeometryPyImp.cpp @@ -455,13 +455,13 @@ PyObject* GeometryPy::getExtensions(PyObject *args) Py::Boolean GeometryPy::getConstruction(void) const { - return Py::Boolean(getGeometryPtr()->Construction); + return Py::Boolean(getGeometryPtr()->getConstruction()); } void GeometryPy::setConstruction(Py::Boolean arg) { if (getGeometryPtr()->getTypeId() != Part::GeomPoint::getClassTypeId()) - getGeometryPtr()->Construction = arg; + getGeometryPtr()->setConstruction(arg); } Py::String GeometryPy::getTag(void) const diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 74f98f052d..f36f1e4d25 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -321,7 +321,7 @@ int Sketch::addGeometry(const Part::Geometry *geo, bool fixed) if (geo->getTypeId() == GeomPoint::getClassTypeId()) { // add a point const GeomPoint *point = static_cast(geo); // create the definition struct for that geom - if( point->Construction == false ) { + if( point->getConstruction() == false ) { return addPoint(*point, fixed); } else { @@ -1047,7 +1047,7 @@ std::vector Sketch::extractGeometry(bool withConstructionEleme std::vector temp; temp.reserve(Geoms.size()); for (std::vector::const_iterator it=Geoms.begin(); it != Geoms.end(); ++it) { - if ((!it->external || withExternalElements) && (!it->geo->Construction || withConstructionElements)) + if ((!it->external || withExternalElements) && (!it->geo->getConstruction() || withConstructionElements)) temp.push_back(it->geo->clone()); } @@ -2899,7 +2899,7 @@ bool Sketch::updateGeometry() if (it->type == Point) { GeomPoint *point = static_cast(it->geo); - if(!point->Construction) { + if(!point->getConstruction()) { point->setPoint(Vector3d(*Points[it->startPointId].x, *Points[it->startPointId].y, 0.0) @@ -3051,7 +3051,7 @@ bool Sketch::updateGeometry() if (Geoms[*it5].type == Point) { GeomPoint *point = static_cast(Geoms[*it5].geo); - if(point->Construction) { + if(point->getConstruction()) { point->setPoint(bsp->pointAtParameter(knots[index])); } } @@ -3802,7 +3802,7 @@ TopoShape Sketch::toShape(void) const // collecting all (non constructive and non external) edges out of the sketch for (;it!=Geoms.end();++it) { - if (!it->external && !it->geo->Construction && (it->type != Point)) { + if (!it->external && !it->geo->getConstruction() && (it->type != Point)) { edge_list.push_back(TopoDS::Edge(it->geo->toShape())); } } diff --git a/src/Mod/Sketcher/App/SketchAnalysis.cpp b/src/Mod/Sketcher/App/SketchAnalysis.cpp index 529926fd27..2849196cca 100644 --- a/src/Mod/Sketcher/App/SketchAnalysis.cpp +++ b/src/Mod/Sketcher/App/SketchAnalysis.cpp @@ -146,7 +146,7 @@ int SketchAnalysis::detectMissingPointOnPointConstraints(double precision, bool for (std::size_t i=0; iConstruction && !includeconstruction) + if(g->getConstruction() && !includeconstruction) continue; if (g->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { @@ -830,7 +830,7 @@ int SketchAnalysis::detectDegeneratedGeometries(double tolerance) for (std::size_t i=0; iConstruction) + if (g->getConstruction()) continue; if (g->getTypeId().isDerivedFrom(Part::GeomCurve::getClassTypeId())) { @@ -851,7 +851,7 @@ int SketchAnalysis::removeDegeneratedGeometries(double tolerance) for (std::size_t i=0; iConstruction) + if (g->getConstruction()) continue; if (g->getTypeId().isDerivedFrom(Part::GeomCurve::getClassTypeId())) { diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 0870537a3f..493fad8c6d 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -120,8 +120,8 @@ SketchObject::SketchObject() Part::GeomLineSegment *VLine = new Part::GeomLineSegment(); HLine->setPoints(Base::Vector3d(0,0,0),Base::Vector3d(1,0,0)); VLine->setPoints(Base::Vector3d(0,0,0),Base::Vector3d(0,1,0)); - HLine->Construction = true; - VLine->Construction = true; + HLine->setConstruction(true); + VLine->setConstruction(true); ExternalGeo.push_back(HLine); ExternalGeo.push_back(VLine); rebuildVertexIndex(); @@ -412,9 +412,9 @@ int SketchObject::toggleDriving(int ConstrId) const Part::Geometry * geo2 = getGeometry(vals[ConstrId]->Second); const Part::Geometry * geo3 = getGeometry(vals[ConstrId]->Third); - bool extorconstructionpoint1 = (vals[ConstrId]->First == Constraint::GeoUndef) || (vals[ConstrId]->First < 0) || (geo1 && geo1->getTypeId() == Part::GeomPoint::getClassTypeId() && geo1->Construction == true); - bool extorconstructionpoint2 = (vals[ConstrId]->Second == Constraint::GeoUndef) || (vals[ConstrId]->Second < 0) || (geo2 && geo2->getTypeId() == Part::GeomPoint::getClassTypeId() && geo2->Construction == true); - bool extorconstructionpoint3 = (vals[ConstrId]->Third == Constraint::GeoUndef) || (vals[ConstrId]->Third < 0) || (geo3 && geo3->getTypeId() == Part::GeomPoint::getClassTypeId() && geo3->Construction == true); + bool extorconstructionpoint1 = (vals[ConstrId]->First == Constraint::GeoUndef) || (vals[ConstrId]->First < 0) || (geo1 && geo1->getTypeId() == Part::GeomPoint::getClassTypeId() && geo1->getConstruction() == true); + bool extorconstructionpoint2 = (vals[ConstrId]->Second == Constraint::GeoUndef) || (vals[ConstrId]->Second < 0) || (geo2 && geo2->getTypeId() == Part::GeomPoint::getClassTypeId() && geo2->getConstruction() == true); + bool extorconstructionpoint3 = (vals[ConstrId]->Third == Constraint::GeoUndef) || (vals[ConstrId]->Third < 0) || (geo3 && geo3->getTypeId() == Part::GeomPoint::getClassTypeId() && geo3->getConstruction() == true); if (extorconstructionpoint1 && extorconstructionpoint2 && extorconstructionpoint3 && vals[ConstrId]->isDriving==false) return -4; @@ -801,7 +801,7 @@ int SketchObject::getAxisCount(void) const int count=0; for (std::vector::const_iterator geo=vals.begin(); geo != vals.end(); geo++) - if ((*geo) && (*geo)->Construction && + if ((*geo) && (*geo)->getConstruction() && (*geo)->getTypeId() == Part::GeomLineSegment::getClassTypeId()) count++; @@ -817,7 +817,7 @@ Base::Axis SketchObject::getAxis(int axId) const int count=0; for (std::vector::const_iterator geo=vals.begin(); geo != vals.end(); geo++) - if ((*geo) && (*geo)->Construction && + if ((*geo) && (*geo)->getConstruction() && (*geo)->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { if (count == axId) { Part::GeomLineSegment *lineSeg = static_cast(*geo); @@ -892,7 +892,7 @@ int SketchObject::addGeometry(const std::vector &geoList, bool Part::Geometry* copy = v->copy(); if(construction && copy->getTypeId() != Part::GeomPoint::getClassTypeId()) { - copy->Construction = construction; + copy->setConstruction(construction); } newVals.push_back(copy); @@ -920,7 +920,7 @@ int SketchObject::addGeometry(const Part::Geometry *geo, bool construction/*=fal Part::Geometry *geoNew = geo->copy(); if(geoNew->getTypeId() != Part::GeomPoint::getClassTypeId()) - geoNew->Construction = construction; + geoNew->setConstruction(construction); newVals.push_back(geoNew); @@ -1052,7 +1052,7 @@ int SketchObject::toggleConstruction(int GeoId) newVals[i] = newVals[i]->clone(); if((int)i == GeoId) { - newVals[i]->Construction = !newVals[i]->Construction; + newVals[i]->setConstruction(!newVals[i]->getConstruction()); } } @@ -1085,7 +1085,7 @@ int SketchObject::setConstruction(int GeoId, bool on) newVals[i] = newVals[i]->clone(); if((int)i == GeoId) { - newVals[i]->Construction = on; + newVals[i]->setConstruction(on); } } @@ -4025,7 +4025,7 @@ int SketchObject::addCopy(const std::vector &geoIdList, const Base::Vector3 (double(x-1)*displacement+double(y)*perpendicularDisplacement)); // position of the reference point Base::Vector3d ep = iterfirstpoint; // position of the current instance corresponding point constrline->setPoints(sp,ep); - constrline->Construction=true; + constrline->setConstruction(true); newgeoVals.push_back(constrline); @@ -4722,7 +4722,7 @@ int SketchObject::exposeInternalGeometry(int GeoId) // a construction point, for now on, is a point that is not handled by the solver and does not contribute to the dofs // This is done so as to avoid having to add another data member to GeomPoint that is specific for the sketcher. - kp->Construction=true; + kp->setConstruction(true); igeo.push_back(kp); @@ -5534,7 +5534,7 @@ int SketchObject::carbonCopy(App::DocumentObject * pObj, bool construction) for (std::vector::const_iterator it=svals.begin(); it != svals.end(); ++it){ Part::Geometry *geoNew = (*it)->copy(); if(construction && geoNew->getTypeId() != Part::GeomPoint::getClassTypeId()) { - geoNew->Construction = true; + geoNew->setConstruction(true); } newVals.push_back(geoNew); } @@ -5868,13 +5868,13 @@ Part::Geometry* projectLine(const BRepAdaptor_Curve& curve, const Handle(Geom_Pl if (Base::Distance(p1,p2) < Precision::Confusion()) { Base::Vector3d p = (p1 + p2) / 2; Part::GeomPoint* point = new Part::GeomPoint(p); - point->Construction = true; + point->setConstruction(true); return point; } else { Part::GeomLineSegment* line = new Part::GeomLineSegment(); line->setPoints(p1,p2); - line->Construction = true; + line->setConstruction(true); return line; } } @@ -5994,8 +5994,8 @@ void SketchObject::rebuildExternalGeometry(void) Part::GeomLineSegment *VLine = new Part::GeomLineSegment(); HLine->setPoints(Base::Vector3d(0,0,0),Base::Vector3d(1,0,0)); VLine->setPoints(Base::Vector3d(0,0,0),Base::Vector3d(0,1,0)); - HLine->Construction = true; - VLine->Construction = true; + HLine->setConstruction(true); + VLine->setConstruction(true); ExternalGeo.push_back(HLine); ExternalGeo.push_back(VLine); for (int i=0; i < int(Objects.size()); i++) { @@ -6093,7 +6093,7 @@ void SketchObject::rebuildExternalGeometry(void) gCircle->setRadius(circle.Radius()); gCircle->setCenter(Base::Vector3d(cnt.X(),cnt.Y(),cnt.Z())); - gCircle->Construction = true; + gCircle->setConstruction(true); ExternalGeo.push_back(gCircle); } else { @@ -6102,7 +6102,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_TrimmedCurve) tCurve = new Geom_TrimmedCurve(hCircle, curve.FirstParameter(), curve.LastParameter()); gArc->setHandle(tCurve); - gArc->Construction = true; + gArc->setConstruction(true); ExternalGeo.push_back(gArc); } } @@ -6204,7 +6204,7 @@ void SketchObject::rebuildExternalGeometry(void) invPlm.multVec(p2,p2); projectedSegment->setPoints(p1, p2); - projectedSegment->Construction = true; + projectedSegment->setConstruction(true); ExternalGeo.push_back(projectedSegment); } else { // general case, full circle @@ -6230,7 +6230,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_Ellipse) curve = new Geom_Ellipse(refFrameEllipse, origCircle.Radius(), minorRadius); Part::GeomEllipse* ellipse = new Part::GeomEllipse(); ellipse->setHandle(curve); - ellipse->Construction = true; + ellipse->setConstruction(true); ExternalGeo.push_back(ellipse); } @@ -6253,7 +6253,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_Ellipse) curve = new Geom_Ellipse(elipsDest); Part::GeomEllipse* ellipse = new Part::GeomEllipse(); ellipse->setHandle(curve); - ellipse->Construction = true; + ellipse->setConstruction(true); ExternalGeo.push_back(ellipse); } @@ -6299,7 +6299,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_Circle) curve = new Geom_Circle(destCurveAx2, 0.5 * (rDest + RDest)); Part::GeomCircle* circle = new Part::GeomCircle(); circle->setHandle(curve); - circle->Construction = true; + circle->setConstruction(true); ExternalGeo.push_back(circle); } @@ -6311,7 +6311,7 @@ void SketchObject::rebuildExternalGeometry(void) Part::GeomLineSegment * projectedSegment = new Part::GeomLineSegment(); projectedSegment->setPoints(Base::Vector3d(start.X(), start.Y(), start.Z()), Base::Vector3d(end.X(), end.Y(), end.Z())); - projectedSegment->Construction = true; + projectedSegment->setConstruction(true); ExternalGeo.push_back(projectedSegment); } else { @@ -6324,7 +6324,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_Ellipse) curve = new Geom_Ellipse(elipsDest); Part::GeomEllipse* ellipse = new Part::GeomEllipse(); ellipse->setHandle(curve); - ellipse->Construction = true; + ellipse->setConstruction(true); ExternalGeo.push_back(ellipse); } @@ -6353,13 +6353,13 @@ void SketchObject::rebuildExternalGeometry(void) if (Base::Distance(p1,p2) < Precision::Confusion()) { Base::Vector3d p = (p1 + p2) / 2; Part::GeomPoint* point = new Part::GeomPoint(p); - point->Construction = true; + point->setConstruction(true); ExternalGeo.push_back(point); } else { Part::GeomLineSegment* line = new Part::GeomLineSegment(); line->setPoints(p1,p2); - line->Construction = true; + line->setConstruction(true); ExternalGeo.push_back(line); } } @@ -6374,7 +6374,7 @@ void SketchObject::rebuildExternalGeometry(void) circle->setRadius(c.Radius()); circle->setCenter(Base::Vector3d(p.X(),p.Y(),p.Z())); - circle->Construction = true; + circle->setConstruction(true); ExternalGeo.push_back(circle); } else { @@ -6383,7 +6383,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_TrimmedCurve) tCurve = new Geom_TrimmedCurve(curve, projCurve.FirstParameter(), projCurve.LastParameter()); arc->setHandle(tCurve); - arc->Construction = true; + arc->setConstruction(true); ExternalGeo.push_back(arc); } } else if (projCurve.GetType() == GeomAbs_BSplineCurve) { @@ -6405,11 +6405,11 @@ void SketchObject::rebuildExternalGeometry(void) gp_Pnt center = circ->Axis().Location(); circle->setCenter(Base::Vector3d(center.X(), center.Y(), center.Z())); - circle->Construction = true; + circle->setConstruction(true); ExternalGeo.push_back(circle); } else { Part::GeomBSplineCurve* bspline = new Part::GeomBSplineCurve(projCurve.BSpline()); - bspline->Construction = true; + bspline->setConstruction(true); ExternalGeo.push_back(bspline); } } else if (projCurve.GetType() == GeomAbs_Hyperbola) { @@ -6428,7 +6428,7 @@ void SketchObject::rebuildExternalGeometry(void) hyperbola->setMinorRadius(e.MinorRadius()); hyperbola->setCenter(Base::Vector3d(p.X(),p.Y(),p.Z())); hyperbola->setAngleXU(-xdir.AngleWithRef(xdirref.XDirection(),normal)); - hyperbola->Construction = true; + hyperbola->setConstruction(true); ExternalGeo.push_back(hyperbola); } else { @@ -6437,7 +6437,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_TrimmedCurve) tCurve = new Geom_TrimmedCurve(curve, projCurve.FirstParameter(), projCurve.LastParameter()); aoh->setHandle(tCurve); - aoh->Construction = true; + aoh->setConstruction(true); ExternalGeo.push_back(aoh); } } else if (projCurve.GetType() == GeomAbs_Parabola) { @@ -6455,7 +6455,7 @@ void SketchObject::rebuildExternalGeometry(void) parabola->setFocal(e.Focal()); parabola->setCenter(Base::Vector3d(p.X(),p.Y(),p.Z())); parabola->setAngleXU(-xdir.AngleWithRef(xdirref.XDirection(),normal)); - parabola->Construction = true; + parabola->setConstruction(true); ExternalGeo.push_back(parabola); } else { @@ -6464,7 +6464,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_TrimmedCurve) tCurve = new Geom_TrimmedCurve(curve, projCurve.FirstParameter(), projCurve.LastParameter()); aop->setHandle(tCurve); - aop->Construction = true; + aop->setConstruction(true); ExternalGeo.push_back(aop); } } @@ -6482,7 +6482,7 @@ void SketchObject::rebuildExternalGeometry(void) Part::GeomEllipse* ellipse = new Part::GeomEllipse(); Handle(Geom_Ellipse) curve = new Geom_Ellipse(e); ellipse->setHandle(curve); - ellipse->Construction = true; + ellipse->setConstruction(true); ExternalGeo.push_back(ellipse); } else { @@ -6491,7 +6491,7 @@ void SketchObject::rebuildExternalGeometry(void) Handle(Geom_TrimmedCurve) tCurve = new Geom_TrimmedCurve(curve, projCurve.FirstParameter(), projCurve.LastParameter()); aoe->setHandle(tCurve); - aoe->Construction = true; + aoe->setConstruction(true); ExternalGeo.push_back(aoe); } } @@ -6516,7 +6516,7 @@ void SketchObject::rebuildExternalGeometry(void) invPlm.multVec(p,p); Part::GeomPoint* point = new Part::GeomPoint(p); - point->Construction = true; + point->setConstruction(true); ExternalGeo.push_back(point); } break; diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index 96f314593d..c19d77f00e 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -237,7 +237,7 @@ bool SketcherGui::isSimpleVertex(const Sketcher::SketchObject* Obj, int GeoId, P bool SketcherGui::isConstructionPoint(const Sketcher::SketchObject* Obj, int GeoId) { const Part::Geometry * geo = Obj->getGeometry(GeoId); - return (geo && geo->getTypeId() == Part::GeomPoint::getClassTypeId() && geo->Construction == true); + return (geo && geo->getTypeId() == Part::GeomPoint::getClassTypeId() && geo->getConstruction() == true); } bool SketcherGui::IsPointAlreadyOnCurve(int GeoIdCurve, int GeoIdPoint, Sketcher::PointPos PosIdPoint, Sketcher::SketchObject* Obj) @@ -1157,7 +1157,7 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel { SketcherGui::ViewProviderSketch* sketchgui = static_cast(getActiveGuiDocument()->getInEdit()); Sketcher::SketchObject* Obj = sketchgui->getSketchObject(); - + switch (seqIndex) { case 0: // {Edge} { @@ -1206,7 +1206,7 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel break; } - + case 1 : // {SelVertex, SelVertexOrRoot} case 2 : // {SelRoot, SelVertex} { @@ -1214,7 +1214,7 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel Sketcher::PointPos PosId1, PosId2; GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; PosId1 = selSeq.at(0).PosId; PosId2 = selSeq.at(1).PosId; - + if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { showNoConstraintBetweenFixedGeometry(); return; @@ -1230,9 +1230,9 @@ void CmdSketcherConstrainHorizontal::applyConstraint(std::vector &sel Gui::Command::commitCommand(); tryAutoRecompute(Obj); - + break; - + } } } @@ -1449,7 +1449,7 @@ void CmdSketcherConstrainVertical::applyConstraint(std::vector &selSe Sketcher::PointPos PosId1, PosId2; GeoId1 = selSeq.at(0).GeoId; GeoId2 = selSeq.at(1).GeoId; PosId1 = selSeq.at(0).PosId; PosId2 = selSeq.at(1).PosId; - + if ( areBothPointsOrSegmentsFixed(Obj, GeoId1, GeoId2) ) { showNoConstraintBetweenFixedGeometry(); return; @@ -1465,7 +1465,7 @@ void CmdSketcherConstrainVertical::applyConstraint(std::vector &selSe Gui::Command::commitCommand(); tryAutoRecompute(Obj); - + break; } } @@ -7003,7 +7003,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::GeomLineSegment *geo = static_cast(Obj->getGeometry(lineids[0])); - if(!geo->Construction) + if(!geo->getConstruction()) Gui::cmdAppObjectArgs(selection[0].getObject(),"toggleConstruction(%d) ",lineids[0]); } @@ -7014,7 +7014,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::GeomLineSegment *geo = static_cast(Obj->getGeometry(lineids[0])); - if(!geo->Construction) + if(!geo->getConstruction()) Gui::cmdAppObjectArgs(selection[0].getObject(),"toggleConstruction(%d) ",lineids[0]); minor=true; @@ -7031,7 +7031,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::GeomLineSegment *geo = static_cast(Obj->getGeometry(lineids[1])); - if(!geo->Construction) + if(!geo->getConstruction()) Gui::cmdAppObjectArgs(selection[0].getObject(),"toggleConstruction(%d) ",lineids[1]); } else @@ -7181,7 +7181,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::GeomLineSegment *geo = static_cast(Obj->getGeometry(lineids[0])); - if(!geo->Construction) + if(!geo->getConstruction()) Gui::cmdAppObjectArgs(selection[0].getObject(),"toggleConstruction(%d) ",lineids[0]); } @@ -7192,7 +7192,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::GeomLineSegment *geo = static_cast(Obj->getGeometry(lineids[0])); - if(!geo->Construction) + if(!geo->getConstruction()) Gui::cmdAppObjectArgs(selection[0].getObject(),"toggleConstruction(%d) ",lineids[0]); minor=true; @@ -7209,7 +7209,7 @@ void CmdSketcherConstrainInternalAlignment::activated(int iMsg) const Part::GeomLineSegment *geo = static_cast(Obj->getGeometry(lineids[1])); - if (!geo->Construction) + if (!geo->getConstruction()) Gui::cmdAppObjectArgs(selection[0].getObject(),"toggleConstruction(%d) ",lineids[1]); } else diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index 90ef44ee5a..54f08fc566 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -5133,7 +5133,7 @@ public: if (GeoIdList.size() == 2 && GeoIdList[0] >= 0 && GeoIdList[1] >= 0) { const Part::Geometry *geom1 = sketchgui->getSketchObject()->getGeometry(GeoIdList[0]); const Part::Geometry *geom2 = sketchgui->getSketchObject()->getGeometry(GeoIdList[1]); - construction=geom1->Construction && geom2->Construction; + construction=geom1->getConstruction() && geom2->getConstruction(); if (geom1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { const Part::GeomLineSegment *lineSeg1 = static_cast(geom1); @@ -5216,7 +5216,7 @@ public: if (radius < 0) return false; - construction=lineSeg1->Construction && lineSeg2->Construction; + construction=lineSeg1->getConstruction() && lineSeg2->getConstruction(); } else { // other supported curves const Part::Geometry *geo1 = static_cast @@ -5224,7 +5224,7 @@ public: const Part::Geometry *geo2 = static_cast (sketchgui->getSketchObject()->getGeometry(secondCurve)); - construction=geo1->Construction && geo2->Construction; + construction=geo1->getConstruction() && geo2->getConstruction(); } diff --git a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp index 43d52b7194..8a5a8f718a 100644 --- a/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp +++ b/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp @@ -712,7 +712,7 @@ void TaskSketcherElements::slotElementsChanged(void) int i=1; for(std::vector< Part::Geometry * >::const_iterator it= vals.begin();it!=vals.end();++it,++i){ Base::Type type = (*it)->getTypeId(); - bool construction = (*it)->Construction; + bool construction = (*it)->getConstruction(); ui->listWidgetElements->addItem(new ElementItem( (type == Part::GeomPoint::getClassTypeId() && element==1) ? Sketcher_Element_Point_StartingPoint.getIcon(construction, false) : @@ -1070,12 +1070,12 @@ void TaskSketcherElements::updateIcons(int element) MultIcon Sketcher_Element_BSpline_EndPoint("Sketcher_Element_BSpline_EndPoint"); MultIcon none("Sketcher_Element_SelectionTypeInvalid"); - + for (int i=0;ilistWidgetElements->count(); i++) { Base::Type type = static_cast(ui->listWidgetElements->item(i))->GeometryType; bool construction = static_cast(ui->listWidgetElements->item(i))->isConstruction; bool external = static_cast(ui->listWidgetElements->item(i))->isExternal; - + ui->listWidgetElements->item(i)->setIcon( (type == Part::GeomPoint::getClassTypeId() && element==1) ? Sketcher_Element_Point_StartingPoint.getIcon(construction, external) : (type == Part::GeomLineSegment::getClassTypeId() && element==0) ? Sketcher_Element_Line_Edge.getIcon(construction, external) : @@ -1122,7 +1122,7 @@ TaskSketcherElements::MultIcon::MultIcon(const char* name) Normal = Gui::BitmapFactory().iconFromTheme(name); QImage imgConstr(Normal.pixmap(Normal.availableSizes()[0]).toImage()); QImage imgExt(imgConstr); - + for(int ix=0 ; ixgetGeometry(edit->PointIdToGeoId[i]); if(tmp && z < zHighlight) { - if(tmp->Construction) + if(tmp->getConstruction()) pverts[i].setValue(x,y,zConstrPoint); else pverts[i].setValue(x,y,zNormPoint); @@ -2688,7 +2688,7 @@ void ViewProviderSketch::updateColor(void) auto isConstructionGeom = [](Sketcher::SketchObject* obj, int GeoId) -> bool { const Part::Geometry* geom = obj->getGeometry(GeoId); if (geom) - return geom->Construction; + return geom->getConstruction(); return false; };