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);
77  virtual void SetInformation(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);};
114  static int GetGlobalReleaseDataFlag();
116 
118 
121  virtual void SetFieldData(vtkFieldData*);
122  vtkGetObjectMacro(FieldData,vtkFieldData);
124 
131  virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
132 
137  vtkMTimeType GetUpdateTime();
138 
146  virtual unsigned long GetActualMemorySize();
147 
153  {}
154 
160  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
161 
168  static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
169  int fieldAssociation, int attributeType);
170 
176  static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
177  int fieldAssociation, const char *name);
178 
182  static void RemoveNamedFieldInformation(vtkInformation *info,
183  int fieldAssociation,
184  const char *name);
185 
192  static vtkInformation *SetActiveAttribute(vtkInformation *info,
193  int fieldAssociation, const char *attributeName, int attributeType);
194 
204  static void SetActiveAttributeInfo(vtkInformation *info,
205  int fieldAssociation, int attributeType, const char *name, int arrayType,
206  int numComponents, int numTuples);
207 
212  static void SetPointDataActiveScalarInfo(vtkInformation *info,
213  int arrayType, int numComponents);
214 
220  void DataHasBeenGenerated();
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 
300  virtual vtkDataSetAttributes* GetAttributes(int type);
301 
308  virtual vtkFieldData* GetAttributesAsFieldData(int type);
309 
315  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
316 
320  virtual vtkIdType GetNumberOfElements(int type);
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
346  static vtkInformationStringKey* DATA_TYPE_NAME();
347  // \ingroup InformationKeys
348  static vtkInformationDataObjectKey* DATA_OBJECT();
349  // \ingroup InformationKeys
350  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
351  // \ingroup InformationKeys
352  static vtkInformationIntegerPointerKey* DATA_EXTENT();
353  // \ingroup InformationKeys
354  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
355  // \ingroup InformationKeys
356  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
357  // \ingroup InformationKeys
358  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
359  // \ingroup InformationKeys
360  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
361  // \ingroup InformationKeys
362  static vtkInformationDoubleKey* DATA_TIME_STEP();
363  // \ingroup InformationKeys
364  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
365  // \ingroup InformationKeys
366  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
367  // \ingroup InformationKeys
368  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
369  // \ingroup InformationKeys
370  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
371  // \ingroup InformationKeys
372  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
373  // \ingroup InformationKeys
374  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
375  // \ingroup InformationKeys
376  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
377  // \ingroup InformationKeys
378  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
379  // \ingroup InformationKeys
380  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
381  // \ingroup InformationKeys
382  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
383  // \ingroup InformationKeys
384  static vtkInformationIntegerKey* FIELD_OPERATION();
385  // \ingroup InformationKeys
386  static vtkInformationDoubleVectorKey* FIELD_RANGE();
387  // \ingroup InformationKeys
388  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
389  // \ingroup InformationKeys
390  static vtkInformationStringKey* FIELD_NAME();
391  // \ingroup InformationKeys
392  static vtkInformationDoubleVectorKey* ORIGIN();
393  // \ingroup InformationKeys
394  static vtkInformationDoubleVectorKey* SPACING();
395  // \ingroup InformationKeys
396  static vtkInformationDoubleVectorKey* DIRECTION();
397  // \ingroup InformationKeys
398  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
399 
400  // Key used to put SIL information in the output information by readers.
401  // \ingroup InformationKeys
402  static vtkInformationDataObjectKey* SIL();
403 
405 
408  static vtkDataObject* GetData(vtkInformation* info);
409  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
411 
412 protected:
413 
414  vtkDataObject();
415  ~vtkDataObject() override;
416 
417  // General field data associated with data object
419 
420  // Keep track of data release during network execution
422 
423  // When was this data last generated?
425 
426  // Arbitrary extra information associated with this data object.
428 
429 private:
430  // Helper method for the ShallowCopy and DeepCopy methods.
431  void InternalDataObjectCopy(vtkDataObject *src);
432 
433 private:
434  vtkDataObject(const vtkDataObject&) = delete;
435  void operator=(const vtkDataObject&) = delete;
436 };
437 
438 #endif
439 
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:59
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:304
Key for vtkDataObject values.
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
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:349
virtual int GetExtentType()
The ExtentType will be left as VTK_PIECES_EXTENT for data objects such as vtkPolyData and vtkUnstruct...
Key for string values in vtkInformation.
Key for double vector values.
FieldOperations
Possible values for the FIELD_OPERATION information entry.
a simple class to control print indentation
Definition: vtkIndent.h:39
Key for integer values in vtkInformation.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
virtual void CopyInformationFromPipeline(vtkInformation *vtkNotUsed(info))
Copy from the pipeline information to the data object's own information.
#define VTK_PIECES_EXTENT
Definition: vtkDataObject.h:60
represent and manipulate attribute data in a dataset
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
vtkTimeStamp UpdateTime
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual int GetDataObjectType()
Return class name of data type.
general representation of visualization data
Definition: vtkDataObject.h:64
AttributeTypes
Possible attribute types.
virtual void CopyInformationToPipeline(vtkInformation *vtkNotUsed(info))
Copy information from this data object to the pipeline information.
vtkInformation * Information
represent and manipulate fields of data
Definition: vtkFieldData.h:56
#define VTK_DATA_OBJECT
Definition: vtkType.h:98