ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkVTKImageExportBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkVTKImageExportBase_h
19 #define __itkVTKImageExportBase_h
20 
21 #include "itkProcessObject.h"
22 
23 namespace itk
24 {
36 class ITK_EXPORT VTKImageExportBase:public ProcessObject
37 {
38 public:
44 
46  itkTypeMacro(VTKImageExportBase, ProcessObject);
47 
49  void * GetCallbackUserData();
50 
52  typedef void ( * UpdateInformationCallbackType )(void *);
53  typedef int ( * PipelineModifiedCallbackType )(void *);
54  typedef int * ( * WholeExtentCallbackType )(void *);
55  typedef double * ( * SpacingCallbackType )(void *);
56  typedef double * ( * OriginCallbackType )(void *);
57  typedef const char * ( *ScalarTypeCallbackType )(void *);
58  typedef int ( * NumberOfComponentsCallbackType )(void *);
59  typedef void ( * PropagateUpdateExtentCallbackType )(void *, int *);
60  typedef void ( * UpdateDataCallbackType )(void *);
61  typedef int * ( * DataExtentCallbackType )(void *);
62  typedef void * ( * BufferPointerCallbackType )(void *);
64 
66  typedef float * ( *FloatSpacingCallbackType )(void *);
67  typedef float * ( *FloatOriginCallbackType )(void *);
69 
75  {
76 public:
77  typedef double * ( *DoubleCallbackType )(void *);
78  typedef float * ( * FloatCallbackType )(void *);
79  operator DoubleCallbackType()
80  {
81  return m_DoubleCallback;
82  }
83 
84  operator FloatCallbackType()
85  {
86  return m_FloatCallback;
87  }
88  CallbackTypeProxy(DoubleCallbackType d, FloatCallbackType f):
89  m_DoubleCallback(d), m_FloatCallback(f) {}
90 private:
91  DoubleCallbackType m_DoubleCallback;
92  FloatCallbackType m_FloatCallback;
93  };
94 
96  UpdateInformationCallbackType GetUpdateInformationCallback() const;
97 
98  PipelineModifiedCallbackType GetPipelineModifiedCallback() const;
99 
100  WholeExtentCallbackType GetWholeExtentCallback() const;
101 
102  CallbackTypeProxy GetSpacingCallback() const;
103 
104  CallbackTypeProxy GetOriginCallback() const;
105 
106  ScalarTypeCallbackType GetScalarTypeCallback() const;
107 
108  NumberOfComponentsCallbackType GetNumberOfComponentsCallback() const;
109 
110  PropagateUpdateExtentCallbackType GetPropagateUpdateExtentCallback() const;
111 
112  UpdateDataCallbackType GetUpdateDataCallback() const;
113 
114  DataExtentCallbackType GetDataExtentCallback() const;
115 
116  BufferPointerCallbackType GetBufferPointerCallback() const;
117 
118 protected:
121  void PrintSelf(std::ostream & os, Indent indent) const;
122 
124 
125  virtual void UpdateInformationCallback();
126 
127  virtual int PipelineModifiedCallback();
128 
129  virtual void UpdateDataCallback();
130 
133  virtual int * WholeExtentCallback() = 0;
134 
135  virtual double * SpacingCallback() = 0;
136 
137  virtual double * OriginCallback() = 0;
138 
139  virtual float * FloatSpacingCallback() = 0;
140 
141  virtual float * FloatOriginCallback() = 0;
142 
143  virtual const char * ScalarTypeCallback() = 0;
144 
145  virtual int NumberOfComponentsCallback() = 0;
146 
147  virtual void PropagateUpdateExtentCallback(int *) = 0;
148 
149  virtual int * DataExtentCallback() = 0;
150 
151  virtual void * BufferPointerCallback() = 0;
152 
153 private:
154  VTKImageExportBase(const Self &); //purposely not implemented
155  void operator=(const Self &); //purposely not implemented
156 
160  static void UpdateInformationCallbackFunction(void *);
161 
162  static int PipelineModifiedCallbackFunction(void *);
163 
164  static int * WholeExtentCallbackFunction(void *);
165 
166  static double * SpacingCallbackFunction(void *);
167 
168  static double * OriginCallbackFunction(void *);
169 
170  static float * FloatSpacingCallbackFunction(void *);
171 
172  static float * FloatOriginCallbackFunction(void *);
173 
174  static const char * ScalarTypeCallbackFunction(void *);
175 
176  static int NumberOfComponentsCallbackFunction(void *);
177 
178  static void PropagateUpdateExtentCallbackFunction(void *, int *);
179 
180  static void UpdateDataCallbackFunction(void *);
181 
182  static int * DataExtentCallbackFunction(void *);
183 
184  static void * BufferPointerCallbackFunction(void *);
185 
186 private:
188  unsigned long m_LastPipelineMTime;
189 };
190 } // end namespace itk
191 
192 #endif
193