VTK  9.0.20200807
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 =========================================================================*/
34 #ifndef vtkDataObject_h
35 #define vtkDataObject_h
36 
37 #include "vtkCommonDataModelModule.h" // For export macro
38 #include "vtkObject.h"
39 
40 class vtkAbstractArray;
41 class vtkDataArray;
43 class vtkFieldData;
44 class vtkInformation;
54 
55 #define VTK_PIECES_EXTENT 0
56 #define VTK_3D_EXTENT 1
57 #define VTK_TIME_EXTENT 2
58 
59 class VTKCOMMONDATAMODEL_EXPORT vtkDataObject : public vtkObject
60 {
61 public:
62  static vtkDataObject* New();
63 
64  vtkTypeMacro(vtkDataObject, vtkObject);
65  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
71  vtkGetObjectMacro(Information, vtkInformation);
72  virtual void SetInformation(vtkInformation*);
74 
79  vtkMTimeType GetMTime() override;
80 
84  virtual void Initialize();
85 
91  void ReleaseData();
92 
94 
97  vtkGetMacro(DataReleased, int);
99 
101 
105  static void SetGlobalReleaseDataFlag(int val);
106  void GlobalReleaseDataFlagOn() { this->SetGlobalReleaseDataFlag(1); }
107  void GlobalReleaseDataFlagOff() { this->SetGlobalReleaseDataFlag(0); }
108  static int GetGlobalReleaseDataFlag();
110 
112 
115  virtual void SetFieldData(vtkFieldData*);
116  vtkGetObjectMacro(FieldData, vtkFieldData);
118 
125  virtual int GetDataObjectType() { return VTK_DATA_OBJECT; }
126 
131  vtkMTimeType GetUpdateTime();
132 
140  virtual unsigned long GetActualMemorySize();
141 
146  virtual void CopyInformationFromPipeline(vtkInformation* vtkNotUsed(info)) {}
147 
153  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
154 
161  static vtkInformation* GetActiveFieldInformation(
162  vtkInformation* info, int fieldAssociation, int attributeType);
163 
169  static vtkInformation* GetNamedFieldInformation(
170  vtkInformation* info, int fieldAssociation, const char* name);
171 
175  static void RemoveNamedFieldInformation(
176  vtkInformation* info, int fieldAssociation, const char* name);
177 
184  static vtkInformation* SetActiveAttribute(
185  vtkInformation* info, int fieldAssociation, const char* attributeName, int attributeType);
186 
196  static void SetActiveAttributeInfo(vtkInformation* info, int fieldAssociation, int attributeType,
197  const char* name, int arrayType, int numComponents, int numTuples);
198 
203  static void SetPointDataActiveScalarInfo(vtkInformation* info, int arrayType, int numComponents);
204 
210  void DataHasBeenGenerated();
211 
217  virtual void PrepareForNewData() { this->Initialize(); }
218 
220 
224  virtual void ShallowCopy(vtkDataObject* src);
225  virtual void DeepCopy(vtkDataObject* src);
227 
236  virtual int GetExtentType() { return VTK_PIECES_EXTENT; }
237 
242  virtual void Crop(const int* updateExtent);
243 
248  {
256  NUMBER_OF_ASSOCIATIONS
257  };
258 
264  {
272  NUMBER_OF_ATTRIBUTE_TYPES
273  };
274 
294  virtual vtkDataSetAttributes* GetAttributes(int type);
295 
307  virtual vtkDataArray* GetGhostArray(int type);
308 
315  virtual vtkFieldData* GetAttributesAsFieldData(int type);
316 
322  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
323 
327  virtual vtkIdType GetNumberOfElements(int type);
328 
333  {
337  FIELD_OPERATION_REMOVED
338  };
339 
344  static const char* GetAssociationTypeAsString(int associationType);
345 
350  static int GetAssociationTypeFromString(const char* associationName);
351 
352  // \ingroup InformationKeys
353  static vtkInformationStringKey* DATA_TYPE_NAME();
354  // \ingroup InformationKeys
355  static vtkInformationDataObjectKey* DATA_OBJECT();
356  // \ingroup InformationKeys
357  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
358  // \ingroup InformationKeys
359  static vtkInformationIntegerPointerKey* DATA_EXTENT();
360  // \ingroup InformationKeys
361  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
362  // \ingroup InformationKeys
363  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
364  // \ingroup InformationKeys
365  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
366  // \ingroup InformationKeys
367  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
368  // \ingroup InformationKeys
369  static vtkInformationDoubleKey* DATA_TIME_STEP();
370  // \ingroup InformationKeys
371  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
372  // \ingroup InformationKeys
373  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
374  // \ingroup InformationKeys
375  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
376  // \ingroup InformationKeys
377  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
378  // \ingroup InformationKeys
379  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
380  // \ingroup InformationKeys
381  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
382  // \ingroup InformationKeys
383  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
384  // \ingroup InformationKeys
385  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
386  // \ingroup InformationKeys
387  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
388  // \ingroup InformationKeys
389  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
390  // \ingroup InformationKeys
391  static vtkInformationIntegerKey* FIELD_OPERATION();
392  // \ingroup InformationKeys
393  static vtkInformationDoubleVectorKey* FIELD_RANGE();
394  // \ingroup InformationKeys
395  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
396  // \ingroup InformationKeys
397  static vtkInformationStringKey* FIELD_NAME();
398  // \ingroup InformationKeys
399  static vtkInformationDoubleVectorKey* ORIGIN();
400  // \ingroup InformationKeys
401  static vtkInformationDoubleVectorKey* SPACING();
402  // \ingroup InformationKeys
403  static vtkInformationDoubleVectorKey* DIRECTION();
404  // \ingroup InformationKeys
405  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
406 
407  // Key used to put SIL information in the output information by readers.
408  // \ingroup InformationKeys
409  static vtkInformationDataObjectKey* SIL();
410 
412 
416  static vtkDataObject* GetData(vtkInformationVector* v, int i = 0);
418 
419 protected:
420  vtkDataObject();
421  ~vtkDataObject() override;
422 
423  // General field data associated with data object
425 
426  // Keep track of data release during network execution
428 
429  // When was this data last generated?
431 
432  // Arbitrary extra information associated with this data object.
434 
435 private:
436  // Helper method for the ShallowCopy and DeepCopy methods.
437  void InternalDataObjectCopy(vtkDataObject* src);
438 
439 private:
440  vtkDataObject(const vtkDataObject&) = delete;
441  void operator=(const vtkDataObject&) = delete;
442 };
443 
444 #endif
vtkDataObject::FIELD_ASSOCIATION_EDGES
Definition: vtkDataObject.h:254
vtkInformationStringKey
Key for string values in vtkInformation.
Definition: vtkInformationStringKey.h:33
vtkDataObject::POINT
Definition: vtkDataObject.h:265
vtkDataObject::CELL
Definition: vtkDataObject.h:266
VTK_DATA_OBJECT
#define VTK_DATA_OBJECT
Definition: vtkType.h:84
vtkDataObject::FieldData
vtkFieldData * FieldData
Definition: vtkDataObject.h:424
vtkIossUtilities::GetData
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.
vtkX3D::type
Definition: vtkX3D.h:522
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:53
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:32
vtkInformationDataObjectKey
Key for vtkDataObject values.
Definition: vtkInformationDataObjectKey.h:33
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkDataObject::CopyInformationFromPipeline
virtual void CopyInformationFromPipeline(vtkInformation *vtkNotUsed(info))
Copy from the pipeline information to the data object's own information.
Definition: vtkDataObject.h:146
vtkDataObject::Information
vtkInformation * Information
Definition: vtkDataObject.h:433
vtkDataObject::GetDataObjectType
virtual int GetDataObjectType()
Return class name of data type.
Definition: vtkDataObject.h:125
vtkDataObject::FIELD_ASSOCIATION_POINTS
Definition: vtkDataObject.h:249
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkDataObject::GlobalReleaseDataFlagOn
void GlobalReleaseDataFlagOn()
Definition: vtkDataObject.h:106
vtkInformationIntegerPointerKey
Key for pointer to integer.
Definition: vtkInformationIntegerPointerKey.h:31
vtkInformationDoubleKey
Key for double values in vtkInformation.
Definition: vtkInformationDoubleKey.h:31
vtkDataObject::POINT_THEN_CELL
Definition: vtkDataObject.h:268
vtkDataObject::FIELD_ASSOCIATION_NONE
Definition: vtkDataObject.h:251
vtkDataObject::FIELD_ASSOCIATION_VERTICES
Definition: vtkDataObject.h:253
vtkFieldData
represent and manipulate fields of data
Definition: vtkFieldData.h:53
vtkDataObject::GlobalReleaseDataFlagOff
void GlobalReleaseDataFlagOff()
Definition: vtkDataObject.h:107
vtkDataObject::FieldOperations
FieldOperations
Possible values for the FIELD_OPERATION information entry.
Definition: vtkDataObject.h:332
vtkDataObject::FIELD_OPERATION_MODIFIED
Definition: vtkDataObject.h:336
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkDataObject::FIELD_ASSOCIATION_CELLS
Definition: vtkDataObject.h:250
vtkDataObject::VERTEX
Definition: vtkDataObject.h:269
vtkInformationIntegerKey
Key for integer values in vtkInformation.
Definition: vtkInformationIntegerKey.h:31
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
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:236
vtkDataObject::PrepareForNewData
virtual void PrepareForNewData()
make the output data ready for new data to be inserted.
Definition: vtkDataObject.h:217
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataObject::UpdateTime
vtkTimeStamp UpdateTime
Definition: vtkDataObject.h:430
VTK_PIECES_EXTENT
#define VTK_PIECES_EXTENT
Definition: vtkDataObject.h:55
vtkDataObject::ROW
Definition: vtkDataObject.h:271
vtkX3D::name
Definition: vtkX3D.h:225
vtkObject.h
vtkDataObject::FIELD
Definition: vtkDataObject.h:267
vtkDataObject::CopyInformationToPipeline
virtual void CopyInformationToPipeline(vtkInformation *vtkNotUsed(info))
Copy information from this data object to the pipeline information.
Definition: vtkDataObject.h:153
vtkAbstractArray
Abstract superclass for all arrays.
Definition: vtkAbstractArray.h:75
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
Definition: vtkX3D.h:382
vtkDataObject::EDGE
Definition: vtkDataObject.h:270
vtkDataObject::DataReleased
int DataReleased
Definition: vtkDataObject.h:427
vtkInformationDoubleVectorKey
Key for double vector values.
Definition: vtkInformationDoubleVectorKey.h:31
vtkInformationInformationVectorKey
Key for vtkInformation vectors.
Definition: vtkInformationInformationVectorKey.h:33
vtkDataObject::FIELD_OPERATION_REINTERPOLATED
Definition: vtkDataObject.h:335
vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS
Definition: vtkDataObject.h:252
vtkDataObject::FieldAssociations
FieldAssociations
Possible values for the FIELD_ASSOCIATION information entry.
Definition: vtkDataObject.h:247
vtkInformationIntegerVectorKey
Key for integer vector values.
Definition: vtkInformationIntegerVectorKey.h:31
vtkDataObject::FIELD_ASSOCIATION_ROWS
Definition: vtkDataObject.h:255
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:59
vtkDataObject::AttributeTypes
AttributeTypes
Possible attribute types.
Definition: vtkDataObject.h:263
vtkDataObject::FIELD_OPERATION_PRESERVED
Definition: vtkDataObject.h:334
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:285