VTK  9.7.20260805
vtkDataObject.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
27
28#ifndef vtkDataObject_h
29#define vtkDataObject_h
30
31#include "vtkCommonDataModelModule.h" // For export macro
32#include "vtkObject.h"
33#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
34
35VTK_ABI_NAMESPACE_BEGIN
38class vtkFieldData;
39class vtkInformation;
50
51#define VTK_PIECES_EXTENT 0
52#define VTK_3D_EXTENT 1
53#define VTK_TIME_EXTENT 2
54
55class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkDataObject : public vtkObject
56{
57public:
58 static vtkDataObject* New();
59
60 vtkTypeMacro(vtkDataObject, vtkObject);
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62
64
67 vtkGetObjectMacro(Information, vtkInformation);
70
76
80 virtual void Initialize();
81
88
90
95
97
106
108
112 vtkGetObjectMacro(FieldData, vtkFieldData);
114
121 virtual int GetDataObjectType() VTK_FUTURE_CONST { return VTK_DATA_OBJECT; }
122
128
136 virtual unsigned long GetActualMemorySize();
137
142 virtual void CopyInformationFromPipeline(vtkInformation* vtkNotUsed(info)) {}
143
149 virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
150
158 vtkInformation* info, int fieldAssociation, int attributeType);
159
166 vtkInformation* info, int fieldAssociation, const char* name);
167
172 vtkInformation* info, int fieldAssociation, const char* name);
173
181 vtkInformation* info, int fieldAssociation, const char* attributeName, int attributeType);
182
192 static void SetActiveAttributeInfo(vtkInformation* info, int fieldAssociation, int attributeType,
193 const char* name, int arrayType, int numComponents, int numTuples);
194
199 static void SetPointDataActiveScalarInfo(vtkInformation* info, int arrayType, int numComponents);
200
207
213 virtual void PrepareForNewData() { this->Initialize(); }
214
222 virtual void ShallowCopy(vtkDataObject* src);
223
231 virtual void DeepCopy(vtkDataObject* src);
232
241 virtual int GetExtentType() VTK_FUTURE_CONST { return VTK_PIECES_EXTENT; }
242
247 virtual void Crop(const int updateExtent[6]);
248
263
279
300
313
326 virtual bool SupportsGhostArray(int type);
327
335
342
347
358
364 static const char* GetAssociationTypeAsString(int associationType);
365
370 static const char* GetAttributeTypeAsString(int attributeType);
371
376 static int GetAssociationTypeFromString(const char* associationName);
377
383
391
399
428
463
469
471
477
478protected:
480 ~vtkDataObject() override;
481
482 // General field data associated with data object
484
485 // Keep track of data release during network execution
487
488 // When was this data last generated?
490
491 // Arbitrary extra information associated with this data object.
493
494private:
495 // Helper method for the ShallowCopy and DeepCopy methods.
496 void InternalDataObjectCopy(vtkDataObject* src);
497
498 vtkDataObject(const vtkDataObject&) = delete;
499 void operator=(const vtkDataObject&) = delete;
500};
501
502VTK_ABI_NAMESPACE_END
503#endif
Abstract superclass for all arrays.
static vtkInformation * GetActiveFieldInformation(vtkInformation *info, int fieldAssociation, int attributeType)
Return the information object within the input information object's field data corresponding to the s...
virtual void ShallowCopy(vtkDataObject *src)
The goal of the method is to copy the data up to the array pointers only.
virtual void CopyInformationFromPipeline(vtkInformation *info)
Copy from the pipeline information to the data object's own information.
virtual vtkFieldData * GetAttributesAsFieldData(int type)
Returns the attributes of the data object as a vtkFieldData.
vtkMTimeType GetUpdateTime()
Used by Threaded ports to determine if they should initiate an asynchronous update (still in developm...
virtual void Initialize()
Restore data object to initial state,.
static const char * GetAssociationTypeAsString(int associationType)
Given an integer association type, this static method returns a string type for the association (i....
static vtkTypeBool GetGlobalReleaseDataFlag()
Turn on/off flag to control whether every object releases its data after being used by a filter.
virtual int GetAttributeTypeForArray(vtkAbstractArray *arr)
Retrieves the attribute type that an array came from.
virtual unsigned long GetActualMemorySize()
Return the actual size of the data in kibibytes (1024 bytes).
static void SetActiveAttributeInfo(vtkInformation *info, int fieldAssociation, int attributeType, const char *name, int arrayType, int numComponents, int numTuples)
Set the name, array type, number of components, and number of tuples within the passed information ob...
virtual int GetDataObjectType() VTK_FUTURE_CONST
Return class name of data type.
FieldOperations
Possible values for the FIELD_OPERATION information entry.
@ FIELD_OPERATION_REINTERPOLATED
static const char * GetAttributeTypeAsString(int attributeType)
Given an integer attribute type, this static method returns a string type for the attribute (i....
~vtkDataObject() override
vtkTimeStamp UpdateTime
virtual void DeepCopy(vtkDataObject *src)
The goal of the method is to copy the complete data from src into this object.
static int GetAssociationTypeFromString(const char *associationName)
Given a string association name, this static method returns an integer association type for the attri...
vtkFieldData * FieldData
virtual bool SupportsGhostArray(int type)
Returns if this type of data object support ghost array for specified type.
void ReleaseData()
Release data back to system to conserve memory resource.
FieldAssociations
Possible values for the FIELD_ASSOCIATION information entry.
@ FIELD_ASSOCIATION_POINTS_THEN_CELLS
static vtkDataObject * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
virtual void SetInformation(vtkInformation *)
Set/Get the information object associated with this data object.
virtual void PrepareForNewData()
make the output data ready for new data to be inserted.
void GlobalReleaseDataFlagOff()
Turn on/off flag to control whether every object releases its data after being used by a filter.
vtkTypeBool DataReleased
AttributeTypes
Possible attribute types.
static void RemoveNamedFieldInformation(vtkInformation *info, int fieldAssociation, const char *name)
Remove the info associated with an array.
virtual vtkDataSetAttributes * GetAttributes(int type)
Returns the attributes of the data object of the specified attribute type.
static vtkDataObject * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
static vtkInformation * SetActiveAttribute(vtkInformation *info, int fieldAssociation, const char *attributeName, int attributeType)
Set the named array to be the active field for the specified type (SCALARS, VECTORS,...
virtual int GetExtentType() VTK_FUTURE_CONST
The ExtentType will be left as VTK_PIECES_EXTENT for data objects such as vtkPolyData and vtkUnstruct...
virtual void CopyInformationToPipeline(vtkInformation *info)
Copy information from this data object to the pipeline information.
void DataHasBeenGenerated()
This method is called by the source when it executes to generate data.
virtual vtkUnsignedCharArray * GetGhostArray(int type)
Returns the ghost arrays of the data object of the specified attribute type.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetMTime() override
Data objects are composite objects and need to check each part for MTime.
static vtkInformation * GetNamedFieldInformation(vtkInformation *info, int fieldAssociation, const char *name)
Return the information object within the input information object's field data corresponding to the s...
void GlobalReleaseDataFlagOn()
Turn on/off flag to control whether every object releases its data after being used by a filter.
static void SetPointDataActiveScalarInfo(vtkInformation *info, int arrayType, int numComponents)
Convenience version of previous method for use (primarily) by the Imaging filters.
static void SetGlobalReleaseDataFlag(vtkTypeBool val)
Turn on/off flag to control whether every object releases its data after being used by a filter.
static vtkDataObject * New()
virtual void SetFieldData(vtkFieldData *)
Assign or retrieve a general field data to this data object.
virtual void Crop(const int updateExtent[6])
This method crops the data object (if necessary) so that the extent matches the update extent.
virtual vtkIdType GetNumberOfElements(int type)
Get the number of elements for a specific attribute type (POINT, CELL, etc.).
vtkInformation * Information
represent and manipulate attribute data in a dataset
Represents and manipulates a collection of data arrays.
a simple class to control print indentation
Definition vtkIndent.h:29
Key for vtkDataObject values.
Key for double values in vtkInformation.
Key for integer values in vtkInformation.
Key for string values in vtkInformation.
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
record modification and/or execution time
dynamic, self-adjusting array of unsigned char
static vtkInformationIntegerKey * FIELD_ACTIVE_ATTRIBUTE()
Information keys to manipulate associated attributes arrays.
static vtkInformationDoubleVectorKey * DIRECTION()
3x3 matrix to describe the data orientation.
static vtkInformationDoubleVectorKey * SPACING()
Spacing between two neighbors points in each direction.
static vtkInformationDoubleKey * DATA_TIME_STEP()
Contains the time value for which the data was generated.
static vtkInformationInformationVectorKey * CELL_DATA_VECTOR()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerKey * FIELD_OPERATION()
Unused in VTK.
static vtkInformationIntegerVectorKey * PIECE_EXTENT()
Information keys to describe the content of this vtkDataObject.
static vtkInformationIntegerKey * FIELD_ARRAY_TYPE()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerKey * FIELD_NUMBER_OF_COMPONENTS()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerKey * FIELD_ATTRIBUTE_TYPE()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerKey * DATA_EXTENT_TYPE()
Represent what extent means for this data.
static vtkInformationIntegerKey * FIELD_NUMBER_OF_TUPLES()
Information keys to manipulate associated attributes arrays.
static vtkInformationDoubleVectorKey * FIELD_RANGE()
Unused in VTK.
static vtkInformationIntegerKey * FIELD_ASSOCIATION()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerKey * DATA_NUMBER_OF_PIECES()
Information keys to describe the content of this vtkDataObject.
static vtkInformationInformationVectorKey * VERTEX_DATA_VECTOR()
Information keys to manipulate associated attributes arrays.
static vtkInformationInformationVectorKey * EDGE_DATA_VECTOR()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerPointerKey * DATA_EXTENT()
Information keys to describe the content of this vtkDataObject.
static vtkInformationIntegerKey * DATA_NUMBER_OF_GHOST_LEVELS()
Information keys to describe the content of this vtkDataObject.
static vtkInformationStringKey * FIELD_NAME()
Information keys to manipulate associated attributes arrays.
static vtkInformationDataObjectKey * SIL()
Key used to put SIL information in the output information by readers.
static vtkInformationDoubleVectorKey * ORIGIN()
3D Coordinates of the origin of this data.
static vtkInformationDoubleVectorKey * BOUNDING_BOX()
6 values to describe the min/max coordinates of the data for each axis.
static vtkInformationStringKey * DATA_TYPE_NAME()
Information keys to describe the content of this vtkDataObject.
static vtkInformationInformationVectorKey * POINT_DATA_VECTOR()
Information keys to manipulate associated attributes arrays.
static vtkInformationIntegerKey * FIELD_ATTRIBUTE_COMPONENT()
If present, this key specifies an actual or virtual component of the array.
static vtkInformationIntegerVectorKey * ALL_PIECES_EXTENT()
Information keys to describe the content of this vtkDataObject.
static vtkInformationDataObjectKey * DATA_OBJECT()
Store a vtkDataObject pointer.
static vtkInformationIntegerKey * DATA_PIECE_NUMBER()
Information keys to describe the content of this vtkDataObject.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_PIECES_EXTENT
int vtkIdType
Definition vtkType.h:363
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
@ VTK_DATA_OBJECT
Definition vtkType.h:116
#define VTK_MARSHALAUTO