[Insight-users] GlutMaster build err

Luis Ibanez luis.ibanez@kitware.com
Fri, 18 Oct 2002 15:26:11 -0400


Hi Dean,

GlutMaster was recently added to Insight/Utilities

It is intended to support a minimal viewer
for 2D and 3D images.  The hope is to provide
a simple rapid start for visualization.

-----------------------

The ImageViewer class can be used like:

   typedef itk::Image< int, 3 > ImageType;
   typedef itk::ImageViewer< ImageType > ViewerType;
   ViewerType::Pointer  viewer = ViewerType::New();
   viewer->SetInput( filter->GetOutput() );
   viewer->Update();

   ViewerType::StartInteraction();

This will display a simple window with a slice of
the 3D image.

The following key are enabled:

'f' = forward  = move to next slice
'b' = backward = move to previous slice
'x' = cut slices along X, that is the YZ plane
'y' = cut slices along Y, that is the XZ plane
'z' = cut slices along Z, that is the XY plane

if the image is 2D all the keys are ignored

-------------------------

GLUT_FOUND is not a variable that you should manipulate
in your cache.  This variable is set directly by CMake
following the rules in CMake/Modules/FindGLUT.cmake

IFF CMake finds the file:

- glut32.dll
- GL/glut.h

it will set GLUT_FOUND to "true" for you.

---

ITK CMakeLists.txt are using the value of GLUT_FOUND
to figure out if glut is available or not.

If GLUT is available, then GlutMaster is built and
the ImageViewer in Image/Code/IO is built too.

If GLUT is not available these classes are simply
ignored.


The right way of enabling the itk::ImageViewer
(and GlutMaster) to build is to run CMake, select
"advanced" and make sure that the following two
variables are set correctly:

1) GLUT_glut_LIBRARY
2) GLUT_INCLUDE_DIR


GLUT_glut_LIBRARY should have the full path
  to glut32

GLUT_INCLUDE_DIR should have the path to GL/glut.h
(if your glut.h is installed in  /home/inglis/src/GL/glut.h
then this variable should be set to /home/inglis/src )

Once these two variables are correctly set,
CMake will internally enable "GLUT_FOUND" and the
value will control the build process of ITK.

....


About the Borland problem.... it is hard to know,...
it may be something that needs to be fixed in GlutMaster..
Could you please verify the CMake configuration first.
If the problem with Borland persists we can track it
and figure out a solution.


Please let us know what you find,

Thanks



    Luis



================================================

Dean Inglis wrote:
> Hi,
> 
> I'm not sure if GlutMaster is part of the
> current CVS build but I was curious so:
> my vtk cmake cache defines both
> GLUT_LIBRARY:STRING=glut32
> GLU_LIBRARY:STRING=import32
> so that the vtk ftgl demos build with glu/glut.
> GLUT_FOUND is not part of CMake 1.4.5, but is
> part of the current cmake CVS, so I added
> GLUT_FOUND:STRING=YES to my itk cmake cache.
> (maybe instead of GLUT_FOUND the CMakeLists.txt
> in GlutMaster could be something along the lines
> IF (GLU_LIBRARY AND GLUT_LIBRARY)?)
> 
> FYI, GlutMaster starts to build on Borland and dies with:
> Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
> c:\Builder\Insight\Utilities\GlutMaster\itkGlutMaster.cxx:
> Error E2337 C:\Program Files\Borland\CBuilder5\Include\stdlib.h 584: Only
> one
> of a set of overloaded functions can be "C"
> 
> Dean
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dean Inglis, Ph.D.
> -      Centre for Appendicular       -
> - Magnetic Resonance Imaging Studies -
> 25 Charlton Avenue East, Unit 610
> Hamilton, ONT, L8N 1Y2
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
> 
>