VTK
vtkImageExport.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageExport.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 vtkImageExport_h
35 #define vtkImageExport_h
36 
37 #include "vtkIOImageModule.h" // For export macro
38 #include "vtkImageAlgorithm.h"
39 
41 {
42 public:
43  static vtkImageExport *New();
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
48  vtkIdType GetDataMemorySize();
49 
51 
53  void GetDataDimensions(int *ptr);
55  this->GetDataDimensions(this->DataDimensions);
56  return this->DataDimensions; }
58 
62  int GetDataNumberOfScalarComponents();
63 
65 
67  int GetDataScalarType();
68  const char *GetDataScalarTypeAsString() {
69  return vtkImageScalarTypeNameMacro(this->GetDataScalarType()); }
71 
73 
74  int *GetDataExtent();
75  void GetDataExtent(int *ptr);
76  double *GetDataSpacing();
77  void GetDataSpacing(double *ptr);
78  double *GetDataOrigin();
79  void GetDataOrigin(double *ptr);
81 
82 //BTX
84 
86 //ETX
88 
90 
95  vtkBooleanMacro(ImageLowerLeft, int);
96  vtkGetMacro(ImageLowerLeft, int);
97  vtkSetMacro(ImageLowerLeft, int);
99 
101 
104  void SetExportVoidPointer(void *);
105  void *GetExportVoidPointer() { return this->ExportVoidPointer; };
107 
109 
112  void Export() { this->Export(this->ExportVoidPointer); };
113  virtual void Export(void *);
115 
120  void *GetPointerToData();
121 
123  void* GetCallbackUserData();
124 
125  //BTX
127 
129  typedef void (*UpdateInformationCallbackType)(void*);
130  typedef int (*PipelineModifiedCallbackType)(void*);
131  typedef int* (*WholeExtentCallbackType)(void*);
132  typedef double* (*SpacingCallbackType)(void*);
133  typedef double* (*OriginCallbackType)(void*);
134  typedef const char* (*ScalarTypeCallbackType)(void*);
135  typedef int (*NumberOfComponentsCallbackType)(void*);
136  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
137  typedef void (*UpdateDataCallbackType)(void*);
138  typedef int* (*DataExtentCallbackType)(void*);
139  typedef void* (*BufferPointerCallbackType)(void*);
141 
143 
144  UpdateInformationCallbackType GetUpdateInformationCallback() const;
145  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
146  WholeExtentCallbackType GetWholeExtentCallback() const;
147  SpacingCallbackType GetSpacingCallback() const;
148  OriginCallbackType GetOriginCallback() const;
149  ScalarTypeCallbackType GetScalarTypeCallback() const;
150  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
151  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
152  UpdateDataCallbackType GetUpdateDataCallback() const;
153  DataExtentCallbackType GetDataExtentCallback() const;
154  BufferPointerCallbackType GetBufferPointerCallback() const;
155  //ETX
157 
158 protected:
159  vtkImageExport();
160  ~vtkImageExport();
161 
162  // This is called by the superclass.
163  virtual int RequestData(vtkInformation *request,
164  vtkInformationVector** inputVector,
165  vtkInformationVector* outputVector);
166 
167  virtual void UpdateInformationCallback();
168  virtual int PipelineModifiedCallback();
169  virtual void UpdateDataCallback();
170  virtual int* WholeExtentCallback();
171  virtual double* SpacingCallback();
172  virtual double* OriginCallback();
173  virtual const char* ScalarTypeCallback();
174  virtual int NumberOfComponentsCallback();
175  virtual void PropagateUpdateExtentCallback(int*);
176  virtual int* DataExtentCallback();
177  virtual void* BufferPointerCallback();
178 
180  int DataDimensions[3];
182 
183  unsigned long LastPipelineMTime;
184 
185 private:
186  vtkImageExport(const vtkImageExport&); // Not implemented.
187  void operator=(const vtkImageExport&); // Not implemented.
188 
189  static void UpdateInformationCallbackFunction(void*);
190  static int PipelineModifiedCallbackFunction(void*);
191  static int* WholeExtentCallbackFunction(void*);
192  static double* SpacingCallbackFunction(void*);
193  static double* OriginCallbackFunction(void*);
194  static const char* ScalarTypeCallbackFunction(void*);
195  static int NumberOfComponentsCallbackFunction(void*);
196  static void PropagateUpdateExtentCallbackFunction(void*, int*);
197  static void UpdateDataCallbackFunction(void*);
198  static int* DataExtentCallbackFunction(void*);
199  static void* BufferPointerCallbackFunction(void*);
200 
203 };
204 
205 #endif
206 
207 
Store vtkAlgorithm input/output information.
vtkAlgorithm * GetInputAlgorithm()
Definition: vtkAlgorithm.h:395
vtkInformation * GetInputInformation()
Definition: vtkAlgorithm.h:422
vtkDataObject * GetInput()
int vtkIdType
Definition: vtkType.h:247
Export VTK images to third-party systems.
int * GetDataDimensions()
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
const char * GetDataScalarTypeAsString()
unsigned long LastPipelineMTime
void * GetExportVoidPointer()
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
#define VTKIOIMAGE_EXPORT
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void * ExportVoidPointer