1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // VISU OBJECT : interactive object for VISU entities implementation
26 #ifndef VISU_ACTOR_BASE_H
27 #define VISU_ACTOR_BASE_H
29 #include "VISU_OBJECT.h"
30 #include "SALOME_Actor.h"
31 #include "VISU_BoostSignals.h"
32 #include <boost/bind.hpp>
34 class VTKViewer_ShrinkFilter;
36 //----------------------------------------------------------------------------
43 //! This class defines an abstaract interface to manage actors
44 class VISU_OBJECT_EXPORT VISU_ActorBase: public SALOME_Actor,
45 public boost::signalslib::trackable
48 vtkTypeMacro(VISU_ActorBase, SALOME_Actor);
50 //----------------------------------------------------------------------------
51 VISU::TActorFactory* GetFactory();
52 virtual void SetFactory(VISU::TActorFactory* theActorFactory);
54 //----------------------------------------------------------------------------
55 virtual void UpdateFromFactory();
57 //----------------------------------------------------------------------------
58 virtual void SetTransform(VTKViewer_Transform* theTransform);
60 virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
61 virtual vtkFloatingPointType GetLineWidth();
63 virtual void SetShrink();
64 virtual void UnShrink();
65 virtual bool IsShrunkable();
66 virtual bool IsShrunk();
67 virtual void SetShrinkable(bool theIsShrinkable);
69 virtual void SetShrinkFactor(vtkFloatingPointType theFactor = 0.8);
70 virtual vtkFloatingPointType GetShrinkFactor();
72 virtual void SetRepresentation(int theMode);
74 virtual void RemoveFromRender(vtkRenderer* theRenderer);
75 virtual void RemoveFromRender();
77 virtual void ConnectToFactory(boost::signal0<void>& , boost::signal0<void>&);
79 //----------------------------------------------------------------------------
80 //! Return pointer to the dataset, which used to calculation of the bounding box of the actor
81 //! Redefined from VTKViewer_Actor
82 virtual vtkDataSet* GetHighlightedDataSet();
87 virtual ~VISU_ActorBase();
89 VISU::TActorFactory* myActorFactory;
90 vtkTimeStamp myUpdateFromFactoryTime;
91 boost::signal1<void,VISU_ActorBase*> myDestroySignal;
93 boost::signalslib::connection myUpdateActorsConnection;
94 boost::signalslib::connection myRemoveFromRendererConnection;
96 vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
102 #endif //VISU_ACTOR_BASE_H