VTK  9.7.1
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
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 
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkAbstractArray;
38 class vtkFieldData;
39 class vtkInformation;
50 
51 #define VTK_PIECES_EXTENT 0
52 #define VTK_3D_EXTENT 1
53 #define VTK_TIME_EXTENT 2
54 
55 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkDataObject : public vtkObject
56 {
57 public:
58  static vtkDataObject* New();
59 
60  vtkTypeMacro(vtkDataObject, vtkObject);
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
67  vtkGetObjectMacro(Information, vtkInformation);
68  virtual void SetInformation(vtkInformation*);
70 
75  vtkMTimeType GetMTime() override;
76 
80  virtual void Initialize();
81 
87  void ReleaseData();
88 
90 
93  vtkGetMacro(DataReleased, vtkTypeBool);
95 
97 
101  static void SetGlobalReleaseDataFlag(vtkTypeBool val);
104  static vtkTypeBool GetGlobalReleaseDataFlag();
106 
108 
111  virtual void SetFieldData(vtkFieldData*);
112  vtkGetObjectMacro(FieldData, vtkFieldData);
114 
121  virtual int GetDataObjectType() VTK_FUTURE_CONST { return VTK_DATA_OBJECT; }
122 
127  vtkMTimeType GetUpdateTime();
128 
136  virtual unsigned long GetActualMemorySize();
137 
142  virtual void CopyInformationFromPipeline(vtkInformation* vtkNotUsed(info)) {}
143 
149  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
150 
157  static vtkInformation* GetActiveFieldInformation(
158  vtkInformation* info, int fieldAssociation, int attributeType);
159 
165  static vtkInformation* GetNamedFieldInformation(
166  vtkInformation* info, int fieldAssociation, const char* name);
167 
171  static void RemoveNamedFieldInformation(
172  vtkInformation* info, int fieldAssociation, const char* name);
173 
180  static vtkInformation* SetActiveAttribute(
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 
206  void DataHasBeenGenerated();
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 
253  {
261  NUMBER_OF_ASSOCIATIONS
262  };
263 
269  {
277  NUMBER_OF_ATTRIBUTE_TYPES
278  };
279 
299  virtual vtkDataSetAttributes* GetAttributes(int type);
300 
312  virtual vtkUnsignedCharArray* GetGhostArray(int type);
313 
326  virtual bool SupportsGhostArray(int type);
327 
334  virtual vtkFieldData* GetAttributesAsFieldData(int type);
335 
341  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
342 
346  virtual vtkIdType GetNumberOfElements(int type);
347 
352  {
356  FIELD_OPERATION_REMOVED
357  };
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 
382 
386  static vtkInformationStringKey* DATA_TYPE_NAME();
390  static vtkInformationDataObjectKey* DATA_OBJECT();
391 
398  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
399 
400  static vtkInformationIntegerPointerKey* DATA_EXTENT();
401  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
402  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
403  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
404  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
405  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
409  static vtkInformationDoubleKey* DATA_TIME_STEP();
414  static vtkInformationDoubleVectorKey* ORIGIN();
418  static vtkInformationDoubleVectorKey* SPACING();
422  static vtkInformationDoubleVectorKey* DIRECTION();
426  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
428 
433  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
435  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
436  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
437  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
438  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
439  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
448  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_COMPONENT();
449  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
450  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
451  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
452  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
456  static vtkInformationIntegerKey* FIELD_OPERATION();
460  static vtkInformationDoubleVectorKey* FIELD_RANGE();
461  static vtkInformationStringKey* FIELD_NAME();
463 
468  static vtkInformationDataObjectKey* SIL();
469 
471 
475  static vtkDataObject* GetData(vtkInformationVector* v, int i = 0);
477 
478 protected:
479  vtkDataObject();
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 
494 private:
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 
502 VTK_ABI_NAMESPACE_END
503 #endif
vtkFieldData * FieldData
void GlobalReleaseDataFlagOn()
Turn on/off flag to control whether every object releases its data after being used by a filter...
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
Key for vtkDataObject values.
Abstract superclass for all arrays.
virtual int GetExtentType() VTK_FUTURE_CONST
The ExtentType will be left as VTK_PIECES_EXTENT for data objects such as vtkPolyData and vtkUnstruct...
record modification and/or execution time
Definition: vtkTimeStamp.h:24
virtual void CopyInformationFromPipeline(vtkInformation *info)
Copy from the pipeline information to the data object's own information.
virtual void PrepareForNewData()
make the output data ready for new data to be inserted.
FieldAssociations
Possible values for the FIELD_ASSOCIATION information entry.
void GlobalReleaseDataFlagOff()
Turn on/off flag to control whether every object releases its data after being used by a filter...
int vtkIdType
Definition: vtkType.h:363
Key for string values in vtkInformation.
int vtkTypeBool
Definition: vtkABI.h:64
Key for double vector values.
FieldOperations
Possible values for the FIELD_OPERATION information entry.
virtual int GetDataObjectType() VTK_FUTURE_CONST
Return class name of data type.
a simple class to control print indentation
Definition: vtkIndent.h:28
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
#define VTK_PIECES_EXTENT
Definition: vtkDataObject.h:51
represent and manipulate attribute data in a dataset
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
dynamic, self-adjusting array of unsigned char
virtual void CopyInformationToPipeline(vtkInformation *info)
Copy information from this data object to the pipeline information.
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
#define VTK_MARSHALAUTO
vtkTimeStamp UpdateTime
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkTypeBool DataReleased
general representation of visualization data
Definition: vtkDataObject.h:55
AttributeTypes
Possible attribute types.
static void SetGlobalReleaseDataFlag(vtkTypeBool val)
Turn on/off flag to control whether every object releases its data after being used by a filter...
vtkInformation * Information
Represents and manipulates a collection of data arrays.
Definition: vtkFieldData.h:51