From: nds Date: Thu, 2 Jun 2016 12:01:19 +0000 (+0300) Subject: Issue #1530 The arcs representation is not fine enough X-Git-Tag: V_2.3.1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dcde2cf7b3e2df1135a2417d286b4b4a1e97bbc2;p=modules%2Fshaper.git Issue #1530 The arcs representation is not fine enough --- diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index 4085f399e..3923c51c6 100755 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -71,7 +71,7 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t Set(myOriginalShape); } // change deviation coefficient to provide more precise circle - ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes()); + ModuleBase_Tools::setDefaultDeviationCoefficient(myResult, Attributes()); AIS_Shape::Compute(thePresentationManager, thePresentation, theMode); if (!aReadyToDisplay) { diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 012ebb0b5..11842fe9b 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -556,6 +557,16 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe } } +void setDefaultDeviationCoefficient(const std::shared_ptr& theResult, + const Handle(Prs3d_Drawer)& theDrawer) +{ + if (!theResult.get()) + return; + + if (theResult->groupName() == ModelAPI_ResultConstruction::group()) + theDrawer->SetDeviationCoefficient(1.e-4); +} + void setDefaultDeviationCoefficient(const TopoDS_Shape& theShape, const Handle(Prs3d_Drawer)& theDrawer) { diff --git a/src/ModuleBase/ModuleBase_Tools.h b/src/ModuleBase/ModuleBase_Tools.h index cdc4121b1..49128e4a5 100755 --- a/src/ModuleBase/ModuleBase_Tools.h +++ b/src/ModuleBase/ModuleBase_Tools.h @@ -169,6 +169,15 @@ Check types of objects which are in the given list MODULEBASE_EXPORT void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFeature, bool& hasParameter, bool& hasCompositeOwner); +/*! Sets the default coeffient into the driver calculated accordingly the shape type. +It provides 1.e-4 for results of construction type +\param theResult a result object to define the deviation coeffient +\param theDrawer a drawer +*/ +MODULEBASE_EXPORT void setDefaultDeviationCoefficient( + const std::shared_ptr& theResult, + const Handle(Prs3d_Drawer)& theDrawer); + /*! Sets the default coeffient into the driver calculated accordingly the shape type. It provides 1.e-4 for a shape withe Edge shape type \param theShape a shape to define the deviation coeffient, diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index 991d4b6f2..403bbe300 100755 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -111,6 +111,7 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t const TopoDS_Shape& aShape = anIter.Key(); aBuilder.Add(aComp, aShape); // change deviation coefficient to provide more precise circle + // as there is no result, the shape is processed to correct deviation. To be unified ModuleBase_Tools::setDefaultDeviationCoefficient(aShape, aDrawer); if (myUseAISWidth) { diff --git a/src/PartSet/PartSet_ResultSketchPrs.cpp b/src/PartSet/PartSet_ResultSketchPrs.cpp index a07cfd490..a8617af00 100755 --- a/src/PartSet/PartSet_ResultSketchPrs.cpp +++ b/src/PartSet/PartSet_ResultSketchPrs.cpp @@ -88,7 +88,7 @@ void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d) setAuxiliaryPresentationStyle(false); // change deviation coefficient to provide more precise circle - ModuleBase_Tools::setDefaultDeviationCoefficient(Shape(), Attributes()); + ModuleBase_Tools::setDefaultDeviationCoefficient(myResult, Attributes()); AIS_Shape::Compute(thePresentationManager, thePresentation, theMode); if (!myAuxiliaryCompound.IsNull()) {