Salome HOME
sources v1.2c
[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 <stdexcept>
35 #include <string>
36
37 class vtkProp;
38 class vtkProperty;
39
40 namespace VISU { 
41   class Prs3d_i;
42 }
43 class VISU_PipeLine;
44
45 #ifdef _WIN_32
46 #define VTKOCC_EXPORT __declspec (dllexport)
47 #else
48 #define VTKOCC_EXPORT VTK_EXPORT
49 #endif
50
51 class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
52  public:
53   vtkTypeMacro(VISU_Actor,SALOME_Actor);
54   void ShallowCopy(vtkProp *prop);
55   static VISU_Actor* New();
56   ~VISU_Actor();
57
58   virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
59
60   VISU::Prs3d_i* GetPrs3d(){ return myPrs3d;}
61   virtual void SetPrs3d(VISU::Prs3d_i* thePrs3d);
62
63   virtual VISU_PipeLine* GetPipeLine() { return myPipeLine;}
64   virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
65
66   VISU_Actor* GetParent(){ return myParent;}
67   virtual void SetParent(VISU_Actor* theParent);
68
69   void highlight(Standard_Boolean highlight);
70   Standard_Boolean isHighlighted() { return true; };
71
72   void  SetOpacity(float opa) {};
73   float GetOpacity() { return 0;};
74
75   virtual void SetShrinkable(bool theIsShrinkable);
76   virtual bool GetShrinkable() { return myIsShrinkable;}
77
78   virtual bool IsShrunk() { return myIsShrunk;}
79   virtual void SetShrink(float theFactor = 0.8); 
80   virtual void UnShrink(); 
81
82   virtual void SetVisibility(int theMode);
83   virtual int GetVisibility();
84
85   virtual void SetProperty(vtkProperty* theProperty);
86   virtual vtkProperty* GetProperty();
87
88   virtual void SetLineWidth(float theLineWidth);
89   virtual float GetLineWidth();
90
91   bool IsHighlighting;
92   std::string myFieldName;
93
94  protected:
95   VISU_Actor();
96  
97   VISU_Actor* myParent;
98   VISU::Prs3d_i* myPrs3d;
99   VISU_PipeLine* myPipeLine;
100   vtkProperty* HighlightProperty;
101   bool myIsShrinkable;
102   bool myIsShrunk;
103 };
104
105 #endif //VISU_ACTOR_H