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 
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 
134  {}
136 
138 
142  static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
143  int fieldAssociation, int attributeType);
145 
147 
150  static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
151  int fieldAssociation, const char *name);
153 
155 
156  static void RemoveNamedFieldInformation(vtkInformation *info,
157  int fieldAssociation,
158  const char *name);
160 
162 
167  static vtkInformation *SetActiveAttribute(vtkInformation *info,
168  int fieldAssociation, const char *attributeName, int attributeType);
170 
172 
179  static void SetActiveAttributeInfo(vtkInformation *info,
180  int fieldAssociation, int attributeType, const char *name, int arrayType,
181  int numComponents, int numTuples);
183 
185 
188  static void SetPointDataActiveScalarInfo(vtkInformation *info,
189  int arrayType, int numComponents);
191 
195  void DataHasBeenGenerated();
196 
200  virtual void PrepareForNewData() {this->Initialize();};
201 
203 
205  virtual void ShallowCopy(vtkDataObject *src);
206  virtual void DeepCopy(vtkDataObject *src);
208 
215  virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
216 
219  virtual void Crop(const int* updateExtent);
220 
221  //BTX
223 
225  {
233  NUMBER_OF_ASSOCIATIONS
234  };
235  //ETX
237 
238  //BTX
240 
243  {
251  NUMBER_OF_ATTRIBUTE_TYPES
252  };
253  //ETX
255 
264  virtual vtkDataSetAttributes* GetAttributes(int type);
265 
270  virtual vtkFieldData* GetAttributesAsFieldData(int type);
271 
275  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
276 
279  virtual vtkIdType GetNumberOfElements(int type);
280 
281  //BTX
283 
285  {
289  FIELD_OPERATION_REMOVED
290  };
291  //ETX
293 
296  static const char* GetAssociationTypeAsString(int associationType);
297 
300  static int GetAssociationTypeFromString(const char* associationType);
301 
302  // \ingroup InformationKeys
303  static vtkInformationStringKey* DATA_TYPE_NAME();
304  // \ingroup InformationKeys
305  static vtkInformationDataObjectKey* DATA_OBJECT();
306  // \ingroup InformationKeys
307  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
308  // \ingroup InformationKeys
309  static vtkInformationIntegerPointerKey* DATA_EXTENT();
310  // \ingroup InformationKeys
311  static vtkInformationIntegerVectorKey* ALL_PIECES_EXTENT();
312  // \ingroup InformationKeys
313  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
314  // \ingroup InformationKeys
315  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
316  // \ingroup InformationKeys
317  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
318  // \ingroup InformationKeys
319  static vtkInformationDoubleKey* DATA_TIME_STEP();
320  // \ingroup InformationKeys
321  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
322  // \ingroup InformationKeys
323  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
324  // \ingroup InformationKeys
325  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
326  // \ingroup InformationKeys
327  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
328  // \ingroup InformationKeys
329  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
330  // \ingroup InformationKeys
331  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
332  // \ingroup InformationKeys
333  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
334  // \ingroup InformationKeys
335  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
336  // \ingroup InformationKeys
337  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
338  // \ingroup InformationKeys
339  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
340  // \ingroup InformationKeys
341  static vtkInformationIntegerKey* FIELD_OPERATION();
342  // \ingroup InformationKeys
343  static vtkInformationDoubleVectorKey* FIELD_RANGE();
344  // \ingroup InformationKeys
345  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
346  // \ingroup InformationKeys
347  static vtkInformationStringKey* FIELD_NAME();
348  // \ingroup InformationKeys
349  static vtkInformationDoubleVectorKey* ORIGIN();
350  // \ingroup InformationKeys
351  static vtkInformationDoubleVectorKey* SPACING();
352  // \ingroup InformationKeys
353  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
354 
355  // Key used to put SIL information in the output information by readers.
356  // \ingroup InformationKeys
357  static vtkInformationDataObjectKey* SIL();
358 
359  //BTX
361 
362  static vtkDataObject* GetData(vtkInformation* info);
363  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
364  //ETX
366 
367 protected:
368 
369  vtkDataObject();
370  ~vtkDataObject();
371 
372  // General field data associated with data object
374 
375  // Keep track of data release during network execution
377 
378  // When was this data last generated?
380 
381  // Arbitrary extra information associated with this data object.
383 
384 private:
385  // Helper method for the ShallowCopy and DeepCopy methods.
386  void InternalDataObjectCopy(vtkDataObject *src);
387 
388 private:
389  vtkDataObject(const vtkDataObject&); // Not implemented.
390  void operator=(const vtkDataObject&); // Not implemented.
391 };
392 
393 #endif
394 
#define vtkNotUsed(x)
Definition: vtkSetGet.h:547
GLuint GLuint GLsizei GLenum type
Definition: vtkgl.h:11315
vtkFieldData * FieldData
void GlobalReleaseDataFlagOn()
abstract base class for most VTK objects
Definition: vtkObject.h:61
const GLdouble * v
Definition: vtkgl.h:11595
Store vtkAlgorithm input/output information.
Key for vtkDataObject values.
Abstract superclass for all arrays.
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
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:281
virtual int GetExtentType()
Key for string values in vtkInformation.
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:632
Key for double vector values.
GLenum src
Definition: vtkgl.h:12525
GLuint const GLchar * name
Definition: vtkgl.h:11983
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
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:222
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
#define VTKCOMMONDATAMODEL_EXPORT
vtkInformation * Information
represent and manipulate fields of data
Definition: vtkFieldData.h:55
#define VTK_DATA_OBJECT
Definition: vtkType.h:73
GLuint GLfloat * val
Definition: vtkgl.h:13789