3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : VISU_Convertor.hxx
24 // Author : Alexey PETROV
27 #ifndef VISU_IDMapper_HeaderFile
28 #define VISU_IDMapper_HeaderFile
31 \file VISU_IDMapper.hxx
32 \brief The file contains declarations for basic interfaces that defines mapping of mesh elements
35 #include "MED_SharedPtr.hxx"
36 #include "VTKViewer.h"
40 class vtkUnstructuredGrid;
47 //---------------------------------------------------------------
48 //! Defines a basic class for intemediate data structures
51 //! Just to provide possibility of dynamic navigation through the class hierarchy
52 virtual ~TBaseStructure()
55 std::string myEntry; //!< To simplify publication of the object tree
57 typedef SharedPtr<TBaseStructure> PBaseStructure;
59 //---------------------------------------------------------------
60 typedef vtkUnstructuredGrid TVTKOutput;
62 //! Defines a basic abstract interface for VTK to object ID's and backward mapping
64 Where object ID means ID which attached to corresponding MED entity.
65 For example, each MED node can have its own ID as well as any other mesh cell
67 struct TIDMapper: virtual TBaseStructure
69 //! Get node object ID for corresponding VTK ID
72 GetNodeObjID(vtkIdType theID) const;
74 //! Get node VTK ID for corresponding object ID
77 GetNodeVTKID(vtkIdType theID) const;
79 //! Get coordinates of node for corresponding object ID
82 GetNodeCoord(vtkIdType theObjID);
84 //! Get cell object ID for corresponding VTK ID
87 GetElemObjID(vtkIdType theID) const;
89 //! Get cell VTK ID for corresponding object ID
92 GetElemVTKID(vtkIdType theID) const;
94 //! Get VTK representation of mesh cell for corresponding object ID
97 GetElemCell(vtkIdType theObjID);
99 //! Get VTK representation of mesh for corresponding MED entity
104 typedef SharedPtr<TIDMapper> PIDMapper;
107 //---------------------------------------------------------------
108 //! Defines an abstract interface for VTK to object ID's and backward mapping
110 This class defines some additional methods that allow get names for corresponding mesh elements
112 struct TNamedIDMapper: virtual TIDMapper
114 //! Get name of mesh node for corresponding object ID
117 GetNodeName(vtkIdType theObjID) const = 0;
119 //! Get name of mesh cell for corresponding object ID
122 GetElemName(vtkIdType theObjID) const = 0;
124 typedef SharedPtr<TNamedIDMapper> PNamedIDMapper;
127 //---------------------------------------------------------------
128 typedef vtkIdType TCellID;
129 typedef vtkIdType TLocalPntID;
130 //! Defines a type that represent complex ID for defined Gauss Point
131 typedef std::pair<TCellID,TLocalPntID> TGaussPointID;
133 struct TGaussPtsIDMapper: virtual TIDMapper
135 //! Gets complex Gauss Point ID by its VTK ID
138 GetObjID(vtkIdType theID) const = 0;
140 //! Gets parent TNamedIDMapper, which contains reference mesh cells
145 typedef SharedPtr<TGaussPtsIDMapper> PGaussPtsIDMapper;
147 //---------------------------------------------------------------