]> SALOME platform Git repositories - modules/visu.git/blob - src/OBJECT/VISU_ActorBase.h
Salome HOME
Merge from V6_3_BR 06/06/2011
[modules/visu.git] / src / OBJECT / VISU_ActorBase.h
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  VISU OBJECT : interactive object for VISU entities implementation
21 //  File   : 
22 //  Author : 
23 //  Module : VISU
24 //  $Header$
25 //
26 #ifndef VISU_ACTOR_BASE_H
27 #define VISU_ACTOR_BASE_H
28
29 #include "VISU_OBJECT.h"
30 #include "SALOME_Actor.h"
31 #include "VISU_BoostSignals.h"
32 #include <boost/bind.hpp>
33
34 class VTKViewer_ShrinkFilter;
35
36 //----------------------------------------------------------------------------
37 namespace VISU 
38
39   struct TActorFactory;
40 }
41
42
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
46 {
47  public:
48   vtkTypeMacro(VISU_ActorBase, SALOME_Actor);
49
50   //----------------------------------------------------------------------------
51   VISU::TActorFactory* GetFactory();
52   virtual void SetFactory(VISU::TActorFactory* theActorFactory);
53   
54   //----------------------------------------------------------------------------
55   virtual void UpdateFromFactory();
56
57   //----------------------------------------------------------------------------
58   virtual void SetTransform(VTKViewer_Transform* theTransform); 
59
60   virtual void SetLineWidth(vtkFloatingPointType theLineWidth);
61   virtual vtkFloatingPointType GetLineWidth();
62
63   virtual void SetShrink();
64   virtual void UnShrink(); 
65   virtual bool IsShrunkable();
66   virtual bool IsShrunk();
67   virtual void SetShrinkable(bool theIsShrinkable);
68
69   virtual void SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); 
70   virtual vtkFloatingPointType GetShrinkFactor();
71   
72   virtual void SetRepresentation(int theMode);
73
74   virtual void RemoveFromRender(vtkRenderer* theRenderer);
75   virtual void RemoveFromRender();
76
77   virtual void ConnectToFactory(boost::signal0<void>& , boost::signal0<void>&);
78
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();
83   
84
85  protected:
86   VISU_ActorBase();
87   virtual  ~VISU_ActorBase();
88
89   VISU::TActorFactory*                 myActorFactory;
90   vtkTimeStamp                         myUpdateFromFactoryTime;
91   boost::signal1<void,VISU_ActorBase*> myDestroySignal;
92
93   boost::signalslib::connection        myUpdateActorsConnection;
94   boost::signalslib::connection        myRemoveFromRendererConnection;
95
96   vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
97
98   bool myIsShrinkable;
99   bool myIsShrunk;
100 };
101
102 #endif //VISU_ACTOR_BASE_H