Commit e8da8a8e authored by Ken Martin's avatar Ken Martin
Browse files

removed VG500

parent 96a5748d
......@@ -537,11 +537,7 @@ ENDIF(VTK_OPENGL_HAS_OSMESA AND VTK_USE_MANGLED_MESA)
# Configure VolumePro support.
IF(VTK_USE_VOLUMEPRO)
INCLUDE(${VTK_SOURCE_DIR}/CMake/FindVLI.cmake)
MARK_AS_ADVANCED(VLI_LIBRARY_FOR_VG500 VLI_INCLUDE_PATH_FOR_VG500
VLI_LIBRARY_FOR_VP1000 VLI_INCLUDE_PATH_FOR_VP1000)
IF(VLI_LIBRARY_FOR_VG500 AND VLI_INCLUDE_PATH_FOR_VG500)
SET(VTK_HAVE_VG500 ON)
ENDIF(VLI_LIBRARY_FOR_VG500 AND VLI_INCLUDE_PATH_FOR_VG500)
MARK_AS_ADVANCED(VLI_LIBRARY_FOR_VP1000 VLI_INCLUDE_PATH_FOR_VP1000)
IF(VLI_LIBRARY_FOR_VP1000 AND VLI_INCLUDE_PATH_FOR_VP1000)
SET(VTK_HAVE_VP1000 ON)
ENDIF(VLI_LIBRARY_FOR_VP1000 AND VLI_INCLUDE_PATH_FOR_VP1000)
......
......@@ -119,12 +119,6 @@ vtkWindowToImageFilter.cxx
vtkWorldPointPicker.cxx
)
IF (VTK_HAVE_VG500)
SET( Kit_SRCS ${Kit_SRCS}
vtkVolumeProVG500Mapper.cxx
vtkOpenGLVolumeProVG500Mapper.cxx
)
ENDIF (VTK_HAVE_VG500)
IF (VTK_HAVE_VP1000)
SET( Kit_SRCS ${Kit_SRCS}
vtkVolumeProVP1000Mapper.cxx
......@@ -213,9 +207,6 @@ ENDIF(VTK_USE_X)
# Build a list of libraries to link to vtkRendering.
IF(VTK_USE_VOLUMEPRO)
IF(VTK_HAVE_VG500)
SET(KIT_LIBS ${KIT_LIBS} ${VLI_LIBRARY_FOR_VG500})
ENDIF(VTK_HAVE_VG500)
IF(VTK_HAVE_VP1000)
SET(KIT_LIBS ${KIT_LIBS} ${VLI_LIBRARY_FOR_VP1000})
ENDIF(VTK_HAVE_VP1000)
......
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOpenGLVolumeProVG500Mapper.cxx
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.
=========================================================================*/
#include "vtkOpenGLVolumeProVG500Mapper.h"
#include "vtkCamera.h"
#include "vtkObjectFactory.h"
#include "vtkRenderer.h"
#include "vtkTransform.h"
#include "vtkVolume.h"
#include <GL/gl.h>
vtkCxxRevisionMacro(vtkOpenGLVolumeProVG500Mapper, "1.20");
vtkStandardNewMacro(vtkOpenGLVolumeProVG500Mapper);
void vtkOpenGLVolumeProVG500Mapper::RenderHexagon( vtkRenderer *ren,
vtkVolume *vol,
VLIPixel *basePlane,
int size[2],
VLIVector3D hexagon[6],
VLIVector2D textureCoords[6] )
{
vtkTransform *t;
int i;
float in[4], out[4];
float *center, x;
float volCenter[3];
VLIVector3D hexCenter;
// Turn lighting off - the hexagon texture already has illumination in it
glDisable( GL_LIGHTING );
// Turn texturing on so that we can draw the textured hexagon
glEnable( GL_TEXTURE_2D );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
// Push a new matrix since we are going to modify it
glMatrixMode( GL_MODELVIEW );
glPushMatrix();
// Find out where the center of the volume is in camera coordinates
t = vtkTransform::New();
t->SetMatrix( ren->GetActiveCamera()->GetViewTransformMatrix() );
center = vol->GetCenter();
// if the cut plane is on
if ( this->CutPlane )
{
// How far is the center from the center of the cut?
float dist =
center[0] * this->CutPlaneEquation[0] +
center[1] * this->CutPlaneEquation[1] +
center[2] * this->CutPlaneEquation[2] +
this->CutPlaneEquation[3] + 0.5*this->CutPlaneThickness;
// Move the center along the cut direction onto the cut center plane.
center[0] -=
dist * this->CutPlaneEquation[0];
center[1] -=
dist * this->CutPlaneEquation[1];
center[2] -=
dist * this->CutPlaneEquation[2];
}
in[0] = center[0];
in[1] = center[1];
in[2] = center[2];
in[3] = 1.0;
t->MultiplyPoint(in, out);
volCenter[0] = out[0] / out[3];
volCenter[1] = out[1] / out[3];
volCenter[2] = out[2] / out[3];
// Invert this matrix to go from view to world
t->Inverse();
// Specify the texture
glColor3f(1.0,1.0,1.0);
#ifdef GL_VERSION_1_1
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, size[0], size[1],
0, GL_RGBA, GL_UNSIGNED_BYTE, basePlane );
#else
glTexImage2D( GL_TEXTURE_2D, 0, 4, size[0], size[1],
0, GL_RGBA, GL_UNSIGNED_BYTE, basePlane );
#endif
// What is the center of the hexagon?
if (hexagon[0] + (hexagon[0]-hexagon[3]) == hexagon[3])
{
x = 0.5;
}
else
{
x = -0.5;
}
hexCenter = hexagon[0] + (x*(hexagon[0] - hexagon[3]));
// Render the hexagon - subtract the hexagon center from
// each vertex, and add the center of the volume to each vertex.
// also, transform the vertices into world coordinates (from the
// view coordinates that the VPRO harware returns them in)
glBegin( GL_POLYGON );
for ( i = 0; i < 6; i++ )
{
glTexCoord2d( textureCoords[i].X(), textureCoords[i].Y() );
in[0] = hexagon[i].X() - hexCenter.X() + volCenter[0];
in[1] = hexagon[i].Y() - hexCenter.Y() + volCenter[1];
in[2] = hexagon[i].Z() - hexCenter.Z() + volCenter[2];
in[3] = 1.0;
t->MultiplyPoint(in, in);
glVertex3fv( in );
}
glEnd();
t->Delete();
glDisable( GL_TEXTURE_2D );
// Pop the OpenGL modelview matrix
glPopMatrix();
// Turn lighting back on
glEnable( GL_LIGHTING );
}
//----------------------------------------------------------------------------
void vtkOpenGLVolumeProVG500Mapper::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
}
/*=========================================================================
Program: Visualization Toolkit
Module: vtkOpenGLVolumeProVG500Mapper.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 vtkOpenGLVolumeProVG500Mapper - Concrete class for VolumePRO mapper
//
// .SECTION Description
// vtkOpenGLVolumeProVG500Mapper is the concrete implementation of a
// vtkVolumeProMapper based on the VG500 chip running with OpenGL.
// Users should not create this class directly - a vtkVolumeProMapper will
// automatically create the object of the right type.
//
// This class is not included in the Rendering CMakeLists by default. If you
// want to add this class to your vtk build, you need to have the vli header
// and library files. Please see the vtkVolumeProVG500Mapper.h file for
// instructions on how to use the vli library with vtk.
//
// For more information on the VolumePRO hardware, please see:
//
// http://www.terarecon.com/3d_products.shtml
//
// If you encounter any problems with this class, please inform Kitware, Inc.
// at kitware@kitware.com.
//
//
// .SECTION See Also
// vtkVolumeMapper vtkVolumeProMapper vtkVolumeProVG500Mapper
//
#ifndef __vtkOpenGLVolumeProVG500Mapper_h
#define __vtkOpenGLVolumeProVG500Mapper_h
#include "vtkVolumeProVG500Mapper.h"
class VTK_VOLUMEPRO_EXPORT vtkOpenGLVolumeProVG500Mapper : public vtkVolumeProVG500Mapper
{
public:
vtkTypeRevisionMacro(vtkOpenGLVolumeProVG500Mapper,vtkVolumeProVG500Mapper);
static vtkOpenGLVolumeProVG500Mapper *New();
virtual void PrintSelf(ostream& os, vtkIndent indent);
protected:
vtkOpenGLVolumeProVG500Mapper() {};
~vtkOpenGLVolumeProVG500Mapper() {};
// Render the hexagon returned by the hardware to the screen.
void RenderHexagon( vtkRenderer *ren,
vtkVolume *vol,
VLIPixel *basePlane,
int size[2],
VLIVector3D hexagon[6],
VLIVector2D textureCoords[6] );
private:
vtkOpenGLVolumeProVG500Mapper(const vtkOpenGLVolumeProVG500Mapper&); // Not implemented.
void operator=(const vtkOpenGLVolumeProVG500Mapper&); // Not implemented.
};
#endif
......@@ -17,9 +17,6 @@
#include "vtkRenderer.h"
#include "vtkToolkits.h"
#if defined (VTK_HAVE_VG500) || defined (VTK_FORCE_COMPILE_VG500)
#include "vtkVolumeProVG500Mapper.h"
#endif
#if defined (VTK_HAVE_VP1000) || defined (VTK_FORCE_COMPILE_VP1000)
#include "vtkVolumeProVP1000Mapper.h"
#endif
......@@ -29,7 +26,7 @@
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkVolumeProMapper, "1.32");
vtkCxxRevisionMacro(vtkVolumeProMapper, "1.33");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -125,17 +122,10 @@ vtkVolumeProMapper *vtkVolumeProMapper::New()
vtkDebugLeaks::DestructClass("vtkVolumeProMapper");
return vtkVolumeProVP1000Mapper::New();
#else
#if defined (VTK_HAVE_VG500) || defined (VTK_FORCE_COMPILE_VG500)
vtkDebugLeaks::DestructClass("vtkVolumeProMapper");
return vtkVolumeProVG500Mapper::New();
#else
// if not using vli, then return the stub class, which will render
// nothing....
return new vtkVolumeProMapper;
#endif
#endif
}
int vtkVolumeProMapper::StatusOK()
......
......@@ -26,8 +26,8 @@
// If you do not have the VolumePRO libraries when building this object, then
// the New method will create a default renderer that will not render.
// You can check the NumberOfBoards ivar to see if it is a real rendering class.
// To build with the VolumePRO board see vtkVolumeProVG500Mapper.h or
// vtkVolumeProVP1000Mapper.h for instructions.
// To build with the VolumePRO board see vtkVolumeProVP1000Mapper.h
// for instructions.
//
// For more information on the VolumePRO hardware, please see:
//
......@@ -38,8 +38,7 @@
//
//
// .SECTION See Also
// vtkVolumeMapper vtkVolumeProVG500Mapper vtkOpenGLVolumeProVG500Mapper
// vtkVolumeProVP1000Mapper vtkOpenGLVolumeProVP1000Mapper
// vtkVolumeMapper vtkVolumeProVP1000Mapper vtkOpenGLVolumeProVP1000Mapper
//
......@@ -216,7 +215,6 @@ public:
// Description:
// Specify whether any geometry intersects the volume.
// Does nothing with VG500
vtkSetClampMacro(IntermixIntersectingGeometry, int, 0, 1);
vtkGetMacro(IntermixIntersectingGeometry, int);
vtkBooleanMacro(IntermixIntersectingGeometry, int);
......
This diff is collapsed.
/*=========================================================================
Program: Visualization Toolkit
Module: vtkVolumeProVG500Mapper.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 vtkVolumeProVG500Mapper - Superclass for VG500 board
//
// .SECTION Description
// vtkVolumeProVG500Mapper is the superclass for VolumePRO volume rendering
// mappers based on the VG500 chip. Subclasses are for underlying graphics
// languages. Users should not create subclasses directly -
// a vtkVolumeProMapper will automatically create the object of the right
// type.
//
// This class is not included in the Rendering CMakeLists by default. If you
// want to add this class to your vtk build, you need to have the vli header
// and library files, and you will need to perform the following steps:
//
// 1. Run cmake, and set the VTK_USE_VOLUMEPRO flag to true.
// 2. If the libary file (VLI_LIBRARY_FOR_VG500) is not found by cmake, set
// the path to that file, and rerun cmake.
// 3. If the header file (VLI_INCLUDE_PATH_FOR_VG500) is not found by cmake,
// set the path to that file, and rerun cmake.
// 4. Rebuild VTK.
//
// For more information on the VolumePRO hardware, please see:
//
// http://www.terarecon.com/3d_products.shtml
//
// If you encounter any problems with this class, please inform Kitware, Inc.
// at kitware@kitware.com.
//
//
// .SECTION See Also
// vtkVolumeMapper vtkVolumeProMapper vtkOpenGLVolumeProVG500Mapper
//
#ifndef __vtkVolumeProVG500Mapper_h
#define __vtkVolumeProVG500Mapper_h
#include "vtkVolumeProMapper.h"
#ifdef _WIN32
// This ugly thing will prevent MS Visual Studio .NET from complaining
// about mixing new and old IOStream. This is necessary due to lack of
// platform independency in vli.h. It probably will not work or
// anything, but it will at least compile.
# if ( defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(_INC_IOSTREAM) )
# define _INC_IOSTREAM
# define _VTK_HACKED_UP_INCLUDE_BLOCKER
# endif
# include "VolumePro/inc/vli.h" // Needed for VLI internals
# if defined(_VTK_HACKED_UP_INCLUDE_BLOCKER)
# undef _INC_IOSTREAM
# undef _VTK_HACKED_UP_INCLUDE_BLOCKER
# endif
#else
# include "vli/include/vli.h" // Needed for VLI internals
#endif
#ifdef VTK_USE_VOLUMEPRO
#define VTK_VOLUMEPRO_EXPORT VTK_RENDERING_EXPORT
#else
#define VTK_VOLUMEPRO_EXPORT
#endif
class VTK_VOLUMEPRO_EXPORT vtkVolumeProVG500Mapper : public vtkVolumeProMapper
{
public:
vtkTypeRevisionMacro(vtkVolumeProVG500Mapper,vtkVolumeProMapper);
static vtkVolumeProVG500Mapper *New();
virtual void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Render the image using the hardware and place it in the frame buffer
virtual void Render( vtkRenderer *, vtkVolume * );
virtual int GetAvailableBoardMemory();
virtual void GetLockSizesForBoardMemory( unsigned int type,
unsigned int *xSize,
unsigned int *ySize,
unsigned int *zSize );
protected:
vtkVolumeProVG500Mapper();
~vtkVolumeProVG500Mapper();
// Update the camera - set the camera matrix
void UpdateCamera( vtkRenderer *, vtkVolume * );
// Update the lights
void UpdateLights( vtkRenderer *, vtkVolume * );
// Update the properties of the volume including transfer functions
// and material properties
void UpdateProperties( vtkRenderer *, vtkVolume * );
// Update the volume - create it if necessary
// Set the volume matrix.
void UpdateVolume( vtkRenderer *, vtkVolume * );
// Set the crop box (as defined in the vtkVolumeMapper superclass)
void UpdateCropping( vtkRenderer *, vtkVolume * );
// Set the cursor
void UpdateCursor( vtkRenderer *, vtkVolume * );
// Update the cut plane
void UpdateCutPlane( vtkRenderer *, vtkVolume * );
// Render the hexagon to the screen
// Defined in the specific graphics implementation.
virtual void RenderHexagon( vtkRenderer * vtkNotUsed(ren),
vtkVolume * vtkNotUsed(vol),
VLIPixel * vtkNotUsed(basePlane),
int size[2],
VLIVector3D hexagon[6],
VLIVector2D textureCoords[6] )
{(void)size; (void)hexagon; (void)textureCoords;}
// Make the base plane size a power of 2 for OpenGL
void CorrectBasePlaneSize( VLIPixel *inBase, int inSize[2],
VLIPixel **outBase, int outSize[2],
VLIVector2D textureCoords[6] );
// Keep track of the size of the data loaded so we know if we can
// simply update when a change occurs or if we need to release and
// create again
int LoadedDataSize[3];
private:
vtkVolumeProVG500Mapper(const vtkVolumeProVG500Mapper&); // Not implemented.
void operator=(const vtkVolumeProVG500Mapper&); // Not implemented.
};
#endif
......@@ -47,7 +47,6 @@ SET(VTK_LANGUAGES "@VTK_LANGUAGES@")
SET(VTK_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
SET(VTK_DEBUG_LEAKS "@VTK_DEBUG_LEAKS@")
SET(VTK_DISABLE_TK_INIT "@VTK_DISABLE_TK_INIT@")
SET(VTK_HAVE_VG500 "@VTK_HAVE_VG500@")
SET(VTK_HAVE_VP1000 "@VTK_HAVE_VP1000@")
SET(VTK_USE_MANGLED_MESA "@VTK_USE_MANGLED_MESA@")
SET(VTK_MPIRUN_EXE "@VTK_MPIRUN_EXE_CONFIG@")
......
......@@ -19,12 +19,6 @@ IF(VTK_USE_RENDERING)
${CMAKE_Xlib_INCLUDE_PATH} ${CMAKE_Xutil_INCLUDE_PATH})
ENDIF(VTK_USE_X)
IF(VTK_HAVE_VG500)
# VolumePro VG 500 include directory.
SET(VTK_INCLUDE_DIRS_SYSTEM ${VTK_INCLUDE_DIRS_SYSTEM}
${VLI_INCLUDE_PATH_FOR_VG500})
ENDIF(VTK_HAVE_VG500)
IF(VTK_HAVE_VP1000)
# VolumePro VP 1000 include directory.
SET(VTK_INCLUDE_DIRS_SYSTEM ${VTK_INCLUDE_DIRS_SYSTEM}
......
......@@ -25,7 +25,6 @@
#cmakedefine VTK_USE_PATENTED
#cmakedefine VTK_USE_RENDERING
#cmakedefine VTK_USE_VOLUMEPRO
#cmakedefine VTK_HAVE_VG500
#cmakedefine VTK_HAVE_VP1000
#cmakedefine VTK_USE_GL2PS
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment