/usr/include/KWWidgets/vtkKWVolumePropertyHelper.h is in libkwwidgets1-dev 1.0.0~cvs20100930-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 | /*=========================================================================
Copyright (c) 1998-2003 Kitware Inc. 469 Clifton Corporate Parkway,
Clifton Park, NY, 12065, USA.
All rights reserved. No part of this software may be reproduced, distributed,
or modified, in any form or by any means, without permission in writing from
Kitware Inc.
IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF,
EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN
"AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
=========================================================================*/
// .NAME vtkKWVolumePropertyHelper - a render widget for volumes
// .SECTION Description
#ifndef __vtkKWVolumePropertyHelper_h
#define __vtkKWVolumePropertyHelper_h
#include "vtkObject.h"
#include "vtkKWWidgets.h" // Needed for export symbols directives
class vtkVolumeProperty;
class vtkKWHistogramSet;
class vtkImageData;
class KWWidgets_EXPORT vtkKWVolumePropertyHelper : public vtkObject
{
public:
static vtkKWVolumePropertyHelper* New();
vtkTypeRevisionMacro(vtkKWVolumePropertyHelper, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Apply a normalized scalar opacity preset to a specific component
// Such normalized values can later be converted to real scalar values
// given an image data and/or an histogram (see ConvertNormalizedToReal).
//BTX
enum
{
// 2 points "ramp": 0% opacity at 0% to 20% opacity at 100%
ScalarOpacityRamp0At0To20At100 = 0,
// 2 points "ramp": 0% opacity at 25% to 100% opacity at 50%
ScalarOpacityRamp0At25To100At50,
// 2 points "ramp": 0% opacity at 50% to 100% opacity at 75%
ScalarOpacityRamp0At50To100At75,
// 4 steps: 0% opacity until 25%, 20% opacity from 25% to 50%,
// 40% opacity from 50% to 75%, and 100% opacity from 75% to 100%.
ScalarOpacitySteps0To25Then20To50Then40To75Then100To100
};
//ETX
static void ApplyScalarOpacityPreset(
vtkVolumeProperty *prop, int comp, int preset);
// Description:
// Apply a normalized color transfer function preset to a specific component.
// Such normalized values can later be converted to real scalar values
// given an image data and/or an histogram (see ConvertNormalizedToReal).
// Some presets will set 2, 3, 4 or more color points. You can specify
// any number of colors though, the missing ones will be picked/rotated
// from the one you passed (i.e. if 2 points are created and one color is
// provided, the same color will be used at both locations).
// Convenience methods are provided to pass one, two, three or four RGB
// color(s) directly instead of an array of RGB colors (i.e. an array of
// double triplets).
//BTX
enum
{
// 2 points "ramp": color at 0%, color at 100%
RGBTransferFunctionRampAt0At100 = 0,
// 3 points "ramp": color at 0%, color at 70%, color at 100%
RGBTransferFunctionRampAt0At70At100,
// 4 steps: color from 0% to 25%, color from 25% to 50%,
// color from 50% to 75%, color from 75% to 100%.
RGBTransferFunctionStepsTo25To50To75To100
};
//ETX
static void ApplyRGBTransferFunctionPreset(
vtkVolumeProperty *prop, int comp, int preset,
int nb_colors, double **rgb);
static void ApplyRGBTransferFunctionPreset(
vtkVolumeProperty *prop, int comp, int preset,
double rgb[3]);
static void ApplyRGBTransferFunctionPreset(
vtkVolumeProperty *prop, int comp, int preset,
double rgb1[3], double rgb2[3]);
static void ApplyRGBTransferFunctionPreset(
vtkVolumeProperty *prop, int comp, int preset,
double rgb1[3], double rgb2[3], double rgb3[3]);
static void ApplyRGBTransferFunctionPreset(
vtkVolumeProperty *prop, int comp, int preset,
double rgb1[3], double rgb2[3], double rgb3[3], double rgb4[3]);
// Description:
// Apply a normalized gradient opacity preset to a specific component
// Such normalized values can later be converted to real scalar values
// given an image data and/or an histogram (see ConvertNormalizedToReal).
//BTX
enum
{
// No edge detection
GradientOpacityNoEdge = 0,
// Medium edge detection
GradientOpacityMediumEdge,
// Strong edge detection
GradientOpacityStrongEdge
};
//ETX
static void ApplyGradientOpacityPreset(
vtkVolumeProperty *prop, int comp, int preset);
// Description:
// Apply a lighting preset to a specific component
//BTX
enum
{
// Full ambient eliminating all directional shading
LightingFullAmbient = 0,
// Dull material properties (no specular lighting)
LightingDull,
// Smooth material properties (moderate specular lighting)
LightingSmooth,
// Shiny material properties (high specular lighting)
LightingShiny
};
//ETX
static void ApplyLightingPreset(
vtkVolumeProperty *prop, int comp, int preset);
// Description:
// Apply a normalized preset, i.e. a combination of a scalar opacity
// preset, a color transfer function preset, a gradient opacity preset
// and a lighting preset (see ApplyScalarOpacityPreset,
// ApplyRGBTransferFunctionPreset, ApplyGradientOpacityPreset and
// ApplyLightingPreset).
// IMPORTANT: note that the vtkVolumeProperty's IndependentComponenents
// flag will be taken into account when setting the transfer functions
// for each components of the property.
// See ConvertNormalizedRange and/or ApplyPresetAndConvertNormalizedRange
// to convert the normalized range to real scalar ranges.
//BTX
enum
{
// ScalarOpacityRamp0At0To20At100
// RGBTransferFunctionRampAt0At100
// => white for comp 0, then colors (red, green, blue, yellow)
// GradientOpacityNoEdge
// LightingDull
// Shading Off
Preset1 = 0,
// ScalarOpacityRamp0At0To20At100
// RGBTransferFunctionRampAt0At100
// => black to white for comp 0, then colors to white
// GradientOpacityNoEdge
// LightingDull
// Shading Off
Preset2,
// ScalarOpacityRamp0At0To20At100
// RGBTransferFunctionRampAt0At70At100
// => rainbox (blue -> green -> red) for all comps
// GradientOpacityNoEdge
// LightingDull
// Shading Off
Preset3,
// ScalarOpacityRamp0At25To100At50
// RGBTransferFunctionRampAt0At100
// => tan for comp 0, then other colors (red, green, blue, yellow)
// LightingDull
// Shading On
Preset4,
// ScalarOpacityRamp0At50To100At75
// RGBTransferFunctionRampAt0At100
// => tan for comp 0, then other colors (red, green, blue, yellow)
// GradientOpacityNoEdge
// LightingDull
// Shading On
Preset5,
// ScalarOpacitySteps0To25Then20To50Then40To75Then100To100
// RGBTransferFunctionStepsTo25To50To75To100
// => red, green, blue, yellow steps for all comps
// GradientOpacityNoEdge
// LightingDull
// Shading On
Preset6
};
//ETX
static void ApplyPreset(vtkVolumeProperty *prop, int preset);
// Description:
// Retrieve some solid color RGB presets.
//BTX
enum
{
Black = 0,
White,
Gray3,
Red,
Green,
Blue,
Yellow,
Magenta,
Cyan,
Tan
};
//ETX
static double* GetRGBColor(int preset);
// Description:
// Convert a normalized volume property to real scalar ranges.
// The contents of normalized_prop is entirely deep-copied to
// target_prop (EXCEPT the ScalarOpacityUnitDistance).
// The points are all moved from normalized space to real scalar ranges
// computed either from the image's data range or from its histogram (if any).
static void ConvertNormalizedRange(
vtkVolumeProperty *normalized_prop,
vtkVolumeProperty *target_prop,
vtkImageData *image,
int independent_component,
vtkKWHistogramSet *histogram_set
);
// Description:
// Convenience method that will create a temporary volume property,
// use ApplyPreset to convert it to a normalized preset, then convert
// its normalized values to real scalar ranges by calling
// ConvertNormalizedRange.
// The points are all moved from normalized space to real scalar ranges
// computed either from the image's data range or from its histogram (if any).
static void ApplyPresetAndConvertNormalizedRange(
int preset,
vtkVolumeProperty *target_prop,
vtkImageData *image,
int independent_component,
vtkKWHistogramSet *histogram_set
);
// Description:
// Deep copy a volume property from source to target.
static void DeepCopyVolumeProperty(
vtkVolumeProperty *target, vtkVolumeProperty *source);
// Description:
// Copy a volume property from source to target, optionally skipping
// some fields.
//BTX
enum
{
CopySkipOpacityUnitDistance = 1,
CopySkipIndependentComponents = 2
};
//ETX
static void CopyVolumeProperty(
vtkVolumeProperty *target, vtkVolumeProperty *source, int options);
protected:
vtkKWVolumePropertyHelper() {};
~vtkKWVolumePropertyHelper() {};
private:
vtkKWVolumePropertyHelper(const vtkKWVolumePropertyHelper&); // Not implemented
void operator=(const vtkKWVolumePropertyHelper&); // Not implemented
};
#endif
|