1 // SMESH OBJECT : interactive object for SMESH visualization
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
29 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
30 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
32 #include "VISU_Actor.h"
33 #include "VTKViewer_GeometryFilter.h"
35 #include <vtkLODActor.h>
36 #include <vtkSmartPointer.h>
38 class VTKViewer_Transform;
39 class VTKViewer_TransformFilter;
41 class VISU_OpenGLPointSpriteMapper;
42 class VISU_GaussPointsPL;
44 class vtkPassThroughFilter;
48 //============================================================================
51 typedef vtkSmartPointer<vtkImageData> TTextureValue;
55 GetTexture(const std::string& theMainTexture,
56 const std::string& theAlphaTexture);
60 //============================================================================
61 class VISU_GaussDeviceActorBase: public vtkLODActor
64 vtkTypeMacro(VISU_GaussDeviceActorBase, vtkLODActor);
67 VISU_GaussDeviceActorBase*
72 Render(vtkRenderer *, vtkMapper *);
74 //----------------------------------------------------------------------------
76 SetTransform(VTKViewer_Transform* theTransform);
78 //----------------------------------------------------------------------------
80 SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) ;
84 DoMapperShallowCopy( vtkMapper* theMapper,
85 bool theIsCopyInput );
87 VISU_OpenGLPointSpriteMapper*
88 GetPointSpriteMapper();
90 //----------------------------------------------------------------------------
91 //! Gets memory size used by the instance (bytes).
97 //----------------------------------------------------------------------------
98 vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
99 vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
101 typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
102 std::vector<PPassThroughFilter> myPassFilter;
104 VISU_GaussDeviceActorBase();
105 ~VISU_GaussDeviceActorBase();
108 VISU_GaussDeviceActorBase(const VISU_GaussDeviceActorBase&); // Not implemented
109 void operator=(const VISU_GaussDeviceActorBase&); // Not implemented
113 //============================================================================
114 class VISU_GaussPtsDeviceActor: public VISU_GaussDeviceActorBase
117 vtkTypeMacro(VISU_GaussPtsDeviceActor, VISU_GaussDeviceActorBase);
120 VISU_GaussPtsDeviceActor*
123 //----------------------------------------------------------------------------
125 AddToRender(vtkRenderer* theRenderer);
128 RemoveFromRender(vtkRenderer* theRenderer);
130 //----------------------------------------------------------------------------
135 SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
138 ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
144 //----------------------------------------------------------------------------
145 //! Gets memory size used by the instance (bytes).
151 //----------------------------------------------------------------------------
152 vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
154 VISU_GaussPtsDeviceActor();
155 ~VISU_GaussPtsDeviceActor();
158 VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
159 void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
163 //============================================================================
166 class vtkAppendPolyData;
167 class vtkPolyDataMapper;
169 #include <vtkLODActor.h>
171 class VISU_CursorPyramid : public vtkLODActor
174 vtkTypeMacro(VISU_CursorPyramid, vtkObject);
182 Render(vtkRenderer *, vtkMapper *);
185 AddToRender(vtkRenderer* theRenderer);
188 RemoveFromRender(vtkRenderer* theRenderer);
191 Init(vtkFloatingPointType theHeight,
192 vtkFloatingPointType theCursorSize,
193 vtkFloatingPointType theRadius,
194 vtkFloatingPointType theMagnification,
195 vtkFloatingPointType theClamp,
196 vtkFloatingPointType thePos[3],
197 vtkFloatingPointType theColor[3]);
199 void SetPreferences(vtkFloatingPointType theHeight,
200 vtkFloatingPointType theCursorSize);
203 VISU_CursorPyramid();
206 Init(vtkFloatingPointType theHeight,
207 vtkFloatingPointType theRadius);
210 vtkSmartPointer<vtkConeSource> mySources[6];
211 vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
212 vtkSmartPointer<vtkPolyDataMapper> myMapper;
214 vtkFloatingPointType myHeight;
215 vtkFloatingPointType myCursorSize;
216 vtkFloatingPointType myRadius;
217 vtkFloatingPointType myMagnification;
218 vtkFloatingPointType myClamp;
221 VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
222 void operator=(const VISU_CursorPyramid&); // Not implemented
226 //==================================================================
227 // class VISU_FramedTextActor
229 #include <vtkActor2D.h>
235 class vtkPolyDataMapper2D;
238 class vtkTextProperty;
241 class VISU_FramedTextActor : public vtkActor2D
245 vtkTypeRevisionMacro(VISU_FramedTextActor,vtkActor2D);
246 static VISU_FramedTextActor *New();
248 virtual int RenderOpaqueGeometry(vtkViewport* viewport);
249 virtual int RenderTranslucentGeometry(vtkViewport*) { return 0; };
250 virtual int RenderOverlay(vtkViewport* viewport);
251 virtual void ReleaseGraphicsResources(vtkWindow *);
252 virtual void SetVisibility (int );
253 virtual int GetVisibility() ;
254 virtual void SetPickable (int ) ;
255 virtual int GetPickable();
258 void SetText(const char* theText);
261 void SetModePosition(const int theMode);
262 int GetModePosition()const;
264 void SetWorldPoint(const vtkFloatingPointType theWorldPoint[4]);
265 const vtkFloatingPointType* GetWorldPoint()const;
267 void SetDistance(const vtkFloatingPointType theDistance);
268 vtkFloatingPointType GetDistance()const;
270 void SetTransparency(const vtkFloatingPointType theTransparency);
271 vtkFloatingPointType GetTransparency()const;
274 VISU_FramedTextActor();
275 ~VISU_FramedTextActor();
279 vtkPolyDataMapper2D *myBarMapper;
280 vtkActor2D *myBarActor;
282 vtkTextProperty *myTextProperty;
283 vtkTextMapper *myTextMapper;
284 vtkActor2D *myTextActor;
286 vtkTimeStamp myBuildTime;
289 vtkFloatingPointType myWorldPoint[4];
290 vtkFloatingPointType myDistance;
291 vtkFloatingPointType myTransparency;
294 VISU_FramedTextActor(const VISU_FramedTextActor&); // Not implemented.
295 void operator=(const VISU_FramedTextActor&); // Not implemented.
298 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H