X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionPlugin%2FConstructionPlugin_Axis.cpp;h=8a6c2a5d0c23fb8ea0dad5ad7b35404771e1c90c;hb=dbba795b3b4b4fbefc9a0cf63a49a451f63737f7;hp=ae24aaf3c7916561f9de78cd36f8dfdbc6dcbf69;hpb=3ee83c7b4a29bfb47ad40090dea7cc27f80c2b47;p=modules%2Fshaper.git diff --git a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp index ae24aaf3c..8a6c2a5d0 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Axis.cpp @@ -44,7 +44,11 @@ void ConstructionPlugin_Axis::createAxisByTwoPoints() AttributeSelectionPtr aRef2 = data()->selection(ConstructionPlugin_Axis::POINT_SECOND()); if ((aRef1.get() != NULL) && (aRef2.get() != NULL)) { GeomShapePtr aShape1 = aRef1->value(); + if (!aShape1.get()) + aShape1 = aRef1->context()->shape(); GeomShapePtr aShape2 = aRef2->value(); + if (!aShape2.get()) + aShape2 = aRef2->context()->shape(); if (aShape1->isVertex() && aShape2->isVertex() && (!aShape1->isEqual(aShape2))) { std::shared_ptr aStart = GeomAlgoAPI_PointBuilder::point(aShape1); std::shared_ptr anEnd = GeomAlgoAPI_PointBuilder::point(aShape2); @@ -52,6 +56,7 @@ void ConstructionPlugin_Axis::createAxisByTwoPoints() std::shared_ptr anEdge = GeomAlgoAPI_EdgeBuilder::line(aStart, anEnd); ResultConstructionPtr aConstr = document()->createConstruction(data()); + aConstr->setInfinite(true); aConstr->setShape(anEdge); setResult(aConstr); } @@ -67,6 +72,7 @@ void ConstructionPlugin_Axis::createAxisByCylindricalFace() std::shared_ptr anEdge = GeomAlgoAPI_EdgeBuilder::cylinderAxis(aSelection); ResultConstructionPtr aConstr = document()->createConstruction(data()); + aConstr->setInfinite(true); aConstr->setShape(anEdge); setResult(aConstr); } @@ -89,7 +95,8 @@ bool ConstructionPlugin_Axis::customisePresentation(ResultPtr theResult, AISObje bool isCustomized = theDefaultPrs.get() != NULL && theDefaultPrs->customisePresentation(theResult, thePrs, theDefaultPrs); - isCustomized = thePrs->setLineStyle(3); + isCustomized = thePrs->setLineStyle(3) || isCustomized; + isCustomized = thePrs->setWidth(2) || isCustomized; return isCustomized; }