00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00027 #ifndef __vtkKWVolumePropertyHelper_h
00028 #define __vtkKWVolumePropertyHelper_h
00029
00030 #include "vtkObject.h"
00031 #include "vtkKWWidgets.h"
00032
00033 class vtkVolumeProperty;
00034 class vtkKWHistogramSet;
00035 class vtkImageData;
00036
00037 class KWWidgets_EXPORT vtkKWVolumePropertyHelper : public vtkObject
00038 {
00039
00040 public:
00041 static vtkKWVolumePropertyHelper* New();
00042 vtkTypeRevisionMacro(vtkKWVolumePropertyHelper, vtkObject);
00043 void PrintSelf(ostream& os, vtkIndent indent);
00044
00046
00049 enum
00050 {
00051
00052 ScalarOpacityRamp0At0To20At100 = 0,
00054
00055
00056 ScalarOpacityRamp0At25To100At50,
00057
00058
00059 ScalarOpacityRamp0At50To100At75,
00060
00061
00062
00063 ScalarOpacitySteps0To25Then20To50Then40To75Then100To100
00064 };
00065
00066 static void ApplyScalarOpacityPreset(
00067 vtkVolumeProperty *prop, int comp, int preset);
00068
00070
00080 enum
00081 {
00082
00083 RGBTransferFunctionRampAt0At100 = 0,
00085
00086
00087 RGBTransferFunctionRampAt0At70At100,
00088
00089
00090
00091 RGBTransferFunctionStepsTo25To50To75To100
00092 };
00093
00094 static void ApplyRGBTransferFunctionPreset(
00095 vtkVolumeProperty *prop, int comp, int preset,
00096 int nb_colors, double **rgb);
00097 static void ApplyRGBTransferFunctionPreset(
00098 vtkVolumeProperty *prop, int comp, int preset,
00099 double rgb[3]);
00100 static void ApplyRGBTransferFunctionPreset(
00101 vtkVolumeProperty *prop, int comp, int preset,
00102 double rgb1[3], double rgb2[3]);
00103 static void ApplyRGBTransferFunctionPreset(
00104 vtkVolumeProperty *prop, int comp, int preset,
00105 double rgb1[3], double rgb2[3], double rgb3[3]);
00106 static void ApplyRGBTransferFunctionPreset(
00107 vtkVolumeProperty *prop, int comp, int preset,
00108 double rgb1[3], double rgb2[3], double rgb3[3], double rgb4[3]);
00109
00111
00115 enum
00116 {
00117
00118 GradientOpacityNoEdge = 0,
00120
00121
00122 GradientOpacityMediumEdge,
00123
00124
00125 GradientOpacityStrongEdge
00126 };
00127
00128 static void ApplyGradientOpacityPreset(
00129 vtkVolumeProperty *prop, int comp, int preset);
00130
00132
00133 enum
00134 {
00135
00136 LightingFullAmbient = 0,
00138
00139
00140 LightingDull,
00141
00142
00143 LightingSmooth,
00144
00145
00146 LightingShiny
00147 };
00148
00149 static void ApplyLightingPreset(
00150 vtkVolumeProperty *prop, int comp, int preset);
00151
00153
00162 enum
00163 {
00164
00165
00166
00167
00168
00169
00170 Preset1 = 0,
00172
00173
00174
00175
00176
00177
00178
00179 Preset2,
00180
00181
00182
00183
00184
00185
00186
00187 Preset3,
00188
00189
00190
00191
00192
00193
00194 Preset4,
00195
00196
00197
00198
00199
00200
00201
00202 Preset5,
00203
00204
00205
00206
00207
00208
00209
00210 Preset6
00211 };
00212
00213 static void ApplyPreset(vtkVolumeProperty *prop, int preset);
00214
00216
00217 enum
00218 {
00219 Black = 0,
00220 White,
00221 Gray3,
00222 Red,
00223 Green,
00224 Blue,
00225 Yellow,
00226 Magenta,
00227 Cyan,
00228 Tan
00229 };
00230
00231 static double* GetRGBColor(int preset);
00233
00235
00240 static void ConvertNormalizedRange(
00241 vtkVolumeProperty *normalized_prop,
00242 vtkVolumeProperty *target_prop,
00243 vtkImageData *image,
00244 int independent_component,
00245 vtkKWHistogramSet *histogram_set
00246 );
00248
00250
00256 static void ApplyPresetAndConvertNormalizedRange(
00257 int preset,
00258 vtkVolumeProperty *target_prop,
00259 vtkImageData *image,
00260 int independent_component,
00261 vtkKWHistogramSet *histogram_set
00262 );
00264
00266
00267 static void DeepCopyVolumeProperty(
00268 vtkVolumeProperty *target, vtkVolumeProperty *source);
00270
00272
00274 enum
00275 {
00276 CopySkipOpacityUnitDistance = 1,
00277 CopySkipIndependentComponents = 2
00278 };
00279
00280 static void CopyVolumeProperty(
00281 vtkVolumeProperty *target, vtkVolumeProperty *source, int options);
00283
00284
00285
00286 protected:
00287 vtkKWVolumePropertyHelper() {};
00288 ~vtkKWVolumePropertyHelper() {};
00289
00290
00291
00292 private:
00293 vtkKWVolumePropertyHelper(const vtkKWVolumePropertyHelper&);
00294 void operator=(const vtkKWVolumePropertyHelper&);
00295 };
00296
00297 #endif
00298