VTK
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 =========================================================================*/
57 #ifndef vtkPlaneCutter_h
58 #define vtkPlaneCutter_h
59 
60 #include "vtkDataSetAlgorithm.h"
61 #include "vtkFiltersCoreModule.h" // For export macro
62 #include "vtkSmartPointer.h" // For SmartPointer
63 #include <vector> // For vector
64 
65 class vtkCellArray;
66 class vtkCellData;
67 class vtkImageData;
69 class vtkPlane;
70 class vtkPointData;
71 class vtkPoints;
72 class vtkSphereTree;
73 class vtkStructuredGrid;
75 
76 class VTKFILTERSCORE_EXPORT vtkPlaneCutter : public vtkDataSetAlgorithm
77 {
78 public:
80 
83  static vtkPlaneCutter* New();
85  void PrintSelf(ostream& os, vtkIndent indent) override;
87 
91  vtkMTimeType GetMTime() override;
92 
94 
99  virtual void SetPlane(vtkPlane*);
100  vtkGetObjectMacro(Plane, vtkPlane);
102 
104 
110  vtkSetMacro(ComputeNormals, bool);
111  vtkGetMacro(ComputeNormals, bool);
112  vtkBooleanMacro(ComputeNormals, bool);
114 
116 
121  vtkSetMacro(InterpolateAttributes, bool);
122  vtkGetMacro(InterpolateAttributes, bool);
123  vtkBooleanMacro(InterpolateAttributes, bool);
125 
127 
132  vtkSetMacro(GeneratePolygons, bool);
133  vtkGetMacro(GeneratePolygons, bool);
134  vtkBooleanMacro(GeneratePolygons, bool);
136 
138 
144  vtkSetMacro(BuildTree, bool);
145  vtkGetMacro(BuildTree, bool);
146  vtkBooleanMacro(BuildTree, bool);
148 
150 
156  vtkSetMacro(BuildHierarchy, bool);
157  vtkGetMacro(BuildHierarchy, bool);
158  vtkBooleanMacro(BuildHierarchy, bool);
160 
165 
166 protected:
167  vtkPlaneCutter();
168  ~vtkPlaneCutter() override;
169 
174  bool BuildTree;
176 
177  // Helpers
178  std::vector<vtkSmartPointer<vtkSphereTree>> SphereTrees;
179 
180  // Pipeline-related methods
183  vtkInformationVector*) override;
187  vtkInformationVector*) override;
188  int FillInputPortInformation(int port, vtkInformation* info) override;
190 
191  virtual int ExecuteDataSet(vtkDataSet* input, vtkSphereTree* tree, vtkMultiPieceDataSet* output);
192 
193  static void AddNormalArray(double* planeNormal, vtkDataSet* ds);
194  static void InitializeOutput(vtkMultiPieceDataSet* output);
195 
196 private:
197  vtkPlaneCutter(const vtkPlaneCutter&) = delete;
198  void operator=(const vtkPlaneCutter&) = delete;
199 };
200 
201 #endif
represent and manipulate point attribute data
Definition: vtkPointData.h:31
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
cut any dataset with a plane and generate a polygonal cut surface
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
composite dataset to encapsulates pieces of dataset.
dataset represents arbitrary combinations of all possible cell types
virtual vtkMTimeType GetMTime()
Return this object's modified time.
perform various plane computations
Definition: vtkPlane.h:31
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when a request asks the algorithm to do its work.
bool InterpolateAttributes
object to represent cell connectivity
Definition: vtkCellArray.h:44
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
topologically regular array of data
class to build and traverse sphere trees
Definition: vtkSphereTree.h:70
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
virtual int RequestDataObject(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called within ProcessRequest to when a request asks the algorithm to create empty output data...
std::vector< vtkSmartPointer< vtkSphereTree > > SphereTrees
static vtkDataSetAlgorithm * New()
represent and manipulate 3D points
Definition: vtkPoints.h:33
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
see vtkAlgorithm for details
vtkPlane * Plane