Salome HOME
patch for crash
[modules/geom.git] / src / CurveCreator / CurveCreator_Curve.cxx
index a2add5ddbb423249ac56a6c1e618893d54526341..35843c83a7b8ec70dcbf16942592ba4eee3fe545 100644 (file)
@@ -59,6 +59,7 @@ CurveCreator_Curve::CurveCreator_Curve( const CurveCreator::Dimension theDimensi
   mySkipSorting(false),
   myPointAspectColor (Quantity_NOC_ROYALBLUE4), 
   myCurveColor (Quantity_NOC_RED),
+  myEraseAll(true),
   myLineWidth(1)
 {
 }
@@ -363,8 +364,12 @@ bool CurveCreator_Curve::redo()
 bool CurveCreator_Curve::clearInternal()
 {
   // erase curve from the viewer
-  if( myDisplayer ) {
-    myDisplayer->eraseAll( true );
+  if( myDisplayer )
+  {
+    if (myEraseAll)
+      myDisplayer->eraseAll( true );
+    else
+      myDisplayer->erase(myAISShape, false);
     myAISShape = NULL;
   }
   // Delete all allocated data.
@@ -400,6 +405,23 @@ bool CurveCreator_Curve::clear()
   return res;
 }
 
+//=======================================================================
+// function: clear
+// purpose:
+//=======================================================================
+void CurveCreator_Curve::SetEraseAllState(bool toEraseAll)
+{
+  myEraseAll = toEraseAll;
+}
+//=======================================================================
+// function: clear
+// purpose:
+//=======================================================================
+bool CurveCreator_Curve::GetEraseAllState() const
+{
+  return myEraseAll;
+}
+
 //! For internal use only! Undo/Redo are not used here.
 bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
 {