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 =========================================================================*/
60 #ifndef vtkPlaneCutter_h
61 #define vtkPlaneCutter_h
62 
63 #include "vtkDataSetAlgorithm.h"
64 #include "vtkFiltersCoreModule.h" // For export macro
65 #include "vtkSmartPointer.h" // For SmartPointer
66 #include <vector> // For vector
67 
68 class vtkCellArray;
69 class vtkCellData;
70 class vtkImageData;
72 class vtkPlane;
73 class vtkPointData;
74 class vtkPoints;
75 class vtkSphereTree;
76 class vtkStructuredGrid;
78 
79 class VTKFILTERSCORE_EXPORT vtkPlaneCutter : public vtkDataSetAlgorithm
80 {
81 public:
83 
86  static vtkPlaneCutter* New();
88  void PrintSelf(ostream& os, vtkIndent indent) override;
90 
94  vtkMTimeType GetMTime() override;
95 
97 
102  virtual void SetPlane(vtkPlane*);
103  vtkGetObjectMacro(Plane, vtkPlane);
105 
107 
113  vtkSetMacro(ComputeNormals, bool);
114  vtkGetMacro(ComputeNormals, bool);
115  vtkBooleanMacro(ComputeNormals, bool);
117 
119 
124  vtkSetMacro(InterpolateAttributes, bool);
125  vtkGetMacro(InterpolateAttributes, bool);
126  vtkBooleanMacro(InterpolateAttributes, bool);
128 
130 
135  vtkSetMacro(GeneratePolygons, bool);
136  vtkGetMacro(GeneratePolygons, bool);
137  vtkBooleanMacro(GeneratePolygons, bool);
139 
141 
147  vtkSetMacro(BuildTree, bool);
148  vtkGetMacro(BuildTree, bool);
149  vtkBooleanMacro(BuildTree, bool);
151 
153 
159  vtkSetMacro(BuildHierarchy, bool);
160  vtkGetMacro(BuildHierarchy, bool);
161  vtkBooleanMacro(BuildHierarchy, bool);
163 
168 
169 protected:
171  ~vtkPlaneCutter() override;
172 
177  bool BuildTree;
179 
180  // Helpers
181  std::vector<vtkSmartPointer<vtkSphereTree>> SphereTrees;
182 
183  // Pipeline-related methods
186  vtkInformationVector*) override;
190  vtkInformationVector*) override;
193 
194  virtual int ExecuteDataSet(vtkDataSet* input, vtkSphereTree* tree, vtkMultiPieceDataSet* output);
195 
196  static void AddNormalArray(double* planeNormal, vtkDataSet* ds);
198 
199 private:
200  vtkPlaneCutter(const vtkPlaneCutter&) = delete;
201  void operator=(const vtkPlaneCutter&) = delete;
202 };
203 
204 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkPlaneCutter::~vtkPlaneCutter
~vtkPlaneCutter() override
vtkPlaneCutter::vtkPlaneCutter
vtkPlaneCutter()
vtkPlane
perform various plane computations
Definition: vtkPlane.h:38
vtkPlaneCutter::Plane
vtkPlane * Plane
Definition: vtkPlaneCutter.h:173
vtkPlaneCutter::BuildHierarchy
bool BuildHierarchy
Definition: vtkPlaneCutter.h:178
vtkMultiPieceDataSet
composite dataset to encapsulates pieces of dataset.
Definition: vtkMultiPieceDataSet.h:44
vtkPointData
represent and manipulate point attribute data
Definition: vtkPointData.h:38
vtkPlaneCutter::BuildTree
bool BuildTree
Definition: vtkPlaneCutter.h:177
vtkPlaneCutter::ComputeNormals
bool ComputeNormals
Definition: vtkPlaneCutter.h:174
vtkPlaneCutter::ExecuteDataSet
virtual int ExecuteDataSet(vtkDataSet *input, vtkSphereTree *tree, vtkMultiPieceDataSet *output)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkPlaneCutter::ProcessRequest
int ProcessRequest(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
See vtkAlgorithm for details.
vtkPlaneCutter::SphereTrees
std::vector< vtkSmartPointer< vtkSphereTree > > SphereTrees
Definition: vtkPlaneCutter.h:181
vtkPlaneCutter::FillOutputPortInformation
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
vtkStructuredGrid
topologically regular array of data
Definition: vtkStructuredGrid.h:64
vtkPlaneCutter::InitializeOutput
static void InitializeOutput(vtkMultiPieceDataSet *output)
vtkDataSetAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkDataSetAlgorithm.h:49
vtkPlaneCutter::InterpolateAttributes
bool InterpolateAttributes
Definition: vtkPlaneCutter.h:175
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkPlaneCutter::New
static vtkPlaneCutter * New()
Standard construction and print methods.
vtkPlaneCutter::RequestDataObject
int RequestDataObject(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest to when a request asks the algorithm to create empty output data...
vtkCellData
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkSmartPointer.h
vtkPlaneCutter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when a request asks the algorithm to do its work.
vtkPlaneCutter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPlaneCutter::GetMTime
vtkMTimeType GetMTime() override
The modified time depends on the delegated cut plane.
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSphereTree
class to build and traverse sphere trees
Definition: vtkSphereTree.h:71
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkDataSetAlgorithm.h
vtkPlaneCutter::RequestUpdateExtent
int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called within ProcessRequest when each filter in the pipeline decides what portion of its inp...
vtkPlaneCutter::GeneratePolygons
bool GeneratePolygons
Definition: vtkPlaneCutter.h:176
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:89
vtkPlaneCutter::SetPlane
virtual void SetPlane(vtkPlane *)
Specify the plane (an implicit function) to perform the cutting.
vtkPlaneCutter
cut any dataset with a plane and generate a polygonal cut surface
Definition: vtkPlaneCutter.h:80
vtkPlaneCutter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkPlaneCutter::AddNormalArray
static void AddNormalArray(double *planeNormal, vtkDataSet *ds)