Scanner Class Reference

Encapsulates the Generalized Voxel Carving (GVC) algorithm. More...

#include <Scanner.h>

Collaboration diagram for Scanner:

Collaboration graph
[legend]
List of all members.

Public Methods

 Scanner ()
 Constructor.

void getVoxelParamsFromScnFile (const char *filename, Vertex &center, int &voxelsPerSide, double &voxelCubeSize)
 Loads a list of voxel parameters from an xml file. More...

void loadImages (const char *filename, int defaultVoxelsPerSide, float defaultVoxelCubeSize)
 Loads a list of images from a .col or .scn file. More...

void carveVoxels (double threshold, bool bUseSilhouettes)
 Assuming our images were loaded with loadImages, constructs the voxel cube. More...

void setProgressCallback (void(*updateCB)(char *str, float pctDone, void *data), int intervalInSeconds, void *data)
 Sets a callback, which receives a string indicating the current operation. More...

void drawWithAngle (bool bSmooth, double latitude, double longitude)
 Draws the voxel cube, given a certain amount of rotation. More...

void takeSnapshots (const char *directoryName)
 For each input image, save a ppm that has both the original and a rendered version. This is used to compare perspectives, especially when the ppm is compiled into a movie. More...

bool hasSilhouettes () const
 If one or more images has a silhouette available, this will return true.

Vertex guessVoxelcubeCenter ()
 Guesses a good place to put the center of the voxel cube.


Public Attributes

VoxelCube voxelCube
QEM::ProgMesh mesh
 A marching-cubes-generated mesh.


Detailed Description

Encapsulates the Generalized Voxel Carving (GVC) algorithm.

Definition at line 20 of file Scanner.h.


Member Function Documentation

void Scanner::carveVoxels double    threshold,
bool    bUseSilhouettes
 

Assuming our images were loaded with loadImages, constructs the voxel cube.

Exceptions:
logic_error 

Todo:
Try to get QEM mesh simplification working (uncomment last two lines of code in this method).

For every voxel we remove, we have to call setTransparent(), erase an item from the svl, and expose the surrounding voxels. Calling any one of these by itself is senseless, so maybe these three methods should be consolidated somehow.

Definition at line 321 of file Scanner.cpp.

Referenced by CChildView::openFile().

void Scanner::drawWithAngle bool    bSmooth,
double    latitude,
double    longitude
 

Draws the voxel cube, given a certain amount of rotation.

Parameters:
latitude  How much to spin the object in the north/south direction. If it's zero, we don't spin it at all; if it's 90 or -90, then we'd spin it to the north or south pole, respectively.
longitude  How much to spin the object east/west. If it's zero, we don't spin it at all; if it's 180, we spin it completely around, etc.

Definition at line 251 of file Scanner.cpp.

void Scanner::getVoxelParamsFromScnFile const char *    filename,
Vertex &    center,
int &    voxelsPerSide,
double &    voxelCubeSize
 

Loads a list of voxel parameters from an xml file.

Here, those are loaded from an ".scn" (xml really) file.

Definition at line 27 of file Scanner.cpp.

Referenced by CChildView::openFile().

void Scanner::loadImages const char *    filename,
int    defaultVoxelsPerSide,
float    defaultVoxelCubeSize
 

Loads a list of images from a .col or .scn file.

Parameters:
filename  The name of the ".scn" or ".col" file to load
Note:
This dumps both the mesh and the voxelcube information.
Exceptions:
runtime_error  Failure in loading one or more of the files specified by filename.

Definition at line 607 of file Scanner.cpp.

Referenced by CChildView::openFile().

void Scanner::setProgressCallback void(*    updateCB)(char *str, float pctDone, void *data),
int    intervalInSeconds,
void *    data
 

Sets a callback, which receives a string indicating the current operation.

Parameters:
updateCB  The callback to call when progress is to be reported. If this is NULL, then progress won't be reported.
intervalInSeconds  The minimum amount of time between progress updates.
data  This is arbitrary data that will be sent back to the caller during the callback.

Definition at line 474 of file Scanner.cpp.

Referenced by CChildView::openFile().

void Scanner::takeSnapshots const char *    directoryName
 

For each input image, save a ppm that has both the original and a rendered version. This is used to compare perspectives, especially when the ppm is compiled into a movie.

This is used to compare perspectives.

Definition at line 536 of file Scanner.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 21 03:35:13 2002 for Archimedes by doxygen1.2.15