1 // VISU OBJECT : interactive object for VISU entities implementation
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
24 // File: VISU_GaussPointsPL.hxx
28 #ifndef VISU_GaussPointsPL_HeaderFile
29 #define VISU_GaussPointsPL_HeaderFile
31 #include "VISUPipeline.hxx"
32 #include "VISU_ColoredPL.hxx"
36 class VISU_OpenGLPointSpriteMapper;
37 class VISU_PointSpriteMapperHolder;
39 class vtkGeometryFilter;
41 class vtkSphereSource;
45 class vtkPassThroughFilter;
49 class SALOME_Transform;
51 class VISU_AppendFilter;
52 class VISU_GaussMergeFilter;
54 //----------------------------------------------------------------------------
55 //! Pipeline for the Gauss Points presentation.
57 * This class uses the special mapper (VISU_OpenGLPointSpriteMapper)
58 * for rendering the Gauss Points as Point Sprites.
60 class VISU_PIPELINE_EXPORT VISU_GaussPointsPL : public VISU_ColoredPL
63 //----------------------------------------------------------------------------
64 vtkTypeMacro(VISU_GaussPointsPL, VISU_ColoredPL);
74 //----------------------------------------------------------------------------
76 SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper);
78 const VISU::PGaussPtsIDMapper&
79 GetGaussPtsIDMapper();
81 VISU_PointSpriteMapperHolder*
82 GetPointSpriteMapperHolder();
84 //! Get the internal #VISU_OpenGLPointSpriteMapper.
85 VISU_OpenGLPointSpriteMapper*
86 GetPointSpriteMapper();
91 //! Get an intermediate dataset that can be picked
95 //----------------------------------------------------------------------------
96 //! Redefined method for initialization of the pipeline.
101 //! Redefined method for updating the pipeline.
106 //! Gets memory size used by the instance (bytes).
111 //----------------------------------------------------------------------------
118 GetObjID(vtkIdType theID);
120 //! Set the Bicolor mode.
122 * When the Bicolor parameter is set to true, scalar bars are
123 * drawing with two colors : red color correspoonds to positive
124 * scalar values, blue color - to negative values.
127 SetBicolor(bool theBicolor);
129 //! Get the Bicolor mode.
133 //! Set the Multicolored mode.
135 * This parameter is using to switch between Results and Geometry
136 * modes. Multiple colors are using when the presentation is
137 * drawing in the Results mode, one color - in the Geometry mode.
140 SetIsColored(bool theIsColored);
145 //! Set type of the primitives.
147 SetPrimitiveType(int thePrimitiveType);
149 //! Get type of the primitives.
153 //! Get the maximum Point Sprite size, which is supported by hardware.
155 GetMaximumSupportedSize();
157 //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp.
159 SetClamp(vtkFloatingPointType theClamp);
161 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteClamp, vtkFloatingPointType).
165 //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteSize.
167 SetSize(vtkFloatingPointType theSize);
169 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteSize, vtkFloatingPointType).
173 //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize.
175 SetMinSize(vtkFloatingPointType theMinSize);
177 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMinSize, vtkFloatingPointType).
181 //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize.
183 SetMaxSize(vtkFloatingPointType theMaxSize);
185 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMaxSize, vtkFloatingPointType).
189 //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification.
191 SetMagnification(vtkFloatingPointType theMagnification);
193 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteMagnification, vtkFloatingPointType).
197 //! Set the increment of changing Magnification parameter.
199 SetMagnificationIncrement(vtkFloatingPointType theIncrement);
201 //! Get the increment of changing Magnification parameter.
203 GetMagnificationIncrement() { return myMagnificationIncrement; }
205 //! Redirect the request to VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold.
207 SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
209 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(PointSpriteAlphaThreshold, vtkFloatingPointType).
213 //! Set resolution of the Geometrical Sphere.
215 SetResolution(int theResolution);
217 //! Get resolution of the Geometrical Sphere.
221 //! Method for changing the Magnification parameter.
223 ChangeMagnification( bool up );
225 //! Get the maximum size of Point Sprites in the presentation.
229 //! Get point size by element's Id.
231 GetPointSize(vtkIdType theID);
233 //! Get point size by element's Id using the specified scalar array.
235 GetPointSize(vtkIdType theID, vtkDataArray* theScalarArray);
237 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkSetMacro(AverageCellSize, vtkFloatingPointType).
239 SetAverageCellSize(vtkFloatingPointType AverageCellSize);
241 //! Redirect the request to VISU_OpenGLPointSpriteMapper.vtkGetMacro(AverageCellSize, vtkFloatingPointType).
243 GetAverageCellSize();
245 //! Set image data for the Point Sprite texture.
247 SetImageData(vtkImageData* theImageData);
249 //! Make the image data for Point Sprite texture.
251 * First parameter - texture for shape.
252 * Second parameter - texture for alpha mask.
255 vtkSmartPointer<vtkImageData>
256 MakeTexture( const char* theMainTexture,
257 const char* theAlphaTexture );
260 //----------------------------------------------------------------------------
263 SetIsDeformed( bool theIsDeformed );
271 SetScale( vtkFloatingPointType theScale );
279 SetMapScale( vtkFloatingPointType theMapScale = 1.0 );
289 AddGeometry(vtkDataSet* theGeometry);
293 GetGeometry(int theGeomNumber);
297 GetNumberOfGeometry();
301 IsExternalGeometryUsed();
312 //----------------------------------------------------------------------------
313 VISU_GaussPointsPL();
316 ~VISU_GaussPointsPL();
320 OnCreateMapperHolder();
332 DoShallowCopy(VISU_PipeLine *thePipeLine,
333 bool theIsCopyInput);
336 //----------------------------------------------------------------------------
337 vtkFloatingPointType myScaleFactor;
338 vtkWarpVector *myWarpVector;
339 std::vector<vtkPassThroughFilter*> myPassFilter;
340 vtkSmartPointer<VISU_PointSpriteMapperHolder> myPointSpriteMapperHolder;
343 vtkSphereSource* mySphereSource;
345 vtkFloatingPointType myMagnificationIncrement;
349 vtkSmartPointer<VISU_AppendFilter> myAppendFilter;
350 vtkSmartPointer<VISU_GaussMergeFilter> myMergeFilter;
353 VISU_GaussPointsPL(const VISU_GaussPointsPL&); // Not implemented.
354 void operator=(const VISU_GaussPointsPL&); // Not implemented.