myNbRedos (0),
myUndoDepth (-1),
myOpLevel(0),
- mySkipSorting(false)
+ mySkipSorting(false),
+ myPointAspectColor (Quantity_NOC_ROYALBLUE4),
+ myCurveColor (Quantity_NOC_RED),
+ myLineWidth(1)
{
}
}
}
-void CurveCreator_Curve::redisplayCurve()
+void CurveCreator_Curve::redisplayCurve(bool preEraseAllObjects)
{
//DEBTRACE("redisplayCurve");
- if( myDisplayer ) {
- myDisplayer->eraseAll( false );
+ if( myDisplayer )
+ {
+ if (preEraseAllObjects)
+ myDisplayer->eraseAll( false );
+ else
+ myDisplayer->erase( myAISShape, false);
myAISShape = NULL;
-
myDisplayer->display( getAISObject( true ), true );
}
}
break;
}
- redisplayCurve();
+ redisplayCurve(false);
return res;
}
aSection->myIsClosed = theIsClosed;
aSection->myPoints = thePoints;
mySections.push_back(aSection);
- redisplayCurve();
+ redisplayCurve(false);
return mySections.size()-1;
}
delete *anIterRm;
mySections.erase(anIterRm);
}
- redisplayCurve();
+ redisplayCurve(false);
return true;
}
aSection = (CurveCreator_Section*)getSection( i );
if( aSection ) {
aSection->myIsClosed = theIsClosed;
- redisplayCurve();
+ redisplayCurve(false);
}
}
} else {
aSection = (CurveCreator_Section*)getSection( theISection );
if ( aSection ) {
aSection->myIsClosed = theIsClosed;
- redisplayCurve();
+ redisplayCurve(false);
}
}
return true;
if ( aSection )
aSection->myType = theType;
}
- redisplayCurve();
+ redisplayCurve(false);
} else {
aSection = (CurveCreator_Section*)getSection( theISection );
if ( aSection && aSection->myType != theType ){
aSection->myType = theType;
- redisplayCurve();
+ redisplayCurve(false);
}
}
return true;
}
}
if(res)
- redisplayCurve();
+ redisplayCurve(false);
return res;
}
}
}
if(res)
- redisplayCurve();
+ redisplayCurve(false);
return res;
}
aRes = removeSectionPoints(aSectionId, anIt->second);
}
if( aRes)
- redisplayCurve();
+ redisplayCurve(false);
return aRes;
}
//DEBTRACE("constructAISObject");
TopoDS_Shape aShape;
CurveCreator_Utils::constructShape( this, aShape );
-
- myAISShape = new AIS_Shape( aShape );
+ myAISShape = new AIS_Shape( aShape );
+ myAISShape->SetColor( myCurveColor );
+ myAISShape->SetWidth( myLineWidth );
Handle(Prs3d_PointAspect) anAspect = myAISShape->Attributes()->PointAspect();
anAspect->SetScale( 3.0 );
anAspect->SetTypeOfMarker(Aspect_TOM_O_POINT);
- anAspect->SetColor(Quantity_NOC_ROYALBLUE4);
+ anAspect->SetColor(myPointAspectColor);
myAISShape->Attributes()->SetPointAspect( anAspect );
-
}
Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const
{
//DEBTRACE("getAISObject");
- if ( !myAISShape && theNeedToBuild ) {
+ if ( !myAISShape && theNeedToBuild )
+ {
CurveCreator_Curve* aCurve = (CurveCreator_Curve*)this;
aCurve->constructAISObject();
}
class CurveCreator_Displayer;
class AIS_Shape;
class AIS_InteractiveObject;
+class Quantity_Color;
/**
* The CurveCreator_Curve object is represented as one or more sets of
public: // TODO: remove public
void getCoordinates( int theISection, int theIPoint, double& theX, double& theY, double& theZ ) const;
protected: // TODO: remove public
- void redisplayCurve();
+ void redisplayCurve(bool preEraseAllObjects = true);
public:
/************ Implementation of INTERFACE methods ************/
/**
* Get the curve AIS object
*/
- virtual Handle(AIS_InteractiveObject) getAISObject( const bool theNeedToBuild = false ) const;
+ virtual Handle(AIS_InteractiveObject) getAISObject( const bool theNeedToBuild = false) const;
protected:
/**
CurveCreator::Sections mySections; //!< curve data
CurveCreator::Dimension myDimension; //!< curve dimension
CurveCreator_Displayer* myDisplayer; //!< curve displayer
+ Quantity_Color myPointAspectColor;
+ Quantity_Color myCurveColor;
+ double myLineWidth;
private:
{
if(myObjects.empty())
return;
- for( int i = 0 ; i < myObjects.size() ; i++ ){
+ for( int i = 0 ; i < myObjects.size() ; i++ )
myContext->Erase(myObjects[i], Standard_False);
- }
myObjects.clear();
if( isUpdate )
myContext->UpdateCurrentViewer();
}
+void CurveCreator_Displayer::erase( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate )
+{
+ if(theObject.IsNull())
+ return;
+ myContext->Erase(theObject, Standard_False);
+ if( isUpdate )
+ myContext->UpdateCurrentViewer();
+}
+
Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
{
if( isHL ){
return Quantity_Color( 0., 1., 0., Quantity_TOC_RGB );
}
+void CurveCreator_Displayer::Update()
+{
+ for( int i = 0 ; i < myObjects.size() ; i++ )
+ myContext->Update(myObjects[i], Standard_True);
+ myContext->UpdateCurrentViewer();
+}
+
/*void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool isHL )
{
return;