#include "CurveCreator_Utils.h"
#include <AIS_Shape.hxx>
+#include <AIS_InteractiveObject.hxx>
#include <Geom_CartesianPoint.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
void CurveCreator_Curve::redisplayCurve()
{
if( myDisplayer ) {
- myDisplayer->erase( false );
+ myDisplayer->eraseAll( false );
myAISShape = NULL;
- myDisplayer->display( constructWire(), true );
+
+ myDisplayer->display( getAISObject( true ), true );
}
}
{
// erase curve from the viewer
if( myDisplayer ) {
- myDisplayer->erase( true );
+ myDisplayer->eraseAll( true );
myAISShape = NULL;
}
// Delete all allocated data.
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