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
24 // File : VISU_Actor.h
25 // Author : Laurent CORNABE with the help of Nicolas REJNERI
34 #include "SALOME_Actor.h"
40 class vtkPolyDataMapper;
45 class VISU_ScalarBarActor;
48 #define VTKOCC_EXPORT __declspec (dllexport)
50 #define VTKOCC_EXPORT VTK_EXPORT
53 class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
55 vtkTypeMacro(VISU_Actor,SALOME_Actor);
56 void ShallowCopy(vtkProp *prop);
57 static VISU_Actor* New();
60 virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
62 VISU::Prs3d_i* getPrs3d(){ return myPrs3d;}
63 virtual void setPrs3d(VISU::Prs3d_i* thePrs3d);
65 VISU_Actor* GetParent(){ return myParent;}
66 virtual void SetParent(VISU_Actor* theParent);
68 void highlight(Standard_Boolean highlight);
69 Standard_Boolean isHighlighted() { return true; };
71 void SetOpacity(float opa) {};
72 float GetOpacity() { return 0;};
74 virtual void SetMapper(vtkMapper* theMapper);
76 virtual void SetShrinkable(bool theIsShrinkable);
77 virtual bool GetShrinkable() { return myIsShrinkable;}
79 virtual bool isShrunk() { return myIsShrunk;}
80 virtual void setShrink(float theFactor = 0.8);
81 virtual void unShrink();
83 virtual void SetVisibility(int theMode);
84 virtual int GetVisibility();
86 virtual void SetProperty(vtkProperty* theProperty);
87 virtual vtkProperty* GetProperty();
89 virtual void SetLineWidth(float theLineWidth);
90 virtual float GetLineWidth();
92 virtual void SetRepresentation(int theMode);
93 virtual int GetRepresentation();
96 std::string myFieldName;
101 VISU_Actor* myParent;
102 VISU::Prs3d_i* myPrs3d;
103 vtkProperty* HighlightProperty;
108 //=======================================================================
110 class VTKOCC_EXPORT VISUScalarMap_Actor : public VISU_Actor {
112 vtkTypeMacro(VISUScalarMap_Actor,VISU_Actor);
113 static VISUScalarMap_Actor* New();
114 ~VISUScalarMap_Actor();
116 virtual void AddToRender(vtkRenderer* theRenderer);
117 virtual void RemoveFromRender(vtkRenderer* theRenderer);
119 virtual void SetVisibility(int theMode);
120 virtual int GetVisibility();
122 virtual VISU_ScalarBarActor* GetScalarBar(){ return myScalarBar;}
124 virtual void SetBarVisibility(const bool* theMode);
125 virtual bool GetBarVisibility(){ return *myBarVisibility;}
128 VISUScalarMap_Actor();
129 const bool* myBarVisibility;
130 VISU_ScalarBarActor* myScalarBar;
133 //=======================================================================
135 class VTKOCC_EXPORT VISUMesh_Actor : public VISU_Actor {
137 vtkTypeMacro(VISUMesh_Actor,VISU_Actor);
138 static VISUMesh_Actor* New();
141 virtual void setIO(const Handle(SALOME_InteractiveObject)& theIO);
142 virtual void setPrs3d(VISU::Prs3d_i* thePrs3d);
144 virtual void AddToRender(vtkRenderer* theRenderer);
145 virtual void RemoveFromRender(vtkRenderer* theRenderer);
147 virtual void SetMapper(vtkMapper* theMapper);
148 virtual void SetTransform(SALOME_Transform* theTransform);
150 virtual vtkProperty* GetProperty();
151 virtual void SetProperty(vtkProperty* theProperty);
153 virtual vtkProperty* GetEdgeProperty();
154 virtual void SetEdgeProperty(vtkProperty* theProperty);
156 virtual void SetLineWidth(float theLineWidth);
157 virtual float GetLineWidth();
159 virtual void SetRepresentation(int theMode);
160 virtual int GetRepresentation() { return myRepresentation;};
162 virtual void SetVisibility(int theMode);
163 virtual int GetVisibility() { return myVisibility;}
165 virtual void SetShrinkable(bool theIsShrinkable);
167 virtual void setShrink(float theFactor = 0.8);
168 virtual void unShrink();
172 int myRepresentation, myVisibility;
173 vtkPolyDataMapper* myEdgeMapper;
174 VISU_Actor *mySurfaceActor, *myEdgeActor;
177 //=======================================================================
179 #endif //VISU_ACTOR_H