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 // VISU OBJECT : interactive object for VISU entities implementation
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_ColoredPrs3d_i.hh"
31 #include "VISU_GaussPtsActorFactory.h"
33 class VISU_LookupTable;
34 class VISU_ScalarBarActor;
36 class VISU_GaussPointsPL;
42 //! Class of the Gauss Points presentation.
43 class VISU_I_EXPORT GaussPoints_i : public virtual POA_VISU::GaussPoints,
44 public virtual TGaussPtsActorFactory,
45 public virtual ColoredPrs3d_i
47 static int myNbPresent;
48 GaussPoints_i(const GaussPoints_i&);
51 //----------------------------------------------------------------------------
52 typedef ColoredPrs3d_i TSuperClass;
53 typedef VISU::GaussPoints TInterface;
56 GaussPoints_i(EPublishInStudyMode thePublishInStudyModep);
65 return VISU::TGAUSSPOINTS;
68 //----------------------------------------------------------------------------
69 //! Gets memory size actually used by the presentation (Mb).
74 //----------------------------------------------------------------------------
79 SetFaceLimit( CORBA::Long theFaceLimit );
85 SetIsDeformed( CORBA::Boolean theIsDeformed );
91 SetScaleFactor( CORBA::Double theScaleFactor );
93 //! Get color for Geometry mode of the presentation.
100 //! Set color for Geometry mode of the presentation.
102 SetColor( const SALOMEDS::Color& theColor );
105 SetQColor( const QColor& theColor );
107 //! Get flag indicating which mode of the presentation is active.
108 /*! When Results mode is active, returns true. Geometry - false. */
112 //! Get flag indicating which mode of the presentation is active.
114 SetIsColored( bool theIsColored );
116 //! Set path to the image using for Main Point Sprite texture.
118 SetMainTexture( const QString& theMainTexture );
120 //! Get path to the image using for Main Point Sprite texture.
127 //! Set path to the image using for Alpha Point Sprite texture.
129 SetAlphaTexture( const QString& theAlphaTexture );
131 //! Get path to the image using for Alpha Point Sprite texture.
138 //! Convert Main and AlphaMask images to VTI format and set them to pipeline.
140 SetQTextures( const QString& theMainTexture,
141 const QString& theAlphaTexture );
144 SetTextures( const char* theMainTexture,
145 const char* theAlphaTexture );
147 //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
149 SetAlphaThreshold(CORBA::Double theAlphaThreshold);
151 //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
155 //! Redirect the request to VISU_GaussPointsPL::SetResolution.
157 SetResolution(CORBA::Long theResolution);
159 //! Redirect the request to VISU_GaussPointsPL::GetResolution.
164 SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType);
166 VISU::GaussPoints::PrimitiveType
169 //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
171 GetMaximumSupportedSize();
173 //! Redirect the request to VISU_GaussPointsPL::SetClamp.
175 SetClamp(CORBA::Double theClamp);
177 //! Redirect the request to VISU_GaussPointsPL::GetClamp.
181 //! Redirect the request to VISU_GaussPointsPL::SetSize.
183 SetGeomSize(CORBA::Double theGeomSize);
185 //! Redirect the request to VISU_GaussPointsPL::GetSize.
189 //! Redirect the request to VISU_GaussPointsPL::SetMinSize.
191 SetMinSize(CORBA::Double theMinSize);
193 //! Redirect the request to VISU_GaussPointsPL::GetMinSize.
197 //! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
199 SetMaxSize(CORBA::Double theMaxSize);
201 //! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
205 //! Redirect the request to VISU_GaussPointsPL::SetMagnification.
207 SetMagnification(CORBA::Double theMagnification);
209 //! Redirect the request to VISU_GaussPointsPL::GetMagnification.
213 //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
215 SetMagnificationIncrement(CORBA::Double theIncrement);
217 //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
219 GetMagnificationIncrement();
221 //! Set flag indicating which scalar bar is active.
223 SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar);
225 //! Get flag indicating which scalar bar is active.
227 GetIsActiveLocalScalarBar();
229 //! Set flag indicating visibility of global scalar bar.
231 SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar);
233 //! Get flag indicating visibility of global scalar bar.
235 GetIsDispGlobalScalarBar();
237 //! Redirect the request to VISU_GaussPointsPL::SetBicolor.
239 SetBiColor(CORBA::Boolean theIsBiColor);
241 //! Redirect the request to VISU_GaussPointsPL::GetBicolor.
245 //! Set value of the distance between global and local scalar bars.
247 SetSpacing(CORBA::Double theSpacing);
249 //! Get value of the distance between global and local scalar bars.
253 //! Let know is the global range is already calculated
255 IsGlobalRangeDefined() const;
270 GetSpecificPL() const
272 return myGaussPointsPL;
275 virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
277 virtual void SetBarVisible(CORBA::Boolean theVisible);
279 //----------------------------------------------------------------------------
280 //! Sets initial source geometry
285 //! Add geometry of mesh as group. \retval the id of added group.
288 AddMeshOnGroup(const char* theGroupName);
290 //! Removes all geometries.
297 GetComponentMin(vtkIdType theCompID);
301 GetComponentMax(vtkIdType theCompID);
304 //! Redefines VISU_ColoredPrs3d_i::DoSetInput
307 DoSetInput(bool theIsInitilizePipe, bool theReInit);
309 //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
312 CreatePipeLine(VISU_PipeLine* thePipeLine);
314 //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
328 OnCreateActor(VISU_GaussPtsAct* theActor);
337 UpdateScalarBar(VISU_ScalarBarActor *theScalarBar,
338 VISU_LookupTable* theLookupTable);
341 VISU_GaussPointsPL *myGaussPointsPL;
343 bool myIsDispGlobalScalarBar;
344 bool myIsActiveLocalScalarBar;
346 vtkFloatingPointType mySpacing;
349 QString myMainTexture;
350 QString myAlphaTexture;
355 IsPossible(Result_i* theResult,
356 const std::string& theMeshName,
357 VISU::Entity theEntity,
358 const std::string& theFieldName,
359 CORBA::Long theTimeStampNumber,
360 bool theIsMemoryCheck);
363 Create(const std::string& theMeshName,
364 VISU::Entity theEntity,
365 const std::string& theFieldName,
366 CORBA::Long theTimeStampNumber);
370 SameAs(const Prs3d_i* theOrigin);
372 static const std::string myComment;
384 ToStream(std::ostringstream& theStr);
388 Restore(SALOMEDS::SObject_ptr theSObject,
389 const Storable::TRestoringMap& theMap);
391 //----------------------------------------------------------------------------
398 CloneActor(VISU_GaussPtsAct1* theActor);
402 UpdateActor(VISU_ActorBase* theActor);
406 UpdateFromActor(VISU_GaussPtsAct* theActor);