3D Human Airway Tree
Program generuje ludzkie drzewo oskrzelowe
vtkBooleanOperationPolyDataFilter.h
Idź do dokumentacji tego pliku.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBooleanOperationPolyDataFilter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 // .NAME vtkBooleanOperationPolyDataFilter
16 // .SECTION Description
17 //
18 // Computes the boundary of the union, intersection, or difference
19 // volume computed from the volumes defined by two input surfaces. The
20 // two surfaces do not need to be manifold, but if they are not,
21 // unexpected results may be obtained. The resulting surface is
22 // available in the first output of the filter. The second output
23 // contains a set of polylines that represent the intersection between
24 // the two input surfaces.
25 //
26 // Written by Chris Weigle and Cory Quammen, The University of North
27 // Carolina at Chapel Hill.
28 
29 #ifndef __vtkBooleanOperationPolyDataFilter_h
30 #define __vtkBooleanOperationPolyDataFilter_h
31 
32 #include "vtkPolyDataAlgorithm.h"
33 
34 #include "vtkDataSetAttributes.h" // Needed for CopyCells() method
35 
36 class vtkIdList;
39 
40 
41 class vtkBooleanOperationPolyDataFilter : public vtkPolyDataAlgorithm
42 {
43 public:
44  // Description:
45  // Construct object that computes the boolean surface.
47 
49  vtkPolyDataAlgorithm);
50 
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54  {
55  UNION=0,
58  };
59 
60  // Description:
61  // Set the boolean operation to perform. Defaults to union.
63  vtkGetMacro( Operation, int );
65  { this->SetOperation( UNION ); }
67  { this->SetOperation( INTERSECTION ); }
69  { this->SetOperation( DIFFERENCE ); }
70 
71  // Description:
72  // Turn on/off cell reorientation of the intersection portion of the
73  // surface when the operation is set to DIFFERENCE. Defaults to on.
77 
78  // Description:
79  // Set/get the tolerance used to determine when a point's absolute
80  // distance is considered to be zero. Defaults to 1e-6.
81  vtkSetMacro(Tolerance, double);
82  vtkGetMacro(Tolerance, double);
83 
84 protected:
87 
88  // Description:
89  // Tolerance used to determine when a point's absolute
90  // distance is considered to be zero.
91  double Tolerance;
92 
93  // Description:
94  // Labels triangles in mesh as part of the intersection or union surface.
95  void SortPolyData(vtkPolyData* input, vtkIdList* intersectionList,
96  vtkIdList* unionList);
97 
98  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*);
99  int FillInputPortInformation(int, vtkInformation*);
100 
101  // Description:
102  // Which operation to perform. Can be UNION, INTERSECTION, or DIFFERENCE.
104 
105  // Description:
106  // Determines if cells from the intersection surface should be
107  // reversed in the difference surface.
109 
110 private:
112  void operator=(const vtkBooleanOperationPolyDataFilter&); // no implementation
113 
114  // Description:
115  // Copies cells with indices given by from one vtkPolyData to
116  // another. The point and cell field lists are used to determine
117  // which fields should be copied.
118  void CopyCells(vtkPolyData* in, vtkPolyData* out, int idx,
119  vtkDataSetAttributes::FieldList & pointFieldList,
120  vtkDataSetAttributes::FieldList & cellFieldList,
121  vtkIdList* cellIds, bool reverseCells);
122 
123  vtkIntersectionPolyDataFilter *PolyDataIntersection;
124 
125  vtkDistancePolyDataFilter *PolyDataDistance;
126 
127 };
128 
129 #endif