/usr/include/vtk-5.8/vtkUnstructuredGridVolumeZSweepMapper.h is in libvtk5-dev 5.8.0-5.
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 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkUnstructuredGridVolumeZSweepMapper.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 vtkUnstructuredGridVolumeZSweepMapper - Unstructured grid volume mapper based the ZSweep Algorithm
// .SECTION Description
// This is a volume mapper for unstructured grid implemented with the ZSweep
// algorithm. This is a software projective method.
// .SECTION see also
// vtkVolumetMapper
// .SECTION Background
// The algorithm is described in the following paper:
// Ricardo Farias, Joseph S. B. Mitchell and Claudio T. Silva.
// ZSWEEP: An Efficient and Exact Projection Algorithm for Unstructured Volume
// Rendering. In 2000 Volume Visualization Symposium, pages 91--99.
// October 2000.
// http://www.cse.ogi.edu/~csilva/papers/volvis2000.pdf
#ifndef __vtkUnstructuredGridVolumeZSweepMapper_h
#define __vtkUnstructuredGridVolumeZSweepMapper_h
#include "vtkUnstructuredGridVolumeMapper.h"
class vtkRenderer;
class vtkVolume;
class vtkRayCastImageDisplayHelper;
class vtkCell;
class vtkGenericCell;
class vtkIdList;
class vtkPriorityQueue;
class vtkTransform;
class vtkMatrix4x4;
class vtkVolumeProperty;
class vtkDoubleArray;
class vtkUnstructuredGridVolumeRayIntegrator;
class vtkRenderWindow;
//BTX
// Internal classes
namespace vtkUnstructuredGridVolumeZSweepMapperNamespace
{
class vtkScreenEdge;
class vtkSpan;
class vtkPixelListFrame;
class vtkUseSet;
class vtkVertices;
class vtkSimpleScreenEdge;
class vtkDoubleScreenEdge;
class vtkVertexEntry;
class vtkPixelListEntryMemory;
};
//ETX
class VTK_VOLUMERENDERING_EXPORT vtkUnstructuredGridVolumeZSweepMapper : public vtkUnstructuredGridVolumeMapper
{
public:
vtkTypeMacro(vtkUnstructuredGridVolumeZSweepMapper,vtkUnstructuredGridVolumeMapper);
void PrintSelf( ostream& os, vtkIndent indent );
// Description:
// Set MaxPixelListSize to 32.
static vtkUnstructuredGridVolumeZSweepMapper *New();
// Description:
// Sampling distance in the XY image dimensions. Default value of 1 meaning
// 1 ray cast per pixel. If set to 0.5, 4 rays will be cast per pixel. If
// set to 2.0, 1 ray will be cast for every 4 (2 by 2) pixels.
vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
vtkGetMacro( ImageSampleDistance, float );
// Description:
// This is the minimum image sample distance allow when the image
// sample distance is being automatically adjusted
vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
vtkGetMacro( MinimumImageSampleDistance, float );
// Description:
// This is the maximum image sample distance allow when the image
// sample distance is being automatically adjusted
vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
vtkGetMacro( MaximumImageSampleDistance, float );
// Description:
// If AutoAdjustSampleDistances is on, the the ImageSampleDistance
// will be varied to achieve the allocated render time of this
// prop (controlled by the desired update rate and any culling in
// use).
vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
vtkGetMacro( AutoAdjustSampleDistances, int );
vtkBooleanMacro( AutoAdjustSampleDistances, int );
// Description:
// If IntermixIntersectingGeometry is turned on, the zbuffer will be
// captured and used to limit the traversal of the rays.
vtkSetClampMacro( IntermixIntersectingGeometry, int, 0, 1 );
vtkGetMacro( IntermixIntersectingGeometry, int );
vtkBooleanMacro( IntermixIntersectingGeometry, int );
// Description:
// Maximum size allowed for a pixel list. Default is 32.
// During the rendering, if a list of pixel is full, incremental compositing
// is performed. Even if it is a user setting, it is an advanced parameter.
// You have to understand how the algorithm works to change this value.
int GetMaxPixelListSize();
// Description:
// Change the maximum size allowed for a pixel list. It is an advanced
// parameter.
// \pre positive_size: size>1
void SetMaxPixelListSize(int size);
// Description:
// Set/Get the helper class for integrating rays. If set to NULL, a
// default integrator will be assigned.
virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
//BTX
// Description:
// WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
// DO NOT USE THIS METHOD OUTSIDE OF THE RENDERING PROCESS
// Render the volume
void Render(vtkRenderer *ren,
vtkVolume *vol);
vtkGetVectorMacro( ImageInUseSize, int, 2 );
vtkGetVectorMacro( ImageOrigin, int, 2 );
vtkGetVectorMacro( ImageViewportSize, int , 2 );
//ETX
protected:
vtkUnstructuredGridVolumeZSweepMapper();
~vtkUnstructuredGridVolumeZSweepMapper();
// Description:
// For each vertex, find the list of incident faces.
void BuildUseSets();
// Description:
// Reorder vertices `v' in increasing order in `w'. Return if the orientation
// has changed.
int ReorderTriangle(vtkIdType v[3],
vtkIdType w[3]);
// Description:
// Project and sort the vertices by z-coordinates in view space in the
// "event list" (an heap).
// \pre empty_list: this->EventList->GetNumberOfItems()==0
void ProjectAndSortVertices(vtkRenderer *ren,
vtkVolume *vol);
// Description:
// Create an empty "pixel list" for each pixel of the screen.
void CreateAndCleanPixelList();
// Description:
// MainLoop of the Zsweep algorithm.
// \post empty_list: this->EventList->GetNumberOfItems()==0
void MainLoop(vtkRenderWindow *renWin);
// Description:
// Do delayed compositing from back to front, stopping at zTarget for each
// pixel inside the bounding box.
void CompositeFunction(double zTarget);
// Description:
// Convert and clamp a float color component into a unsigned char.
unsigned char ColorComponentRealToByte(float color);
// Description:
// Perform scan conversion of a triangle face.
void RasterizeFace(vtkIdType faceIds[3], int externalSide);
//BTX
// Description:
// Perform scan conversion of a triangle defined by its vertices.
// \pre ve0_exists: ve0!=0
// \pre ve1_exists: ve1!=0
// \pre ve2_exists: ve2!=0
void RasterizeTriangle(
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkVertexEntry *ve0,
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkVertexEntry *ve1,
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkVertexEntry *ve2,
bool exitFace);
// Description:
// Perform scan conversion of an horizontal span from left ro right at line
// y.
// \pre left_exists: left!=0
// \pre right_exists: right!=0
void RasterizeSpan(int y,
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkScreenEdge *left,
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkScreenEdge *right,
bool exitFace);
// Description:
// Scan conversion of a straight line defined by endpoints v0 and v1.
// \pre v0_exists: v0!=0
// \pre v1_exists: v1!=0
// \pre y_ordered v0->GetScreenY()<=v1->GetScreenY()
void RasterizeLine(
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkVertexEntry *v0,
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkVertexEntry *v1,
bool exitFace);
//ETX
void StoreRenderTime(vtkRenderer *ren,
vtkVolume *vol,
float t);
float RetrieveRenderTime(vtkRenderer *ren,
vtkVolume *vol);
// Description:
// Return the value of the z-buffer at screen coordinates (x,y).
double GetZBufferValue(int x,
int y);
double GetMinimumBoundsDepth(vtkRenderer *ren,
vtkVolume *vol);
// Description:
// Allocate an array of usesets of size `size' only if the current one is not
// large enough. Otherwise clear each use set of each vertex.
void AllocateUseSet(vtkIdType size);
// Description:
// Allocate a vertex array of size `size' only if the current one is not
// large enough.
void AllocateVertices(vtkIdType size);
// Description:
// For debugging purpose, save the pixel list frame as a dataset.
void SavePixelListFrame();
int MaxPixelListSize;
float ImageSampleDistance;
float MinimumImageSampleDistance;
float MaximumImageSampleDistance;
int AutoAdjustSampleDistances;
vtkRayCastImageDisplayHelper *ImageDisplayHelper;
// This is how big the image would be if it covered the entire viewport
int ImageViewportSize[2];
// This is how big the allocated memory for image is. This may be bigger
// or smaller than ImageFullSize - it will be bigger if necessary to
// ensure a power of 2, it will be smaller if the volume only covers a
// small region of the viewport
int ImageMemorySize[2];
// This is the size of subregion in ImageSize image that we are using for
// the current image. Since ImageSize is a power of 2, there is likely
// wasted space in it. This number will be used for things such as clearing
// the image if necessary.
int ImageInUseSize[2];
// This is the location in ImageFullSize image where our ImageSize image
// is located.
int ImageOrigin[2];
// This is the allocated image
unsigned char *Image;
// This is the accumulating double RGBA image
float *RealRGBAImage;
float *RenderTimeTable;
vtkVolume **RenderVolumeTable;
vtkRenderer **RenderRendererTable;
int RenderTableSize;
int RenderTableEntries;
int IntermixIntersectingGeometry;
float *ZBuffer;
int ZBufferSize[2];
int ZBufferOrigin[2];
vtkDataArray *Scalars;
int CellScalars;
// if use CellScalars, we need to keep track of the
// values on each side of the face and figure out
// if the face is used by two cells (twosided) or one cell.
double FaceScalars[2];
int FaceSide;
//BTX
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkSpan *Span;
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkPixelListFrame *PixelListFrame;
// Used by BuildUseSets().
vtkGenericCell *Cell;
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkUseSet *UseSet;
vtkPriorityQueue *EventList;
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkVertices *Vertices;
vtkTransform *PerspectiveTransform;
vtkMatrix4x4 *PerspectiveMatrix;
// Used by the main loop
int MaxPixelListSizeReached;
int XBounds[2];
int YBounds[2];
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkSimpleScreenEdge *SimpleEdge;
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkDoubleScreenEdge *DoubleEdge;
vtkUnstructuredGridVolumeRayIntegrator *RayIntegrator;
vtkUnstructuredGridVolumeRayIntegrator *RealRayIntegrator;
vtkTimeStamp SavedTriangleListMTime;
// Used during compositing
vtkDoubleArray *IntersectionLengths;
vtkDoubleArray *NearIntersections;
vtkDoubleArray *FarIntersections;
// Benchmark
vtkIdType MaxRecordedPixelListSize;
vtkUnstructuredGridVolumeZSweepMapperNamespace::vtkPixelListEntryMemory *MemoryManager;
//ETX
private:
vtkUnstructuredGridVolumeZSweepMapper(const vtkUnstructuredGridVolumeZSweepMapper&); // Not implemented.
void operator=(const vtkUnstructuredGridVolumeZSweepMapper&); // Not implemented.
};
#endif
|