Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef SMESH_OBJECTDEF_H
00030 #define SMESH_OBJECTDEF_H
00031
00032 #include "SMESH_Controls.hxx"
00033 #include "SMESH_Object.h"
00034 #include "SMESH_Client.hxx"
00035
00036
00037 #include <SALOMEconfig.h>
00038 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00039 #include CORBA_SERVER_HEADER(SMESH_Group)
00040
00041 #include <map>
00042 #include <list>
00043
00044 class vtkPoints;
00045 class SALOME_ExtractUnstructuredGrid;
00046
00047 class SMESH_Actor;
00048 class SMDS_MeshNode;
00049 class SMDS_MeshElement;
00050
00051
00052
00053
00054
00055 class SMESHOBJECT_EXPORT SMESH_VisualObjDef: public SMESH_VisualObj
00056 {
00057 public:
00058 typedef std::list<const SMDS_MeshElement*> TEntityList;
00059 typedef std::map<vtkIdType,vtkIdType> TMapOfIds;
00060
00061 SMESH_VisualObjDef();
00062 virtual ~SMESH_VisualObjDef();
00063
00064 virtual bool Update( int theIsClear = true ) = 0;
00065 virtual bool NulData() {return 0; };
00066 virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
00067 virtual int GetElemDimension( const int theObjId ) = 0;
00068
00069 virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
00070 virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0;
00071 virtual bool IsNodePrs() const = 0;
00072 virtual SMDS_Mesh* GetMesh() const = 0;
00073
00074 virtual bool IsValid() const;
00075
00076 virtual bool GetEdgeNodes( const int theElemId,
00077 const int theEdgeNum,
00078 int& theNodeId1,
00079 int& theNodeId2 ) const;
00080
00081 virtual vtkUnstructuredGrid* GetUnstructuredGrid();
00082
00083 virtual vtkIdType GetNodeObjId( int theVTKID );
00084 virtual vtkIdType GetNodeVTKId( int theObjID );
00085 virtual vtkIdType GetElemObjId( int theVTKID );
00086 virtual vtkIdType GetElemVTKId( int theObjID );
00087
00088 protected:
00089
00090 void createPoints( vtkPoints* );
00091 void buildPrs(bool buildGrid = false);
00092 void buildNodePrs();
00093 void buildElemPrs();
00094
00095
00096
00097 TMapOfIds mySMDS2VTKNodes;
00098 TMapOfIds myVTK2SMDSNodes;
00099 TMapOfIds mySMDS2VTKElems;
00100 TMapOfIds myVTK2SMDSElems;
00101 bool myLocalGrid;
00102
00103 vtkUnstructuredGrid* myGrid;
00104 };
00105
00106
00107
00108
00109
00110
00111
00112 class SMESHOBJECT_EXPORT SMESH_MeshObj: public SMESH_VisualObjDef
00113 {
00114 public:
00115
00116 SMESH_MeshObj( SMESH::SMESH_Mesh_ptr );
00117 virtual ~SMESH_MeshObj();
00118
00119 virtual bool Update( int theIsClear = true );
00120 virtual bool NulData();
00121
00122 virtual int GetNbEntities( const SMDSAbs_ElementType) const;
00123 virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
00124 virtual bool IsNodePrs() const;
00125
00126 virtual int GetElemDimension( const int theObjId );
00127
00128 virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
00129
00130 SMESH::SMESH_Mesh_ptr GetMeshServer() { return myClient.GetMeshServer(); }
00131 SMDS_Mesh* GetMesh() const { return myClient.GetMesh(); }
00132
00133 protected:
00134 SMESH_Client myClient;
00135 vtkUnstructuredGrid* myEmptyGrid;
00136 };
00137
00138
00139
00140
00141
00142
00143
00144 class SMESHOBJECT_EXPORT SMESH_SubMeshObj: public SMESH_VisualObjDef
00145 {
00146 public:
00147
00148 SMESH_SubMeshObj(SMESH_MeshObj* theMeshObj);
00149 virtual ~SMESH_SubMeshObj();
00150
00151 virtual bool Update( int theIsClear = true );
00152
00153 virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor );
00154 virtual int GetElemDimension( const int theObjId );
00155 virtual SMDS_Mesh* GetMesh() const { return myMeshObj->GetMesh(); }
00156
00157 protected:
00158
00159 SMESH_MeshObj* myMeshObj;
00160 };
00161
00162
00163
00164
00165
00166
00167
00168 class SMESHOBJECT_EXPORT SMESH_GroupObj: public SMESH_SubMeshObj
00169 {
00170 public:
00171 SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* );
00172 virtual ~SMESH_GroupObj();
00173
00174 virtual int GetNbEntities( const SMDSAbs_ElementType) const;
00175 virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
00176 virtual bool IsNodePrs() const;
00177
00178 virtual SMDSAbs_ElementType GetElementType() const;
00179
00180 private:
00181
00182 SMESH::SMESH_GroupBase_var myGroupServer;
00183 };
00184
00185
00186
00187
00188
00189
00190
00191 class SMESHOBJECT_EXPORT SMESH_subMeshObj : public SMESH_SubMeshObj
00192 {
00193 public:
00194
00195 SMESH_subMeshObj( SMESH::SMESH_subMesh_ptr,
00196 SMESH_MeshObj* );
00197 virtual ~SMESH_subMeshObj();
00198
00199 virtual int GetNbEntities( const SMDSAbs_ElementType) const;
00200 virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
00201 virtual bool IsNodePrs() const;
00202
00203 protected:
00204
00205 SMESH::SMESH_subMesh_var mySubMeshServer;
00206 };
00207
00208
00209 #endif