From: apo Date: Thu, 12 Jan 2006 07:47:38 +0000 (+0000) Subject: Fix for Bug GVIEW10346 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR-D5-38-2003;p=modules%2Fgeom.git Fix for Bug GVIEW10346 Previews of Local coordinate system remain in VTK. --- diff --git a/src/OBJECT/GEOM_VTKTrihedron.cxx b/src/OBJECT/GEOM_VTKTrihedron.cxx index 67e32cedd..3e79afb81 100644 --- a/src/OBJECT/GEOM_VTKTrihedron.cxx +++ b/src/OBJECT/GEOM_VTKTrihedron.cxx @@ -207,7 +207,6 @@ GEOM_VTKTrihedron::GEOM_VTKTrihedron() { myMapper = vtkPolyDataMapper::New(); myAxis[ 0 ] = myAxis[ 1 ] = myAxis[ 2 ] = 0; - myPresent = vtkActorCollection::New(); mySize = 100; SetInfinitive( true ); myColor[ 0 ] = myColor[ 1 ] = myColor[ 1 ] = -1; @@ -216,8 +215,6 @@ GEOM_VTKTrihedron::GEOM_VTKTrihedron() GEOM_VTKTrihedron::~GEOM_VTKTrihedron() { - myPresent->RemoveAllItems(); - myPresent->Delete(); for ( int i = 0; i < 3; i++ ) myAxis[i]->Delete(); @@ -285,9 +282,12 @@ void GEOM_VTKTrihedron::AddToRender( vtkRenderer* theRenderer ) void GEOM_VTKTrihedron::RemoveFromRender( vtkRenderer* theRenderer ) { - myPresent->InitTraversal(); - while(vtkActor* anActor = myPresent->GetNextActor()) - theRenderer->RemoveActor(anActor); + for(int i = 0; i < 3; i++) + { + myAxis[i]->RemoveFromRender(theRenderer); + } + + theRenderer->RemoveActor( this ); } int GEOM_VTKTrihedron::GetVisibleActorCount(vtkRenderer* theRenderer) diff --git a/src/OBJECT/GEOM_VTKTrihedron.hxx b/src/OBJECT/GEOM_VTKTrihedron.hxx index 92332c8c6..b67ad3fbb 100644 --- a/src/OBJECT/GEOM_VTKTrihedron.hxx +++ b/src/OBJECT/GEOM_VTKTrihedron.hxx @@ -89,7 +89,6 @@ public: virtual bool hasHighlight() { return false; } protected: - vtkActorCollection* myPresent; VTKViewer_Axis* myAxis[3]; vtkPolyDataMapper* myMapper; float mySize;