VTK  9.5.20251109
vtkGenericDataSet.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
45#ifndef vtkGenericDataSet_h
46#define vtkGenericDataSet_h
47
48#include "vtkCommonDataModelModule.h" // For export macro
49#include "vtkDataObject.h"
50#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_6_0()
51
52VTK_ABI_NAMESPACE_BEGIN
53class vtkCellTypes;
58
59class VTKCOMMONDATAMODEL_EXPORT vtkGenericDataSet : public vtkDataObject
60{
61public:
63
67 void PrintSelf(ostream& os, vtkIndent indent) override;
69
76
83 virtual vtkIdType GetNumberOfCells(int dim = -1) = 0;
84
88 vtkIdType GetNumberOfElements(int type) override;
89
96 virtual int GetCellDimension() = 0;
97
99
109 virtual void GetDistinctCellTypes(vtkCellTypes* types);
110 VTK_DEPRECATED_IN_9_6_0("Use GetDistinctCellTypes(vtkCellTypes* types) instead.")
111 virtual void GetCellTypes(vtkCellTypes* types) { this->GetDistinctCellTypes(types); }
113
126 virtual vtkGenericCellIterator* NewCellIterator(int dim = -1) = 0;
127
138 virtual vtkGenericCellIterator* NewBoundaryIterator(int dim = -1, int exteriorOnly = 0) = 0;
139
148
162 virtual int FindCell(
163 double x[3], vtkGenericCellIterator*& cell, double tol2, int& subId, double pcoords[3]) = 0;
164
170 virtual void FindPoint(double x[3], vtkGenericPointIterator* p) = 0;
171
177
181 virtual void ComputeBounds() = 0;
182
189 virtual double* GetBounds();
190
195 virtual void GetBounds(double bounds[6]);
196
202 virtual double* GetCenter();
203
207 virtual void GetCenter(double center[3]);
208
213 virtual double GetLength();
214
216
219 vtkGetObjectMacro(Attributes, vtkGenericAttributeCollection);
221
238 {
239 return this->Superclass::GetAttributes(type);
240 }
241
243
248 virtual void SetTessellator(vtkGenericCellTessellator* tessellator);
249 vtkGetObjectMacro(Tessellator, vtkGenericCellTessellator);
251
257 unsigned long GetActualMemorySize() override;
258
262 int GetDataObjectType() VTK_FUTURE_CONST override;
263
267 virtual vtkIdType GetEstimatedSize() = 0;
268
270
273 static vtkGenericDataSet* GetData(vtkInformation* info);
274 static vtkGenericDataSet* GetData(vtkInformationVector* v, int i = 0);
276
277protected:
283
284 ~vtkGenericDataSet() override;
285
287
288 // Main helper class to tessellate a higher order cell into linear ones.
290
291 double Bounds[6]; // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
292 double Center[3]; // Center of the geometric bounding box
293 vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
294
295private:
296 vtkGenericDataSet(const vtkGenericDataSet&) = delete;
297 void operator=(const vtkGenericDataSet&) = delete;
298};
299
300VTK_ABI_NAMESPACE_END
301#endif
object provides direct access to cells in vtkCellArray and type information
general representation of visualization data
represent and manipulate attribute data in a dataset
iterator used to traverse cells
helper class to perform cell tessellation
defines dataset interface
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK type and print macros.
virtual void ComputeBounds()=0
Compute the geometry bounding box.
virtual void SetTessellator(vtkGenericCellTessellator *tessellator)
Set/Get a cell tessellator if cells must be tessellated during processing.
unsigned long GetActualMemorySize() override
Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has updated.
virtual vtkIdType GetNumberOfPoints()=0
Return the number of points composing the dataset.
vtkDataSetAttributes * GetAttributes(int type) override
Returns the attributes of the data object of the specified attribute type.
virtual double GetLength()
Return the length of the diagonal of the bounding box.
virtual int GetCellDimension()=0
Return -1 if the dataset is explicitly defined by cells of varying dimensions or if there are no cell...
virtual vtkIdType GetNumberOfCells(int dim=-1)=0
Return the number of cells that explicitly define the dataset.
virtual double * GetBounds()
Return a pointer to the geometry bounding box in the form (xmin,xmax, ymin,ymax, zmin,...
virtual vtkGenericPointIterator * NewPointIterator()=0
Return an iterator to traverse the points composing the dataset; they can be points that define a cel...
virtual vtkGenericCellIterator * NewBoundaryIterator(int dim=-1, int exteriorOnly=0)=0
Return an iterator to traverse cell boundaries of dimension ‘dim’ (or all dimensions if -1) of the da...
int GetDataObjectType() VTK_FUTURE_CONST override
Return the type of data object.
virtual void GetCenter(double center[3])
Get the center of the bounding box in global coordinates.
virtual void GetBounds(double bounds[6])
Return the geometry bounding box in global coordinates in the form (xmin,xmax, ymin,...
virtual void FindPoint(double x[3], vtkGenericPointIterator *p)=0
Locate the closest point ‘p’ to position ‘x’ (global coordinates).
vtkIdType GetNumberOfElements(int type) override
Get the number of elements for a specific attribute type (POINT, CELL, etc.).
virtual double * GetCenter()
Get the center of the bounding box in global coordinates.
virtual int FindCell(double x[3], vtkGenericCellIterator *&cell, double tol2, int &subId, double pcoords[3])=0
Locate the closest cell to position ‘x’ (global coordinates) with respect to a tolerance squared ‘tol...
virtual vtkGenericCellIterator * NewCellIterator(int dim=-1)=0
Return an iterator to traverse cells of dimension ‘dim’ (or all dimensions if -1) that explicitly def...
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for their modified time.
virtual void GetDistinctCellTypes(vtkCellTypes *types)
Get a list of types of cells in a dataset.
iterator used to traverse points
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
#define VTK_DEPRECATED_IN_9_6_0(reason)
int vtkIdType
Definition vtkType.h:367
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_NEWINSTANCE