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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
32 #include "SALOME_Actor.h"
33 #include "VISU_ActorFactory.h"
36 #include <vtkSmartPointer.h>
37 #include <boost/signals/signal1.hpp>
38 #include <boost/signals/trackable.hpp>
42 class vtkDataSetMapper;
45 class vtkInteractorStyle;
46 class VTKViewer_ShrinkFilter;
50 #define VTKOCC_EXPORT __declspec (dllexport)
52 #define VTKOCC_EXPORT VTK_EXPORT
60 //----------------------------------------------------------------------------
61 class VTKOCC_EXPORT VISU_Actor :
63 public boost::bsignals::trackable
66 vtkTypeMacro(VISU_Actor,SALOME_Actor);
73 ShallowCopy(vtkProp *prop);
77 ShallowCopyPL(VISU_PipeLine* thePipeLine);
79 //----------------------------------------------------------------------------
82 setIO(const Handle(SALOME_InteractiveObject)& theIO);
84 //----------------------------------------------------------------------------
90 SetPrs3d(VISU::Prs3d_i* thePrs3d);
92 //----------------------------------------------------------------------------
98 SetFactory(VISU::TActorFactory* theActorFactory);
100 //----------------------------------------------------------------------------
109 //----------------------------------------------------------------------------
116 SetPipeLine(VISU_PipeLine* thePipeLine);
118 //----------------------------------------------------------------------------
121 SetRepresentation(int theMode);
123 //----------------------------------------------------------------------------
142 SetShrinkable(bool theIsShrinkable);
146 SetShrinkFactor(float theFactor = 0.8);
152 //----------------------------------------------------------------------------
155 SetOpacity(float theValue);
163 SetLineWidth(float theLineWidth);
169 //----------------------------------------------------------------------------
172 AddToRender( vtkRenderer* );
176 RemoveFromRender( vtkRenderer* );
178 //----------------------------------------------------------------------------
181 PreHighlight(vtkInteractorStyle* theInteractorStyle,
182 SVTK_SelectionEvent* theSelectionEvent,
183 bool theIsHighlight);
187 SetVTKMapping(bool theIsVTKMapping);
191 IsVTKMapping() const;
197 //----------------------------------------------------------------------------
200 GetNodeObjId(vtkIdType theID);
204 GetNodeVTKID(vtkIdType theID);
208 GetNodeCoord(vtkIdType theObjID);
212 GetElemObjId(vtkIdType theID);
216 GetElemVTKID(vtkIdType theID);
220 GetElemCell(vtkIdType theObjID);
222 //----------------------------------------------------------------------------
231 SetMapperInput(vtkDataSet* theDataSet);
237 //----------------------------------------------------------------------------
239 VISU::Prs3d_i* myPrs3d;
240 vtkSmartPointer<VISU_PipeLine> myPipeLine;
241 vtkSmartPointer<vtkDataSetMapper> myMapper;
243 VISU::TActorFactory* myActorFactory;
244 boost::signal1<void,VISU_Actor*> myDestroySignal;
246 vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
250 vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
251 vtkSmartPointer<vtkTextActor> myAnnotationActor;
254 #endif //VISU_ACTOR_H