Back to index

salome-gui  6.5.0
VTKViewer_AppendFilter.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_APPENDFILTER_H
00024 #define VTKVIEWER_APPENDFILTER_H
00025 
00026 #include "VTKViewer.h"
00027 
00028 #include <vtkAppendFilter.h>
00029 #include <vtkSmartPointer.h>
00030 
00031 #include <vector>
00032 #include <map>
00033 
00034 class vtkPointSet;
00035 
00036 #ifdef WIN32
00037 #pragma warning ( disable:4251 )
00038 #endif
00039 
00042 class VTKVIEWER_EXPORT VTKViewer_AppendFilter : public vtkAppendFilter 
00043 {
00044 public:
00047   static VTKViewer_AppendFilter *New();
00048   
00052   vtkTypeRevisionMacro(VTKViewer_AppendFilter, vtkAppendFilter);
00053 
00054   void SetDoMappingFlag(const bool theFlag);
00055 
00056   bool DoMappingFlag() const;
00057 
00058   void
00059   SetSharedPointsDataSet(vtkPointSet* thePointsDataSet);
00060 
00061   vtkPointSet*
00062   GetSharedPointsDataSet();
00063 
00064   vtkIdType
00065   GetPointOutputID(vtkIdType theInputID,
00066                    vtkIdType theInputDataSetID);
00067 
00068   vtkIdType
00069   GetCellOutputID(vtkIdType theInputID,
00070                   vtkIdType theInputDataSetID);
00071 
00072   void 
00073   GetPointInputID(vtkIdType theOutputID,
00074                  vtkIdType& theInputID,
00075                  vtkIdType& theStartID,
00076                  vtkIdType& theInputDataSetID);
00077 
00078   void
00079   GetCellInputID(vtkIdType theOutputID,
00080                  vtkIdType& theInputID,
00081                  vtkIdType& theStartID,
00082                  vtkIdType& theInputDataSetID);
00083 
00084   typedef std::vector<vtkIdType> TVectorIds;
00085 
00086 protected:
00090   VTKViewer_AppendFilter();
00094   ~VTKViewer_AppendFilter();
00095 
00096   // Usual data generation method
00097   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00098 
00099   virtual int FillInputPortInformation(int port, vtkInformation *info);
00100   
00101   void DoMapping();
00102 
00103   void Reset();
00104 
00105   int MakeOutput(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00106 
00107   bool myDoMappingFlag;
00108   TVectorIds myNodeRanges;
00109   TVectorIds myCellRanges;
00110   vtkSmartPointer<vtkPointSet> mySharedPointsDataSet;
00111 };
00112 
00113 #ifdef WIN32
00114 #pragma warning ( default:4251 )
00115 #endif
00116 
00117 #endif