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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
29 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
30 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
32 #include "VTKViewer_GeometryFilter.h"
34 #include <vtkLODActor.h>
35 #include <vtkSmartPointer.h>
37 class VTKViewer_Transform;
38 class VTKViewer_TransformFilter;
39 class VTKViewer_PassThroughFilter;
41 class VISU_OpenGLPointSpriteMapper;
42 class VISU_GaussPointsPL;
45 //============================================================================
46 class VISU_GaussPtsDeviceActor: public vtkLODActor
49 vtkTypeMacro(VISU_GaussPtsDeviceActor,vtkLODActor);
52 VISU_GaussPtsDeviceActor*
57 Render(vtkRenderer *, vtkMapper *);
59 //----------------------------------------------------------------------------
61 AddToRender(vtkRenderer* theRenderer);
64 RemoveFromRender(vtkRenderer* theRenderer);
67 SetTransform(VTKViewer_Transform* theTransform);
69 //----------------------------------------------------------------------------
74 SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
77 ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
79 VISU_OpenGLPointSpriteMapper*
83 //----------------------------------------------------------------------------
84 vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
85 vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
86 vtkSmartPointer<VTKViewer_GeometryFilter> myGeomFilter;
87 vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
89 typedef vtkSmartPointer<VTKViewer_PassThroughFilter> PPassThroughFilter;
90 std::vector<PPassThroughFilter> myPassFilter;
92 VISU_GaussPtsDeviceActor();
93 ~VISU_GaussPtsDeviceActor();
96 VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
97 void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
101 //============================================================================
104 class vtkAppendPolyData;
105 class vtkPolyDataMapper;
107 #include <vtkLODActor.h>
109 class VISU_CursorPyramid : public vtkLODActor
112 vtkTypeMacro(VISU_CursorPyramid, vtkObject);
120 Render(vtkRenderer *, vtkMapper *);
123 AddToRender(vtkRenderer* theRenderer);
126 RemoveFromRender(vtkRenderer* theRenderer);
129 Init(float theHeight,
132 float theMagnification,
137 void SetPreferences(float theHeight,
138 float theCursorSize);
141 VISU_CursorPyramid();
144 Init(float theHeight,
148 vtkSmartPointer<vtkConeSource> mySources[6];
149 vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
150 vtkSmartPointer<vtkPolyDataMapper> myMapper;
155 float myMagnification;
159 VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
160 void operator=(const VISU_CursorPyramid&); // Not implemented
164 //==================================================================
165 // class VISU_FramedTextActor
167 #include <vtkActor2D.h>
173 class vtkPolyDataMapper2D;
176 class vtkTextProperty;
179 class VISU_FramedTextActor : public vtkActor2D
183 vtkTypeRevisionMacro(VISU_FramedTextActor,vtkActor2D);
184 static VISU_FramedTextActor *New();
186 virtual int RenderOpaqueGeometry(vtkViewport* viewport);
187 virtual int RenderTranslucentGeometry(vtkViewport*) { return 0; };
188 virtual int RenderOverlay(vtkViewport* viewport);
189 virtual void ReleaseGraphicsResources(vtkWindow *);
190 virtual void SetVisibility (int );
191 virtual int GetVisibility() ;
192 virtual void SetPickable (int ) ;
193 virtual int GetPickable();
196 void SetText(const char* theText);
199 void SetModePosition(const int theMode);
200 int GetModePosition()const;
202 void SetWorldPoint(const float theWorldPoint[4]);
203 const float* GetWorldPoint()const;
205 void SetDistance(const float theDistance);
206 float GetDistance()const;
208 void SetTransparency(const float theTransparency);
209 float GetTransparency()const;
212 VISU_FramedTextActor();
213 ~VISU_FramedTextActor();
217 vtkPolyDataMapper2D *myBarMapper;
218 vtkActor2D *myBarActor;
220 vtkTextProperty *myTextProperty;
221 vtkTextMapper *myTextMapper;
222 vtkActor2D *myTextActor;
224 vtkTimeStamp myBuildTime;
227 float myWorldPoint[4];
229 float myTransparency;
232 VISU_FramedTextActor(const VISU_FramedTextActor&); // Not implemented.
233 void operator=(const VISU_FramedTextActor&); // Not implemented.
236 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H