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 
65 {
66 public:
67  static vtkDataObject *New();
68 
69  vtkTypeMacro(vtkDataObject,vtkObject);
70  void PrintSelf(ostream& os, vtkIndent indent);
71 
73 
74  vtkGetObjectMacro(Information, vtkInformation);
75  virtual void SetInformation(vtkInformation*);
77 
80  unsigned long int GetMTime();
81 
83  virtual void Initialize();
84 
89  void ReleaseData();
90 
92 
93  vtkGetMacro(DataReleased,int);
95 
96 
98 
100  static void SetGlobalReleaseDataFlag(int val);
101  void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
102  void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
103  static int GetGlobalReleaseDataFlag();
105 
107 
108  virtual void SetFieldData(vtkFieldData*);
109  vtkGetObjectMacro(FieldData,vtkFieldData);
111 
116  virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
117 
120  unsigned long GetUpdateTime();
121 
127  virtual unsigned long GetActualMemorySize();
128 
130 
133  {}
135 
139  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
140 
142 
146  static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
147  int fieldAssociation, int attributeType);
149 
151 
154  static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
155  int fieldAssociation, const char *name);
157 
159 
160  static void RemoveNamedFieldInformation(vtkInformation *info,
161  int fieldAssociation,
162  const char *name);
164 
166 
171  static vtkInformation *SetActiveAttribute(vtkInformation *info,
172  int fieldAssociation, const char *attributeName, int attributeType);
174 
176 
183  static void SetActiveAttributeInfo(vtkInformation *info,
184  int fieldAssociation, int attributeType, const char *name, int arrayType,
185  int numComponents, int numTuples);
187 
189 
192  static void SetPointDataActiveScalarInfo(vtkInformation *info,
193  int arrayType, int numComponents);
195 
199  void DataHasBeenGenerated();
200 
204  virtual void PrepareForNewData() {this->Initialize();};
205 
207 
209  virtual void ShallowCopy(vtkDataObject *src);
210  virtual void DeepCopy(vtkDataObject *src);
212 
219  virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
220 
223  virtual void Crop(const int* updateExtent);
224 
225  //BTX
227 
229  {
237  NUMBER_OF_ASSOCIATIONS
238  };
239  //ETX
241 
242  //BTX
244 
247  {
255  NUMBER_OF_ATTRIBUTE_TYPES
256  };
257  //ETX
259 
268  virtual vtkDataSetAttributes* GetAttributes(int type);
269 
274  virtual vtkFieldData* GetAttributesAsFieldData(int type);
275 
279  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
280 
283  virtual vtkIdType GetNumberOfElements(int type);
284 
285  //BTX
287 
289  {
293  FIELD_OPERATION_REMOVED
294  };
295  //ETX
297 
300  static const char* GetAssociationTypeAsString(int associationType);
301 
304  static int GetAssociationTypeFromString(const char* associationType);
305 
306  // \ingroup InformationKeys
307  static vtkInformationStringKey* DATA_TYPE_NAME();
308  // \ingroup InformationKeys
309  static vtkInformationDataObjectKey* DATA_OBJECT();
310  // \ingroup InformationKeys
311  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
312  // \ingroup InformationKeys
313  static vtkInformationIntegerPointerKey* DATA_EXTENT();
314  // \ingroup InformationKeys
315  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
316  // \ingroup InformationKeys
317  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
318  // \ingroup InformationKeys
319  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
320  // \ingroup InformationKeys
321  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
322  // \ingroup InformationKeys
323  static vtkInformationDoubleKey* DATA_TIME_STEP();
324  // \ingroup InformationKeys
325  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
326  // \ingroup InformationKeys
327  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
328  // \ingroup InformationKeys
329  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
330  // \ingroup InformationKeys
331  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
332  // \ingroup InformationKeys
333  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
334  // \ingroup InformationKeys
335  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
336  // \ingroup InformationKeys
337  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
338  // \ingroup InformationKeys
339  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
340  // \ingroup InformationKeys
341  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
342  // \ingroup InformationKeys
343  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
344  // \ingroup InformationKeys
345  static vtkInformationIntegerKey* FIELD_OPERATION();
346  // \ingroup InformationKeys
347  static vtkInformationDoubleVectorKey* FIELD_RANGE();
348  // \ingroup InformationKeys
349  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
350  // \ingroup InformationKeys
351  static vtkInformationStringKey* FIELD_NAME();
352  // \ingroup InformationKeys
353  static vtkInformationDoubleVectorKey* ORIGIN();
354  // \ingroup InformationKeys
355  static vtkInformationDoubleVectorKey* SPACING();
356  // \ingroup InformationKeys
357  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
358 
359  // Key used to put SIL information in the output information by readers.
360  // \ingroup InformationKeys
361  static vtkInformationDataObjectKey* SIL();
362 
363  //BTX
365 
366  static vtkDataObject* GetData(vtkInformation* info);
367  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
368  //ETX
370 
371 protected:
372 
373  vtkDataObject();
374  ~vtkDataObject();
375 
376  // General field data associated with data object
378 
379  // Keep track of data release during network execution
381 
382  // When was this data last generated?
384 
385  // Arbitrary extra information associated with this data object.
387 
388 private:
389  // Helper method for the ShallowCopy and DeepCopy methods.
390  void InternalDataObjectCopy(vtkDataObject *src);
391 
392 private:
393  vtkDataObject(const vtkDataObject&); // Not implemented.
394  void operator=(const vtkDataObject&); // Not implemented.
395 };
396 
397 #endif
398 
vtkFieldData * FieldData
void GlobalReleaseDataFlagOn()
abstract base class for most VTK objects
Definition: vtkObject.h:61
Store vtkAlgorithm input/output information.
Key for vtkDataObject values.
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:34
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
virtual void PrepareForNewData()
void GlobalReleaseDataFlagOff()
int vtkIdType
Definition: vtkType.h:275
virtual int GetExtentType()
Key for string values in vtkInformation.
Key for double vector values.
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
Key for integer values in vtkInformation.
virtual void CopyInformationFromPipeline(vtkInformation *vtkNotUsed(info))
#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()
virtual int GetDataObjectType()
general representation of visualization data
Definition: vtkDataObject.h:64
virtual void CopyInformationToPipeline(vtkInformation *vtkNotUsed(info))
#define VTKCOMMONDATAMODEL_EXPORT
vtkInformation * Information
represent and manipulate fields of data
Definition: vtkFieldData.h:55
#define VTK_DATA_OBJECT
Definition: vtkType.h:73