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 "vtkObject.h"
44 
45 class vtkAbstractArray;
46 class vtkAlgorithmOutput;
48 class vtkExecutive;
49 class vtkFieldData;
50 class vtkInformation;
51 class vtkProcessObject;
52 class vtkSource;
53 class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
65 
66 #define VTK_PIECES_EXTENT 0
67 #define VTK_3D_EXTENT 1
68 #define VTK_TIME_EXTENT 2
69 
71 {
72 public:
73  static vtkDataObject *New();
74 
75  vtkTypeMacro(vtkDataObject,vtkObject);
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
79 
80  vtkGetObjectMacro(Source,vtkSource);
81  void SetSource(vtkSource *s);
83 
85 
86  vtkGetObjectMacro(Information, vtkInformation);
87  virtual void SetInformation(vtkInformation*);
89 
91 
92  vtkGetObjectMacro(PipelineInformation, vtkInformation);
93  virtual void SetPipelineInformation(vtkInformation*);
95 
97  virtual vtkAlgorithmOutput* GetProducerPort();
98 
101  unsigned long int GetMTime();
102 
104  virtual void Initialize();
105 
110  void ReleaseData();
111 
114  int ShouldIReleaseData();
115 
117 
118  vtkGetMacro(DataReleased,int);
120 
122 
124  void SetReleaseDataFlag(int);
125  int GetReleaseDataFlag();
126  vtkBooleanMacro(ReleaseDataFlag,int);
128 
130 
132  static void SetGlobalReleaseDataFlag(int val);
133  void GlobalReleaseDataFlagOn() {this->SetGlobalReleaseDataFlag(1);};
134  void GlobalReleaseDataFlagOff() {this->SetGlobalReleaseDataFlag(0);};
135  static int GetGlobalReleaseDataFlag();
137 
139 
140  virtual void SetFieldData(vtkFieldData*);
141  vtkGetObjectMacro(FieldData,vtkFieldData);
143 
144  // Handle the source/data loop.
145  virtual void Register(vtkObjectBase* o);
146  virtual void UnRegister(vtkObjectBase* o);
147 
153  virtual void Update();
154 
160  virtual void UpdateInformation();
161 
166  virtual void PropagateUpdateExtent();
167 
173  virtual void TriggerAsynchronousUpdate();
174 
181  virtual void UpdateData();
182 
188  virtual unsigned long GetEstimatedMemorySize();
189 
191 
194  virtual void SetUpdateExtent(int piece,int numPieces, int ghostLevel);
195  void SetUpdateExtent(int piece, int numPieces)
196  {this->SetUpdateExtent(piece, numPieces, 0);}
198 
200 
207  virtual void SetUpdateExtent(int x0, int x1, int y0, int y1, int z0, int z1);
208  virtual void SetUpdateExtent(int extent[6]);
209  virtual int* GetUpdateExtent();
210  virtual void GetUpdateExtent(int& x0, int& x1, int& y0, int& y1,
211  int& z0, int& z1);
212  virtual void GetUpdateExtent(int extent[6]);
214 
219  virtual int GetDataObjectType() {return VTK_DATA_OBJECT;}
220 
223  unsigned long GetUpdateTime();
224 
229  void SetUpdateExtentToWholeExtent();
230 
233  unsigned long GetPipelineMTime();
234 
240  virtual unsigned long GetActualMemorySize();
241 
243  void CopyInformation( vtkDataObject *data );
244 
246 
248  {this->CopyInformation( data );};
250 
252 
254  void SetUpdatePiece(int piece);
255  void SetUpdateNumberOfPieces(int num);
256  virtual int GetUpdatePiece();
257  virtual int GetUpdateNumberOfPieces();
259 
261 
263  void SetUpdateGhostLevel(int level);
264  virtual int GetUpdateGhostLevel();
266 
268 
273  virtual void SetRequestExactExtent(int flag);
274  virtual int GetRequestExactExtent();
275  vtkBooleanMacro(RequestExactExtent, int);
277 
279 
282  virtual void SetWholeExtent(int x0, int x1, int y0, int y1, int z0, int z1);
283  virtual void SetWholeExtent(int extent[6]);
284  virtual int* GetWholeExtent();
285  virtual void GetWholeExtent(int& x0, int& x1, int& y0, int& y1,
286  int& z0, int& z1);
287  virtual void GetWholeExtent(int extent[6]);
289 
291 
294  virtual void SetWholeBoundingBox(double x0, double x1, double y0,
295  double y1, double z0, double z1);
296  virtual void SetWholeBoundingBox(double bb[6]);
297  virtual double* GetWholeBoundingBox();
298  virtual void GetWholeBoundingBox(double& x0, double& x1, double& y0,
299  double& y1, double& z0, double& z1);
300  virtual void GetWholeBoundingBox(double extent[6]);
302 
304 
308  virtual void SetMaximumNumberOfPieces(int);
309  virtual int GetMaximumNumberOfPieces();
311 
313 
318  virtual void CopyInformationToPipeline(vtkInformation* request,
319  vtkInformation* input,
320  vtkInformation* output,
321  int forceCopy);
323 
325 
329  vtkInformation* input)
330  {
331  this->CopyInformationToPipeline(request, input, this->PipelineInformation, 0);
332  }
334 
337  virtual void CopyInformationFromPipeline(vtkInformation* request);
338 
340 
344  static vtkInformation *GetActiveFieldInformation(vtkInformation *info,
345  int fieldAssociation, int attributeType);
347 
349 
352  static vtkInformation *GetNamedFieldInformation(vtkInformation *info,
353  int fieldAssociation, const char *name);
355 
357 
358  static void RemoveNamedFieldInformation(vtkInformation *info,
359  int fieldAssociation,
360  const char *name);
362 
364 
369  static vtkInformation *SetActiveAttribute(vtkInformation *info,
370  int fieldAssociation, const char *attributeName, int attributeType);
372 
374 
381  static void SetActiveAttributeInfo(vtkInformation *info,
382  int fieldAssociation, int attributeType, const char *name, int arrayType,
383  int numComponents, int numTuples);
385 
387 
390  static void SetPointDataActiveScalarInfo(vtkInformation *info,
391  int arrayType, int numComponents);
393 
397  void DataHasBeenGenerated();
398 
402  virtual void PrepareForNewData() {this->Initialize();};
403 
405 
407  virtual void ShallowCopy(vtkDataObject *src);
408  virtual void DeepCopy(vtkDataObject *src);
410 
412 
413  void SetExtentTranslator(vtkExtentTranslator* translator);
414  vtkExtentTranslator* GetExtentTranslator();
416 
423  virtual int GetExtentType() { return VTK_PIECES_EXTENT; };
424 
427  virtual void Crop();
428 
429  //BTX
431 
433  {
441  NUMBER_OF_ASSOCIATIONS
442  };
443  //ETX
445 
446  //BTX
448 
451  {
459  NUMBER_OF_ATTRIBUTE_TYPES
460  };
461  //ETX
463 
472  virtual vtkDataSetAttributes* GetAttributes(int type);
473 
478  virtual vtkFieldData* GetAttributesAsFieldData(int type);
479 
483  virtual int GetAttributeTypeForArray(vtkAbstractArray* arr);
484 
487  virtual vtkIdType GetNumberOfElements(int type);
488 
489  //BTX
491 
493  {
497  FIELD_OPERATION_REMOVED
498  };
499  //ETX
501 
504  static const char* GetAssociationTypeAsString(int associationType);
505 
506  static vtkInformationStringKey* DATA_TYPE_NAME();
507  static vtkInformationDataObjectKey* DATA_OBJECT();
508  static vtkInformationIntegerKey* DATA_EXTENT_TYPE();
509  static vtkInformationIntegerPointerKey* DATA_EXTENT();
510  static vtkInformationIntegerKey* DATA_PIECE_NUMBER();
511  static vtkInformationIntegerKey* DATA_NUMBER_OF_PIECES();
512  static vtkInformationIntegerKey* DATA_NUMBER_OF_GHOST_LEVELS();
513  static vtkInformationDoubleKey* DATA_RESOLUTION();
514  static vtkInformationDoubleVectorKey* DATA_TIME_STEPS();
515  static vtkInformationInformationVectorKey* POINT_DATA_VECTOR();
516  static vtkInformationInformationVectorKey* CELL_DATA_VECTOR();
517  static vtkInformationInformationVectorKey* VERTEX_DATA_VECTOR();
518  static vtkInformationInformationVectorKey* EDGE_DATA_VECTOR();
519  static vtkInformationIntegerKey* FIELD_ARRAY_TYPE();
520  static vtkInformationIntegerKey* FIELD_ASSOCIATION();
521  static vtkInformationIntegerKey* FIELD_ATTRIBUTE_TYPE();
522  static vtkInformationIntegerKey* FIELD_ACTIVE_ATTRIBUTE();
523  static vtkInformationIntegerKey* FIELD_NUMBER_OF_COMPONENTS();
524  static vtkInformationIntegerKey* FIELD_NUMBER_OF_TUPLES();
525  static vtkInformationIntegerKey* FIELD_OPERATION();
526  static vtkInformationDoubleVectorKey* FIELD_RANGE();
527  static vtkInformationDoubleVectorKey* PIECE_FIELD_RANGE();
528  static vtkInformationStringKey* FIELD_ARRAY_NAME();
529  static vtkInformationIntegerVectorKey* PIECE_EXTENT();
530  static vtkInformationStringKey* FIELD_NAME();
531  static vtkInformationDoubleVectorKey* ORIGIN();
532  static vtkInformationDoubleVectorKey* SPACING();
533  static vtkInformationIntegerKey* DATA_GEOMETRY_UNMODIFIED();
534 
535  // Key used to put SIL information in the output information by readers.
536  static vtkInformationDataObjectKey* SIL();
537 
538  //BTX
540 
541  static vtkDataObject* GetData(vtkInformation* info);
542  static vtkDataObject* GetData(vtkInformationVector* v, int i=0);
543  //ETX
545 
546 protected:
547 
548  vtkDataObject();
549  ~vtkDataObject();
550 
551  // General field data associated with data object
553 
554  // Who generated this data as output?
556 
557  // Keep track of data release during network execution
559 
560  // When was this data last generated?
562 
563  // Get the executive that manages this data object.
564  vtkExecutive* GetExecutive();
565 
566  // Get the port number producing this data object.
567  int GetPortNumber();
568 
569  virtual void ReportReferences(vtkGarbageCollector*);
570 
571  // Arbitrary extra information associated with this data object.
573 
574  // Reference the pipeline information object that owns this data
575  // object.
577 
578  //BTX
579  // Check whether this data object is owned by a vtkStreamingDemandDrivenPipeline.
580  vtkStreamingDemandDrivenPipeline* TrySDDP(const char* method);
582  //ETX
583 
584  //BTX
585  friend class vtkStreamingDemandDrivenPipelineToDataObjectFriendship;
586  //ETX
587 
588  static const char AssociationNames[NUMBER_OF_ASSOCIATIONS][55];
589 
590 private:
591  // Helper method for the ShallowCopy and DeepCopy methods.
592  void InternalDataObjectCopy(vtkDataObject *src);
593 
594 private:
595  vtkDataObject(const vtkDataObject&); // Not implemented.
596  void operator=(const vtkDataObject&); // Not implemented.
597 };
598 
599 #endif
600 
vtkFieldData * FieldData
void GlobalReleaseDataFlagOn()
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void Register(vtkObjectBase *o)
vtkStreamingDemandDrivenPipeline SDDP
Store vtkAlgorithm input/output information.
#define VTK_FILTERING_EXPORT
void CopyInformationToPipeline(vtkInformation *request, vtkInformation *input)
Key for vtkDataObject values.
Abstract superclass for all arrays.
record modification and/or execution time
Definition: vtkTimeStamp.h:33
virtual void PrepareForNewData()
Generates a structured extent from unstructured.
void GlobalReleaseDataFlagOff()
int vtkIdType
Definition: vtkType.h:255
Superclass for all pipeline executives in VTK.
Definition: vtkExecutive.h:47
virtual int GetExtentType()
Key for string values in vtkInformation.
Detect and break reference loops.
Proxy object to connect input/output ports.
Key for double vector values.
virtual void PrintSelf(ostream &os, vtkIndent indent)
virtual void UnRegister(vtkObjectBase *o)
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void ReportReferences(vtkGarbageCollector *)
Key for integer values in vtkInformation.
#define VTK_PIECES_EXTENT
Definition: vtkDataObject.h:66
virtual void CopyTypeSpecificInformation(vtkDataObject *data)
represent and manipulate attribute data in a dataset
abstract base class for most VTK objects
Definition: vtkObjectBase.h:59
vtkInformation * PipelineInformation
abstract class specifies interface for visualization filters
void SetUpdateExtent(int piece, int numPieces)
vtkSource * Source
Key for double values in vtkInformation.
Store zero or more vtkInformation instances.
abstract class specifies interface for visualization network source
Definition: vtkSource.h:55
Executive supporting partial updates.
vtkTimeStamp UpdateTime
static vtkObject * New()
virtual int GetDataObjectType()
general representation of visualization data
Definition: vtkDataObject.h:70
vtkInformation * Information
represent and manipulate fields of data
Definition: vtkFieldData.h:58
#define VTK_DATA_OBJECT
Definition: vtkType.h:73