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
23 // File : VISU_PrsObject_i.hxx
24 // Author : Alexey PETROV
27 #ifndef VISU_GaussPoints_i_HeaderFile
28 #define VISU_GaussPoints_i_HeaderFile
30 #include "VISU_Result_i.hh"
31 #include "VISU_ColoredPrs3d_i.hh"
32 #include "VISU_GaussPtsActorFactory.h"
35 class vtkScalarBarActor;
37 class VISU_GaussPointsPL;
41 //! Class of the Gauss Points presentation.
42 class GaussPoints_i : public virtual POA_VISU::GaussPoints,
43 public virtual VISU::TGaussPtsActorFactory,
44 public virtual MinMaxCunsomer,
45 public virtual ColoredPrs3d_i
47 static int myNbPresent;
49 GaussPoints_i(const GaussPoints_i&);
52 //----------------------------------------------------------------------------
53 typedef ColoredPrs3d_i TSuperClass;
56 GaussPoints_i(Result_i* theResult,
59 GaussPoints_i(Result_i* theResult,
60 SALOMEDS::SObject_ptr theSObject);
69 return VISU::TGAUSSPOINTS;
72 typedef VISU::GaussPoints TInterface;
74 //! Get the Gauss Points Pipeline.
79 GetFaceLimit() { return myFaceLimit; }
82 SetFaceLimit( int theFaceLimit ) { myFaceLimit = theFaceLimit; }
88 SetIsDeformed( bool theIsDeformed );
94 SetScaleFactor( vtkFloatingPointType theScaleFactor );
96 //! Get color for Geometry mode of the presentation.
98 GetColor() { return myColor; }
100 //! Set color for Geometry mode of the presentation.
102 SetColor( const QColor& theColor ) { myColor = theColor; }
104 //! Get flag indicating which mode of the presentation is active.
105 /*! When Results mode is active, returns true. Geometry - false. */
107 GetIsColored() { return myIsColored; }
109 //! Get flag indicating which mode of the presentation is active.
111 SetIsColored( bool theIsColored );
113 //! Set path to the image using for Main Point Sprite texture.
115 SetMainTexture( const QString& theMainTexture );
117 //! Get path to the image using for Main Point Sprite texture.
121 //! Set path to the image using for Alpha Point Sprite texture.
123 SetAlphaTexture( const QString& theAlphaTexture );
125 //! Get path to the image using for Alpha Point Sprite texture.
129 //! Convert Main and AlphaMask images to VTI format and set them to pipeline.
131 SetTextures( const QString& theMainTexture,
132 const QString& theAlphaTexture );
134 //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
136 SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
138 //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
142 //! Redirect the request to VISU_GaussPointsPL::SetResolution.
144 SetResolution(int theResolution);
146 //! Redirect the request to VISU_GaussPointsPL::GetResolution.
151 SetPrimitiveType(int thePrimitiveType);
156 //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
158 GetMaximumSupportedSize();
160 //! Redirect the request to VISU_GaussPointsPL::SetClamp.
162 SetClamp(vtkFloatingPointType theClamp);
164 //! Redirect the request to VISU_GaussPointsPL::GetClamp.
168 //! Redirect the request to VISU_GaussPointsPL::SetSize.
170 SetGeomSize(vtkFloatingPointType theGeomSize);
172 //! Redirect the request to VISU_GaussPointsPL::GetSize.
176 //! Redirect the request to VISU_GaussPointsPL::SetMinSize.
178 SetMinSize(vtkFloatingPointType theMinSize);
180 //! Redirect the request to VISU_GaussPointsPL::GetMinSize.
184 //! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
186 SetMaxSize(vtkFloatingPointType theMaxSize);
188 //! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
192 //! Redirect the request to VISU_GaussPointsPL::SetMagnification.
194 SetMagnification(vtkFloatingPointType theMagnification);
196 //! Redirect the request to VISU_GaussPointsPL::GetMagnification.
200 //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
202 SetMagnificationIncrement(vtkFloatingPointType theIncrement);
204 //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
206 GetMagnificationIncrement();
208 //! Set flag indicating which scalar bar is active.
210 SetIsActiveLocalScalarBar(const bool theFlag);
212 //! Get flag indicating which scalar bar is active.
214 GetIsActiveLocalScalarBar() const;
216 //! Set flag indicating visibility of global scalar bar.
218 SetIsDispGlobalScalarBar(const bool theFlag);
220 //! Get flag indicating visibility of global scalar bar.
222 GetIsDispGlobalScalarBar() const;
224 //! Redirect the request to VISU_GaussPointsPL::SetBicolor.
226 SetBiColor(bool theIsBiColor);
228 //! Redirect the request to VISU_GaussPointsPL::GetBicolor.
232 //! Set value of the distance between global and local scalar bars.
234 SetSpacing(const vtkFloatingPointType theSpacing);
236 //! Get value of the distance between global and local scalar bars.
240 //! Let know is the global range is already calculated
242 IsGlobalRangeDefined() const;
244 //! To update the min / max automatically
252 DoSetInput(Result_i* theResult);
263 OnCreateActor(VISU_GaussPtsAct* theActor,
264 const Handle(SALOME_InteractiveObject)& theIO = NULL);
267 OnCreateActor1(const Handle(SALOME_InteractiveObject)& theIO = NULL);
270 OnCreateActor2(const Handle(SALOME_InteractiveObject)& theIO = NULL);
273 UpdateScalarBar(vtkScalarBarActor *theScalarBar,
274 vtkLookupTable* theLookupTable);
277 VISU_GaussPointsPL *myGaussPointsPL;
280 bool myIsDispGlobalScalarBar;
281 bool myIsActiveLocalScalarBar;
283 vtkFloatingPointType mySpacing;
286 QString myMainTexture;
287 QString myAlphaTexture;
292 IsPossible(Result_i* theResult,
293 const char* theMeshName,
294 VISU::Entity theEntity,
295 const char* theFieldName,
297 int isMemoryCheck = true);
300 Create(const char* theMeshName,
301 VISU::Entity theEntity,
302 const char* theFieldName,
305 static const std::string myComment;
317 ToStream(std::ostringstream& theStr);
321 Restore(const Storable::TRestoringMap& theMap);
323 //----------------------------------------------------------------------------
326 CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
330 CloneActor(VISU_GaussPtsAct1* theActor);
334 UpdateActor(VISU_Actor* theActor);
338 UpdateFromActor(VISU_GaussPtsAct* theActor);