src/CONVERTOR/VISU_MergeFilter.hxx

Go to the documentation of this file.
00001 //  SALOME VTKViewer : build VTK viewer into Salome desktop
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 //
00024 //  File   : 
00025 //  Author : 
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/VISU/VISU_SRC/src/CONVERTOR/VISU_MergeFilter.hxx,v 1.3.2.3 2007/04/20 12:59:02 enk Exp $
00028 
00029 #ifndef VISU_MergeFilter_H
00030 #define VISU_MergeFilter_H
00031 
00032 #include <vtkUnstructuredGridToUnstructuredGridFilter.h>
00033 
00034 class vtkDataSet;
00035 
00036 namespace VISU
00037 {
00038   class TFieldList;
00039 }
00040 
00041 // Following class was redefined in order to fix VTK bug 
00042 //  (see code for more details)
00043 
00044 class VISU_MergeFilter : public vtkUnstructuredGridToUnstructuredGridFilter
00045 {
00046 public:
00047   static VISU_MergeFilter *New();
00048   vtkTypeMacro(VISU_MergeFilter,vtkUnstructuredGridToUnstructuredGridFilter);
00049 
00050   // Description:
00051   // Specify object from which to extract geometry information.
00052   void SetGeometry(vtkUnstructuredGrid *input) {this->SetInput(input);};
00053   vtkUnstructuredGrid *GetGeometry() {return this->GetInput();};
00054 
00055   // Description:
00056   // Specify object from which to extract scalar information.
00057   void SetScalars(vtkDataSet *);
00058   vtkDataSet *GetScalars();
00059 
00060   // Description:
00061   // Set / get the object from which to extract vector information.
00062   void SetVectors(vtkDataSet *);
00063   vtkDataSet *GetVectors();
00064 
00065   // Description:
00066   // Set / get the object from which to extract normal information.
00067   void SetNormals(vtkDataSet *);
00068   vtkDataSet *GetNormals();
00069   
00070   // Description:
00071   // Set / get the object from which to extract texture coordinates
00072   // information.
00073   void SetTCoords(vtkDataSet *);
00074   vtkDataSet *GetTCoords();
00075 
00076   // Description:
00077   // Set / get the object from which to extract tensor data.
00078   void SetTensors(vtkDataSet *);
00079   vtkDataSet *GetTensors();
00080 
00081   // Description:
00082   // Set the object from which to extract a field and the name
00083   // of the field
00084   void AddField(const char* name, vtkDataSet* input);
00085 
00086   // Description:
00087   // Removes all previously added fields
00088   void RemoveFields();
00089 
00090   // Description:
00091   // Defines whether to perform merging of data with the geometry according to
00092   // the ids of the cell or not
00093   void
00094   SetMergingInputs(bool theIsMergingInputs);
00095   
00096   bool
00097   IsMergingInputs();
00098   
00099 protected:
00100   VISU_MergeFilter();
00101   ~VISU_MergeFilter();
00102 
00103   // Usual data generation method
00104   void BasicExecute(vtkDataSet *output);
00105   void Execute();
00106 
00107   VISU::TFieldList* FieldList;
00108   bool myIsMergingInputs;
00109 
00110 private:
00111   bool MergeGeometryCellsAndDataOnCells();
00112   bool MergeGeometryCellsAndDataOnAllPoints();
00113   bool MergeGeometryCellsAndDataOnNotAllPoints();
00114   
00115   VISU_MergeFilter(const VISU_MergeFilter&);  // Not implemented.
00116   void operator=(const VISU_MergeFilter&);  // Not implemented.
00117 };
00118 
00119 #endif
00120 
00121