Back to index

salome-gui  6.5.0
VTKViewer_GeometryFilter.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_GEOMETRYFILTER_H
00024 #define VTKVIEWER_GEOMETRYFILTER_H
00025 
00026 #include "VTKViewer.h"
00027 
00028 #include <vtkGeometryFilter.h>
00029 
00030 #include <map>
00031 #include <vector>
00032 
00033 #ifdef WIN32
00034 #pragma warning ( disable:4251 )
00035 #endif
00036 
00037 class vtkUnstructuredGrid;
00038 
00041 class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter 
00042 {
00043 public:
00046   static VTKViewer_GeometryFilter *New();
00047   
00051   vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
00056   void SetInside(int theShowInside);
00061   int GetInside();
00067   int GetAppendCoincident3D() const;
00073   void SetAppendCoincident3D(int theFlag);
00079   void SetWireframeMode(int theIsWireframeMode);
00084   int GetWireframeMode();
00089   void SetStoreMapping(int theStoreMapping);
00094   int GetStoreMapping();
00099   virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
00104   virtual vtkIdType GetElemObjId(int theVtkID);
00105 
00106   virtual void SetQuadraticArcMode(bool theFlag);
00107   virtual bool GetQuadraticArcMode() const;
00108 
00109   virtual void   SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
00110   virtual vtkFloatingPointType GetQuadraticArcAngle() const;
00111 
00112   typedef std::vector<vtkIdType> TVectorId;
00113   typedef std::map<vtkIdType, TVectorId> TMapOfVectorId;
00114 
00115   static void InsertId( const vtkIdType theCellId,
00116                         const vtkIdType theCellType,
00117                         TVectorId& theVTK2ObjIds,
00118                         TMapOfVectorId& theDimension2VTK2ObjIds );
00119 
00120 protected:
00124   VTKViewer_GeometryFilter();
00128   ~VTKViewer_GeometryFilter();
00129 
00130   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00131 
00132   //special cases for performance
00133   
00137   int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
00138 
00139 
00140   void BuildArcedPolygon(vtkIdType cellId,
00141                          vtkUnstructuredGrid* input,
00142                          vtkPolyData *output,
00143                          TMapOfVectorId& theDimension2VTK2ObjIds,
00144                          bool triangulate = false);
00145     
00146 private:
00147   TVectorId myVTK2ObjIds;
00148   int       myShowInside;
00149   int       myStoreMapping;
00150   int       myIsWireframeMode;
00151   int       myAppendCoincident3D;
00152 
00153   vtkFloatingPointType    myMaxArcAngle;   // define max angle for mesh 2D quadratic element in the degrees
00154   bool      myIsBuildArc;     // flag for representation 2D quadratic element as arked polygon
00155 };
00156 
00157 #ifdef WIN32
00158 #pragma warning ( default:4251 )
00159 #endif
00160 
00161 #endif