00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkVolumeProVG500Mapper.h,v $ 00005 Language: C++ 00006 00007 00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 00009 All rights reserved. 00010 00011 Redistribution and use in source and binary forms, with or without 00012 modification, are permitted provided that the following conditions are met: 00013 00014 * Redistributions of source code must retain the above copyright notice, 00015 this list of conditions and the following disclaimer. 00016 00017 * Redistributions in binary form must reproduce the above copyright notice, 00018 this list of conditions and the following disclaimer in the documentation 00019 and/or other materials provided with the distribution. 00020 00021 * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names 00022 of any contributors may be used to endorse or promote products derived 00023 from this software without specific prior written permission. 00024 00025 * Modified source versions must be plainly marked as such, and must not be 00026 misrepresented as being the original software. 00027 00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR 00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00038 00039 =========================================================================*/ 00077 #ifndef __vtkVolumeProVG500Mapper_h 00078 #define __vtkVolumeProVG500Mapper_h 00079 00080 #include "vtkVolumeProMapper.h" 00081 00082 #ifdef _WIN32 00083 #include "VolumePro/inc/vli.h" 00084 #else 00085 #include "vli/include/vli.h" 00086 #endif 00087 00088 #ifdef VTK_USE_VOLUMEPRO 00089 #define VTK_VOLUMEPRO_EXPORT VTK_RENDERING_EXPORT 00090 #else 00091 #define VTK_VOLUMEPRO_EXPORT 00092 #endif 00093 00094 class VTK_VOLUMEPRO_EXPORT vtkVolumeProVG500Mapper : public vtkVolumeProMapper 00095 { 00096 public: 00097 vtkTypeMacro(vtkVolumeProVG500Mapper,vtkVolumeProMapper); 00098 static vtkVolumeProVG500Mapper *New(); 00100 00101 virtual void Render( vtkRenderer *, vtkVolume * ); 00102 virtual int GetAvailableBoardMemory(); 00103 virtual void GetLockSizesForBoardMemory( unsigned int type, 00104 unsigned int *xSize, 00105 unsigned int *ySize, 00106 unsigned int *zSize ); 00108 protected: 00109 vtkVolumeProVG500Mapper(); 00110 ~vtkVolumeProVG500Mapper(); 00111 00112 // Update the camera - set the camera matrix 00113 void UpdateCamera( vtkRenderer *, vtkVolume * ); 00114 00115 // Update the lights 00116 void UpdateLights( vtkRenderer *, vtkVolume * ); 00117 00118 // Update the properties of the volume including transfer functions 00119 // and material properties 00120 void UpdateProperties( vtkRenderer *, vtkVolume * ); 00121 00122 // Update the volume - create it if necessary 00123 // Set the volume matrix. 00124 void UpdateVolume( vtkRenderer *, vtkVolume * ); 00125 00126 // Set the crop box (as defined in the vtkVolumeMapper superclass) 00127 void UpdateCropping( vtkRenderer *, vtkVolume * ); 00128 00129 // Set the cursor 00130 void UpdateCursor( vtkRenderer *, vtkVolume * ); 00131 00132 // Update the cut plane 00133 void UpdateCutPlane( vtkRenderer *, vtkVolume * ); 00134 00135 // Render the hexagon to the screen 00136 // Defined in the specific graphics implementation. 00137 virtual void RenderHexagon( vtkRenderer * vtkNotUsed(ren), 00138 vtkVolume * vtkNotUsed(vol), 00139 VLIPixel * vtkNotUsed(basePlane), 00140 int size[2], 00141 VLIVector3D hexagon[6], 00142 VLIVector2D textureCoords[6] ) 00143 {(void)size; (void)hexagon; (void)textureCoords;} 00144 00145 // Make the base plane size a power of 2 for OpenGL 00146 void CorrectBasePlaneSize( VLIPixel *inBase, int inSize[2], 00147 VLIPixel **outBase, int outSize[2], 00148 VLIVector2D textureCoords[6] ); 00149 00150 // Keep track of the size of the data loaded so we know if we can 00151 // simply update when a change occurs or if we need to release and 00152 // create again 00153 int LoadedDataSize[3]; 00154 00155 private: 00156 vtkVolumeProVG500Mapper(const vtkVolumeProVG500Mapper&); // Not implemented. 00157 void operator=(const vtkVolumeProVG500Mapper&); // Not implemented. 00158 }; 00159 00160 00161 00162 #endif 00163 00164 00165