diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index e867630dc..c285e40c1 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -33,6 +33,7 @@ #include "SMDS_UnstructuredGrid.hxx" #include "SMESH_ScalarBarActor.h" #include "VTKViewer_CellCenters.h" +#include "VTKViewer_DataSetMapper.h" #include "VTKViewer_ExtractUnstructuredGrid.h" #include "VTKViewer_FramedTextActor.h" #include "SALOME_InteractiveObject.hxx" @@ -365,6 +366,9 @@ SMESH_ActorDef::SMESH_ActorDef() myPickableActor = myBaseActor; + myMapper = VTKViewer_DataSetMapper::New(); + myMapper->SetInput( myPickableActor->GetUnstructuredGrid() ); + myHighlightProp = vtkProperty::New(); myHighlightProp->SetAmbient(1.0); myHighlightProp->SetDiffuse(0.0); @@ -627,6 +631,8 @@ SMESH_ActorDef::~SMESH_ActorDef() myImplicitBoolean->Delete(); + myMapper->Delete(); + myTimeStamp->Delete(); } @@ -1165,7 +1171,7 @@ void SMESH_ActorDef::ShallowCopy(vtkProp *prop){ vtkMapper* SMESH_ActorDef::GetMapper(){ - return myPickableActor->GetMapper(); + return myMapper; } diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index 682748007..339afd405 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -70,6 +70,7 @@ class vtkImplicitBoolean; class vtkTimeStamp; class VTKViewer_CellCenters; +class VTKViewer_DataSetMapper; class SMESH_DeviceActor; class SMESH_ScalarBarActor; @@ -230,6 +231,8 @@ class SMESH_ActorDef : public SMESH_Actor vtkProperty* myEdgeProp; vtkProperty* myNodeProp; + VTKViewer_DataSetMapper* myMapper; + SMESH_DeviceActor* myBaseActor; SMESH_DeviceActor* myNodeActor; SMESH_DeviceActor* myPickableActor;