Salome HOME
Issue 0019818: EDF 703 SMESH VISU : Display Mesh Groups names in viewer (as a caption)
[modules/visu.git] / src / OBJECT / VISU_ScalarMapAct.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_ScalarMapAct.h
24 //  Author : Laurent CORNABE with help of Nicolas REJNERI
25 //  Module : VISU
26 //  $Header$
27 //
28 #ifndef VISU_ScalarMapAct_HeaderFile
29 #define VISU_ScalarMapAct_HeaderFile
30
31 #include "VISU_OBJECT.h"
32 #include "VISU_DataSetActor.h"
33
34 class VISU_ScalarBarActor;
35 class VISU_PointsDeviceActor;
36
37
38 //----------------------------------------------------------------------------
39 class VISU_OBJECT_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor 
40 {
41  public:
42   vtkTypeMacro(VISU_ScalarMapAct,VISU_DataSetActor);
43
44   static
45   VISU_ScalarMapAct* 
46   New();
47
48   ~VISU_ScalarMapAct();
49
50   //! Copies all properties from the given actor
51   virtual
52   void
53   DeepCopy(VISU_Actor *theActor);
54
55   virtual
56   void
57   ShallowCopyPL(VISU_PipeLine* thePipeLine);
58
59   //! Apply view transformation
60   virtual
61   void
62   SetTransform(VTKViewer_Transform* theTransform); 
63
64   virtual
65   void
66   SetShrinkable(bool theIsShrinkable);
67
68   virtual
69   void
70   SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); 
71
72   virtual
73   void
74   SetShrink(); 
75
76   virtual
77   void
78   UnShrink(); 
79   
80   virtual
81   void
82   SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
83
84   virtual
85   void
86   SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
87
88   virtual
89   void
90   SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0); 
91
92   virtual
93   void
94   SetFeatureEdgesFlags(bool theIsFeatureEdges,
95                        bool theIsBoundaryEdges,
96                        bool theIsManifoldEdges,
97                        bool theIsNonManifoldEdges);
98
99   virtual
100   void
101   SetFeatureEdgesColoring(bool theIsColoring);
102
103   virtual
104   void
105   SetOpacity(vtkFloatingPointType theValue);
106
107   virtual
108   vtkFloatingPointType
109   GetOpacity();
110
111   virtual
112   void
113   SetLineWidth(vtkFloatingPointType theLineWidth);
114
115   virtual
116   vtkFloatingPointType
117   GetLineWidth();
118
119   virtual
120   void
121   AddToRender(vtkRenderer* theRenderer); 
122
123   virtual
124   int
125   RenderOpaqueGeometry(vtkViewport *ren);
126
127   virtual
128   int
129   RenderTranslucentGeometry(vtkViewport *ren);
130
131   virtual
132   void
133   RemoveFromRender(vtkRenderer* theRenderer);
134
135   virtual
136   void
137   SetVisibility(int theMode);
138
139   virtual
140   int
141   GetBarVisibility();
142
143   virtual
144   VISU_ScalarBarActor* 
145   GetScalarBar();
146
147   virtual
148   void
149   SetBarVisibility(bool theMode);
150
151   virtual
152   void
153   SetRepresentation(int theMode);
154
155   virtual
156   void
157   SetShading(bool theOn = true);
158
159   virtual
160   bool
161   IsShading();
162
163   //! Gets memory size used by the instance (bytes).
164   virtual
165   unsigned long int
166   GetMemorySize();
167  
168  protected:
169   VISU_ScalarMapAct();
170
171   virtual 
172   void
173   SetMapperInput(vtkDataSet* theDataSet);
174
175   bool myBarVisibility;
176   VISU_ScalarBarActor* myScalarBar;
177
178   VISU_PointsDeviceActor* myPointsActor;
179   SVTK_DeviceActor*    mySurfaceActor;
180   SVTK_DeviceActor*    myEdgeActor;
181 };
182 //----------------------------------------------------------------------------
183
184
185 #endif