src/CONVERTOR/VISU_IDMapper.hxx

Go to the documentation of this file.
00001 //  VISU CONVERTOR :
00002 //
00003 //  Copyright (C) 2003  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 //  File   : VISU_Convertor.hxx
00024 //  Author : Alexey PETROV
00025 //  Module : VISU
00026 
00027 #ifndef VISU_IDMapper_HeaderFile
00028 #define VISU_IDMapper_HeaderFile
00029 
00035 #include "MED_SharedPtr.hxx"
00036 #include "VTKViewer.h"
00037 
00038 #include <string>
00039 
00040 class vtkUnstructuredGrid;
00041 class vtkCell;
00042 
00043 namespace VISU
00044 {
00045   using MED::SharedPtr;
00046 
00047   //---------------------------------------------------------------
00049   struct TBaseStructure
00050   {
00052     virtual ~TBaseStructure()
00053     {}
00054 
00055     std::string myEntry; 
00056   };
00057   typedef SharedPtr<TBaseStructure> PBaseStructure;
00058 
00059   //---------------------------------------------------------------
00060   typedef vtkUnstructuredGrid TVTKOutput;
00061 
00063 
00067   struct TIDMapper: virtual TBaseStructure
00068   {
00070     virtual 
00071     vtkIdType 
00072     GetNodeObjID(vtkIdType theID) const;
00073 
00075     virtual 
00076     vtkIdType 
00077     GetNodeVTKID(vtkIdType theID) const;
00078 
00080     virtual
00081     vtkFloatingPointType* 
00082     GetNodeCoord(vtkIdType theObjID);
00083 
00085     virtual 
00086     vtkIdType 
00087     GetElemObjID(vtkIdType theID) const;
00088 
00090     virtual 
00091     vtkIdType 
00092     GetElemVTKID(vtkIdType theID) const;
00093 
00095     virtual
00096     vtkCell* 
00097     GetElemCell(vtkIdType theObjID);
00098 
00100     virtual
00101     TVTKOutput*
00102     GetVTKOutput() = 0;
00103   };
00104   typedef SharedPtr<TIDMapper> PIDMapper;
00105   
00106 
00107   //---------------------------------------------------------------
00109 
00112   struct TNamedIDMapper: virtual TIDMapper
00113   {
00115     virtual
00116     std::string 
00117     GetNodeName(vtkIdType theObjID) const = 0;
00118 
00120     virtual
00121     std::string 
00122     GetElemName(vtkIdType theObjID) const = 0;
00123   };
00124   typedef SharedPtr<TNamedIDMapper> PNamedIDMapper;
00125   
00126 
00127   //---------------------------------------------------------------
00128   typedef vtkIdType TCellID; 
00129   typedef vtkIdType TLocalPntID;
00131   typedef std::pair<TCellID,TLocalPntID> TGaussPointID;
00132 
00133   struct TGaussPtsIDMapper: virtual TIDMapper
00134   {
00136     virtual 
00137     TGaussPointID 
00138     GetObjID(vtkIdType theID) const = 0;
00139 
00141     virtual 
00142     TNamedIDMapper*
00143     GetParent() = 0;
00144   };
00145   typedef SharedPtr<TGaussPtsIDMapper> PGaussPtsIDMapper;
00146 
00147   //---------------------------------------------------------------
00148 }
00149 
00150 #endif