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"
37 #include <vtkSmartPointer.h>
41 class vtkDataSetMapper;
44 class vtkInteractorStyle;
45 class VTKViewer_ShrinkFilter;
49 #define VTKOCC_EXPORT __declspec (dllexport)
51 #define VTKOCC_EXPORT VTK_EXPORT
59 //----------------------------------------------------------------------------
60 class VTKOCC_EXPORT VISU_Actor :
62 public boost::signalslib::trackable
65 vtkTypeMacro(VISU_Actor,SALOME_Actor);
72 ShallowCopy(vtkProp *prop);
76 ShallowCopyPL(VISU_PipeLine* thePipeLine);
78 //----------------------------------------------------------------------------
81 setIO(const Handle(SALOME_InteractiveObject)& theIO);
83 //----------------------------------------------------------------------------
89 SetPrs3d(VISU::Prs3d_i* thePrs3d);
91 //----------------------------------------------------------------------------
97 SetFactory(VISU::TActorFactory* theActorFactory);
99 //----------------------------------------------------------------------------
108 //----------------------------------------------------------------------------
115 SetPipeLine(VISU_PipeLine* thePipeLine);
117 //----------------------------------------------------------------------------
120 SetRepresentation(int theMode);
122 //----------------------------------------------------------------------------
141 SetShrinkable(bool theIsShrinkable);
145 SetShrinkFactor(vtkFloatingPointType theFactor = 0.8);
151 //----------------------------------------------------------------------------
154 SetOpacity(vtkFloatingPointType theValue);
162 SetLineWidth(vtkFloatingPointType theLineWidth);
168 //----------------------------------------------------------------------------
171 AddToRender( vtkRenderer* );
175 RemoveFromRender( vtkRenderer* );
177 //----------------------------------------------------------------------------
180 PreHighlight(vtkInteractorStyle* theInteractorStyle,
181 SVTK_SelectionEvent* theSelectionEvent,
182 bool theIsHighlight);
186 SetVTKMapping(bool theIsVTKMapping);
190 IsVTKMapping() const;
196 //----------------------------------------------------------------------------
199 GetNodeObjId(vtkIdType theID);
203 GetNodeVTKID(vtkIdType theID);
206 vtkFloatingPointType*
207 GetNodeCoord(vtkIdType theObjID);
211 GetElemObjId(vtkIdType theID);
215 GetElemVTKID(vtkIdType theID);
219 GetElemCell(vtkIdType theObjID);
221 //----------------------------------------------------------------------------
230 SetMapperInput(vtkDataSet* theDataSet);
236 //----------------------------------------------------------------------------
238 VISU::Prs3d_i* myPrs3d;
239 vtkSmartPointer<VISU_PipeLine> myPipeLine;
240 vtkSmartPointer<vtkDataSetMapper> myMapper;
242 VISU::TActorFactory* myActorFactory;
243 boost::signal1<void,VISU_Actor*> myDestroySignal;
245 vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
249 vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
250 vtkSmartPointer<vtkTextActor> myAnnotationActor;
253 #endif //VISU_ACTOR_H