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 
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 
277 
278 protected:
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 
315 
316 private:
317  vtkImageImport(const vtkImageImport&); // Not implemented.
318  void operator=(const vtkImageImport&); // Not implemented.
319 };
320 
321 #endif
vtkImageImport::DataScalarType
int DataScalarType
Definition: vtkImageImport.h:290
vtkGetVector6Macro
#define vtkGetVector6Macro(name, type)
Definition: vtkSetGet.h:380
vtkImageImport::NumberOfScalarComponents
int NumberOfScalarComponents
Definition: vtkImageImport.h:289
vtkImageImport::ScalarTypeCallback
ScalarTypeCallbackType ScalarTypeCallback
Definition: vtkImageImport.h:306
vtkImageImport::BufferPointerCallback
BufferPointerCallbackType BufferPointerCallback
Definition: vtkImageImport.h:311
vtkSetVector3Macro
#define vtkSetVector3Macro(name, type)
Definition: vtkSetGet.h:287
vtkImageImport::SaveUserArray
int SaveUserArray
Definition: vtkImageImport.h:287
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkImageImport::DataExtentCallback
DataExtentCallbackType DataExtentCallback
Definition: vtkImageImport.h:310
vtkImageImport::UpdateInformationCallback
UpdateInformationCallbackType UpdateInformationCallback
Definition: vtkImageImport.h:301
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
VTK_UNSIGNED_SHORT
#define VTK_UNSIGNED_SHORT
Definition: vtkType.h:30
save
void save(Archiver &ar, const vtkUnicodeString &str, const unsigned int vtkNotUsed(version))
Definition: vtkVariantBoostSerialization.h:64
vtkIOImageModule.h
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImageImport::SetDataScalarTypeToFloat
void SetDataScalarTypeToFloat()
Definition: vtkImageImport.h:73
vtkImageAlgorithm.h
vtkImageImport::SetDataScalarTypeToDouble
void SetDataScalarTypeToDouble()
Definition: vtkImageImport.h:72
VTKIOIMAGE_EXPORT
#define VTKIOIMAGE_EXPORT
Definition: vtkIOImageModule.h:15
vtkImageImport::SpacingCallback
SpacingCallbackType SpacingCallback
Definition: vtkImageImport.h:304
vtkImageImport::SetImportVoidPointer
void SetImportVoidPointer(void *ptr, int save)
vtkImageImport::InvokeExecuteInformationCallbacks
void InvokeExecuteInformationCallbacks()
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:40
vtkImageImport::ExecuteDataWithInformation
virtual void ExecuteDataWithInformation(vtkDataObject *d, vtkInformation *outInfo)
vtkImageImport::SetDataExtentToWholeExtent
void SetDataExtentToWholeExtent()
Definition: vtkImageImport.h:99
vtkImageImport::SetDataScalarTypeToUnsignedChar
void SetDataScalarTypeToUnsignedChar()
Definition: vtkImageImport.h:78
vtkImageImport::ScalarArrayName
char * ScalarArrayName
Definition: vtkImageImport.h:297
vtkImageImport::ComputePipelineMTime
virtual int ComputePipelineMTime(vtkInformation *request, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec, int requestFromOutputPort, unsigned long *mtime)
vtkImageImport::NumberOfComponentsCallback
NumberOfComponentsCallbackType NumberOfComponentsCallback
Definition: vtkImageImport.h:307
vtkGetVector3Macro
#define vtkGetVector3Macro(name, type)
Definition: vtkSetGet.h:304
vtkImageImport::PipelineModifiedCallback
PipelineModifiedCallbackType PipelineModifiedCallback
Definition: vtkImageImport.h:302
vtkImageScalarTypeNameMacro
#define vtkImageScalarTypeNameMacro(type)
Definition: vtkSetGet.h:51
vtkImageImport::InvokeUpdateInformationCallbacks
void InvokeUpdateInformationCallbacks()
vtkImageImport::vtkImageImport
vtkImageImport()
vtkImageImport::GetDataScalarTypeAsString
const char * GetDataScalarTypeAsString()
Definition: vtkImageImport.h:81
vtkImageImport::New
static vtkImageImport * New()
vtkImageImport::SetImportVoidPointer
void SetImportVoidPointer(void *ptr)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkImageImport::InvokeExecuteDataCallbacks
void InvokeExecuteDataCallbacks()
vtkImageImport::SetDataScalarTypeToShort
void SetDataScalarTypeToShort()
Definition: vtkImageImport.h:75
VTK_FLOAT
#define VTK_FLOAT
Definition: vtkType.h:35
vtkImageImport::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
VTK_DOUBLE
#define VTK_DOUBLE
Definition: vtkType.h:36
vtkImageImport::GetImportVoidPointer
void * GetImportVoidPointer()
Definition: vtkImageImport.h:58
VTK_UNSIGNED_CHAR
#define VTK_UNSIGNED_CHAR
Definition: vtkType.h:28
vtkImageImport::LegacyCheckWholeExtent
void LegacyCheckWholeExtent()
vtkImageImport::~vtkImageImport
~vtkImageImport()
vtkImageImport::CallbackUserData
void * CallbackUserData
Definition: vtkImageImport.h:298
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
VTK_SHORT
#define VTK_SHORT
Definition: vtkType.h:29
vtkImageImport::PropagateUpdateExtentCallback
PropagateUpdateExtentCallbackType PropagateUpdateExtentCallback
Definition: vtkImageImport.h:308
vtkImageImport::UpdateDataCallback
UpdateDataCallbackType UpdateDataCallback
Definition: vtkImageImport.h:309
vtkImageImport::SetDataScalarTypeToInt
void SetDataScalarTypeToInt()
Definition: vtkImageImport.h:74
vtkImageImport::ImportVoidPointer
void * ImportVoidPointer
Definition: vtkImageImport.h:286
vtkSetVector6Macro
#define vtkSetVector6Macro(name, type)
Definition: vtkSetGet.h:360
vtkImageImport::InvokePipelineModifiedCallbacks
int InvokePipelineModifiedCallbacks()
vtkImageImport::SetDataScalarTypeToUnsignedShort
void SetDataScalarTypeToUnsignedShort()
Definition: vtkImageImport.h:76
vtkImageImport::WholeExtentCallback
WholeExtentCallbackType WholeExtentCallback
Definition: vtkImageImport.h:303
vtkImageImport::OriginCallback
OriginCallbackType OriginCallback
Definition: vtkImageImport.h:305
vtkgl::void
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
vtkImageImport::RequestInformation
virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkImageImport::CopyImportVoidPointer
void CopyImportVoidPointer(void *ptr, vtkIdType size)
VTK_INT
#define VTK_INT
Definition: vtkType.h:31
vtkImageImport
Import data from a C array.
Definition: vtkImageImport.h:41
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
int
int
Definition: vtkVectorOperators.h:164
vtkImageImport::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843