VTK
|
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 "vtkFiltersGeneralModule.h" // For export macro 00040 #include "vtkPolyDataAlgorithm.h" 00041 00042 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method 00043 00044 class vtkIdList; 00045 00046 class VTKFILTERSGENERAL_EXPORT vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm 00047 { 00048 public: 00050 static vtkBooleanOperationPolyDataFilter *New(); 00051 00052 vtkTypeMacro(vtkBooleanOperationPolyDataFilter, 00053 vtkPolyDataAlgorithm); 00054 00055 void PrintSelf(ostream& os, vtkIndent indent); 00056 00057 enum OperationType 00058 { 00059 VTK_UNION=0, 00060 VTK_INTERSECTION, 00061 VTK_DIFFERENCE 00062 }; 00063 00065 00066 vtkSetClampMacro( Operation, int, VTK_UNION, VTK_DIFFERENCE ); 00067 vtkGetMacro( Operation, int ); 00068 void SetOperationToUnion() 00069 { this->SetOperation( VTK_UNION ); } 00070 void SetOperationToIntersection() 00071 { this->SetOperation( VTK_INTERSECTION ); } 00072 void SetOperationToDifference() 00073 { this->SetOperation( VTK_DIFFERENCE ); } 00075 00077 00079 vtkSetMacro( ReorientDifferenceCells, int ); 00080 vtkGetMacro( ReorientDifferenceCells, int ); 00081 vtkBooleanMacro( ReorientDifferenceCells, int ); 00083 00085 00087 vtkSetMacro(Tolerance, double); 00088 vtkGetMacro(Tolerance, double); 00090 00091 protected: 00092 vtkBooleanOperationPolyDataFilter(); 00093 ~vtkBooleanOperationPolyDataFilter(); 00094 00096 00098 void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList, 00099 vtkIdList* unionList); 00101 00102 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*); 00103 int FillInputPortInformation(int, vtkInformation*); 00104 00105 private: 00106 vtkBooleanOperationPolyDataFilter(const vtkBooleanOperationPolyDataFilter&); // Not implemented 00107 void operator=(const vtkBooleanOperationPolyDataFilter&); // Not implemented 00108 00110 00113 void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx, 00114 vtkDataSetAttributes::FieldList & pointFieldList, 00115 vtkDataSetAttributes::FieldList & cellFieldList, 00116 vtkIdList* cellIds, bool reverseCells); 00118 00121 double Tolerance; 00122 00125 int Operation; 00126 00128 00130 int ReorientDifferenceCells; 00131 }; 00133 00134 #endif