1 // Copyright (C) 2007-2012 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
23 // SMESH OBJECT : interactive object for SMESH visualization
29 #ifndef VISU_GAUSS_PTS_DEVICE_ACTOR_H
30 #define VISU_GAUSS_PTS_DEVICE_ACTOR_H
32 #include "VISU_OBJECT.h"
33 #include "VISU_Actor.h"
34 #include "VTKViewer_GeometryFilter.h"
36 #include <vtkLODActor.h>
37 #include <vtkSmartPointer.h>
39 class VTKViewer_Transform;
40 class VTKViewer_TransformFilter;
42 class VISU_OpenGLPointSpriteMapper;
43 class VISU_GaussPointsPL;
45 class vtkPassThroughFilter;
47 class SALOME_ExtractPolyDataGeometry;
50 //============================================================================
53 typedef vtkSmartPointer<vtkImageData> TTextureValue;
57 GetTexture(const std::string& theMainTexture,
58 const std::string& theAlphaTexture);
62 //============================================================================
63 class VISU_OBJECT_EXPORT VISU_GaussDeviceActorBase: public vtkLODActor
66 vtkTypeMacro(VISU_GaussDeviceActorBase, vtkLODActor);
69 VISU_GaussDeviceActorBase*
74 Render(vtkRenderer *, vtkMapper *);
76 //----------------------------------------------------------------------------
78 SetTransform(VTKViewer_Transform* theTransform);
80 //----------------------------------------------------------------------------
82 SetPointSpriteMapper(VISU_OpenGLPointSpriteMapper* theMapper) ;
86 DoMapperShallowCopy( vtkMapper* theMapper,
87 bool theIsCopyInput );
89 VISU_OpenGLPointSpriteMapper*
90 GetPointSpriteMapper();
92 //----------------------------------------------------------------------------
93 //! Gets memory size used by the instance (bytes).
98 //----------------------------------------------------------------------------
99 void SetExtractor(SALOME_ExtractPolyDataGeometry* theExtractor)
100 { myPolyDataExtractor = theExtractor; }
102 SALOME_ExtractPolyDataGeometry* GetExtractor() const
103 { return myPolyDataExtractor; }
106 //----------------------------------------------------------------------------
107 vtkSmartPointer<VISU_OpenGLPointSpriteMapper> myMapper;
108 vtkSmartPointer<VTKViewer_TransformFilter> myTransformFilter;
110 typedef vtkSmartPointer<vtkPassThroughFilter> PPassThroughFilter;
111 std::vector<PPassThroughFilter> myPassFilter;
113 SALOME_ExtractPolyDataGeometry* myPolyDataExtractor;
115 VISU_GaussDeviceActorBase();
116 ~VISU_GaussDeviceActorBase();
119 VISU_GaussDeviceActorBase(const VISU_GaussDeviceActorBase&); // Not implemented
120 void operator=(const VISU_GaussDeviceActorBase&); // Not implemented
124 //============================================================================
125 class VISU_GaussPtsDeviceActor: public VISU_GaussDeviceActorBase
128 vtkTypeMacro(VISU_GaussPtsDeviceActor, VISU_GaussDeviceActorBase);
131 VISU_GaussPtsDeviceActor*
134 //----------------------------------------------------------------------------
136 AddToRender(vtkRenderer* theRenderer);
139 RemoveFromRender(vtkRenderer* theRenderer);
141 //----------------------------------------------------------------------------
146 SetPipeLine(VISU_GaussPointsPL* thePipeLine) ;
149 ShallowCopyPL(VISU_GaussPointsPL* thePipeLine);
155 //----------------------------------------------------------------------------
156 //! Gets memory size used by the instance (bytes).
162 //----------------------------------------------------------------------------
163 vtkSmartPointer<VISU_GaussPointsPL> myPipeLine;
165 VISU_GaussPtsDeviceActor();
166 ~VISU_GaussPtsDeviceActor();
169 VISU_GaussPtsDeviceActor(const VISU_GaussPtsDeviceActor&); // Not implemented
170 void operator=(const VISU_GaussPtsDeviceActor&); // Not implemented
174 //============================================================================
177 class vtkAppendPolyData;
178 class vtkPolyDataMapper;
180 #include <vtkLODActor.h>
182 class VISU_CursorPyramid : public vtkLODActor
185 vtkTypeMacro(VISU_CursorPyramid, vtkObject);
193 Render(vtkRenderer *, vtkMapper *);
196 AddToRender(vtkRenderer* theRenderer);
199 RemoveFromRender(vtkRenderer* theRenderer);
202 Init(vtkFloatingPointType theHeight,
203 vtkFloatingPointType theCursorSize,
204 vtkFloatingPointType theRadius,
205 vtkFloatingPointType theMagnification,
206 vtkFloatingPointType theClamp,
207 vtkFloatingPointType thePos[3],
208 vtkFloatingPointType theColor[3]);
210 void SetPreferences(vtkFloatingPointType theHeight,
211 vtkFloatingPointType theCursorSize);
214 VISU_CursorPyramid();
217 Init(vtkFloatingPointType theHeight,
218 vtkFloatingPointType theRadius);
221 vtkSmartPointer<vtkConeSource> mySources[6];
222 vtkSmartPointer<vtkAppendPolyData> myAppendFilter;
223 vtkSmartPointer<vtkPolyDataMapper> myMapper;
225 vtkFloatingPointType myHeight;
226 vtkFloatingPointType myCursorSize;
227 vtkFloatingPointType myRadius;
228 vtkFloatingPointType myMagnification;
229 vtkFloatingPointType myClamp;
232 VISU_CursorPyramid(const VISU_CursorPyramid&); // Not implemented
233 void operator=(const VISU_CursorPyramid&); // Not implemented
237 #endif //VISU_GAUSS_PTS_DEVICE_ACTOR_H