VTK
vtkImageImport.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageImport.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 vtkImageImport_h
35 #define vtkImageImport_h
36 
37 #include "vtkIOImageModule.h" // For export macro
38 #include "vtkImageAlgorithm.h"
39 
41 {
42 public:
43  static vtkImageImport *New();
45  void PrintSelf(ostream& os, vtkIndent indent);
46 
50  void CopyImportVoidPointer(void *ptr, vtkIdType size);
51 
53 
57  void SetImportVoidPointer(void *ptr);
58  void *GetImportVoidPointer() {return this->ImportVoidPointer;};
60 
66  void SetImportVoidPointer(void *ptr, int save);
67 
69 
71  vtkSetMacro(DataScalarType,int);
72  void SetDataScalarTypeToDouble(){this->SetDataScalarType(VTK_DOUBLE);}
73  void SetDataScalarTypeToFloat(){this->SetDataScalarType(VTK_FLOAT);}
74  void SetDataScalarTypeToInt(){this->SetDataScalarType(VTK_INT);}
75  void SetDataScalarTypeToShort(){this->SetDataScalarType(VTK_SHORT);}
77  {this->SetDataScalarType(VTK_UNSIGNED_SHORT);}
79  {this->SetDataScalarType(VTK_UNSIGNED_CHAR);}
80  vtkGetMacro(DataScalarType, int);
81  const char *GetDataScalarTypeAsString() {
82  return vtkImageScalarTypeNameMacro(this->DataScalarType); }
84 
86 
88  vtkSetMacro(NumberOfScalarComponents,int);
89  vtkGetMacro(NumberOfScalarComponents,int);
91 
93 
97  vtkSetVector6Macro(DataExtent,int);
98  vtkGetVector6Macro(DataExtent,int);
100  {this->SetDataExtent(this->GetWholeExtent());}
102 
104 
106  vtkSetVector3Macro(DataSpacing,double);
107  vtkGetVector3Macro(DataSpacing,double);
109 
111 
113  vtkSetVector3Macro(DataOrigin,double);
114  vtkGetVector3Macro(DataOrigin,double);
116 
118 
121  vtkSetVector6Macro(WholeExtent,int);
122  vtkGetVector6Macro(WholeExtent,int);
124 
126 
127  virtual int RequestUpdateExtent( vtkInformation* request,
128  vtkInformationVector** inputVector,
129  vtkInformationVector* outputVector);
131 
132 
133  virtual int
135  vtkInformationVector** inInfoVec,
136  vtkInformationVector* outInfoVec,
137  int requestFromOutputPort,
138  unsigned long* mtime);
140 
142 
144  vtkSetStringMacro(ScalarArrayName);
145  vtkGetStringMacro(ScalarArrayName);
147 
148  //BTX
150 
152  typedef void (*UpdateInformationCallbackType)(void*);
153  typedef int (*PipelineModifiedCallbackType)(void*);
154  typedef int* (*WholeExtentCallbackType)(void*);
155  typedef double* (*SpacingCallbackType)(void*);
156  typedef double* (*OriginCallbackType)(void*);
157  typedef const char* (*ScalarTypeCallbackType)(void*);
158  typedef int (*NumberOfComponentsCallbackType)(void*);
159  typedef void (*PropagateUpdateExtentCallbackType)(void*, int*);
160  typedef void (*UpdateDataCallbackType)(void*);
161  typedef int* (*DataExtentCallbackType)(void*);
162  typedef void* (*BufferPointerCallbackType)(void*);
164 
166 
169  vtkSetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
170  vtkGetMacro(UpdateInformationCallback, UpdateInformationCallbackType);
172 
174 
178  vtkSetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
179  vtkGetMacro(PipelineModifiedCallback, PipelineModifiedCallbackType);
181 
183 
187  vtkSetMacro(WholeExtentCallback, WholeExtentCallbackType);
188  vtkGetMacro(WholeExtentCallback, WholeExtentCallbackType);
190 
192 
195  vtkSetMacro(SpacingCallback, SpacingCallbackType);
196  vtkGetMacro(SpacingCallback, SpacingCallbackType);
198 
200 
203  vtkSetMacro(OriginCallback, OriginCallbackType);
204  vtkGetMacro(OriginCallback, OriginCallbackType);
206 
208 
211  vtkSetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
212  vtkGetMacro(ScalarTypeCallback, ScalarTypeCallbackType);
214 
216 
219  vtkSetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
220  vtkGetMacro(NumberOfComponentsCallback, NumberOfComponentsCallbackType);
222 
224 
229  vtkSetMacro(PropagateUpdateExtentCallback,PropagateUpdateExtentCallbackType);
230  vtkGetMacro(PropagateUpdateExtentCallback,PropagateUpdateExtentCallbackType);
232 
234 
237  vtkSetMacro(UpdateDataCallback, UpdateDataCallbackType);
238  vtkGetMacro(UpdateDataCallback, UpdateDataCallbackType);
240 
242 
247  vtkSetMacro(DataExtentCallback, DataExtentCallbackType);
248  vtkGetMacro(DataExtentCallback, DataExtentCallbackType);
250 
252 
256  vtkSetMacro(BufferPointerCallback, BufferPointerCallbackType);
257  vtkGetMacro(BufferPointerCallback, BufferPointerCallbackType);
259 
261 
263  vtkSetMacro(CallbackUserData, void*);
264  vtkGetMacro(CallbackUserData, void*);
266 
267  //ETX
268 
270 
271  int InvokePipelineModifiedCallbacks();
272  void InvokeUpdateInformationCallbacks();
273  void InvokeExecuteInformationCallbacks();
274  void InvokeExecuteDataCallbacks();
275  void LegacyCheckWholeExtent();
277 
278 protected:
279  vtkImageImport();
280  ~vtkImageImport();
281 
284 
285 
288 
291 
292  int WholeExtent[6];
293  int DataExtent[6];
294  double DataSpacing[3];
295  double DataOrigin[3];
296 
299 
300  //BTX
301  UpdateInformationCallbackType UpdateInformationCallback;
302  PipelineModifiedCallbackType PipelineModifiedCallback;
303  WholeExtentCallbackType WholeExtentCallback;
304  SpacingCallbackType SpacingCallback;
305  OriginCallbackType OriginCallback;
306  ScalarTypeCallbackType ScalarTypeCallback;
307  NumberOfComponentsCallbackType NumberOfComponentsCallback;
308  PropagateUpdateExtentCallbackType PropagateUpdateExtentCallback;
309  UpdateDataCallbackType UpdateDataCallback;
310  DataExtentCallbackType DataExtentCallback;
311  BufferPointerCallbackType BufferPointerCallback;
312  //ETX
313 
314  virtual void ExecuteDataWithInformation(vtkDataObject *d, vtkInformation* outInfo);
315 
316 private:
317  vtkImageImport(const vtkImageImport&); // Not implemented.
318  void operator=(const vtkImageImport&); // Not implemented.
319 };
320 
321 #endif
void SetDataScalarTypeToDouble()
void SetDataScalarTypeToShort()
const char * GetDataScalarTypeAsString()
void * GetImportVoidPointer()
Store vtkAlgorithm input/output information.
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:30
WholeExtentCallbackType WholeExtentCallback
void * CallbackUserData
virtual void ExecuteDataWithInformation(vtkDataObject *output, vtkInformation *outInfo)
int vtkIdType
Definition: vtkType.h:275
BufferPointerCallbackType BufferPointerCallback
void SetDataScalarTypeToFloat()
void SetDataExtentToWholeExtent()
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetDataScalarTypeToInt()
Import data from a C array.
#define VTK_DOUBLE
Definition: vtkType.h:36
#define VTK_FLOAT
Definition: vtkType.h:35
UpdateDataCallbackType UpdateDataCallback
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetDataScalarTypeToUnsignedChar()
#define VTK_SHORT
Definition: vtkType.h:29
void SetDataScalarTypeToUnsignedShort()
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
PropagateUpdateExtentCallbackType PropagateUpdateExtentCallback
NumberOfComponentsCallbackType NumberOfComponentsCallback
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
ScalarTypeCallbackType ScalarTypeCallback
Generic algorithm superclass for image algs.
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent)
static vtkAlgorithm * New()
void * ImportVoidPointer
int NumberOfScalarComponents
#define VTKIOIMAGE_EXPORT
char * ScalarArrayName
UpdateInformationCallbackType UpdateInformationCallback
OriginCallbackType OriginCallback
general representation of visualization data
Definition: vtkDataObject.h:64
PipelineModifiedCallbackType PipelineModifiedCallback
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime)
SpacingCallbackType SpacingCallback
#define VTK_INT
Definition: vtkType.h:31
DataExtentCallbackType DataExtentCallback