1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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
22 // SMESH OBJECT : interactive object for SMESH visualization
28 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
29 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
31 #include "VISU_OBJECT.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;
46 class SALOME_ExtractPolyDataGeometry;
49 //============================================================================
52 typedef vtkSmartPointer<vtkImageData> TTextureValue;
56 GetTexture(const std::string& theMainTexture,
57 const std::string& theAlphaTexture);
61 //============================================================================
62 class VISU_OBJECT_EXPORT VISU_GaussDeviceActorBase: public vtkLODActor
65 vtkTypeMacro(VISU_GaussDeviceActorBase, vtkLODActor);
68 VISU_GaussDeviceActorBase*
73 Render(vtkRenderer *, vtkMapper *);
75 //----------------------------------------------------------------------------
77 SetTransform(VTKViewer_Transform* theTransform);
79 //----------------------------------------------------------------------------
81 SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) ;
85 DoMapperShallowCopy( vtkMapper* theMapper,
86 bool theIsCopyInput );
88 VISU_OpenGLPointSpriteMapper*
89 GetPointSpriteMapper();
91 //----------------------------------------------------------------------------
92 //! Gets memory size used by the instance (bytes).
97 //----------------------------------------------------------------------------
98 void SetExtractor(SALOME_ExtractPolyDataGeometry* theExtractor)
99 { myPolyDataExtractor = theExtractor; }
101 SALOME_ExtractPolyDataGeometry* GetExtractor() const
102 { return myPolyDataExtractor; }
105 //----------------------------------------------------------------------------
106 vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
107 vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
109 typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
110 std::vector<PPassThroughFilter> myPassFilter;
112 SALOME_ExtractPolyDataGeometry* myPolyDataExtractor;
114 VISU_GaussDeviceActorBase();
115 ~VISU_GaussDeviceActorBase();
118 VISU_GaussDeviceActorBase(const VISU_GaussDeviceActorBase&); // Not implemented
119 void operator=(const VISU_GaussDeviceActorBase&); // Not implemented
123 //============================================================================
124 class VISU_GaussPtsDeviceActor: public VISU_GaussDeviceActorBase
127 vtkTypeMacro(VISU_GaussPtsDeviceActor, VISU_GaussDeviceActorBase);
130 VISU_GaussPtsDeviceActor*
133 //----------------------------------------------------------------------------
135 AddToRender(vtkRenderer* theRenderer);
138 RemoveFromRender(vtkRenderer* theRenderer);
140 //----------------------------------------------------------------------------
145 SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
148 ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
154 //----------------------------------------------------------------------------
155 //! Gets memory size used by the instance (bytes).
161 //----------------------------------------------------------------------------
162 vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
164 VISU_GaussPtsDeviceActor();
165 ~VISU_GaussPtsDeviceActor();
168 VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
169 void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
173 //============================================================================
176 class vtkAppendPolyData;
177 class vtkPolyDataMapper;
179 #include <vtkLODActor.h>
181 class VISU_CursorPyramid : public vtkLODActor
184 vtkTypeMacro(VISU_CursorPyramid, vtkObject);
192 Render(vtkRenderer *, vtkMapper *);
195 AddToRender(vtkRenderer* theRenderer);
198 RemoveFromRender(vtkRenderer* theRenderer);
201 Init(vtkFloatingPointType theHeight,
202 vtkFloatingPointType theCursorSize,
203 vtkFloatingPointType theRadius,
204 vtkFloatingPointType theMagnification,
205 vtkFloatingPointType theClamp,
206 vtkFloatingPointType thePos[3],
207 vtkFloatingPointType theColor[3]);
209 void SetPreferences(vtkFloatingPointType theHeight,
210 vtkFloatingPointType theCursorSize);
213 VISU_CursorPyramid();
216 Init(vtkFloatingPointType theHeight,
217 vtkFloatingPointType theRadius);
220 vtkSmartPointer<vtkConeSource> mySources[6];
221 vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
222 vtkSmartPointer<vtkPolyDataMapper> myMapper;
224 vtkFloatingPointType myHeight;
225 vtkFloatingPointType myCursorSize;
226 vtkFloatingPointType myRadius;
227 vtkFloatingPointType myMagnification;
228 vtkFloatingPointType myClamp;
231 VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
232 void operator=(const VISU_CursorPyramid&); // Not implemented
236 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H