]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To implement automatic memory management by introducing VISU_Actor::RemoveFromRendere...
authorapo <apo@opencascade.com>
Fri, 23 Sep 2005 05:51:40 +0000 (05:51 +0000)
committerapo <apo@opencascade.com>
Fri, 23 Sep 2005 05:51:40 +0000 (05:51 +0000)
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/OBJECT/VISU_GaussPtsAct.cxx

index 596705fcb8b184c728376de4bfb0ed9c09fe183b..6afb6871718d77f81b146bf9065f1db3afadbc62 100644 (file)
@@ -67,7 +67,7 @@ using namespace std;
 static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -89,8 +89,7 @@ VISU_Actor
   myAnnotationMapper(vtkTextMapper::New()),
   myAnnotationActor(vtkTextActor::New())
 {
-  if(MYDEBUG) MESSAGE("VISU_Actor() - this = "<<this);
-  SetDebug(MYVTKDEBUG);
+  if(MYDEBUG) MESSAGE("VISU_Actor::VISU_Actor - this = "<<this);
 
   myMapper->Delete();
   myShrinkFilter->Delete();
@@ -125,6 +124,7 @@ VISU_Actor
 {
   if(MYDEBUG) MESSAGE("~VISU_Actor() - this = "<<this);
   Superclass::SetProperty(NULL);
+  SetDebug(MYVTKDEBUG);
 }
 
 //----------------------------------------------------------------------------
@@ -166,6 +166,7 @@ VISU_Actor
   myActorFactory = theActorFactory;
 }
 
+//----------------------------------------------------------------------------
 void
 VISU_Actor
 ::Update()
@@ -174,6 +175,12 @@ VISU_Actor
   Superclass::Update();
 }
 
+void
+VISU_Actor
+::RemoveFromRender()
+{
+  RemoveFromRender(GetRenderer());
+}
 
 //----------------------------------------------------------------------------
 void
index 523a5e748f0729aa6c99ac515b12eb3023279962..7aae1496be045d01f7155d0603d31c67557bd639 100644 (file)
@@ -90,10 +90,15 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
   void
   SetFactory(VISU::TActorFactory* theActorFactory);
 
+  //----------------------------------------------------------------------------
   virtual
   void
   Update();
 
+  virtual
+  void
+  RemoveFromRender();
+
   //----------------------------------------------------------------------------
   virtual
   VISU_PipeLine* 
index f1b65371f6253f2b46854cc492a9667ea2885970..76ae269c6f5952fde792bf89149d1bf96c03aa85 100644 (file)
 #include <vtkCell.h>
 #include <vtkMath.h>
 
+#include "utilities.h"
+
+#ifdef _DEBUG_
+static int MYDEBUG = 1;
+#else
+static int MYDEBUG = 0;
+#endif
+
 //
 ///////////////////////////////////////////////////////////////////////////
 //
@@ -249,6 +257,8 @@ VISU_GaussPtsAct
   mySphereActor(vtkActor::New()),
   myCursorPyramid(VISU_CursorPyramid::New())
 {
+  if(MYDEBUG) MESSAGE("VISU_GaussPtsAct::VISU_GaussPtsAct - this = "<<this);
+
   myEventCallbackCommand->Delete();
 
   myEventCallbackCommand->SetClientData(this); 
@@ -434,13 +444,11 @@ VISU_GaussPtsAct
   if(myInteractor)
     myInteractor->RemoveObserver(myEventCallbackCommand.GetPointer());
   
-  
   if(theInteractor)
     theInteractor->AddObserver(vtkCommand::CharEvent, 
                               myEventCallbackCommand.GetPointer(), 
                               0.0);
   
-
   Superclass::SetInteractor(theInteractor);
 
   Modified();