1 // VISU OBJECT : interactive object for VISU entities implementation
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
27 #include "VISU_IDMapper.hxx"
29 #include <vtkUnstructuredGrid.h>
30 #include <vtkPolyData.h>
31 #include <vtkDataSet.h>
35 //---------------------------------------------------------------
36 //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing
39 ::IsStructured() const
41 return myIsStructured;
48 return myGrilleStructure;
53 ::GetIndexesOfNode(vtkIdType theNodeId)
55 TIdTypeVector aNullVec;
58 TObj2IdTypeVector::const_iterator aIter = myObjID2StructureID.find(theNodeId);
59 if(aIter!=myObjID2StructureID.end())
67 ::GetObjectIDByIndexes(TIdTypeVector theVec)
69 TObj2IdTypeVector::const_iterator aIter = myObjID2StructureID.begin();
70 for(;aIter!=myObjID2StructureID.end();aIter++){
71 if(theVec == aIter->second)
78 //---------------------------------------------------------------
81 ::GetNodeCoord(vtkIdType theObjID)
83 vtkIdType aVTKID = GetNodeVTKID(theObjID);
84 return GetOutput()->GetPoint(aVTKID);
89 ::GetNodeVTKID(vtkIdType theID) const
96 ::GetNodeObjID(vtkIdType theID) const
103 ::GetElemCell(int theObjID)
105 vtkIdType aVtkID = GetElemVTKID(theObjID);
106 return GetOutput()->GetCell(aVtkID);
111 ::GetElemVTKID(vtkIdType theID) const
118 ::GetElemObjID(vtkIdType theID) const
122 //---------------------------------------------------------------
126 TUnstructuredGridIDMapper
129 return GetUnstructuredGridOutput();
131 //---------------------------------------------------------------
138 return GetPolyDataOutput();
142 //---------------------------------------------------------------