VTK
dox/Graphics/vtkBooleanOperationPolyDataFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkBooleanOperationPolyDataFilter.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00036 #ifndef __vtkBooleanOperationPolyDataFilter_h
00037 #define __vtkBooleanOperationPolyDataFilter_h
00038 
00039 #include "vtkPolyDataAlgorithm.h"
00040 
00041 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method
00042 
00043 class vtkIdList;
00044 
00045 class VTK_GRAPHICS_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
00046 {
00047 public:
00049   static vtkBooleanOperationPolyDataFilter *New();
00050 
00051   vtkTypeMacro(vtkBooleanOperationPolyDataFilter,
00052                vtkPolyDataAlgorithm);
00053 
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00056   enum OperationType
00057   {
00058     VTK_UNION=0,
00059     VTK_INTERSECTION,
00060     VTK_DIFFERENCE
00061   };
00062 
00064 
00065   vtkSetClampMacro( Operation, int, VTK_UNION, VTK_DIFFERENCE );
00066   vtkGetMacro( Operation, int );
00067   void SetOperationToUnion()
00068   { this->SetOperation( VTK_UNION ); }
00069   void SetOperationToIntersection()
00070   { this->SetOperation( VTK_INTERSECTION ); }
00071   void SetOperationToDifference()
00072   { this->SetOperation( VTK_DIFFERENCE ); }
00074 
00076 
00078   vtkSetMacro( ReorientDifferenceCells, int );
00079   vtkGetMacro( ReorientDifferenceCells, int );
00080   vtkBooleanMacro( ReorientDifferenceCells, int );
00082 
00084 
00086   vtkSetMacro(Tolerance, double);
00087   vtkGetMacro(Tolerance, double);
00089 
00090 protected:
00091   vtkBooleanOperationPolyDataFilter();
00092   ~vtkBooleanOperationPolyDataFilter();
00093 
00095 
00097   void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList,
00098                     vtkIdList* unionList);
00100 
00101   int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
00102   int FillInputPortInformation(int, vtkInformation*);
00103 
00104 private:
00105   vtkBooleanOperationPolyDataFilter(const vtkBooleanOperationPolyDataFilter&); // Not implemented
00106   void operator=(const vtkBooleanOperationPolyDataFilter&); // Not implemented
00107 
00109 
00112   void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
00113                  vtkDataSetAttributes::FieldList & pointFieldList,
00114                  vtkDataSetAttributes::FieldList & cellFieldList,
00115                  vtkIdList* cellIds, bool reverseCells);
00117 
00120   double Tolerance;
00121 
00124   int Operation;
00125 
00127 
00129   int ReorientDifferenceCells;
00130 };
00132 
00133 #endif