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:
187  vtkPlaneCutter();
188  ~vtkPlaneCutter() override;
189 
194  bool BuildTree;
196 
197  // Helpers
198  // Support delegation to vtkPolyDataPlaneCutter. Checking convexity can be
199  // time consuming.
202 
203  vtkSphereTree* GetSphereTree(vtkDataSet*);
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
227  int FillInputPortInformation(int port, vtkInformation* info) override;
229 
230  int ExecuteMultiBlockDataSet(vtkMultiBlockDataSet* input, vtkMultiBlockDataSet* output);
231  int ExecuteUniformGridAMR(vtkUniformGridAMR* input, vtkPartitionedDataSetCollection* output);
232  int ExecutePartitionedDataCollection(
234  int ExecutePartitionedData(
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
virtual int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
composite dataset to encapsulates a dataset consisting of partitions.
represent and manipulate point attribute data
Definition: vtkPointData.h:41
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
static vtkDataObjectAlgorithm * New()
std::map< vtkDataSet *, vtkSmartPointer< vtkSphereTree > > SphereTrees
represent and manipulate cell attribute data
Definition: vtkCellData.h:41
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
a simple class to control print indentation
Definition: vtkIndent.h:39
cut any dataset with a plane and generate a polygonal cut surface
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
composite dataset to encapsulates pieces of dataset.
dataset represents arbitrary combinations of all possible cell types
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
perform various plane computations
Definition: vtkPlane.h:36
bool InterpolateAttributes
vtkInputInfo InputInfo
Superclass for algorithms that produce only data object as output.
object to represent cell connectivity
Definition: vtkCellArray.h:186
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
topologically regular array of data
Composite dataset that organizes datasets into blocks.
class to build and traverse sphere trees
Definition: vtkSphereTree.h:72
Store zero or more vtkInformation instances.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
general representation of visualization data
Definition: vtkDataObject.h:65
a concrete implementation of vtkCompositeDataSet
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkPlane * Plane
vtkInputInfo(vtkDataObject *input, vtkMTimeType mtime)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Composite dataset that groups datasets as a collection.