Back to index

salome-smesh  6.5.0
SMESH_Object.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_Object.h
00025 //  Author : Nicolas REJNERI
00026 //  Module : SMESH
00027 //  $Header: /home/server/cvs/SMESH/SMESH_SRC/src/OBJECT/SMESH_Object.h,v 1.9.2.2.6.4.2.1 2012-04-13 09:31:05 vsr Exp $
00028 //
00029 #ifndef SMESH_OBJECT_H
00030 #define SMESH_OBJECT_H
00031 
00032 #ifdef WNT
00033  #if defined SMESHOBJECT_EXPORTS || defined SMESHObject_EXPORTS
00034   #define SMESHOBJECT_EXPORT __declspec( dllexport )
00035  #else
00036   #define SMESHOBJECT_EXPORT __declspec( dllimport )
00037  #endif
00038 #else
00039  #define SMESHOBJECT_EXPORT
00040 #endif
00041 
00042 #include <boost/shared_ptr.hpp>
00043 #include <vtkSystemIncludes.h>
00044 
00045 #include "SMESH_Controls.hxx"
00046 #include "SMDSAbs_ElementType.hxx"
00047 
00048 class SMDS_Mesh;
00049 class vtkUnstructuredGrid;
00050 
00051 /*
00052   Class       : SMESH_VisualObj
00053   Description : Base class for all mesh objects to be visuilised
00054 */
00055 class SMESHOBJECT_EXPORT SMESH_VisualObj
00056 {
00057 public:
00058   virtual bool Update( int theIsClear = true ) = 0;
00059   virtual bool NulData() = 0;
00060   virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
00061   virtual int GetElemDimension( const int theObjId ) = 0;
00062 
00063   virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0;
00064   virtual SMDS_Mesh* GetMesh() const = 0;
00065 
00066   virtual bool GetEdgeNodes( const int theElemId,
00067                              const int theEdgeNum,
00068                              int&      theNodeId1,
00069                              int&      theNodeId2 ) const = 0;
00070   virtual bool              IsValid() const = 0;
00071   
00072   virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
00073   
00074   virtual vtkIdType GetNodeObjId( int theVTKID ) = 0;
00075   virtual vtkIdType GetNodeVTKId( int theObjID ) = 0;
00076   virtual vtkIdType GetElemObjId( int theVTKID ) = 0;
00077   virtual vtkIdType GetElemVTKId( int theObjID ) = 0;
00078   virtual void              ClearEntitiesFlags() = 0;
00079   virtual bool              GetEntitiesFlag() = 0;
00080   virtual unsigned int      GetEntitiesState() = 0;
00081 };
00082 
00083 typedef boost::shared_ptr<SMESH_VisualObj> TVisualObjPtr;
00084 
00085 #endif