Salome HOME
Fix for a crash: Create sketch, circle, Radius constraint with 0 value.
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Transformation.cpp
index 280d14e34b3dc1201a70ac1bb5c3a236beb40ffa..b783a75440db11ceb1baaf856f28e9318d11ad2d 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_Root.hxx>
+#include <Prs3d_LineAspect.hxx>
 #include <Geom_CartesianPoint.hxx>
 #include <gp_Pnt.hxx>
 #include <StdPrs_Point.hxx>
@@ -43,7 +44,13 @@ bool SketcherPrs_Transformation::updatePoints(double theStep) const
 
   int aNbB = anAttrB->size();
   if (aNbB == 0)
+  {
+#ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED
+  //if (!myPntArray.IsNull())
+    //  mySPoints.Clear();
+#endif
     return false;
+  }
 
   SketcherPrs_PositionMgr* aMgr = SketcherPrs_PositionMgr::get();
   myPntArray = new Graphic3d_ArrayOfPoints(aNbB);
@@ -69,8 +76,12 @@ void SketcherPrs_Transformation::drawLines(const Handle(Prs3d_Presentation)& the
 
   Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup(thePrs);
 
-  Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
-  aGroup->SetPrimitivesAspect(aLineAspect);
+  //Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
+  //aGroup->SetPrimitivesAspect(aLineAspect);
+
+  // drawListOfShapes uses myDrawer for attributes definition
+  Handle(Prs3d_LineAspect) aLnAspect = new Prs3d_LineAspect(theColor, Aspect_TOL_SOLID, 1);
+  myDrawer->SetLineAspect(aLnAspect);
 
   drawListOfShapes(anAttrB, thePrs);
   if (myConstraint->getKind() == SketchPlugin_MultiTranslation::ID()) {