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) VTK_OVERRIDE;
71 
73 
76  vtkGetObjectMacro(Information, vtkInformation);
77  virtual void SetInformation(vtkInformation*);
79 
84  vtkMTimeType GetMTime() VTK_OVERRIDE;
85 
89  virtual void Initialize();
90 
97  void ReleaseData();
98 
100 
103  vtkGetMacro(DataReleased,int);
105 
106 
108 
112  static void SetGlobalReleaseDataFlag(int val);
113  void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
114  void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
115  static int GetGlobalReleaseDataFlag();
117 
119 
122  virtual void SetFieldData(vtkFieldData*);
123  vtkGetObjectMacro(FieldData,vtkFieldData);
125 
132  virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
133 
138  vtkMTimeType GetUpdateTime();
139 
147  virtual unsigned long GetActualMemorySize();
148 
154  {}
155 
161  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
162 
169  static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
170  int fieldAssociation, int attributeType);
171 
177  static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
178  int fieldAssociation, const char *name);
179 
183  static void RemoveNamedFieldInformation(vtkInformation *info,
184  int fieldAssociation,
185  const char *name);
186 
193  static vtkInformation *SetActiveAttribute(vtkInformation *info,
194  int fieldAssociation, const char *attributeName, int attributeType);
195 
205  static void SetActiveAttributeInfo(vtkInformation *info,
206  int fieldAssociation, int attributeType, const char *name, int arrayType,
207  int numComponents, int numTuples);
208 
213  static void SetPointDataActiveScalarInfo(vtkInformation *info,
214  int arrayType, int numComponents);
215 
221  void DataHasBeenGenerated();
222 
228  virtual void PrepareForNewData() {this->Initialize();};
229 
231 
235  virtual void ShallowCopy(vtkDataObject *src);
236  virtual void DeepCopy(vtkDataObject *src);
238 
247  virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
248 
253  virtual void Crop(const int* updateExtent);
254 
259  {
267  NUMBER_OF_ASSOCIATIONS
268  };
269 
275  {
283  NUMBER_OF_ATTRIBUTE_TYPES
284  };
285 
301  virtual vtkDataSetAttributes* GetAttributes(int type);
302 
309  virtual vtkFieldData* GetAttributesAsFieldData(int type);
310 
316  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
317 
321  virtual vtkIdType GetNumberOfElements(int type);
322 
327  {
331  FIELD_OPERATION_REMOVED
332  };
333 
338  static const char* GetAssociationTypeAsString(int associationType);
339 
344  static int GetAssociationTypeFromString(const char* associationType);
345 
346  // \ingroup InformationKeys
347  static vtkInformationStringKey* DATA_TYPE_NAME();
348  // \ingroup InformationKeys
349  static vtkInformationDataObjectKey* DATA_OBJECT();
350  // \ingroup InformationKeys
351  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
352  // \ingroup InformationKeys
353  static vtkInformationIntegerPointerKey* DATA_EXTENT();
354  // \ingroup InformationKeys
355  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
356  // \ingroup InformationKeys
357  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
358  // \ingroup InformationKeys
359  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
360  // \ingroup InformationKeys
361  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
362  // \ingroup InformationKeys
363  static vtkInformationDoubleKey* DATA_TIME_STEP();
364  // \ingroup InformationKeys
365  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
366  // \ingroup InformationKeys
367  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
368  // \ingroup InformationKeys
369  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
370  // \ingroup InformationKeys
371  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
372  // \ingroup InformationKeys
373  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
374  // \ingroup InformationKeys
375  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
376  // \ingroup InformationKeys
377  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
378  // \ingroup InformationKeys
379  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
380  // \ingroup InformationKeys
381  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
382  // \ingroup InformationKeys
383  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
384  // \ingroup InformationKeys
385  static vtkInformationIntegerKey* FIELD_OPERATION();
386  // \ingroup InformationKeys
387  static vtkInformationDoubleVectorKey* FIELD_RANGE();
388  // \ingroup InformationKeys
389  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
390  // \ingroup InformationKeys
391  static vtkInformationStringKey* FIELD_NAME();
392  // \ingroup InformationKeys
393  static vtkInformationDoubleVectorKey* ORIGIN();
394  // \ingroup InformationKeys
395  static vtkInformationDoubleVectorKey* SPACING();
396  // \ingroup InformationKeys
397  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
398 
399  // Key used to put SIL information in the output information by readers.
400  // \ingroup InformationKeys
401  static vtkInformationDataObjectKey* SIL();
402 
404 
407  static vtkDataObject* GetData(vtkInformation* info);
408  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
410 
411 protected:
412 
413  vtkDataObject();
414  ~vtkDataObject() VTK_OVERRIDE;
415 
416  // General field data associated with data object
417  vtkFieldData *FieldData;
418 
419  // Keep track of data release during network execution
420  int DataReleased;
421 
422  // When was this data last generated?
423  vtkTimeStamp UpdateTime;
424 
425  // Arbitrary extra information associated with this data object.
426  vtkInformation* Information;
427 
428 private:
429  // Helper method for the ShallowCopy and DeepCopy methods.
430  void InternalDataObjectCopy(vtkDataObject *src);
431 
432 private:
433  vtkDataObject(const vtkDataObject&) VTK_DELETE_FUNCTION;
434  void operator=(const vtkDataObject&) VTK_DELETE_FUNCTION;
435 };
436 
437 #endif
438 
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.
Key for vtkDataObject values.
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:35
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
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:287
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.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
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.
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.
represent and manipulate fields of data
Definition: vtkFieldData.h:56
#define VTK_DATA_OBJECT
Definition: vtkType.h:94