/usr/include/vtk-6.2/vtkImageMapper3D.h is in libvtk6-dev 6.2.0+dfsg1-10build1.
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 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkImageMapper3D.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkImageMapper3D - abstract class for mapping images to the screen
// .SECTION Description
// vtkImageMapper3D is a mapper that will draw a 2D image, or a slice
// of a 3D image. The slice plane can be set automatically follow the
// camera, so that it slices through the focal point and faces the camera.
// .SECTION Thanks
// Thanks to David Gobbi at the Seaman Family MR Centre and Dept. of Clinical
// Neurosciences, Foothills Medical Centre, Calgary, for providing this class.
// .SECTION See also
// vtkImage vtkImageProperty vtkImageResliceMapper vtkImageSliceMapper
#ifndef vtkImageMapper3D_h
#define vtkImageMapper3D_h
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkAbstractMapper3D.h"
class vtkRenderer;
class vtkProp3D;
class vtkPoints;
class vtkMatrix4x4;
class vtkLookupTable;
class vtkScalarsToColors;
class vtkImageSlice;
class vtkImageProperty;
class vtkImageData;
class vtkMultiThreader;
class vtkImageToImageMapper3DFriendship;
class VTKRENDERINGCORE_EXPORT vtkImageMapper3D : public vtkAbstractMapper3D
{
public:
vtkTypeMacro(vtkImageMapper3D, vtkAbstractMapper3D);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// This should only be called by the renderer.
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop) = 0;
// Description:
// Release any graphics resources that are being consumed by
// this mapper. The parameter window is used to determine
// which graphic resources to release.
virtual void ReleaseGraphicsResources(vtkWindow *) = 0;
// Description:
// The input data for this mapper.
void SetInputData(vtkImageData *input);
vtkImageData *GetInput();
vtkDataSet *GetDataSetInput();
vtkDataObject *GetDataObjectInput();
// Description:
// Instead of displaying the image only out to the image
// bounds, include a half-voxel border around the image.
// Within this border, the image values will be extrapolated
// rather than interpolated.
vtkSetMacro(Border, int);
vtkBooleanMacro(Border, int);
vtkGetMacro(Border, int);
// Description:
// Instead of rendering only to the image border, render out
// to the viewport boundary with the background color. The
// background color will be the lowest color on the lookup
// table that is being used for the image.
vtkSetMacro(Background, int);
vtkBooleanMacro(Background, int);
vtkGetMacro(Background, int);
// Description:
// Automatically set the slice position to the camera focal point.
// This provides a convenient way to interact with the image, since
// most Interactors directly control the camera.
vtkSetMacro(SliceAtFocalPoint, int);
vtkBooleanMacro(SliceAtFocalPoint, int);
vtkGetMacro(SliceAtFocalPoint, int);
// Description:
// Automatically set the slice orientation so that it faces the camera.
// This provides a convenient way to interact with the image, since
// most Interactors directly control the camera.
vtkSetMacro(SliceFacesCamera, int);
vtkBooleanMacro(SliceFacesCamera, int);
vtkGetMacro(SliceFacesCamera, int);
// Description:
// A plane that describes what slice of the input is being
// rendered by the mapper. This plane is in world coordinates,
// not data coordinates. Before using this plane, call Update
// or UpdateInformation to make sure the plane is up-to-date.
// These methods are automatically called by Render.
vtkGetObjectMacro(SlicePlane, vtkPlane);
// Description:
// Get the plane as a homogeneous 4-vector that gives the plane
// equation coefficients. The prop3D matrix must be provided so
// that the plane can be converted to data coords.
virtual void GetSlicePlaneInDataCoords(vtkMatrix4x4 *propMatrix,
double plane[4]);
// Description:
// The number of threads to create when rendering.
vtkSetClampMacro(NumberOfThreads, int, 1, VTK_MAX_THREADS);
vtkGetMacro(NumberOfThreads, int);
// Description:
// Turn on streaming, to pull the minimum amount of data from the input.
// Streaming decreases the memory required to display large images, since
// only one slice will be pulled through the input pipeline if only
// one slice is mapped to the screen. The default behavior is to pull
// the full 3D input extent through the input pipeline, but to do this
// only when the input data changes. The default behavior results in
// much faster follow-up renders when the input data is static.
vtkSetMacro(Streaming, int);
vtkGetMacro(Streaming, int);
vtkBooleanMacro(Streaming, int);
protected:
vtkImageMapper3D();
~vtkImageMapper3D();
// Description:
// See algorithm for more info
virtual int FillInputPortInformation(int port, vtkInformation* info);
virtual int FillOutputPortInformation(int port, vtkInformation* info);
// Description:
// Handle requests from the pipeline executive.
virtual int ProcessRequest(vtkInformation* request,
vtkInformationVector** inInfo,
vtkInformationVector* outInfo);
// Description:
// Checkerboard the alpha component of an RGBA image. The origin and
// spacing are in pixel units.
static void CheckerboardRGBA(
unsigned char *data, int xsize, int ysize,
double originx, double originy, double spacingx, double spacingy);
// Description:
// Perform window/level and color mapping operations to produce
// unsigned char data that can be used as a texture. See the
// source file for more information.
unsigned char *MakeTextureData(
vtkImageProperty *property, vtkImageData *input, int extent[6],
int &xsize, int &ysize, int &bytesPerPixel, bool &reuseTexture,
bool &reuseData);
// Description:
// Compute the coordinates and texture coordinates for the image, given
// an extent that describes a single slice.
void MakeTextureGeometry(
const int extent[6], double coords[12], double tcoords[8]);
// Description:
// Given an extent that describes a slice (it must have unit thickness
// in one of the three directions), return the dimension indices that
// correspond to the texture "x" and "y", provide the x, y image size,
// and provide the texture size (padded to a power of two if the hardware
// requires).
virtual void ComputeTextureSize(
const int extent[6], int &xdim, int &ydim,
int imageSize[2], int textureSize[2]);
// Description:
// Get the renderer associated with this mapper, or zero if none.
// This will raise an error if multiple renderers are found.
vtkRenderer *GetCurrentRenderer();
// Description:
// Get the vtkImage prop associated with this mapper, or zero if none.
vtkImageSlice *GetCurrentProp() { return this->CurrentProp; }
// Description:
// Get the data-to-world matrix for this mapper, according to the
// assembly path for its prop.
vtkMatrix4x4 *GetDataToWorldMatrix();
// Description:
// Get the background color, by using the first color in the
// supplied lookup table, or black if there is no lookup table.
void GetBackgroundColor(vtkImageProperty *property, double color[4]);
int Border;
int Background;
vtkScalarsToColors *DefaultLookupTable;
vtkMultiThreader *Threader;
int NumberOfThreads;
int Streaming;
// The slice.
vtkPlane *SlicePlane;
int SliceAtFocalPoint;
int SliceFacesCamera;
// Information about the image, updated by UpdateInformation
double DataSpacing[3];
double DataOrigin[3];
int DataWholeExtent[6];
// Set by vtkImageStack when doing multi-pass rendering
bool MatteEnable;
bool ColorEnable;
bool DepthEnable;
private:
// The prop this mapper is attached to, or zero if none.
vtkImageSlice *CurrentProp;
vtkRenderer *CurrentRenderer;
// The cached data-to-world matrix
vtkMatrix4x4 *DataToWorldMatrix;
vtkImageMapper3D(const vtkImageMapper3D&); // Not implemented.
void operator=(const vtkImageMapper3D&); // Not implemented.
friend class vtkImageToImageMapper3DFriendship;
};
#endif
|