]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1530 The arcs representation is not fine enough
authornds <nds@opencascade.com>
Thu, 2 Jun 2016 12:01:19 +0000 (15:01 +0300)
committernds <nds@opencascade.com>
Thu, 2 Jun 2016 12:01:52 +0000 (15:01 +0300)
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/ModuleBase/ModuleBase_Tools.cpp
src/ModuleBase/ModuleBase_Tools.h
src/PartSet/PartSet_OperationPrs.cpp
src/PartSet/PartSet_ResultSketchPrs.cpp

index 4085f399eccbe8f0a7707ec79214d0040cfaa6ec..3923c51c6a70fcbef0064ecdcf15207ebb5f65a6 100755 (executable)
@@ -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) {
index 012ebb0b584eaba717e4c250fdcb339dd7a69512..11842fe9bc844e58f969937cad1bf3b20ccbeb07 100755 (executable)
@@ -21,6 +21,7 @@
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_AttributeRefAttrList.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_ResultConstruction.h>
 #include <Events_Loop.h>
 
 #include <ModelAPI_Data.h>
@@ -556,6 +557,16 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe
   }
 }
 
+void setDefaultDeviationCoefficient(const std::shared_ptr<ModelAPI_Result>& 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)
 {
index cdc4121b13e10d486a97252b29b5afe50a4c8d53..49128e4a58a9bb300deca4b1197934d879d67fc8 100755 (executable)
@@ -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<ModelAPI_Result>& 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, 
index 991d4b6f2ca20721ed4bd195314c71dc2b540641..403bbe3005926430a2bdc70f0fce1c5ac6725d86 100755 (executable)
@@ -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) {
index a07cfd490431463dc915434438af59fcac49583c..a8617af00033efd3fde6a65d86e338b352372dcc 100755 (executable)
@@ -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()) {