Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / OBJECT / VISU_ScalarMapAct.h
1 //  Copyright (C) 2007-2010  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
35 class VISU_ScalarBarActor;
36
37 //----------------------------------------------------------------------------
38 class VISU_OBJECT_EXPORT VISU_ScalarMapAct : public VISU_DataSetActor 
39 {
40  public:
41   vtkTypeMacro(VISU_ScalarMapAct,VISU_DataSetActor);
42
43   static
44   VISU_ScalarMapAct* 
45   New();
46
47   ~VISU_ScalarMapAct();
48
49   //! Copies all properties from the given actor
50   virtual
51   void
52   DeepCopy(VISU_Actor *theActor);
53
54   virtual
55   void
56   ShallowCopyPL(VISU_PipeLine* thePipeLine);
57
58   //! Apply view transformation
59   virtual
60   void
61   SetTransform(VTKViewer_Transform* theTransform); 
62
63   virtual
64   vtkProperty* 
65   GetEdgeProperty(); 
66
67   virtual
68   void
69   SetShrinkable(bool theIsShrinkable);
70
71   virtual
72   void
73   SetShrinkFactor(vtkFloatingPointType theFactor = 0.8); 
74
75   virtual
76   void
77   SetShrink(); 
78
79   virtual
80   void
81   UnShrink(); 
82
83   virtual
84     EQuadratic2DRepresentation GetQuadratic2DRepresentation() const;
85   
86   virtual void 
87     SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode );
88
89   
90   virtual
91   void
92   SetFeatureEdgesAllowed(bool theIsFeatureEdgesAllowed);
93
94   virtual
95   void
96   SetFeatureEdgesEnabled(bool theIsFeatureEdgesEnabled);
97
98   virtual
99   void
100   SetFeatureEdgesAngle(vtkFloatingPointType theAngle = 30.0); 
101
102   virtual
103   void
104   SetFeatureEdgesFlags(bool theIsFeatureEdges,
105                        bool theIsBoundaryEdges,
106                        bool theIsManifoldEdges,
107                        bool theIsNonManifoldEdges);
108
109   virtual
110   void
111   SetFeatureEdgesColoring(bool theIsColoring);
112
113   virtual
114   void
115   SetOpacity(vtkFloatingPointType theValue);
116
117   virtual
118   vtkFloatingPointType
119   GetOpacity();
120
121   virtual
122   void
123   SetLineWidth(vtkFloatingPointType theLineWidth);
124
125   virtual
126   vtkFloatingPointType
127   GetLineWidth();
128
129   virtual
130   void
131   AddToRender(vtkRenderer* theRenderer); 
132
133   virtual
134   int
135   RenderOpaqueGeometry(vtkViewport *ren);
136
137   virtual
138   int
139   RenderTranslucentGeometry(vtkViewport *ren);
140
141   virtual
142   void
143   RemoveFromRender(vtkRenderer* theRenderer);
144
145   virtual
146   void
147   SetVisibility(int theMode);
148
149   virtual
150   int
151   GetBarVisibility();
152
153   virtual
154   VISU_ScalarBarActor* 
155   GetScalarBar();
156
157   virtual
158   void
159   SetBarVisibility(bool theMode);
160
161   virtual
162   void
163   SetRepresentation(int theMode);
164
165   virtual
166   void
167   SetShading(bool theOn = true);
168
169   virtual
170   bool
171   IsShading();
172
173   virtual
174   void
175   SetMarkerStd( VTK::MarkerType, VTK::MarkerScale );
176
177   virtual
178   void
179   SetMarkerTexture( int, VTK::MarkerTexture );
180
181  protected:
182   VISU_ScalarMapAct();
183
184   virtual 
185   void
186   SetMapperInput(vtkDataSet* theDataSet);
187
188   bool myBarVisibility;
189   VISU_ScalarBarActor* myScalarBar;
190
191   SVTK_DeviceActor*    myPointsActor;
192   SVTK_DeviceActor*    mySurfaceActor;
193   SVTK_DeviceActor*    myEdgeActor;
194 };
195 //----------------------------------------------------------------------------
196
197
198 #endif