Back to index

salome-gui  6.5.0
VTKViewer_ConvexTool.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  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 #ifndef _VTKViewer_ConvexTool_H
00024 #define _VTKViewer_ConvexTool_H
00025 
00026 #include "VTKViewer.h"
00027 
00028 #include <map>
00029 #include <vector>
00030 
00031 #include <vtkSystemIncludes.h>
00032 
00033 class vtkUnstructuredGrid;
00034 class vtkGeometryFilter;
00035 class vtkGenericCell;
00036 class vtkDelaunay3D;
00037 class vtkPolyData;
00038 class vtkCellData;
00039 class vtkPoints;
00040 class vtkIdList;
00041 class vtkCell;
00042 class vtkCellArray;
00043 class vtkTriangle;
00044 class vtkOrderedTriangulator;
00045 
00046 
00047 //----------------------------------------------------------------------------
00048 class VTKVIEWER_EXPORT VTKViewer_Triangulator
00049 {
00050  public:
00051   VTKViewer_Triangulator();
00052 
00053   ~VTKViewer_Triangulator();
00054 
00055   bool 
00056   Execute(vtkUnstructuredGrid *theInput,
00057           vtkCellData* thInputCD,
00058           vtkIdType theCellId,
00059           int theShowInside,
00060           int theAllVisible,
00061           int theAppendCoincident3D,
00062           const char* theCellsVisibility,
00063           vtkPolyData *theOutput,
00064           vtkCellData* theOutputCD,
00065           int theStoreMapping,
00066           std::vector<vtkIdType>& theVTK2ObjIds,
00067           std::map< vtkIdType, std::vector<vtkIdType> >& theDimension2VTK2ObjIds,
00068           bool theIsCheckConvex);
00069 
00070  private:
00071   vtkIdList* myCellIds;
00072 
00073  protected:
00074   vtkIdType *myPointIds;
00075   vtkIdList* myFaceIds;
00076   vtkPoints* myPoints;
00077 
00078   virtual
00079   vtkPoints* 
00080   InitPoints(vtkUnstructuredGrid *theInput,
00081              vtkIdType theCellId);
00082 
00083   virtual
00084   vtkIdType 
00085   GetNumFaces() = 0;
00086 
00087   virtual
00088   vtkCell* 
00089   GetFace(vtkIdType theFaceId) = 0;
00090 
00091   vtkIdType 
00092   GetNbOfPoints();
00093 
00094   vtkIdType 
00095   GetPointId(vtkIdType thePointId);
00096 
00097   vtkFloatingPointType 
00098   GetCellLength();
00099 
00100   void 
00101   GetCellNeighbors(vtkUnstructuredGrid *theInput,
00102                    vtkIdType theCellId,
00103                    vtkCell* theFace,
00104                    vtkIdList* theCellIds);
00105 
00106   vtkIdType 
00107   GetConnectivity(vtkIdType thePntId);
00108 };
00109 
00110 
00111 //----------------------------------------------------------------------------
00112 class VTKVIEWER_EXPORT VTKViewer_OrderedTriangulator : public VTKViewer_Triangulator
00113 {
00114  public:
00115 
00116   VTKViewer_OrderedTriangulator();
00117 
00118   ~VTKViewer_OrderedTriangulator();
00119 
00120  protected:
00121   vtkOrderedTriangulator *myTriangulator;
00122   vtkCellArray *myBoundaryTris;
00123   vtkTriangle  *myTriangle;
00124 
00125   virtual
00126   vtkPoints* 
00127   InitPoints(vtkUnstructuredGrid *theInput,
00128              vtkIdType theCellId);
00129 
00130   virtual
00131   vtkIdType 
00132   GetNumFaces();
00133 
00134   virtual
00135   vtkCell* 
00136   GetFace(vtkIdType theFaceId);
00137 };
00138 
00139 
00140 //----------------------------------------------------------------------------
00141 class VTKVIEWER_EXPORT VTKViewer_DelaunayTriangulator : public VTKViewer_Triangulator
00142 {
00143  public:
00144 
00145   VTKViewer_DelaunayTriangulator();
00146 
00147   ~VTKViewer_DelaunayTriangulator();
00148 
00149  protected:
00150   vtkUnstructuredGrid* myUnstructuredGrid;
00151   vtkGeometryFilter* myGeometryFilter;
00152   vtkDelaunay3D* myDelaunay3D;
00153   vtkPolyData* myPolyData;
00154 
00155   virtual
00156   vtkPoints* 
00157   InitPoints(vtkUnstructuredGrid *theInput,
00158              vtkIdType theCellId);
00159 
00160   virtual
00161   vtkIdType 
00162   GetNumFaces();
00163 
00164   virtual
00165   vtkCell* 
00166   GetFace(vtkIdType theFaceId);
00167 };
00168 
00169 
00170 #endif // _VTKViewer_ConvexTool_H