VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
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  static vtkInformationStringKey* DATA_TYPE_NAME();
303  static vtkInformationDataObjectKey* DATA_OBJECT();
304  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
305  static vtkInformationIntegerPointerKey* DATA_EXTENT();
306  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
307  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
308  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
309  static vtkInformationDoubleKey* DATA_RESOLUTION();
310  static vtkInformationDoubleKey* DATA_TIME_STEP();
311  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
312  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
313  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
314  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
315  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
316  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
317  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
318  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
319  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
320  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
321  static vtkInformationIntegerKey* FIELD_OPERATION();
322  static vtkInformationDoubleVectorKey* FIELD_RANGE();
323  static vtkInformationDoubleVectorKey* PIECE_FIELD_RANGE();
324  static vtkInformationStringKey* FIELD_ARRAY_NAME();
325  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
326  static vtkInformationStringKey* FIELD_NAME();
327  static vtkInformationDoubleVectorKey* ORIGIN();
328  static vtkInformationDoubleVectorKey* SPACING();
329  static vtkInformationIntegerKey* DATA_GEOMETRY_UNMODIFIED();
330  static vtkInformationDoubleVectorKey* BOUNDING_BOX();
331 
332  // Key used to put SIL information in the output information by readers.
333  static vtkInformationDataObjectKey* SIL();
334 
335  //BTX
337 
338  static vtkDataObject* GetData(vtkInformation* info);
339  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
340  //ETX
342 
343 protected:
344 
345  vtkDataObject();
346  ~vtkDataObject();
347 
348  // General field data associated with data object
350 
351  // Keep track of data release during network execution
353 
354  // When was this data last generated?
356 
357  // Arbitrary extra information associated with this data object.
359 
360 private:
361  // Helper method for the ShallowCopy and DeepCopy methods.
362  void InternalDataObjectCopy(vtkDataObject *src);
363 
364 private:
365  vtkDataObject(const vtkDataObject&); // Not implemented.
366  void operator=(const vtkDataObject&); // Not implemented.
367 };
368 
369 #endif
370 
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.
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:268
virtual int GetExtentType()
Key for string values in vtkInformation.
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
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