VTK
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 =========================================================================*/
40 #ifndef vtkDataObject_h
41 #define vtkDataObject_h
42 
43 #include "vtkCommonDataModelModule.h" // For export macro
44 #include "vtkObject.h"
45 
46 class vtkAbstractArray;
48 class vtkFieldData;
49 class vtkInformation;
59 
60 #define VTK_PIECES_EXTENT 0
61 #define VTK_3D_EXTENT 1
62 #define VTK_TIME_EXTENT 2
63 
64 class VTKCOMMONDATAMODEL_EXPORT vtkDataObject : public vtkObject
65 {
66 public:
67  static vtkDataObject *New();
68 
69  vtkTypeMacro(vtkDataObject,vtkObject);
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
76  vtkGetObjectMacro(Information, vtkInformation);
79 
84  vtkMTimeType GetMTime() override;
85 
89  virtual void Initialize();
90 
96  void ReleaseData();
97 
99 
102  vtkGetMacro(DataReleased,int);
104 
105 
107 
111  static void SetGlobalReleaseDataFlag(int val);
112  void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
113  void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
116 
118 
121  virtual void SetFieldData(vtkFieldData*);
122  vtkGetObjectMacro(FieldData,vtkFieldData);
124 
131  virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
132 
138 
146  virtual unsigned long GetActualMemorySize();
147 
153  {}
154 
160  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
161 
169  int fieldAssociation, int attributeType);
170 
177  int fieldAssociation, const char *name);
178 
183  int fieldAssociation,
184  const char *name);
185 
193  int fieldAssociation, const char *attributeName, int attributeType);
194 
205  int fieldAssociation, int attributeType, const char *name, int arrayType,
206  int numComponents, int numTuples);
207 
213  int arrayType, int numComponents);
214 
221 
227  virtual void PrepareForNewData() {this->Initialize();};
228 
230 
234  virtual void ShallowCopy(vtkDataObject *src);
235  virtual void DeepCopy(vtkDataObject *src);
237 
246  virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
247 
252  virtual void Crop(const int* updateExtent);
253 
258  {
266  NUMBER_OF_ASSOCIATIONS
267  };
268 
274  {
282  NUMBER_OF_ATTRIBUTE_TYPES
283  };
284 
301 
309 
316 
321 
326  {
330  FIELD_OPERATION_REMOVED
331  };
332 
337  static const char* GetAssociationTypeAsString(int associationType);
338 
343  static int GetAssociationTypeFromString(const char* associationType);
344 
345  // \ingroup InformationKeys
347  // \ingroup InformationKeys
349  // \ingroup InformationKeys
351  // \ingroup InformationKeys
353  // \ingroup InformationKeys
355  // \ingroup InformationKeys
357  // \ingroup InformationKeys
359  // \ingroup InformationKeys
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 
398  // Key used to put SIL information in the output information by readers.
399  // \ingroup InformationKeys
401 
403 
409 
410 protected:
411 
413  ~vtkDataObject() override;
414 
415  // General field data associated with data object
417 
418  // Keep track of data release during network execution
420 
421  // When was this data last generated?
423 
424  // Arbitrary extra information associated with this data object.
426 
427 private:
428  // Helper method for the ShallowCopy and DeepCopy methods.
429  void InternalDataObjectCopy(vtkDataObject *src);
430 
431 private:
432  vtkDataObject(const vtkDataObject&) = delete;
433  void operator=(const vtkDataObject&) = delete;
434 };
435 
436 #endif
437 
vtkDataObject::FIELD_ASSOCIATION_EDGES
@ FIELD_ASSOCIATION_EDGES
Definition: vtkDataObject.h:264
vtkDataObject::DATA_TYPE_NAME
static vtkInformationStringKey * DATA_TYPE_NAME()
vtkDataObject::GetAttributes
virtual vtkDataSetAttributes * GetAttributes(int type)
Returns the attributes of the data object of the specified attribute type.
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:37
vtkDataObject::POINT
@ POINT
Definition: vtkDataObject.h:275
vtkDataObject::POINT_DATA_VECTOR
static vtkInformationInformationVectorKey * POINT_DATA_VECTOR()
vtkDataObject::Initialize
virtual void Initialize()
Restore data object to initial state,.
vtkDataObject::FIELD_ACTIVE_ATTRIBUTE
static vtkInformationIntegerKey * FIELD_ACTIVE_ATTRIBUTE()
vtkDataObject::CELL
@ CELL
Definition: vtkDataObject.h:276
vtkDataObject::GetAssociationTypeAsString
static const char * GetAssociationTypeAsString(int associationType)
Given an integer association type, this static method returns a string type for the attribute (i....
VTK_DATA_OBJECT
#define VTK_DATA_OBJECT
Definition: vtkType.h:98
vtkDataObject::EDGE_DATA_VECTOR
static vtkInformationInformationVectorKey * EDGE_DATA_VECTOR()
vtkDataObject::SPACING
static vtkInformationDoubleVectorKey * SPACING()
vtkDataObject::FieldData
vtkFieldData * FieldData
Definition: vtkDataObject.h:416
vtkDataObject::GetAttributesAsFieldData
virtual vtkFieldData * GetAttributesAsFieldData(int type)
Returns the attributes of the data object as a vtkFieldData.
vtkX3D::type
@ type
Definition: vtkX3D.h:516
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkDataObject::VERTEX_DATA_VECTOR
static vtkInformationInformationVectorKey * VERTEX_DATA_VECTOR()
vtkDataObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:60
vtkDataObject::SetPointDataActiveScalarInfo
static void SetPointDataActiveScalarInfo(vtkInformation *info, int arrayType, int numComponents)
Convenience version of previous method for use (primarily) by the Imaging filters.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkDataObject::DATA_OBJECT
static vtkInformationDataObjectKey * DATA_OBJECT()
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkDataObject::FIELD_ASSOCIATION
static vtkInformationIntegerKey * FIELD_ASSOCIATION()
vtkInformationDataObjectKey
Key for vtkDataObject values.
Definition: vtkInformationDataObjectKey.h:34
vtkDataObject::SetInformation
virtual void SetInformation(vtkInformation *)
vtkDataObject::GetNamedFieldInformation
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...
vtkDataObject::PIECE_EXTENT
static vtkInformationIntegerVectorKey * PIECE_EXTENT()
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkDataObject::CopyInformationFromPipeline
virtual void CopyInformationFromPipeline(vtkInformation *vtkNotUsed(info))
Copy from the pipeline information to the data object's own information.
Definition: vtkDataObject.h:152
vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS
static vtkInformationIntegerKey * DATA_NUMBER_OF_GHOST_LEVELS()
vtkDataObject::Information
vtkInformation * Information
Definition: vtkDataObject.h:425
vtkDataObject::GetUpdateTime
vtkMTimeType GetUpdateTime()
Used by Threaded ports to determine if they should initiate an asynchronous update (still in developm...
vtkDataObject::GetDataObjectType
virtual int GetDataObjectType()
Return class name of data type.
Definition: vtkDataObject.h:131
vtkDataObject::FIELD_ASSOCIATION_POINTS
@ FIELD_ASSOCIATION_POINTS
Definition: vtkDataObject.h:259
vtkDataObject::GlobalReleaseDataFlagOn
void GlobalReleaseDataFlagOn()
Definition: vtkDataObject.h:112
vtkInformationIntegerPointerKey
Key for pointer to integer.
Definition: vtkInformationIntegerPointerKey.h:32
vtkInformationDoubleKey
Key for double values in vtkInformation.
Definition: vtkInformationDoubleKey.h:35
vtkDataObject::SIL
static vtkInformationDataObjectKey * SIL()
vtkDataObject::RemoveNamedFieldInformation
static void RemoveNamedFieldInformation(vtkInformation *info, int fieldAssociation, const char *name)
Remove the info associated with an array.
vtkDataObject::POINT_THEN_CELL
@ POINT_THEN_CELL
Definition: vtkDataObject.h:278
vtkDataObject::FIELD_ASSOCIATION_NONE
@ FIELD_ASSOCIATION_NONE
Definition: vtkDataObject.h:261
vtkDataObject::DeepCopy
virtual void DeepCopy(vtkDataObject *src)
vtkDataObject::vtkDataObject
vtkDataObject()
vtkDataObject::SetGlobalReleaseDataFlag
static void SetGlobalReleaseDataFlag(int val)
Turn on/off flag to control whether every object releases its data after being used by a filter.
vtkDataObject::GetMTime
vtkMTimeType GetMTime() override
Data objects are composite objects and need to check each part for MTime.
vtkDataObject::ALL_PIECES_EXTENT
static vtkInformationIntegerVectorKey * ALL_PIECES_EXTENT()
vtkDataObject::FIELD_ASSOCIATION_VERTICES
@ FIELD_ASSOCIATION_VERTICES
Definition: vtkDataObject.h:263
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:57
vtkDataObject::DataHasBeenGenerated
void DataHasBeenGenerated()
This method is called by the source when it executes to generate data.
vtkDataObject::GetNumberOfElements
virtual vtkIdType GetNumberOfElements(int type)
Get the number of elements for a specific attribute type (POINT, CELL, etc.).
vtkDataObject::GlobalReleaseDataFlagOff
void GlobalReleaseDataFlagOff()
Definition: vtkDataObject.h:113
vtkDataObject::FieldOperations
FieldOperations
Possible values for the FIELD_OPERATION information entry.
Definition: vtkDataObject.h:326
vtkDataObject::FIELD_OPERATION_MODIFIED
@ FIELD_OPERATION_MODIFIED
Definition: vtkDataObject.h:329
vtkDataObject::~vtkDataObject
~vtkDataObject() override
vtkDataObject::SetActiveAttribute
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,...
vtkDataObject::FIELD_ASSOCIATION_CELLS
@ FIELD_ASSOCIATION_CELLS
Definition: vtkDataObject.h:260
vtkDataObject::FIELD_OPERATION
static vtkInformationIntegerKey * FIELD_OPERATION()
vtkDataObject::DATA_PIECE_NUMBER
static vtkInformationIntegerKey * DATA_PIECE_NUMBER()
vtkDataObject::VERTEX
@ VERTEX
Definition: vtkDataObject.h:279
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:35
vtkDataObject::FIELD_NUMBER_OF_COMPONENTS
static vtkInformationIntegerKey * FIELD_NUMBER_OF_COMPONENTS()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkDataObject::GetExtentType
virtual int GetExtentType()
The ExtentType will be left as VTK_PIECES_EXTENT for data objects such as vtkPolyData and vtkUnstruct...
Definition: vtkDataObject.h:246
vtkDataObject::BOUNDING_BOX
static vtkInformationDoubleVectorKey * BOUNDING_BOX()
vtkDataObject::PrepareForNewData
virtual void PrepareForNewData()
make the output data ready for new data to be inserted.
Definition: vtkDataObject.h:227
vtkDataObject::GetActiveFieldInformation
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...
vtkDataObject::SetActiveAttributeInfo
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...
vtkDataObject::DATA_NUMBER_OF_PIECES
static vtkInformationIntegerKey * DATA_NUMBER_OF_PIECES()
vtkDataObject::FIELD_RANGE
static vtkInformationDoubleVectorKey * FIELD_RANGE()
vtkDataObject::Crop
virtual void Crop(const int *updateExtent)
This method crops the data object (if necessary) so that the extent matches the update extent.
vtkDataObject::UpdateTime
vtkTimeStamp UpdateTime
Definition: vtkDataObject.h:422
VTK_PIECES_EXTENT
#define VTK_PIECES_EXTENT
Definition: vtkDataObject.h:60
vtkDataObject::ROW
@ ROW
Definition: vtkDataObject.h:281
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkObject.h
vtkDataObject::FIELD
@ FIELD
Definition: vtkDataObject.h:277
vtkDataObject::DATA_TIME_STEP
static vtkInformationDoubleKey * DATA_TIME_STEP()
vtkDataObject::CopyInformationToPipeline
virtual void CopyInformationToPipeline(vtkInformation *vtkNotUsed(info))
Copy information from this data object to the pipeline information.
Definition: vtkDataObject.h:160
vtkDataObject::ReleaseData
void ReleaseData()
Release data back to system to conserve memory resource.
vtkDataObject::GetActualMemorySize
virtual unsigned long GetActualMemorySize()
Return the actual size of the data in kibibytes (1024 bytes).
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:79
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkDataObject::GetAttributeTypeForArray
virtual int GetAttributeTypeForArray(vtkAbstractArray *arr)
Retrieves the attribute type that an array came from.
vtkDataObject::EDGE
@ EDGE
Definition: vtkDataObject.h:280
vtkDataObject::DataReleased
int DataReleased
Definition: vtkDataObject.h:419
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:35
vtkDataObject::GetAssociationTypeFromString
static int GetAssociationTypeFromString(const char *associationType)
Given an integer association type, this static method returns a string type for the attribute (i....
vtkDataObject::SetFieldData
virtual void SetFieldData(vtkFieldData *)
Assign or retrieve a general field data to this data object.
vtkInformationInformationVectorKey
Key for vtkInformation vectors.
Definition: vtkInformationInformationVectorKey.h:34
vtkDataObject::GetData
static vtkDataObject * GetData(vtkInformationVector *v, int i=0)
vtkDataObject::FIELD_OPERATION_REINTERPOLATED
@ FIELD_OPERATION_REINTERPOLATED
Definition: vtkDataObject.h:328
vtkDataObject::FIELD_NAME
static vtkInformationStringKey * FIELD_NAME()
vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS
@ FIELD_ASSOCIATION_POINTS_THEN_CELLS
Definition: vtkDataObject.h:262
vtkDataObject::FieldAssociations
FieldAssociations
Possible values for the FIELD_ASSOCIATION information entry.
Definition: vtkDataObject.h:258
vtkDataObject::FIELD_NUMBER_OF_TUPLES
static vtkInformationIntegerKey * FIELD_NUMBER_OF_TUPLES()
vtkDataObject::FIELD_ATTRIBUTE_TYPE
static vtkInformationIntegerKey * FIELD_ATTRIBUTE_TYPE()
vtkInformationIntegerVectorKey
Key for integer vector values.
Definition: vtkInformationIntegerVectorKey.h:35
vtkDataObject::FIELD_ASSOCIATION_ROWS
@ FIELD_ASSOCIATION_ROWS
Definition: vtkDataObject.h:265
vtkDataObject::ORIGIN
static vtkInformationDoubleVectorKey * ORIGIN()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkDataObject::GetGlobalReleaseDataFlag
static int GetGlobalReleaseDataFlag()
vtkDataObject::FIELD_ARRAY_TYPE
static vtkInformationIntegerKey * FIELD_ARRAY_TYPE()
vtkDataObject::CELL_DATA_VECTOR
static vtkInformationInformationVectorKey * CELL_DATA_VECTOR()
vtkDataObject::ShallowCopy
virtual void ShallowCopy(vtkDataObject *src)
Shallow and Deep copy.
vtkDataObject::DATA_EXTENT_TYPE
static vtkInformationIntegerKey * DATA_EXTENT_TYPE()
vtkDataObject::DATA_EXTENT
static vtkInformationIntegerPointerKey * DATA_EXTENT()
vtkDataObject::AttributeTypes
AttributeTypes
Possible attribute types.
Definition: vtkDataObject.h:274
vtkDataObject::GetData
static vtkDataObject * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkDataObject::FIELD_OPERATION_PRESERVED
@ FIELD_OPERATION_PRESERVED
Definition: vtkDataObject.h:327
vtkDataObject::New
static vtkDataObject * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302