Salome HOME
Fix for Bug IPAL8945
[modules/visu.git] / src / CONVERTOR / VISU_IDMapper.cxx
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //  File:
24 //  Author:
25 //  Module : VISU
26
27 #include "VISU_IDMapper.hxx"
28
29 #include <vtkUnstructuredGrid.h>
30
31 namespace VISU
32 {
33   //---------------------------------------------------------------
34   float*  
35   TIDMapper
36   ::GetNodeCoord(vtkIdType theObjID)
37   {
38     vtkIdType aVTKID = GetNodeVTKID(theObjID);
39     return GetVTKOutput()->GetPoint(aVTKID);
40   }
41
42   vtkIdType
43   TIDMapper
44   ::GetNodeVTKID(vtkIdType theID) const
45   {
46     return theID;
47   }
48
49   vtkIdType
50   TIDMapper
51   ::GetNodeObjID(vtkIdType theID) const
52   {
53     return theID;
54   }
55
56   vtkCell* 
57   TIDMapper
58   ::GetElemCell(int theObjID)
59   {
60     vtkIdType aVtkID = GetElemVTKID(theObjID);
61     return GetVTKOutput()->GetCell(aVtkID);
62   }
63
64   vtkIdType
65   TIDMapper
66   ::GetElemVTKID(vtkIdType theID) const
67   {
68     return theID;
69   }
70
71   vtkIdType
72   TIDMapper
73   ::GetElemObjID(vtkIdType theID) const
74   {
75     return theID;
76   }  
77 }