Version: 6.3.1

src/VTKViewer/VTKViewer_GeometryFilter.h

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 #ifndef VTKVIEWER_GEOMETRYFILTER_H
00024 #define VTKVIEWER_GEOMETRYFILTER_H
00025 
00026 #include "VTKViewer.h"
00027 
00028 #include <vtkGeometryFilter.h>
00029 
00030 #include <vector>
00031 
00032 #ifdef WIN32
00033 #pragma warning ( disable:4251 )
00034 #endif
00035 
00036 class vtkUnstructuredGrid;
00037 
00040 class VTKVIEWER_EXPORT VTKViewer_GeometryFilter : public vtkGeometryFilter 
00041 {
00042 public:
00045   static VTKViewer_GeometryFilter *New();
00046   
00050   vtkTypeRevisionMacro(VTKViewer_GeometryFilter, vtkGeometryFilter);
00055   void SetInside(int theShowInside);
00060   int GetInside();
00065   void SetWireframeMode(int theIsWireframeMode);
00070   int GetWireframeMode();
00075   void SetStoreMapping(int theStoreMapping);
00080   int GetStoreMapping();
00085   virtual vtkIdType GetNodeObjId(int theVtkID) { return theVtkID;}
00090   virtual vtkIdType GetElemObjId(int theVtkID);
00091 
00092   virtual void SetQuadraticArcMode(bool theFlag);
00093   virtual bool GetQuadraticArcMode() const;
00094 
00095   virtual void   SetQuadraticArcAngle(vtkFloatingPointType theMaxAngle);
00096   virtual vtkFloatingPointType GetQuadraticArcAngle() const;
00097 
00098 
00099 protected:
00103   VTKViewer_GeometryFilter();
00107   ~VTKViewer_GeometryFilter();
00108 
00109   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00110 
00111   //special cases for performance
00112   
00116   int UnstructuredGridExecute (vtkDataSet *, vtkPolyData *, vtkInformation *);
00117 
00118 
00119   void BuildArcedPolygon(vtkIdType cellId, vtkUnstructuredGrid* input, vtkPolyData *output, bool triangulate = false);
00120     
00121 private:
00122   typedef std::vector<vtkIdType> TVectorId;
00123 
00124 private:
00125   TVectorId myVTK2ObjIds;
00126   int       myShowInside;
00127   int       myStoreMapping;
00128   int       myIsWireframeMode;
00129 
00130   vtkFloatingPointType    myMaxArcAngle;   // define max angle for mesh 2D quadratic element in the degrees
00131   bool      myIsBuildArc;     // flag for representation 2D quadratic element as arked polygon
00132 };
00133 
00134 #ifdef WIN32
00135 #pragma warning ( default:4251 )
00136 #endif
00137 
00138 #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