1 // VISU OBJECT : interactive object for VISU entities implementation
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
32 #include "SALOME_Actor.h"
33 #include "VISU_ActorFactory.h"
34 #include "VISU_BoostSignals.h"
35 #include "SVTK_DeviceActor.h"
38 #include <vtkTimeStamp.h>
39 #include <vtkSmartPointer.h>
45 class vtkInteractorStyle;
46 class VTKViewer_ShrinkFilter;
50 #define VTKOCC_EXPORT __declspec (dllexport)
52 #define VTKOCC_EXPORT VTK_EXPORT
57 namespace Representation
59 const Type Surfaceframe = Insideframe + 1;
68 //----------------------------------------------------------------------------
69 class VTKOCC_EXPORT VISU_Actor :
71 public boost::signalslib::trackable
74 vtkTypeMacro(VISU_Actor,SALOME_Actor);
80 //! Copies all properties from the given actor
83 DeepCopy(VISU_Actor *theActor);
87 ShallowCopyPL(VISU_PipeLine* thePipeLine);
89 //----------------------------------------------------------------------------
92 setIO(const Handle(SALOME_InteractiveObject)& theIO);
94 //----------------------------------------------------------------------------
100 SetPrs3d(VISU::Prs3d_i* thePrs3d);
102 //----------------------------------------------------------------------------
108 SetFactory(VISU::TActorFactory* theActorFactory);
110 //----------------------------------------------------------------------------
119 //----------------------------------------------------------------------------
126 SetPipeLine(VISU_PipeLine* thePipeLine);
128 //----------------------------------------------------------------------------
131 SetRepresentation(int theMode);
133 //----------------------------------------------------------------------------
152 SetShrinkable(bool theIsShrinkable);
156 SetShrinkFactor(vtkFloatingPointType theFactor = 0.8);
162 //----------------------------------------------------------------------------
165 SetOpacity(vtkFloatingPointType theValue);
173 SetLineWidth(vtkFloatingPointType theLineWidth);
179 //----------------------------------------------------------------------------
182 AddToRender( vtkRenderer* );
186 RemoveFromRender( vtkRenderer* );
188 //----------------------------------------------------------------------------
191 PreHighlight(vtkInteractorStyle* theInteractorStyle,
192 SVTK_SelectionEvent* theSelectionEvent,
193 bool theIsHighlight);
197 SetVTKMapping(bool theIsVTKMapping);
201 IsVTKMapping() const;
207 //! Gets memory size used by the instance (bytes).
212 //----------------------------------------------------------------------------
215 GetNodeObjId(vtkIdType theID);
219 GetNodeVTKID(vtkIdType theID);
222 vtkFloatingPointType*
223 GetNodeCoord(vtkIdType theObjID);
227 GetElemObjId(vtkIdType theID);
231 GetElemVTKID(vtkIdType theID);
235 GetElemCell(vtkIdType theObjID);
237 //----------------------------------------------------------------------------
246 SetMapperInput(vtkDataSet* theDataSet) = 0;
252 //----------------------------------------------------------------------------
254 VISU::Prs3d_i* myPrs3d;
255 vtkSmartPointer<VISU_PipeLine> myPipeLine;
257 VISU::TActorFactory* myActorFactory;
258 vtkTimeStamp myUpdateFromFactoryTime;
259 boost::signal1<void,VISU_Actor*> myDestroySignal;
261 vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
265 vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
266 vtkSmartPointer<vtkTextActor> myAnnotationActor;
269 #endif //VISU_ACTOR_H