Salome HOME
f7ecaeaf878bf897d4009915165c7769f2962ddc
[modules/visu.git] / src / OBJECT / VISU_ScalarMapAct.h
1 // Copyright (C) 2007-2011  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
23 //  VISU OBJECT : interactive object for VISU entities implementation
24 //  File   : VISU_ScalarMapAct.h
25 //  Author : Laurent CORNABE with help of Nicolas REJNERI
26 //  Module : VISU
27 //  $Header$
28 //
29 #ifndef VISU_ScalarMapAct_HeaderFile
30 #define VISU_ScalarMapAct_HeaderFile
31
32 #include "VISU_OBJECT.h"
33 #include "VISU_DataSetActor.h"
34 #include "SVTK_DeviceActor.h"
35
36 namespace VTK
37 {
38   const MarkerType MT_POINT_SPRITE = MT_USER + 1;
39 }
40
41 class VISU_ScalarBarActor;
42 class VISU_PointsDeviceActor;
43
44 //----------------------------------------------------------------------------
45 class VISU_OBJECT_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor 
46 {
47  public:
48   vtkTypeMacro(VISU_ScalarMapAct,VISU_DataSetActor);
49
50   static
51   VISU_ScalarMapAct* 
52   New();
53
54   ~VISU_ScalarMapAct();
55
56   //! Copies all properties from the given actor
57   virtual
58   void
59   DeepCopy(VISU_Actor *theActor);
60
61   virtual
62   void
63   ShallowCopyPL(VISU_PipeLine* thePipeLine);
64
65   //! Apply view transformation
66   virtual
67   void
68   SetTransform(VTKViewer_Transform* theTransform); 
69
70   virtual
71   vtkProperty* 
72   GetEdgeProperty(); 
73
74   virtual
75   void
76   SetShrinkable(bool theIsShrinkable);
77
78   virtual
79   void
80   SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); 
81
82   virtual
83   void
84   SetShrink(); 
85
86   virtual
87   void
88   UnShrink(); 
89
90   virtual
91     EQuadratic2DRepresentation GetQuadratic2DRepresentation() const;
92   
93   virtual void 
94     SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode );
95
96   
97   virtual
98   void
99   SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
100
101   virtual
102   void
103   SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
104
105   virtual
106   void
107   SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0); 
108
109   virtual
110   void
111   SetFeatureEdgesFlags(bool theIsFeatureEdges,
112                        bool theIsBoundaryEdges,
113                        bool theIsManifoldEdges,
114                        bool theIsNonManifoldEdges);
115
116   virtual
117   void
118   SetFeatureEdgesColoring(bool theIsColoring);
119
120   virtual
121   void
122   SetOpacity(vtkFloatingPointType theValue);
123
124   virtual
125   vtkFloatingPointType
126   GetOpacity();
127
128   virtual
129   void
130   SetLineWidth(vtkFloatingPointType theLineWidth);
131
132   virtual
133   vtkFloatingPointType
134   GetLineWidth();
135
136   virtual
137   void
138   AddToRender(vtkRenderer* theRenderer); 
139
140   virtual
141   int
142   RenderOpaqueGeometry(vtkViewport *ren);
143
144   virtual
145   int
146 #if (VTK_XVERSION < 0x050100)
147   RenderTranslucentGeometry(vtkViewport *ren);
148 #else
149   RenderTranslucentPolygonalGeometry(vtkViewport *ren);
150
151   virtual
152   int
153   HasTranslucentPolygonalGeometry();
154 #endif
155
156   virtual
157   void
158   RemoveFromRender(vtkRenderer* theRenderer);
159
160   virtual
161   void
162   SetVisibility(int theMode);
163
164   virtual
165   int
166   GetBarVisibility();
167
168   virtual
169   vtkFloatingPointType 
170   Get0DElemSize();
171
172   virtual
173   VISU_ScalarBarActor* 
174   GetScalarBar();
175
176   virtual
177   void
178   SetBarVisibility(bool theMode);
179
180   virtual
181   void
182   SetRepresentation(int theMode);
183
184   virtual
185   void
186   SetShading(bool theOn = true);
187
188   virtual
189   bool
190   IsShading();
191
192   //! Gets memory size used by the instance (bytes).
193   virtual
194   unsigned long int
195   GetMemorySize();
196
197   virtual
198   void
199   SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
200
201   virtual
202   void
203   SetMarkerTexture( int, VTK::MarkerTexture );
204
205   virtual
206   void
207   Set0DElemSize(vtkFloatingPointType theValue);
208
209
210  protected:
211   VISU_ScalarMapAct();
212
213   virtual 
214   void
215   SetMapperInput(vtkDataSet* theDataSet);
216
217   bool myBarVisibility;
218   VISU_ScalarBarActor* myScalarBar;
219
220   VISU_PointsDeviceActor* myPointSpriteActor;
221   SVTK_DeviceActor*    myPointsActor;
222   SVTK_DeviceActor*    mySurfaceActor;
223   SVTK_DeviceActor*    myEdgeActor;
224
225   bool myIsPointSpriteMode;
226 };
227 //----------------------------------------------------------------------------
228
229
230 #endif