Salome HOME
3d4dbbf8b433b30c685b8a1b1d7808c53220d5e9
[modules/smesh.git] / src / OBJECT / SMESH_Object.h
1 //  Copyright (C) 2007-2008  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 //  SMESH OBJECT : interactive object for SMESH visualization
23 //  File   : SMESH_Object.h
24 //  Author : Nicolas REJNERI
25 //  Module : SMESH
26 //  $Header$
27 //
28 #ifndef SMESH_OBJECT_H
29 #define SMESH_OBJECT_H
30
31 #ifdef WNT
32  #if defined SMESHOBJECT_EXPORTS || defined SMESHObject_EXPORTS
33   #define SMESHOBJECT_EXPORT __declspec( dllexport )
34  #else
35   #define SMESHOBJECT_EXPORT __declspec( dllimport )
36  #endif
37 #else
38  #define SMESHOBJECT_EXPORT
39 #endif
40
41 #include <boost/shared_ptr.hpp>
42 #include <vtkSystemIncludes.h>
43
44 #include "SMESH_Controls.hxx"
45 #include "SMDSAbs_ElementType.hxx"
46
47 class SMDS_Mesh;
48 class vtkUnstructuredGrid;
49
50 /*
51   Class       : SMESH_VisualObj
52   Description : Base class for all mesh objects to be visuilised
53 */
54 class SMESHOBJECT_EXPORT SMESH_VisualObj
55 {
56 public:
57   virtual bool Update( int theIsClear = true ) = 0;
58   virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
59   virtual int GetElemDimension( const int theObjId ) = 0;
60
61   virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
62   virtual SMDS_Mesh* GetMesh() const = 0;
63
64   virtual bool GetEdgeNodes( const int theElemId,
65                              const int theEdgeNum,
66                              int&      theNodeId1,
67                              int&      theNodeId2 ) const = 0;
68   
69   virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
70   
71   virtual vtkIdType GetNodeObjId( int theVTKID ) = 0;
72   virtual vtkIdType GetNodeVTKId( int theObjID ) = 0;
73   virtual vtkIdType GetElemObjId( int theVTKID ) = 0;
74   virtual vtkIdType GetElemVTKId( int theObjID ) = 0;
75 };
76
77 typedef boost::shared_ptr<SMESH_VisualObj> TVisualObjPtr;
78
79 #endif