Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/visu.git] / src / OBJECT / VISU_Actor.h
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : VISU_Actor.h
25 //  Author : Laurent CORNABE with the help of Nicolas REJNERI
26 //  Module : VISU
27 //  $Header$
28
29 #ifndef VISU_ACTOR_H
30 #define VISU_ACTOR_H
31
32 #include "SALOME_Actor.h"
33
34 #include <string>
35
36 class vtkProp;
37 class vtkProperty;
38 class vtkDataSetMapper;
39
40 class SALOME_ShrinkFilter;
41 class VISU_PipeLine;
42
43 namespace VISU { 
44   class Prs3d_i;
45 }
46
47 #ifdef _WIN_32
48 #define VTKOCC_EXPORT __declspec (dllexport)
49 #else
50 #define VTKOCC_EXPORT VTK_EXPORT
51 #endif
52
53 class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
54  public:
55   vtkTypeMacro(VISU_Actor,SALOME_Actor);
56   void ShallowCopy(vtkProp *prop);
57   static VISU_Actor* New();
58   virtual ~VISU_Actor();
59
60   virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
61
62   VISU::Prs3d_i* GetPrs3d(){ return myPrs3d;}
63   virtual void SetPrs3d(VISU::Prs3d_i* thePrs3d);
64
65   virtual VISU_PipeLine* GetPipeLine() { return myPipeLine;}
66   virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
67
68   VISU_Actor* GetParent(){ return myParent;}
69   virtual void SetParent(VISU_Actor* theParent);
70
71   virtual void SetOpacity(float theValue);
72   virtual float GetOpacity();
73
74   virtual void SetRepresentation(int theMode);
75
76
77   virtual bool IsShrunkable() { return myIsShrinkable;}
78   virtual bool IsShrunk() { return myIsShrunk;}
79   virtual void SetShrink();
80   virtual void UnShrink(); 
81
82   virtual void SetShrinkable(bool theIsShrinkable);
83   virtual void SetShrinkFactor(float theFactor = 0.8); 
84   virtual float GetShrinkFactor();
85
86
87   virtual void SetVisibility(int theMode);
88   virtual int GetVisibility();
89
90   virtual void SetProperty(vtkProperty* theProperty);
91   virtual vtkProperty* GetProperty();
92
93   virtual void SetLineWidth(float theLineWidth);
94   virtual float GetLineWidth();
95   
96
97   virtual int GetNodeObjId(int theVtkID);
98   virtual int GetElemObjId(int theVtkID);
99
100
101   std::string myFieldName;
102
103  protected:
104   VISU_Actor();
105  
106   VISU_Actor* myParent;
107   VISU::Prs3d_i* myPrs3d;
108   VISU_PipeLine* myPipeLine;
109   vtkDataSetMapper* myMapper;
110
111   SALOME_ShrinkFilter* myShrinkFilter;
112   bool myIsShrinkable;
113   bool myIsShrunk;
114 };
115
116 #endif //VISU_ACTOR_H