VTK  9.1.0
vtkBSPCuts.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkBSPCuts.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/*----------------------------------------------------------------------------
16 Copyright (c) Sandia Corporation
17 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18----------------------------------------------------------------------------*/
19
36#ifndef vtkBSPCuts_h
37#define vtkBSPCuts_h
38
39#include "vtkCommonDataModelModule.h" // For export macro
40#include "vtkDataObject.h"
41
42class vtkKdNode;
43
44class VTKCOMMONDATAMODEL_EXPORT vtkBSPCuts : public vtkDataObject
45{
46public:
47 static vtkBSPCuts* New();
48 vtkTypeMacro(vtkBSPCuts, vtkDataObject);
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
54 int GetDataObjectType() override { return VTK_BSP_CUTS; }
55
73 void CreateCuts(double* bounds, int ncuts, int* dim, double* coord, int* lower, int* upper,
74 double* lowerDataCoord, double* upperDataCoord, int* npoints);
75
81
87 vtkKdNode* GetKdNodeTree() { return this->Top; }
88
94 vtkGetMacro(NumberOfCuts, int);
95
100 int GetArrays(int len, int* dim, double* coord, int* lower, int* upper, double* lowerDataCoord,
101 double* upperDataCoord, int* npoints);
102
107 int Equals(vtkBSPCuts* other, double tolerance = 0.0);
108
109 void PrintTree();
111
113
119
123 void Initialize() override;
124
126
130 void ShallowCopy(vtkDataObject* src) override;
131 void DeepCopy(vtkDataObject* src) override;
133
134protected:
136 ~vtkBSPCuts() override;
137
139
140 static int CountNodes(vtkKdNode* kd);
141 static void SetMinMaxId(vtkKdNode* kd);
142 static void _PrintTree(vtkKdNode* kd, int depth);
143
144 void BuildTree(vtkKdNode* kd, int idx);
145 int WriteArray(vtkKdNode* kd, int loc);
146
148 void AllocateArrays(int size);
149
151
152 // required cut information
153
154 int NumberOfCuts; // number of cuts, also length of each array
155 int* Dim; // dimension (x/y/z - 0/1/2) where cut occurs
156 double* Coord; // location of cut along axis
157 int* Lower; // location in arrays of left (lower) child info
158 int* Upper; // location in arrays of right (lower) child info
159
160 // optional cut information
161
162 double* LowerDataCoord; // coordinate of uppermost data in lower half
163 double* UpperDataCoord; // coordinate of lowermost data in upper half
164 int* Npoints; // number of data values in partition
165
166 double Bounds[6];
167
168 vtkBSPCuts(const vtkBSPCuts&) = delete;
169 void operator=(const vtkBSPCuts&) = delete;
170};
171
172#endif
This class represents an axis-aligned Binary Spatial Partitioning of a 3D space.
Definition: vtkBSPCuts.h:45
int * Lower
Definition: vtkBSPCuts.h:157
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * LowerDataCoord
Definition: vtkBSPCuts.h:162
int WriteArray(vtkKdNode *kd, int loc)
void PrintArrays()
void BuildTree(vtkKdNode *kd, int idx)
void PrintTree()
vtkKdNode * GetKdNodeTree()
Return a tree of vtkKdNode's representing the cuts specified in this object.
Definition: vtkBSPCuts.h:87
void ShallowCopy(vtkDataObject *src) override
Shallow copy.
int * Upper
Definition: vtkBSPCuts.h:158
static int CountNodes(vtkKdNode *kd)
static void _PrintTree(vtkKdNode *kd, int depth)
static void SetMinMaxId(vtkKdNode *kd)
int NumberOfCuts
Definition: vtkBSPCuts.h:154
void DeepCopy(vtkDataObject *src) override
Shallow copy.
double * UpperDataCoord
Definition: vtkBSPCuts.h:163
int * Dim
Definition: vtkBSPCuts.h:155
double * Coord
Definition: vtkBSPCuts.h:156
static vtkBSPCuts * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
int GetDataObjectType() override
Returns VTK_BSP_CUTS.
Definition: vtkBSPCuts.h:54
int Equals(vtkBSPCuts *other, double tolerance=0.0)
Compare these cuts with those of the other tree.
~vtkBSPCuts() override
void CreateCuts(vtkKdNode *kd)
Initialize the cuts from a tree of vtkKdNode's.
void Initialize() override
Restore data object to initial state,.
void operator=(const vtkBSPCuts &)=delete
int GetArrays(int len, int *dim, double *coord, int *lower, int *upper, double *lowerDataCoord, double *upperDataCoord, int *npoints)
Get the arrays representing the cuts in the partitioning.
static vtkBSPCuts * New()
vtkBSPCuts(const vtkBSPCuts &)=delete
static void DeleteAllDescendants(vtkKdNode *kd)
void ResetArrays()
int * Npoints
Definition: vtkBSPCuts.h:164
static vtkBSPCuts * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkKdNode * Top
Definition: vtkBSPCuts.h:150
void CreateCuts(double *bounds, int ncuts, int *dim, double *coord, int *lower, int *upper, double *lowerDataCoord, double *upperDataCoord, int *npoints)
Initialize the cuts with arrays of information.
void AllocateArrays(int size)
general representation of visualization data
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
This class represents a single spatial region in an 3D axis aligned binary spatial partitioning.
Definition: vtkKdNode.h:43
#define VTK_BSP_CUTS
Definition: vtkType.h:123