1 // Copyright (C) 2007-2013 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 // VISU OBJECT : interactive object for VISU entities implementation
24 // File : VISU_PrsObject_i.hxx
25 // Author : Alexey PETROV
28 #ifndef VISU_GaussPoints_i_HeaderFile
29 #define VISU_GaussPoints_i_HeaderFile
31 #include "VISU_ColoredPrs3d_i.hh"
32 #include "VISU_GaussPtsActorFactory.h"
34 class VISU_LookupTable;
35 class VISU_ScalarBarActor;
37 class VISU_GaussPointsPL;
43 //! Class of the Gauss Points presentation.
44 class VISU_I_EXPORT GaussPoints_i : public virtual POA_VISU::GaussPoints,
45 public virtual TGaussPtsActorFactory,
46 public virtual ColoredPrs3d_i
48 static int myNbPresent;
49 GaussPoints_i(const GaussPoints_i&);
52 //----------------------------------------------------------------------------
53 typedef ColoredPrs3d_i TSuperClass;
54 typedef VISU::GaussPoints TInterface;
57 GaussPoints_i(EPublishInStudyMode thePublishInStudyModep);
66 return VISU::TGAUSSPOINTS;
69 //----------------------------------------------------------------------------
70 //! Gets memory size actually used by the presentation (Mb).
75 //----------------------------------------------------------------------------
80 SetFaceLimit( CORBA::Long theFaceLimit );
86 SetIsDeformed( CORBA::Boolean theIsDeformed );
92 SetScaleFactor( CORBA::Double theScaleFactor );
94 //! Get color for Geometry mode of the presentation.
101 //! Set color for Geometry mode of the presentation.
103 SetColor( const SALOMEDS::Color& theColor );
106 SetQColor( const QColor& theColor );
108 //! Get flag indicating which mode of the presentation is active.
109 /*! When Results mode is active, returns true. Geometry - false. */
113 //! Get flag indicating which mode of the presentation is active.
115 SetIsColored( bool theIsColored );
117 //! Set path to the image using for Main Point Sprite texture.
119 SetMainTexture( const QString& theMainTexture );
121 //! Get path to the image using for Main Point Sprite texture.
128 //! Set path to the image using for Alpha Point Sprite texture.
130 SetAlphaTexture( const QString& theAlphaTexture );
132 //! Get path to the image using for Alpha Point Sprite texture.
139 //! Convert Main and AlphaMask images to VTI format and set them to pipeline.
141 SetQTextures( const QString& theMainTexture,
142 const QString& theAlphaTexture );
145 SetTextures( const char* theMainTexture,
146 const char* theAlphaTexture );
148 //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
150 SetAlphaThreshold(CORBA::Double theAlphaThreshold);
152 //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
156 //! Redirect the request to VISU_GaussPointsPL::SetResolution.
158 SetResolution(CORBA::Long theResolution);
160 //! Redirect the request to VISU_GaussPointsPL::GetResolution.
165 SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType);
167 VISU::GaussPoints::PrimitiveType
170 //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
172 GetMaximumSupportedSize();
174 //! Redirect the request to VISU_GaussPointsPL::SetClamp.
176 SetClamp(CORBA::Double theClamp);
178 //! Redirect the request to VISU_GaussPointsPL::GetClamp.
182 //! Redirect the request to VISU_GaussPointsPL::SetSize.
184 SetGeomSize(CORBA::Double theGeomSize);
186 //! Redirect the request to VISU_GaussPointsPL::GetSize.
190 //! Redirect the request to VISU_GaussPointsPL::SetMinSize.
192 SetMinSize(CORBA::Double theMinSize);
194 //! Redirect the request to VISU_GaussPointsPL::GetMinSize.
198 //! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
200 SetMaxSize(CORBA::Double theMaxSize);
202 //! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
206 //! Redirect the request to VISU_GaussPointsPL::SetMagnification.
208 SetMagnification(CORBA::Double theMagnification);
210 //! Redirect the request to VISU_GaussPointsPL::GetMagnification.
214 //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
216 SetMagnificationIncrement(CORBA::Double theIncrement);
218 //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
220 GetMagnificationIncrement();
222 //! Set flag indicating which scalar bar is active.
224 SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar);
226 //! Get flag indicating which scalar bar is active.
228 GetIsActiveLocalScalarBar();
230 //! Set flag indicating visibility of global scalar bar.
232 SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar);
234 //! Get flag indicating visibility of global scalar bar.
236 GetIsDispGlobalScalarBar();
238 //! Redirect the request to VISU_GaussPointsPL::SetBicolor.
240 SetBiColor(CORBA::Boolean theIsBiColor);
242 //! Redirect the request to VISU_GaussPointsPL::GetBicolor.
246 //! Set value of the distance between global and local scalar bars.
248 SetSpacing(CORBA::Double theSpacing);
250 //! Get value of the distance between global and local scalar bars.
254 //! Let know is the global range is already calculated
256 IsGlobalRangeDefined() const;
271 GetSpecificPL() const
273 return myGaussPointsPL;
276 virtual CORBA::Boolean IsBarVisible() { return myShowBar; }
278 virtual void SetBarVisible(CORBA::Boolean theVisible);
280 //----------------------------------------------------------------------------
281 //! Sets initial source geometry
286 //! Add geometry of mesh as group. \retval the id of added group.
289 AddMeshOnGroup(const char* theGroupName);
291 //! Removes all geometries.
298 GetComponentMin(vtkIdType theCompID);
302 GetComponentMax(vtkIdType theCompID);
305 //! Redefines VISU_ColoredPrs3d_i::DoSetInput
308 DoSetInput(bool theIsInitilizePipe, bool theReInit);
310 //! Redefines VISU_ColoredPrs3d_i::CreatePipeLine
313 CreatePipeLine(VISU_PipeLine* thePipeLine);
315 //! Redefines VISU_ColoredPrs3d_i::CheckIsPossible
329 OnCreateActor(VISU_GaussPtsAct* theActor);
338 UpdateScalarBar(VISU_ScalarBarActor *theScalarBar,
339 VISU_LookupTable* theLookupTable);
342 VISU_GaussPointsPL *myGaussPointsPL;
344 bool myIsDispGlobalScalarBar;
345 bool myIsActiveLocalScalarBar;
350 QString myMainTexture;
351 QString myAlphaTexture;
356 IsPossible(Result_i* theResult,
357 const std::string& theMeshName,
358 VISU::Entity theEntity,
359 const std::string& theFieldName,
360 CORBA::Long theTimeStampNumber,
361 bool theIsMemoryCheck);
364 Create(const std::string& theMeshName,
365 VISU::Entity theEntity,
366 const std::string& theFieldName,
367 CORBA::Long theTimeStampNumber);
371 SameAs(const Prs3d_i* theOrigin);
373 static const std::string myComment;
385 ToStream(std::ostringstream& theStr);
389 Restore(SALOMEDS::SObject_ptr theSObject,
390 const Storable::TRestoringMap& theMap);
392 //----------------------------------------------------------------------------
399 CloneActor(VISU_GaussPtsAct1* theActor);
403 UpdateActor(VISU_ActorBase* theActor);
407 UpdateFromActor(VISU_GaussPtsAct* theActor);