Version: 6.3.1

src/CONVERTOR/VISU_ConvertorUtils.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  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 //  VISU OBJECT : interactive object for VISU entities implementation
00024 //  File   : VISU_ConvertorUtils.hxx
00025 //  Author : Alexey PETROV
00026 //  Module : VISU
00027 //
00028 #ifndef VISU_ConvertorUtils_HeaderFile
00029 #define VISU_ConvertorUtils_HeaderFile
00030 
00031 #include "VISUConvertor.hxx"
00032 
00033 #include "VISU_ConvertorDef.hxx"
00034 #include "VISU_IDMapper.hxx"
00035 #include "MED_Utilities.hxx"
00036 
00037 #include "VTKViewer.h"
00038 #include <vtkSystemIncludes.h>
00039 
00040 #include <string>
00041 
00042 class vtkInformationVector;
00043 class vtkUnstructuredGrid;
00044 class vtkPolyData;
00045 class vtkTimerLog;
00046 class vtkDataSet;
00047 class vtkCell;
00048 
00049 #ifndef VISU_ENABLE_QUADRATIC
00050   #define VISU_ENABLE_QUADRATIC
00051   #define VISU_USE_VTK_QUADRATIC
00052 #endif
00053 
00054 namespace MED
00055 {
00056   class PrefixPrinter;
00057 }
00058 
00059 namespace VISU
00060 {
00061   //---------------------------------------------------------------
00063   vtkIdType VISU_CONVERTOR_EXPORT
00064   VISUGeom2NbNodes(EGeometry theGeom);
00065 
00066 
00067   //---------------------------------------------------------------
00069   vtkIdType
00070   VISUGeom2VTK(EGeometry theGeom);
00071 
00072 
00073   //---------------------------------------------------------------
00075   VISU_CONVERTOR_EXPORT
00076   void 
00077   WriteToFile(vtkUnstructuredGrid* theDataSet, 
00078               const std::string& theFileName);
00079 
00080 
00081   //---------------------------------------------------------------
00083   VISU_CONVERTOR_EXPORT
00084   void 
00085   WriteToFile(vtkPolyData* theDataSet, 
00086               const std::string& theFileName);
00087 
00088 
00089   //---------------------------------------------------------------
00090   VISU_CONVERTOR_EXPORT
00091   bool 
00092   IsDataOnCells(vtkDataSet* theDataSet);
00093 
00094   //---------------------------------------------------------------
00095   VISU_CONVERTOR_EXPORT
00096   bool 
00097   IsElnoData(vtkDataSet* theDataSet);
00098 
00099 
00100   //---------------------------------------------------------------
00101   VISU_CONVERTOR_EXPORT
00102   bool 
00103   IsDataOnPoints(vtkDataSet* theDataSet);
00104 
00105 
00106   //---------------------------------------------------------------
00107   VISU_CONVERTOR_EXPORT
00108   vtkIdType
00109   GetElemVTKID(vtkDataSet *theDataSet, vtkIdType theID, int theEntity = -1);
00110 
00111 
00112   //---------------------------------------------------------------
00113   VISU_CONVERTOR_EXPORT
00114   vtkIdType
00115   GetElemObjID(vtkDataSet *theDataSet, vtkIdType theID);
00116 
00117 
00118   //---------------------------------------------------------------
00119   VISU_CONVERTOR_EXPORT
00120   vtkCell* 
00121   GetElemCell(vtkDataSet *theDataSet, vtkIdType theObjID);
00122 
00123 
00124   //---------------------------------------------------------------
00125   VISU_CONVERTOR_EXPORT
00126   vtkIdType
00127   GetNodeVTKID(vtkDataSet *theDataSet, vtkIdType theID);
00128 
00129 
00130   //---------------------------------------------------------------
00131   VISU_CONVERTOR_EXPORT
00132   vtkIdType
00133   GetNodeObjID(vtkDataSet *theDataSet, vtkIdType theID);
00134 
00135 
00136   //---------------------------------------------------------------
00137   VISU_CONVERTOR_EXPORT
00138   vtkFloatingPointType* 
00139   GetNodeCoord(vtkDataSet *theDataSet, vtkIdType theObjID);
00140 
00141   //---------------------------------------------------------------
00142   VISU_CONVERTOR_EXPORT
00143   TGaussPointID
00144   GetObjID(vtkDataSet *theDataSet, vtkIdType theID);
00145 
00146 
00147   //---------------------------------------------------------------
00148   typedef vtkIdType TInputID;
00149   typedef vtkIdType TCellID; 
00150   typedef std::pair<TInputID,TCellID> TInputCellID;
00151 
00152   VISU_CONVERTOR_EXPORT
00153   TInputCellID
00154   GetInputCellID(vtkDataSet *theDataSet, vtkIdType theObjID);
00155 
00156 
00157   VISU_CONVERTOR_EXPORT
00158   vtkDataSet*
00159   GetInput(vtkInformationVector **theInputVector, 
00160            vtkIdType theInputId = 0);
00161 
00162   VISU_CONVERTOR_EXPORT
00163   vtkDataSet*
00164   GetOutput(vtkInformationVector *theOutputVector);
00165 
00167   //---------------------------------------------------------------
00168   typedef vtkIdType TVTKPointID;
00169   typedef vtkIdType TVTKCellID;
00170   typedef std::pair<TVTKPointID,TVTKCellID> TElnoPointID;
00171   typedef std::vector<TElnoPointID> TElnoPoints;
00172 
00173   VISU_CONVERTOR_EXPORT 
00174   TElnoPoints
00175   GetElnoPoints(vtkDataSet *theDataSet, vtkIdType theNodeObjID);
00176 
00177   //---------------------------------------------------------------
00179   class VISU_CONVERTOR_EXPORT TTimerLog
00180   {
00181     int myIsDebug;
00182     double myCPUTime;
00183     std::string myName;
00184     vtkTimerLog* myTimerLog;
00185     MED::PrefixPrinter myPrefixPrinter;
00186   public:
00187 
00188     TTimerLog(int theIsDebug,
00189               const std::string& theName);
00190     ~TTimerLog();
00191   };
00192   
00193 
00194   //---------------------------------------------------------------
00195 }
00196 
00197 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS