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 =========================================================================*/
34 #ifndef vtkDataObject_h
35 #define vtkDataObject_h
36 
37 #include "vtkCommonDataModelModule.h" // For export macro
38 #include "vtkObject.h"
39 
40 class vtkAbstractArray;
42 class vtkFieldData;
43 class vtkInformation;
53 
54 #define VTK_PIECES_EXTENT 0
55 #define VTK_3D_EXTENT 1
56 #define VTK_TIME_EXTENT 2
57 
58 class VTKCOMMONDATAMODEL_EXPORT vtkDataObject : public vtkObject
59 {
60 public:
61  static vtkDataObject *New();
62 
63  vtkTypeMacro(vtkDataObject,vtkObject);
64  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
65 
67 
70  vtkGetObjectMacro(Information, vtkInformation);
71  virtual void SetInformation(vtkInformation*);
73 
78  vtkMTimeType GetMTime() VTK_OVERRIDE;
79 
83  virtual void Initialize();
84 
90  void ReleaseData();
91 
93 
96  vtkGetMacro(DataReleased,int);
98 
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 
147  {}
148 
154  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
155 
162  static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
163  int fieldAssociation, int attributeType);
164 
170  static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
171  int fieldAssociation, const char *name);
172 
176  static void RemoveNamedFieldInformation(vtkInformation *info,
177  int fieldAssociation,
178  const char *name);
179 
186  static vtkInformation *SetActiveAttribute(vtkInformation *info,
187  int fieldAssociation, const char *attributeName, int attributeType);
188 
198  static void SetActiveAttributeInfo(vtkInformation *info,
199  int fieldAssociation, int attributeType, const char *name, int arrayType,
200  int numComponents, int numTuples);
201 
206  static void SetPointDataActiveScalarInfo(vtkInformation *info,
207  int arrayType, int numComponents);
208 
214  void DataHasBeenGenerated();
215 
221  virtual void PrepareForNewData() {this->Initialize();};
222 
224 
228  virtual void ShallowCopy(vtkDataObject *src);
229  virtual void DeepCopy(vtkDataObject *src);
231 
240  virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
241 
246  virtual void Crop(const int* updateExtent);
247 
252  {
260  NUMBER_OF_ASSOCIATIONS
261  };
262 
268  {
276  NUMBER_OF_ATTRIBUTE_TYPES
277  };
278 
294  virtual vtkDataSetAttributes* GetAttributes(int type);
295 
302  virtual vtkFieldData* GetAttributesAsFieldData(int type);
303 
309  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
310 
314  virtual vtkIdType GetNumberOfElements(int type);
315 
320  {
324  FIELD_OPERATION_REMOVED
325  };
326 
331  static const char* GetAssociationTypeAsString(int associationType);
332 
337  static int GetAssociationTypeFromString(const char* associationType);
338 
339  // \ingroup InformationKeys
340  static vtkInformationStringKey* DATA_TYPE_NAME();
341  // \ingroup InformationKeys
342  static vtkInformationDataObjectKey* DATA_OBJECT();
343  // \ingroup InformationKeys
344  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
345  // \ingroup InformationKeys
346  static vtkInformationIntegerPointerKey* DATA_EXTENT();
347  // \ingroup InformationKeys
348  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
349  // \ingroup InformationKeys
350  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
351  // \ingroup InformationKeys
352  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
353  // \ingroup InformationKeys
354  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
355  // \ingroup InformationKeys
356  static vtkInformationDoubleKey* DATA_TIME_STEP();
357  // \ingroup InformationKeys
358  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
359  // \ingroup InformationKeys
360  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
361  // \ingroup InformationKeys
362  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
363  // \ingroup InformationKeys
364  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
365  // \ingroup InformationKeys
366  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
367  // \ingroup InformationKeys
368  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
369  // \ingroup InformationKeys
370  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
371  // \ingroup InformationKeys
372  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
373  // \ingroup InformationKeys
374  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
375  // \ingroup InformationKeys
376  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
377  // \ingroup InformationKeys
378  static vtkInformationIntegerKey* FIELD_OPERATION();
379  // \ingroup InformationKeys
380  static vtkInformationDoubleVectorKey* FIELD_RANGE();
381  // \ingroup InformationKeys
382  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
383  // \ingroup InformationKeys
384  static vtkInformationStringKey* FIELD_NAME();
385  // \ingroup InformationKeys
386  static vtkInformationDoubleVectorKey* ORIGIN();
387  // \ingroup InformationKeys
388  static vtkInformationDoubleVectorKey* SPACING();
389  // \ingroup InformationKeys
390  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
391 
392  // Key used to put SIL information in the output information by readers.
393  // \ingroup InformationKeys
394  static vtkInformationDataObjectKey* SIL();
395 
397 
400  static vtkDataObject* GetData(vtkInformation* info);
401  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
403 
404 protected:
405 
406  vtkDataObject();
407  ~vtkDataObject() VTK_OVERRIDE;
408 
409  // General field data associated with data object
410  vtkFieldData *FieldData;
411 
412  // Keep track of data release during network execution
413  int DataReleased;
414 
415  // When was this data last generated?
416  vtkTimeStamp UpdateTime;
417 
418  // Arbitrary extra information associated with this data object.
419  vtkInformation* Information;
420 
421 private:
422  // Helper method for the ShallowCopy and DeepCopy methods.
423  void InternalDataObjectCopy(vtkDataObject *src);
424 
425 private:
426  vtkDataObject(const vtkDataObject&) VTK_DELETE_FUNCTION;
427  void operator=(const vtkDataObject&) VTK_DELETE_FUNCTION;
428 };
429 
430 #endif
431 
abstract base class for most VTK objects
Definition: vtkObject.h:53
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:300
Key for vtkDataObject values.
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:32
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:345
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:33
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:54
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:58
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:53
#define VTK_DATA_OBJECT
Definition: vtkType.h:98