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
23 // File : VISU_ConvertorUtils.hxx
24 // Author : Alexey PETROV
27 #ifndef VISU_ConvertorUtils_HeaderFile
28 #define VISU_ConvertorUtils_HeaderFile
30 #include "VISUConvertor.hxx"
32 #include "VISU_ConvertorDef.hxx"
33 #include "VISU_IDMapper.hxx"
34 #include "MED_Utilities.hxx"
36 #include "VTKViewer.h"
37 #include <vtkSystemIncludes.h>
41 class vtkInformationVector;
42 class vtkUnstructuredGrid;
48 #ifndef VISU_ENABLE_QUADRATIC
49 #define VISU_ENABLE_QUADRATIC
50 #define VISU_USE_VTK_QUADRATIC
60 //---------------------------------------------------------------
61 //! Get number of nodes for defined geometrical type
62 vtkIdType VISU_CONVERTOR_EXPORT
63 VISUGeom2NbNodes(EGeometry theGeom);
66 //---------------------------------------------------------------
67 //! Maps VISU geometrical type to VTK one
69 VISUGeom2VTK(EGeometry theGeom);
72 //---------------------------------------------------------------
73 //! The utility function allows to write vtkUnstructuredGrid to a file with defined name
76 WriteToFile(vtkUnstructuredGrid* theDataSet,
77 const std::string& theFileName);
80 //---------------------------------------------------------------
81 //! The utility function allows to write vtkPolyData to a file with defined name
84 WriteToFile(vtkPolyData* theDataSet,
85 const std::string& theFileName);
88 //---------------------------------------------------------------
91 IsDataOnCells(vtkDataSet* theDataSet);
94 //---------------------------------------------------------------
97 IsDataOnPoints(vtkDataSet* theDataSet);
100 //---------------------------------------------------------------
101 VISU_CONVERTOR_EXPORT
103 GetElemVTKID(vtkDataSet *theDataSet, vtkIdType theID, int theEntity = -1);
106 //---------------------------------------------------------------
107 VISU_CONVERTOR_EXPORT
109 GetElemObjID(vtkDataSet *theDataSet, vtkIdType theID);
112 //---------------------------------------------------------------
113 VISU_CONVERTOR_EXPORT
115 GetElemCell(vtkDataSet *theDataSet, vtkIdType theObjID);
118 //---------------------------------------------------------------
119 VISU_CONVERTOR_EXPORT
121 GetNodeVTKID(vtkDataSet *theDataSet, vtkIdType theID);
124 //---------------------------------------------------------------
125 VISU_CONVERTOR_EXPORT
127 GetNodeObjID(vtkDataSet *theDataSet, vtkIdType theID);
130 //---------------------------------------------------------------
131 VISU_CONVERTOR_EXPORT
132 vtkFloatingPointType*
133 GetNodeCoord(vtkDataSet *theDataSet, vtkIdType theObjID);
135 //---------------------------------------------------------------
136 VISU_CONVERTOR_EXPORT
138 GetObjID(vtkDataSet *theDataSet, vtkIdType theID);
141 //---------------------------------------------------------------
142 typedef vtkIdType TInputID;
143 typedef vtkIdType TCellID;
144 typedef std::pair<TInputID,TCellID> TInputCellID;
146 VISU_CONVERTOR_EXPORT
148 GetInputCellID(vtkDataSet *theDataSet, vtkIdType theObjID);
151 VISU_CONVERTOR_EXPORT
153 GetInput(vtkInformationVector **theInputVector,
154 vtkIdType theInputId = 0);
156 VISU_CONVERTOR_EXPORT
158 GetOutput(vtkInformationVector *theOutputVector);
160 //---------------------------------------------------------------
161 //! The utility class that allows to perform perfomance mesurement
162 class VISU_CONVERTOR_EXPORT TTimerLog
167 vtkTimerLog* myTimerLog;
168 MED::PrefixPrinter myPrefixPrinter;
171 TTimerLog(int theIsDebug,
172 const std::string& theName);
177 //---------------------------------------------------------------