Salome HOME
patch for correct compilation on Linux
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Curve.cxx
index 1ce68e6c1fef900fa5998c6527b09f0e19c042ac..3f88a8b2bddda6622673f0070e50d193fa438794 100644 (file)
@@ -29,6 +29,7 @@
 #include "CurveCreator_Utils.h"
 
 #include <AIS_Shape.hxx>
+#include <AIS_InteractiveObject.hxx>
 #include <Geom_CartesianPoint.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Lin.hxx>
@@ -244,9 +245,10 @@ void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double&
 void CurveCreator_Curve::redisplayCurve()
 {
   if( myDisplayer ) {
-    myDisplayer->erase( false );
+    myDisplayer->eraseAll( false );
     myAISShape = NULL;
-    myDisplayer->display( constructWire(), true );
+
+    myDisplayer->display( getAISObject( true ), true );
   }
 }
 
@@ -365,7 +367,7 @@ bool CurveCreator_Curve::clearInternal()
 {
   // erase curve from the viewer
   if( myDisplayer ) {
-    myDisplayer->erase( true );
+    myDisplayer->eraseAll( true );
     myAISShape = NULL;
   }
   // Delete all allocated data.
@@ -939,27 +941,19 @@ CurveCreator::Coordinates CurveCreator_Curve::getPoints( const int theISection )
   return aCoords;
 }
 
-
-/***********************************************/
-/***       Presentation methods              ***/
-/***********************************************/
-std::vector<Handle_AIS_InteractiveObject> CurveCreator_Curve::constructWire()
+void CurveCreator_Curve::constructAISObject()
 {
-  std::vector<Handle_AIS_InteractiveObject> aCurveRepresentation;
-
   TopoDS_Shape aShape;
   CurveCreator_Utils::constructShape( this, aShape );
 
   myAISShape = new AIS_Shape( aShape );
-  aCurveRepresentation.push_back( myAISShape );
-  return aCurveRepresentation;
 }
 
-//=======================================================================
-// function: getAISObject
-// purpose:
-//=======================================================================
-Handle_AIS_InteractiveObject CurveCreator_Curve::getAISObject() const
+Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const
 {
+  if ( !myAISShape && theNeedToBuild ) {
+    CurveCreator_Curve* aCurve = (CurveCreator_Curve*)this;
+    aCurve->constructAISObject();
+  }
   return myAISShape;
 }
\ No newline at end of file