VTK  9.2.6
vtkPlaneCutter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlaneCutter.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 =========================================================================*/
77 #ifndef vtkPlaneCutter_h
78 #define vtkPlaneCutter_h
79 
80 #include "vtkDataObjectAlgorithm.h"
81 #include "vtkFiltersCoreModule.h" // For export macro
82 #include "vtkSmartPointer.h" // For SmartPointer
83 #include <map> // For std::map
84 
85 class vtkCellArray;
86 class vtkCellData;
87 class vtkImageData;
92 class vtkPlane;
93 class vtkPointData;
94 class vtkPoints;
95 class vtkPolyData;
96 class vtkSphereTree;
97 class vtkStructuredGrid;
98 class vtkUniformGridAMR;
100 
101 class VTKFILTERSCORE_EXPORT vtkPlaneCutter : public vtkDataObjectAlgorithm
102 {
103 public:
105 
108  static vtkPlaneCutter* New();
110  void PrintSelf(ostream& os, vtkIndent indent) override;
112 
116  vtkMTimeType GetMTime() override;
117 
119 
124  virtual void SetPlane(vtkPlane*);
125  vtkGetObjectMacro(Plane, vtkPlane);
127 
129 
135  vtkSetMacro(ComputeNormals, bool);
136  vtkGetMacro(ComputeNormals, bool);
137  vtkBooleanMacro(ComputeNormals, bool);
139 
141 
146  vtkSetMacro(InterpolateAttributes, bool);
147  vtkGetMacro(InterpolateAttributes, bool);
148  vtkBooleanMacro(InterpolateAttributes, bool);
150 
152 
157  vtkSetMacro(GeneratePolygons, bool);
158  vtkGetMacro(GeneratePolygons, bool);
159  vtkBooleanMacro(GeneratePolygons, bool);
161 
163 
169  vtkSetMacro(BuildTree, bool);
170  vtkGetMacro(BuildTree, bool);
171  vtkBooleanMacro(BuildTree, bool);
173 
175 
181  vtkSetMacro(BuildHierarchy, bool);
182  vtkGetMacro(BuildHierarchy, bool);
183  vtkBooleanMacro(BuildHierarchy, bool);
185 
186 protected:
188  ~vtkPlaneCutter() override;
189 
194  bool BuildTree;
196 
197  // Helpers
198  // Support delegation to vtkPolyDataPlaneCutter. Checking convexity can be
199  // time consuming.
202 
204  std::map<vtkDataSet*, vtkSmartPointer<vtkSphereTree>> SphereTrees;
206  {
209 
211  : Input(nullptr)
212  , LastMTime(0)
213  {
214  }
216  : Input(input)
217  , LastMTime(mtime)
218  {
219  }
220  };
222 
223  // Pipeline-related methods
229 
235  vtkPartitionedDataSet* input, vtkPartitionedDataSet* output, bool copyStructure);
236  int ExecuteDataSet(vtkDataSet* input, vtkSphereTree* tree, vtkPolyData* output);
237 
238  static void AddNormalArray(double* planeNormal, vtkPolyData* polyData);
239 
240 private:
241  vtkPlaneCutter(const vtkPlaneCutter&) = delete;
242  void operator=(const vtkPlaneCutter&) = delete;
243 };
244 
245 #endif
object to represent cell connectivity
Definition: vtkCellArray.h:296
represent and manipulate cell attribute data
Definition: vtkCellData.h:151
Superclass for algorithms that produce only data object as output.
general representation of visualization data
abstract class to specify dataset behavior
Definition: vtkDataSet.h:172
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
a simple class to control print indentation
Definition: vtkIndent.h:119
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
composite dataset to encapsulates pieces of dataset.
Composite dataset that groups datasets as a collection.
composite dataset to encapsulates a dataset consisting of partitions.
cut any dataset with a plane and generate a polygonal cut surface
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
static void AddNormalArray(double *planeNormal, vtkPolyData *polyData)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
static vtkPlaneCutter * New()
Standard construction and print methods.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard construction and print methods.
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkInputInfo InputInfo
bool InterpolateAttributes
int ExecuteUniformGridAMR(vtkUniformGridAMR *input, vtkPartitionedDataSetCollection *output)
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
int ExecuteDataSet(vtkDataSet *input, vtkSphereTree *tree, vtkPolyData *output)
std::map< vtkDataSet *, vtkSmartPointer< vtkSphereTree > > SphereTrees
int ExecutePartitionedDataCollection(vtkPartitionedDataSetCollection *input, vtkPartitionedDataSetCollection *output)
~vtkPlaneCutter() override
virtual void SetPlane(vtkPlane *)
Specify the plane (an implicit function) to perform the cutting.
vtkSphereTree * GetSphereTree(vtkDataSet *)
int ExecuteMultiBlockDataSet(vtkMultiBlockDataSet *input, vtkMultiBlockDataSet *output)
vtkMTimeType GetMTime() override
The modified time depends on the delegated cut plane.
vtkPlane * Plane
int ExecutePartitionedData(vtkPartitionedDataSet *input, vtkPartitionedDataSet *output, bool copyStructure)
perform various plane computations
Definition: vtkPlane.h:146
represent and manipulate point attribute data
Definition: vtkPointData.h:151
represent and manipulate 3D points
Definition: vtkPoints.h:149
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
class to build and traverse sphere trees
Definition: vtkSphereTree.h:73
topologically regular array of data
a concrete implementation of vtkCompositeDataSet
dataset represents arbitrary combinations of all possible cell types
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
vtkInputInfo(vtkDataObject *input, vtkMTimeType mtime)
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287