VTK  9.3.0
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 
51 VTK_ABI_NAMESPACE_BEGIN
52 class vtkCellTypes;
57 
58 class VTKCOMMONDATAMODEL_EXPORT vtkGenericDataSet : public vtkDataObject
59 {
60 public:
62 
66  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
75 
82  virtual vtkIdType GetNumberOfCells(int dim = -1) = 0;
83 
88 
95  virtual int GetCellDimension() = 0;
96 
107  virtual void GetCellTypes(vtkCellTypes* types);
108 
121  virtual vtkGenericCellIterator* NewCellIterator(int dim = -1) = 0;
122 
133  virtual vtkGenericCellIterator* NewBoundaryIterator(int dim = -1, int exteriorOnly = 0) = 0;
134 
143 
157  virtual int FindCell(
158  double x[3], vtkGenericCellIterator*& cell, double tol2, int& subId, double pcoords[3]) = 0;
159 
165  virtual void FindPoint(double x[3], vtkGenericPointIterator* p) = 0;
166 
171  vtkMTimeType GetMTime() override;
172 
176  virtual void ComputeBounds() = 0;
177 
184  virtual double* GetBounds();
185 
190  virtual void GetBounds(double bounds[6]);
191 
197  virtual double* GetCenter();
198 
202  virtual void GetCenter(double center[3]);
203 
208  virtual double GetLength();
209 
211 
214  vtkGetObjectMacro(Attributes, vtkGenericAttributeCollection);
216 
233  {
234  return this->Superclass::GetAttributes(type);
235  }
236 
238 
243  virtual void SetTessellator(vtkGenericCellTessellator* tessellator);
244  vtkGetObjectMacro(Tessellator, vtkGenericCellTessellator);
246 
252  unsigned long GetActualMemorySize() override;
253 
257  int GetDataObjectType() override;
258 
263 
265 
271 
272 protected:
278 
279  ~vtkGenericDataSet() override;
280 
282 
283  // Main helper class to tessellate a higher order cell into linear ones.
285 
286  double Bounds[6]; // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
287  double Center[3]; // Center of the geometric bounding box
288  vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
289 
290 private:
291  vtkGenericDataSet(const vtkGenericDataSet&) = delete;
292  void operator=(const vtkGenericDataSet&) = delete;
293 };
294 
295 VTK_ABI_NAMESPACE_END
296 #endif
object provides direct access to cells in vtkCellArray and type information
Definition: vtkCellTypes.h:46
general representation of visualization data
Definition: vtkDataObject.h:55
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 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...
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.
vtkGenericDataSet()
Constructor with uninitialized bounds (1,-1, 1,-1, 1,-1), empty attribute collection and default tess...
unsigned long GetActualMemorySize() override
Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has updated.
static vtkGenericDataSet * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
virtual vtkIdType GetNumberOfPoints()=0
Return the number of points composing the dataset.
virtual double * GetBounds()
Return a pointer to the geometry bounding box in the form (xmin,xmax, ymin,ymax, zmin,...
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...
vtkTimeStamp ComputeTime
int GetDataObjectType() override
Return the type of data object.
virtual vtkIdType GetNumberOfCells(int dim=-1)=0
Return the number of cells that explicitly define the dataset.
static vtkGenericDataSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
virtual vtkGenericCellIterator * NewCellIterator(int dim=-1)=0
Return an iterator to traverse cells of dimension ‘dim’ (or all dimensions if -1) that explicitly def...
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,...
~vtkGenericDataSet() override
virtual vtkGenericPointIterator * NewPointIterator()=0
Return an iterator to traverse the points composing the dataset; they can be points that define a cel...
virtual vtkIdType GetEstimatedSize()=0
Estimated size needed after tessellation (or special operation)
virtual void FindPoint(double x[3], vtkGenericPointIterator *p)=0
Locate the closest point ‘p’ to position ‘x’ (global coordinates).
vtkDataSetAttributes * GetAttributes(int type) override
Returns the attributes of the data object of the specified attribute type.
vtkIdType GetNumberOfElements(int type) override
Get the number of elements for a specific attribute type (POINT, CELL, etc.).
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...
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for their modified time.
vtkGenericCellTessellator * Tessellator
vtkGenericAttributeCollection * Attributes
virtual double * GetCenter()
Get the center of the bounding box in global coordinates.
virtual void GetCellTypes(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:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
Definition: vtkTimeStamp.h:25
@ info
Definition: vtkX3D.h:376
@ center
Definition: vtkX3D.h:230
@ type
Definition: vtkX3D.h:516
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_NEWINSTANCE