VTK  9.1.0
vtkDataObject.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkDataObject.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=========================================================================*/
43#ifndef vtkDataObject_h
44#define vtkDataObject_h
45
46#include "vtkCommonDataModelModule.h" // For export macro
47#include "vtkObject.h"
48
50class vtkDataArray;
52class vtkFieldData;
53class vtkInformation;
63
64#define VTK_PIECES_EXTENT 0
65#define VTK_3D_EXTENT 1
66#define VTK_TIME_EXTENT 2
67
68class VTKCOMMONDATAMODEL_EXPORT vtkDataObject : public vtkObject
69{
70public:
71 static vtkDataObject* New();
72
73 vtkTypeMacro(vtkDataObject, vtkObject);
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
77
80 vtkGetObjectMacro(Information, vtkInformation);
83
89
93 virtual void Initialize();
94
101
103
106 vtkGetMacro(DataReleased, int);
108
110
114 static void SetGlobalReleaseDataFlag(int val);
115 void GlobalReleaseDataFlagOn() { this->SetGlobalReleaseDataFlag(1); }
116 void GlobalReleaseDataFlagOff() { this->SetGlobalReleaseDataFlag(0); }
119
121
125 vtkGetObjectMacro(FieldData, vtkFieldData);
127
134 virtual int GetDataObjectType() { return VTK_DATA_OBJECT; }
135
141
149 virtual unsigned long GetActualMemorySize();
150
155 virtual void CopyInformationFromPipeline(vtkInformation* vtkNotUsed(info)) {}
156
162 virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
163
171 vtkInformation* info, int fieldAssociation, int attributeType);
172
179 vtkInformation* info, int fieldAssociation, const char* name);
180
185 vtkInformation* info, int fieldAssociation, const char* name);
186
194 vtkInformation* info, int fieldAssociation, const char* attributeName, int attributeType);
195
205 static void SetActiveAttributeInfo(vtkInformation* info, int fieldAssociation, int attributeType,
206 const char* name, int arrayType, int numComponents, int numTuples);
207
212 static void SetPointDataActiveScalarInfo(vtkInformation* info, int arrayType, int numComponents);
213
220
226 virtual void PrepareForNewData() { this->Initialize(); }
227
229
233 virtual void ShallowCopy(vtkDataObject* src);
234 virtual void DeepCopy(vtkDataObject* src);
236
245 virtual int GetExtentType() { return VTK_PIECES_EXTENT; }
246
251 virtual void Crop(const int* updateExtent);
252
257 {
265 NUMBER_OF_ASSOCIATIONS
266 };
267
273 {
281 NUMBER_OF_ATTRIBUTE_TYPES
282 };
283
304
317
325
332
337
342 {
346 FIELD_OPERATION_REMOVED
347 };
348
353 static const char* GetAssociationTypeAsString(int associationType);
354
359 static int GetAssociationTypeFromString(const char* associationName);
360
361 // \ingroup InformationKeys
363 // \ingroup InformationKeys
365 // \ingroup InformationKeys
367 // \ingroup InformationKeys
369 // \ingroup InformationKeys
371 // \ingroup InformationKeys
373 // \ingroup InformationKeys
375 // \ingroup InformationKeys
377 // \ingroup InformationKeys
379 // \ingroup InformationKeys
381 // \ingroup InformationKeys
383 // \ingroup InformationKeys
385 // \ingroup InformationKeys
387 // \ingroup InformationKeys
389 // \ingroup InformationKeys
391 // \ingroup InformationKeys
393 // \ingroup InformationKeys
395 // \ingroup InformationKeys
397 // \ingroup InformationKeys
399 // \ingroup InformationKeys
401 // \ingroup InformationKeys
403 // \ingroup InformationKeys
405 // \ingroup InformationKeys
407 // \ingroup InformationKeys
409 // \ingroup InformationKeys
411 // \ingroup InformationKeys
413 // \ingroup InformationKeys
415
416 // Key used to put SIL information in the output information by readers.
417 // \ingroup InformationKeys
419
421
427
428protected:
430 ~vtkDataObject() override;
431
432 // General field data associated with data object
434
435 // Keep track of data release during network execution
437
438 // When was this data last generated?
440
441 // Arbitrary extra information associated with this data object.
443
444private:
445 // Helper method for the ShallowCopy and DeepCopy methods.
446 void InternalDataObjectCopy(vtkDataObject* src);
447
448private:
449 vtkDataObject(const vtkDataObject&) = delete;
450 void operator=(const vtkDataObject&) = delete;
451};
452
453#endif
Abstract superclass for all arrays.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
general representation of visualization data
Definition: vtkDataObject.h:69
static vtkInformationIntegerKey * FIELD_ACTIVE_ATTRIBUTE()
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)
Shallow and Deep copy.
static vtkInformationDoubleVectorKey * DIRECTION()
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 vtkInformationDoubleVectorKey * SPACING()
static const char * GetAssociationTypeAsString(int associationType)
Given an integer association type, this static method returns a string type for the attribute (i....
virtual int GetAttributeTypeForArray(vtkAbstractArray *arr)
Retrieves the attribute type that an array came from.
static vtkInformationDoubleKey * DATA_TIME_STEP()
static vtkInformationInformationVectorKey * CELL_DATA_VECTOR()
static vtkInformationIntegerKey * FIELD_OPERATION()
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 void Crop(const int *updateExtent)
This method crops the data object (if necessary) so that the extent matches the update extent.
static vtkInformationIntegerVectorKey * PIECE_EXTENT()
FieldOperations
Possible values for the FIELD_OPERATION information entry.
@ FIELD_OPERATION_REINTERPOLATED
~vtkDataObject() override
static vtkInformationIntegerKey * FIELD_ARRAY_TYPE()
vtkTimeStamp UpdateTime
virtual void DeepCopy(vtkDataObject *src)
Shallow and Deep copy.
static int GetAssociationTypeFromString(const char *associationName)
Given a string association name, this static method returns an integer association type for the attri...
vtkFieldData * FieldData
static vtkInformationIntegerKey * FIELD_NUMBER_OF_COMPONENTS()
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
@ FIELD_ASSOCIATION_VERTICES
static vtkInformationIntegerKey * FIELD_ATTRIBUTE_TYPE()
static vtkInformationIntegerKey * DATA_EXTENT_TYPE()
static vtkInformationIntegerKey * FIELD_NUMBER_OF_TUPLES()
static vtkDataObject * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
static vtkInformationDoubleVectorKey * FIELD_RANGE()
static int GetGlobalReleaseDataFlag()
Turn on/off flag to control whether every object releases its data after being used by a filter.
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.
static vtkInformationIntegerKey * FIELD_ASSOCIATION()
void GlobalReleaseDataFlagOff()
Turn on/off flag to control whether every object releases its data after being used by a filter.
AttributeTypes
Possible attribute types.
static void RemoveNamedFieldInformation(vtkInformation *info, int fieldAssociation, const char *name)
Remove the info associated with an array.
virtual void CopyInformationFromPipeline(vtkInformation *vtkNotUsed(info))
Copy from the pipeline information to the data object's own information.
static vtkInformationIntegerKey * DATA_NUMBER_OF_PIECES()
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,...
static vtkInformationInformationVectorKey * VERTEX_DATA_VECTOR()
static vtkInformationInformationVectorKey * EDGE_DATA_VECTOR()
static vtkInformationIntegerPointerKey * DATA_EXTENT()
static vtkInformationIntegerKey * DATA_NUMBER_OF_GHOST_LEVELS()
void DataHasBeenGenerated()
This method is called by the source when it executes to generate data.
static vtkInformationStringKey * FIELD_NAME()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int GetDataObjectType()
Return class name of data type.
vtkMTimeType GetMTime() override
Data objects are composite objects and need to check each part for MTime.
static vtkInformationDataObjectKey * SIL()
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...
virtual vtkDataArray * GetGhostArray(int type)
Returns the ghost arrays of the data object of the specified atribute type.
static void SetGlobalReleaseDataFlag(int val)
Turn on/off flag to control whether every object releases its data after being used by a filter.
static vtkInformationDoubleVectorKey * ORIGIN()
static vtkInformationDoubleVectorKey * BOUNDING_BOX()
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 vtkInformationStringKey * DATA_TYPE_NAME()
static vtkInformationInformationVectorKey * POINT_DATA_VECTOR()
static vtkDataObject * New()
virtual void CopyInformationToPipeline(vtkInformation *vtkNotUsed(info))
Copy information from this data object to the pipeline information.
virtual void SetFieldData(vtkFieldData *)
Assign or retrieve a general field data to this data object.
virtual int GetExtentType()
The ExtentType will be left as VTK_PIECES_EXTENT for data objects such as vtkPolyData and vtkUnstruct...
static vtkInformationIntegerVectorKey * ALL_PIECES_EXTENT()
static vtkInformationDataObjectKey * DATA_OBJECT()
virtual vtkIdType GetNumberOfElements(int type)
Get the number of elements for a specific attribute type (POINT, CELL, etc.).
static vtkInformationIntegerKey * DATA_PIECE_NUMBER()
vtkInformation * Information
represent and manipulate attribute data in a dataset
represent and manipulate fields of data
Definition: vtkFieldData.h:64
a simple class to control print indentation
Definition: vtkIndent.h:43
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.
abstract base class for most VTK objects
Definition: vtkObject.h:63
record modification and/or execution time
Definition: vtkTimeStamp.h:42
@ info
Definition: vtkX3D.h:382
@ type
Definition: vtkX3D.h:522
@ name
Definition: vtkX3D.h:225
#define VTK_PIECES_EXTENT
Definition: vtkDataObject.h:64
int vtkIdType
Definition: vtkType.h:332
#define VTK_DATA_OBJECT
Definition: vtkType.h:84
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287