Salome HOME
another z layer for hilight presentation
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Displayer.cxx
index f0c5463d8e32d348eb19a10ee6ccdfe3493e0470..6bc8df52bf6672c86f92e0376ef0c18fc3c1ee4a 100644 (file)
@@ -1,55 +1,44 @@
 #include "CurveCreator_Displayer.h"
 
-CurveCreator_Displayer::CurveCreator_Displayer( Handle_AIS_InteractiveContext theContext ) :
-  myContext( theContext )
+CurveCreator_Displayer::CurveCreator_Displayer( Handle_AIS_InteractiveContext theContext,
+                                                const int theZLayer ) :
+  myContext( theContext ), myZLayer( theZLayer )
 {
   myObjects.clear();
 }
 
 CurveCreator_Displayer::~CurveCreator_Displayer(void)
 {
-  erase( true );
+  eraseAll( true );
   for( int i = 0 ; i < myObjects.size() ; i++ ){
     myObjects[i].Nullify();
   }
   myObjects.clear();
 }
 
-void CurveCreator_Displayer::display( AISObjectsList theCurveObjects, bool isUpdate )
+void CurveCreator_Displayer::display( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate )
 {
-  myObjects = theCurveObjects;
-  if(myObjects.empty())
+  if ( theObject.IsNull() )
     return;
-  for( int i = 0 ; i < myObjects.size() ; i++ ){
-    myContext->Display(myObjects[i], Standard_False);
-  }
+
+  myObjects.push_back( theObject );
+  myContext->Display( theObject, Standard_False );
+
+  if ( myZLayer >= 0 )
+    myContext->SetZLayer( theObject, myZLayer );
+
   if( isUpdate )
     myContext->UpdateCurrentViewer();
 }
 
-void CurveCreator_Displayer::erase( bool isUpdate )
+void CurveCreator_Displayer::eraseAll( bool isUpdate )
 {
   if(myObjects.empty())
     return;
   for( int i = 0 ; i < myObjects.size() ; i++ ){
     myContext->Erase(myObjects[i], Standard_False);
   }
-  if( isUpdate )
-    myContext->UpdateCurrentViewer();
-}
-
-void CurveCreator_Displayer::displayAIS( Handle(AIS_InteractiveObject) theObject, bool isUpdate )
-{
-  myContext->Display( theObject, Standard_False );
-
-  if( isUpdate )
-    myContext->UpdateCurrentViewer();
-}
-
-void CurveCreator_Displayer::redisplayAIS( Handle(AIS_InteractiveObject) theObject, bool isUpdate )
-{
-  myContext->Redisplay( theObject, Standard_False );
-
+  myObjects.clear();
   if( isUpdate )
     myContext->UpdateCurrentViewer();
 }
@@ -62,7 +51,7 @@ Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
   return Quantity_Color( 0., 1., 0., Quantity_TOC_RGB );
 }
 
-void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool isHL )
+/*void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool isHL )
 {
   return;
   //TODO:
@@ -72,4 +61,4 @@ void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool i
     myContext->Display(theObjects[i], Standard_False);
   }
   myContext->UpdateCurrentViewer();
-}
+}*/