Salome HOME
84d42dd258cb540725e73266cc782448e7cef7a5
[modules/smesh.git] / src / OBJECT / SMESH_Object.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  SMESH OBJECT : interactive object for SMESH visualization
24 //  File   : SMESH_Object.h
25 //  Author : Nicolas REJNERI
26 //  Module : SMESH
27 //  $Header$
28 //
29 #ifndef SMESH_OBJECT_H
30 #define SMESH_OBJECT_H
31
32 #ifdef WNT
33  #if defined SMESHOBJECT_EXPORTS || defined SMESHObject_EXPORTS
34   #define SMESHOBJECT_EXPORT __declspec( dllexport )
35  #else
36   #define SMESHOBJECT_EXPORT __declspec( dllimport )
37  #endif
38 #else
39  #define SMESHOBJECT_EXPORT
40 #endif
41
42 #include <boost/shared_ptr.hpp>
43 #include <vtkSystemIncludes.h>
44
45 #include "SMESH_Controls.hxx"
46 #include "SMDSAbs_ElementType.hxx"
47
48 #include <SALOMEconfig.h>
49 #include CORBA_SERVER_HEADER(SMESH_Mesh)
50
51 class SMDS_Mesh;
52 class vtkUnstructuredGrid;
53
54 /*
55   Class       : SMESH_VisualObj
56   Description : Base class for all mesh objects to be visuilised
57 */
58 class SMESHOBJECT_EXPORT SMESH_VisualObj
59 {
60 public:
61   virtual bool Update( int theIsClear = true ) = 0;
62   virtual bool NulData() = 0;
63   virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
64   virtual int GetElemDimension( const int theObjId ) = 0;
65
66   virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
67   virtual SMDS_Mesh* GetMesh() const = 0;
68   virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0;
69
70   virtual bool GetEdgeNodes( const int theElemId,
71                              const int theEdgeNum,
72                              int&      theNodeId1,
73                              int&      theNodeId2 ) const = 0;
74   virtual bool              IsValid() const = 0;
75   
76   virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
77   
78   virtual vtkIdType GetNodeObjId( int theVTKID ) = 0;
79   virtual vtkIdType GetNodeVTKId( int theObjID ) = 0;
80   virtual vtkIdType GetElemObjId( int theVTKID ) = 0;
81   virtual vtkIdType GetElemVTKId( int theObjID ) = 0;
82   virtual void              ClearEntitiesFlags() = 0;
83   virtual bool              GetEntitiesFlag() = 0;
84   virtual unsigned int      GetEntitiesState() = 0;
85 };
86
87 typedef boost::shared_ptr<SMESH_VisualObj> TVisualObjPtr;
88
89 #endif