Back to index

salome-smesh  6.5.0
SMESH_Actor.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SMESH OBJECT : interactive object for SMESH visualization
00024 //  File   : SMESH_Actor.h
00025 //  Author : Nicolas REJNERI
00026 //  Module : SMESH
00027 //
00028 #ifndef SMESH_ACTOR_H
00029 #define SMESH_ACTOR_H
00030 
00031 #include <SALOMEconfig.h> // To fix some redefinition
00032 #include <SALOME_Actor.h>
00033 #include "SMESH_Object.h"
00034 
00035 #include <vtkCommand.h>
00036 
00037 class vtkUnstructuredGrid;
00038 
00039 class SMESH_ScalarBarActor;
00040 
00041 class vtkPlane;
00042 class vtkImplicitBoolean;
00043 
00044 #ifndef DISABLE_PLOT2DVIEWER
00045 class SPlot2d_Histogram;
00046 #endif
00047 
00048 namespace SMESH
00049 {
00050   const vtkIdType DeleteActorEvent = vtkCommand::UserEvent + 100;
00051 }
00052 
00053 class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
00054 {
00055   static SMESH_Actor* New() { return NULL;}
00056 
00057  public:
00058   vtkTypeMacro(SMESH_Actor,SALOME_Actor);
00059   static SMESH_Actor* New(TVisualObjPtr theVisualObj, 
00060                           const char* theEntry, 
00061                           const char* theName,
00062                           int theIsClear);
00063   
00064   virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b, int delta ) = 0;
00065   virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b, int& delta ) = 0;
00066     
00067   virtual void SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
00068   virtual void GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
00069 
00070   virtual void SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
00071   virtual void GetNodeColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
00072   
00073   virtual void SetOutlineColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
00074   virtual void GetOutlineColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;  
00075 
00076   virtual void Set0DColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
00077   virtual void Get0DColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
00078 
00079   virtual void SetHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
00080   virtual void GetHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
00081 
00082   virtual void SetPreHighlightColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
00083   virtual void GetPreHighlightColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
00084  
00085   virtual vtkFloatingPointType GetLineWidth() = 0;
00086   virtual void SetLineWidth(vtkFloatingPointType theVal) = 0;
00087 
00088   virtual void Set0DSize(vtkFloatingPointType size) = 0;
00089   virtual vtkFloatingPointType Get0DSize() = 0;
00090 
00091   enum EReperesent { ePoint, eEdge, eSurface};
00092   
00093   enum EEntityMode { e0DElements = 0x01, eEdges = 0x02, eFaces = 0x04, eVolumes = 0x08, eAllEntity = 0x0f};
00094 
00095   enum EQuadratic2DRepresentation { eLines = 0x01, eArcs = 0x02 };
00096 
00097   virtual void SetEntityMode(unsigned int theMode) = 0;
00098   virtual unsigned int GetEntityMode() const = 0;
00099 
00100   virtual void SetQuadratic2DRepresentation(EQuadratic2DRepresentation) = 0;
00101   virtual EQuadratic2DRepresentation GetQuadratic2DRepresentation() = 0;
00102 
00103   virtual void SetPointRepresentation(bool theIsPointsVisible) = 0;
00104   virtual bool GetPointRepresentation() = 0;
00105 
00106   virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
00107 
00108   virtual void SetShrinkFactor(vtkFloatingPointType theValue) = 0;
00109 
00110   virtual void SetPointsLabeled(bool theIsPointsLabeled) = 0;
00111   virtual bool GetPointsLabeled() = 0;
00112 
00113   virtual void SetCellsLabeled(bool theIsCellsLabeled) = 0;
00114   virtual bool GetCellsLabeled() = 0;
00115 
00116   virtual void SetFacesOriented(bool theIsFacesOriented) = 0;
00117   virtual bool GetFacesOriented() = 0;
00118 
00119   virtual void SetFacesOrientationColor(vtkFloatingPointType theColor[3]) = 0;
00120   virtual void GetFacesOrientationColor(vtkFloatingPointType theColor[3]) = 0;
00121 
00122   virtual void SetFacesOrientationScale(vtkFloatingPointType theScale) = 0;
00123   virtual vtkFloatingPointType GetFacesOrientationScale() = 0;
00124 
00125   virtual void SetFacesOrientation3DVectors(bool theState) = 0;
00126   virtual bool GetFacesOrientation3DVectors() = 0;
00127 
00128   enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
00129                 eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
00130                 eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D,
00131                 eMaxElementLength2D, eMaxElementLength3D, eBareBorderFace, eBareBorderVolume,
00132                 eOverConstrainedFace, eOverConstrainedVolume, eCoincidentNodes,
00133                 eCoincidentElems1D, eCoincidentElems2D, eCoincidentElems3D };
00134   virtual void SetControlMode(eControl theMode) = 0;
00135   virtual eControl GetControlMode() = 0;
00136   virtual SMESH::Controls::FunctorPtr GetFunctor() = 0;
00137 
00138   virtual SMESH_ScalarBarActor* GetScalarBarActor() = 0;
00139 
00140   virtual void RemoveAllClippingPlanes() = 0; 
00141   virtual vtkIdType GetNumberOfClippingPlanes() = 0; 
00142   virtual vtkPlane* GetClippingPlane(vtkIdType theID) = 0; 
00143   virtual vtkIdType AddClippingPlane(vtkPlane* thePlane) = 0; 
00144 
00145   virtual TVisualObjPtr GetObject() = 0;
00146 
00147   virtual void SetControlsPrecision( const long ) = 0;
00148   virtual long GetControlsPrecision() const = 0;
00149 
00150   virtual void UpdateScalarBar() = 0;
00151   virtual void UpdateDistribution() = 0;
00152 
00153 #ifndef DISABLE_PLOT2DVIEWER
00154   virtual SPlot2d_Histogram* GetPlot2Histogram() = 0;
00155   virtual SPlot2d_Histogram* UpdatePlot2Histogram() = 0;
00156 #endif
00157 };
00158 
00159 
00160 #endif //SMESH_ACTOR_H