Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuMarchingCubes Class Reference

A utility window for the marching cubes algorithm on regular unimodal grids. More...

#include <vuMarchingCubes.h>

Inheritance diagram for vuMarchingCubes:

Inheritance graph
[legend]
Collaboration diagram for vuMarchingCubes:

Collaboration graph
[legend]
List of all members.

Public Types

enum  {
  idMCFirst = vuMCHistogram::idMCHLast, idMCCbxCubeEnabled, idMCCbxLight1Enabled, idMCCbxDrawFrame,
  idMCCbxDrawLines, idMCRbxRotate, idMCCbxCullLinesFrontBack, idMCCbxUpdateMode,
  idMCCbxMeshStatisitcs, idMCCbxDrawNormals, idMCBtnUpdate
}

Public Member Functions

 vuMarchingCubes ()
 Constructor.
virtual ~vuMarchingCubes ()
 Destructor.
bool init (const char *DataFile)
 Initialize the tool.
virtual void addTop (wxSizer *sizer)
 This method adds controls to the top of the window.
virtual void addRight (wxSizer *sizer)
 This method adds controls to the right of the window.
wxPanelcreateInfoNotebook (wxNotebook *nb)
 Adds the Info page to the notebook on the right side.
wxPanelcreateSettingsNotebook (wxNotebook *nb)
wxPanelcreateGLNotebook (wxNotebook *nb)
wxPanelcreateHelpNotebook (wxNotebook *nb)
virtual vuCameragetCamera ()
 Abstract function needs to be overwritten.
void setCamera (vuCamera *cam)
 Abstract function needs to be overwritten.
virtual vuImagegetCurrentImage ()
 Abstract function needs to be overwritten.
virtual void DrawFromImage ()
 Abstract function needs to be overwritten.
virtual void DrawAgain ()
 Abstract function needs to be overwritten.
void redraw ()
 Redraws the gl context.
void resize ()
 called, wenn the gl geometry is changed.
void OnCubeChange (int val)
 Called, when the cube config is changed by the respective widgets.
void setBackground ()
void OnProgress (float v)
 Updates the progress bar in the right side tab.
void OnChangeFrame ()
 This function is called from a decorator whenever the frame setting is changed.
void OnThresChange ()
void OnNormalLengthChange (float l)
void OnSetObjectColor ()
void OnSetLineColor ()
void OnCubeSizeChange ()
void OnSelectType (int n)

Static Public Member Functions

const char * getFileType ()
 Returns the type of vu Datafile that the utility works with.

Protected Member Functions

vu1getVolume ()
 returns a pointer to m_Data
bool glInit ()
 Initialize OpenGL.
void glResize ()
 Called, when the window is resized.
void glRender ()
 Called, when anything in the window is changed (object rotated, or other).
void OnChar (wxKeyEvent &event)
 We do keyboard handling for our own.
void glOnMouse (wxMouseEvent &event)
 Handles mouse event.
void onMouseLeftMoving (wxMouseEvent &event)
 The function handles mouse drags with the left mouse button pressed.
void onMouseRightMoving (wxMouseEvent &event)
void onMouseDown (wxMouseEvent &event)
void onMouseUp (wxMouseEvent &event)
void onDblClick (wxMouseEvent &event)
 On a double click the cube under the "cursor" will be highlighted.
void OnLight1Checked (wxCommandEvent &event)
void OnCubeEnabledChecked (wxCommandEvent &event)
void OnFrameChecked (wxCommandEvent &event)
void OnRotateChecked (wxCommandEvent &event)
void OnCullLinesFrontBackChecked (wxCommandEvent &event)
void OnUpdateModeChecked (wxCommandEvent &event)
void OnDrawNormalsChecked (wxCommandEvent &event)

Private Member Functions

void rotate (float ax, float ay)
 Rotate the object in x an y direction.
wxString format (double val)
 Format the float value val to a
 %0.3f 
string.
void doThresChange ()
void doResetThres ()
int outside (vuVector &point, double *size)
 Takes a point and a volume size and returns, if the point is outside this volume.

Private Attributes

vu1m_Data
 The raycaster owned by the utility.
MarchingCubesBasem_base
 Shortcut the the MarchingCubesBase methods.
MCGlobalData m_gd
 Global data used by several classes in the marching cubes engine.
wxImageList * m_imageList
 Images for the Page headers on m_notebook.
vuMCSliderm_thres
 This slider holds the threshold for the marching cubes alogrithm.
vuMCKeyValuem_cubesTotal
 Indicates the number of cubes total.
vuMCKeyValuem_cube0
 Cubes of type 0 are handled separatly so the historgram does show anything meaningful.
vuMCKeyValuem_cube255
 Cubes of type 255 are also handled separatly.
vuMCKeyValuem_cubeOther
 Indicates the number of cubes of other types.
vuMCHistogramm_cubeHist
 This widget shows the number of occurrences of all cube types.
vuMCKeyVectorm_size
vuMCKeyVectorm_angle
 Holds the Rotation angle of the object.
vuMCKeyVectorm_pos
 Holds and shows the position of the opbject.
vuMCKeyValuem_zoom
vuMCKeyVectorm_light0Pos
 Holds an displays the position of light 0.
wxCheckBox * m_light1Enabled
 Light 1 can be enabled.
vuMCKeyVectorm_light1Pos
 Holds an displays the position of light 1.
vuMCKeyValuem_numTriangles
vuMCKeyValuem_numVertices
vuMCKeyValuem_numIndices
vuMCKeyValuem_meshSize
 Indicates the memory usage of the complete mesh.
wxStaticText * m_statusText
 This label should be set to explain the status shonw in the m_status.
wxGauge * m_status
vuMCRGBColorm_backColor
 Light Color.
vuMCRGBColorm_lightColor
vuMCGrayColorm_lightDiffuse
vuMCGrayColorm_lightSpecular
vuMCGrayColorm_lightShiny
vuMCRGBColorm_frameColor
vuMCRGBColorm_lineColor
vuMCRGBColorm_selectColor
vuMCRGBColorm_objectColor
vuMCGrayColorm_objectDiffuse
vuMCGrayColorm_objectSpecular
vuMCGrayColorm_objectShiny
vuMCSliderm_mouseSpeed
wxCheckBox * m_drawFrame
wxCheckBox * m_cullBack
wxCheckBox * m_cullFront
wxCheckBox * m_linesBack
wxCheckBox * m_linesFront
vuMCSliderm_frameRadius
wxRadioBox * m_rotateX
wxRadioBox * m_rotateY
wxRadioBox * m_rotateZ
wxCheckBox * m_updateMode
wxCheckBox * m_doMeshStatistics
wxCheckBox * m_cubeEnabled
vuMCBitFieldm_cube
 Manipulates and displayes the cube setup.
wxCheckBox * m_drawNormals
vuMCSliderm_drawNormalsSize
vuMCSliderm_cubeSizeX
vuMCSliderm_cubeSizeY
vuMCSliderm_cubeSizeZ
int m_fpsTime
int m_fpsCount
vuMCSliderm_fpsWatermark
float m_fps
float m_avgFps
GLdouble x1
GLdouble y1
GLdouble z1
GLdouble x2
GLdouble y2
GLdouble z2

Friends

class vuMCMCBProgressCallback
class vuMCMCBHistoCallback

Detailed Description

A utility window for the marching cubes algorithm on regular unimodal grids.

This class provides the frontend for the marching cubes algorithm. It does all the rendering while the data classes (such as vu1112211) do the data reading and scanning and provide the vertices and triangles. This stands in opposition to the paradigma of all other "tools" in this framework.

The class also provides a "slider" to change the threshold for the raycaster, provides information about the engine state and let's the user change some settings, such as several colors and the behaviour of the controller. It also provides a interface to the cube browser, which is implemented in MarchingCubesBase.

For more information about the structure of the engine see the general documentation of this file.

Todo:
Refactor documentation.

Bug:
Changing the cube size does not update the cube browser.

Definition at line 957 of file vuMarchingCubes.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
idMCFirst 
idMCCbxCubeEnabled 
idMCCbxLight1Enabled 
idMCCbxDrawFrame 
idMCCbxDrawLines 
idMCRbxRotate 
idMCCbxCullLinesFrontBack 
idMCCbxUpdateMode 
idMCCbxMeshStatisitcs 
idMCCbxDrawNormals 
idMCBtnUpdate 

Definition at line 964 of file vuMarchingCubes.h.


Constructor & Destructor Documentation

vuMarchingCubes::vuMarchingCubes  ) 
 

Constructor.

vuMarchingCubes::~vuMarchingCubes  )  [virtual]
 

Destructor.

Definition at line 1132 of file vuMarchingCubes.cpp.

References DEBUGD.


Member Function Documentation

void vuMarchingCubes::addRight wxSizer *  sizer  )  [virtual]
 

This method adds controls to the right of the window.

Reimplemented from vuBasicUtility.

Definition at line 1342 of file vuMarchingCubes.cpp.

References createGLNotebook(), createHelpNotebook(), createInfoNotebook(), createSettingsNotebook(), DEBUG0, m_imageList, and size.

Here is the call graph for this function:

void vuMarchingCubes::addTop wxSizer *  sizer  )  [virtual]
 

This method adds controls to the top of the window.

Reimplemented from vuBasicUtility.

Definition at line 1323 of file vuMarchingCubes.cpp.

References DEBUG0, idMCBtnUpdate, m_gd, m_thres, MCGlobalData::thres, vuMCSlider::UpdateMode(), MCGlobalData::valueMax, MCGlobalData::valueMin, and VU_MCS_END_UPDATE.

Here is the call graph for this function:

wxPanel * vuMarchingCubes::createGLNotebook wxNotebook *  nb  ) 
 

Definition at line 1575 of file vuMarchingCubes.cpp.

References idMCCbxLight1Enabled, MCGlobalData::lineColor, m_backColor, m_frameColor, m_gd, m_light1Enabled, m_lightColor, m_lightDiffuse, m_lightShiny, m_lightSpecular, m_lineColor, m_objectColor, m_objectDiffuse, m_objectShiny, m_objectSpecular, m_selectColor, MC_DEFAULT_LIGHT1_ENABLED, MCGlobalData::objectColor, setBackground(), and vuMCRGBColor::tovuVector().

Referenced by addRight().

Here is the call graph for this function:

wxPanel * vuMarchingCubes::createHelpNotebook wxNotebook *  nb  ) 
 

Definition at line 1638 of file vuMarchingCubes.cpp.

Referenced by addRight().

wxPanel * vuMarchingCubes::createInfoNotebook wxNotebook *  nb  ) 
 

Adds the Info page to the notebook on the right side.

Definition at line 1376 of file vuMarchingCubes.cpp.

References DEBUG0, m_angle, m_cube0, m_cube255, m_cubeHist, m_cubeOther, m_cubesTotal, m_light0Pos, m_light1Pos, m_meshSize, m_numIndices, m_numTriangles, m_numVertices, m_pos, m_size, m_status, m_statusText, m_zoom, and MC_DEFAULT_LIGHT1_ENABLED.

Referenced by addRight().

wxPanel * vuMarchingCubes::createSettingsNotebook wxNotebook *  nb  ) 
 

Definition at line 1458 of file vuMarchingCubes.cpp.

References MCGlobalData::cubeBrowser, MCGlobalData::doMeshStatistics, MCGlobalData::drawNormals, idMCCbxCubeEnabled, idMCCbxCullLinesFrontBack, idMCCbxDrawFrame, idMCCbxDrawNormals, idMCCbxMeshStatisitcs, idMCCbxUpdateMode, idMCRbxRotate, m_cube, m_cubeEnabled, m_cubeSizeX, m_cubeSizeY, m_cubeSizeZ, m_cullBack, m_cullFront, m_doMeshStatistics, m_drawFrame, m_drawNormals, m_drawNormalsSize, m_fpsWatermark, m_frameRadius, m_gd, m_linesBack, m_linesFront, m_mouseSpeed, m_rotateX, m_rotateY, m_rotateZ, m_thres, m_updateMode, MC_DEFAULT_DRAW_FRAME, MC_DEFAULT_FPS_WATERMARK, MCGlobalData::normalsLength, NULL, and vuMCSlider::UpdateMode().

Referenced by addRight().

Here is the call graph for this function:

void vuMarchingCubes::doResetThres  )  [private]
 

Definition at line 2385 of file vuMarchingCubes.cpp.

References DEBUG0, m_numIndices, m_numTriangles, and m_numVertices.

Referenced by OnThresChange().

void vuMarchingCubes::doThresChange  )  [private]
 

Definition at line 2357 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG3, m_base, m_gd, m_meshSize, m_numIndices, m_numTriangles, m_numVertices, m_thres, vuMCSlider::Max(), MCGlobalData::meshSize, vuMCSlider::Min(), MarchingCubesBase::numIndices(), MarchingCubesBase::numTriangles(), MarchingCubesBase::numVertices(), MCGlobalData::valueMax, and MCGlobalData::valueMin.

Referenced by init(), and OnThresChange().

Here is the call graph for this function:

void vuMarchingCubes::DrawAgain  )  [virtual]
 

Abstract function needs to be overwritten.

Implements vuBasicUtility.

Definition at line 1315 of file vuMarchingCubes.cpp.

References DEBUG0.

void vuMarchingCubes::DrawFromImage  )  [virtual]
 

Abstract function needs to be overwritten.

Implements vuBasicUtility.

Definition at line 1307 of file vuMarchingCubes.cpp.

References DEBUG0.

wxString vuMarchingCubes::format double  val  )  [inline, private]
 

Format the float value val to a

 %0.3f 
string.

Definition at line 1190 of file vuMarchingCubes.h.

Referenced by glRender().

vuCamera * vuMarchingCubes::getCamera  )  [virtual]
 

Abstract function needs to be overwritten.

Implements vuBasicUtility.

Definition at line 1280 of file vuMarchingCubes.cpp.

References DEBUG0.

vuImage * vuMarchingCubes::getCurrentImage  )  [virtual]
 

Abstract function needs to be overwritten.

Implements vuBasicUtility.

Definition at line 1298 of file vuMarchingCubes.cpp.

References DEBUG0.

const char * vuMarchingCubes::getFileType  )  [static]
 

Returns the type of vu Datafile that the utility works with.

Reimplemented from vuBasicUtility.

Definition at line 1194 of file vuMarchingCubes.cpp.

References DEBUG0.

vu1 * vuMarchingCubes::getVolume  )  [protected, virtual]
 

returns a pointer to m_Data

Reimplemented from vuBasicUtility.

Definition at line 1677 of file vuMarchingCubes.cpp.

References DEBUG0.

bool vuMarchingCubes::glInit  )  [protected, virtual]
 

Initialize OpenGL.

Reimplemented from vuBasicUtility.

Definition at line 1687 of file vuMarchingCubes.cpp.

References vuMCRGBColor::Alpha(), assert, vuMCRGBColor::Blue(), DEBUG0, GL_AMBIENT_AND_DIFFUSE, GL_BACK, GL_CULL_FACE, GL_DEPTH_TEST, GL_FRONT_AND_BACK, GL_LIGHT0, GL_LIGHT_MODEL_LOCAL_VIEWER, GL_LIGHT_MODEL_TWO_SIDE, GL_LIGHTING, GL_LINE_SMOOTH, GL_SMOOTH, GL_TRUE, glClearColor(), glColorMaterial(), glCullFace(), glEnable(), glLightModeli(), glShadeModel(), vuMCRGBColor::Green(), m_backColor, m_Data, m_size, NULL, and vuMCRGBColor::Red().

Here is the call graph for this function:

void vuMarchingCubes::glOnMouse wxMouseEvent &  event  )  [protected, virtual]
 

Handles mouse event.

Reimplemented from vuBasicUtility.

Definition at line 1861 of file vuMarchingCubes.cpp.

References DEBUG0, onDblClick(), onMouseDown(), onMouseLeftMoving(), onMouseRightMoving(), and onMouseUp().

Here is the call graph for this function:

void vuMarchingCubes::glRender void   )  [protected, virtual]
 

Called, when anything in the window is changed (object rotated, or other).

It first resets the color and modelview matrix, than rotates the object and at least calls the objects rendering code, i.e. m_data->glRender().

Light settings could be moved to a extra function which is called whenever a light is changed.

Reimplemented from vuBasicUtility.

Definition at line 1754 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG2, DEBUG5, DEBUG7, DEBUGGL, MCGlobalData::drawObject, format(), vuMCKeyVector::Get(), GL_AMBIENT, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_DIFFUSE, GL_FRONT_AND_BACK, GL_LIGHT0, GL_LIGHT1, GL_LINES, GL_POSITION, GL_SHININESS, GL_SPECULAR, glBegin(), glClear(), glEnd(), GLfloat, glLightfv(), glLoadIdentity(), glMaterialfv(), MarchingCubesBase::glRender(), MarchingCubesBase::glRenderFrame(), glRotatef(), glTranslatef(), glVertex3d(), m_angle, m_avgFps, m_backColor, m_base, m_cubeSizeX, m_cubeSizeY, m_cubeSizeZ, m_drawFrame, m_fps, m_fpsCount, m_fpsTime, m_fpsWatermark, m_frameColor, m_gd, m_light0Pos, m_light1Enabled, m_light1Pos, m_lightColor, m_lightDiffuse, m_lightShiny, m_lightSpecular, m_objectColor, m_objectDiffuse, m_objectShiny, m_objectSpecular, m_pos, m_rotateX, m_rotateY, m_rotateZ, x1, x2, y1, y2, z1, and z2.

Here is the call graph for this function:

void vuMarchingCubes::glResize  )  [protected, virtual]
 

Called, when the window is resized.

Reimplemented from vuBasicUtility.

Definition at line 1716 of file vuMarchingCubes.cpp.

References MCGlobalData::cubeSize, DEBUG0, DEBUG7, vuGLCanvas::getHeight(), vuGLCanvas::getWidth(), GL_MODELVIEW, GL_PROJECTION, glFrustum(), GLint, glLoadIdentity(), glMatrixMode(), glViewport(), m_base, m_gd, MarchingCubesBase::maxSize(), and size.

Referenced by OnCubeSizeChange(), onMouseLeftMoving(), and resize().

Here is the call graph for this function:

bool vuMarchingCubes::init const char *  DataFile  )  [virtual]
 

Initialize the tool.

Reimplemented from vuBasicUtility.

Definition at line 1213 of file vuMarchingCubes.cpp.

References assert, DEBUG0, DEBUG1, doThresChange(), MCGlobalData::drawNormals, vuMCSlider::Format(), MCGlobalData::frameRadius, m_base, m_cubeHist, m_cubeOther, m_cubesTotal, m_Data, m_drawNormals, m_drawNormalsSize, m_frameRadius, m_gd, m_meshSize, m_selectColor, m_size, MarchingCubesBase::marchCubes(), vuMCSlider::Max(), MarchingCubesBase::maxSize(), MCGlobalData::meshSize, vuMCSlider::Min(), MCGlobalData::normalsLength, NULL, vu1::read(), vu1::setFileName(), MarchingCubesBase::setGlobalData(), MarchingCubesBase::SetHistoCallback(), MarchingCubesBase::SetProgressCallback(), vuMCHistogram::SetSelColor(), MarchingCubesBase::Size1(), MarchingCubesBase::Size2(), MarchingCubesBase::Size3(), vuMCRGBColor::tovuVector(), vuMCMCBHistoCallback, and vuMCMCBProgressCallback.

Here is the call graph for this function:

void vuMarchingCubes::OnChangeFrame  ) 
 

This function is called from a decorator whenever the frame setting is changed.

Definition at line 2240 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG1, MCGlobalData::frameRadius, m_gd, and vuGLCanvas::redraw().

Referenced by vuMCFrameChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnChar wxKeyEvent &  event  )  [protected, virtual]
 

We do keyboard handling for our own.

Reimplemented from vuBasicUtility.

Definition at line 1844 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG7, vuMCHistogram::Flush(), and m_cubeHist.

Here is the call graph for this function:

void vuMarchingCubes::OnCubeChange int  val  ) 
 

Called, when the cube config is changed by the respective widgets.

Definition at line 2198 of file vuMarchingCubes.cpp.

References MCGlobalData::cube, DEBUG0, vuMCHistogram::Flush(), MCGlobalData::isObjectColor, m_cubeHist, m_gd, m_objectColor, m_selectColor, MCGlobalData::objectColor, vuGLCanvas::redraw(), vuMCHistogram::Select(), and vuMCRGBColor::tovuVector().

Referenced by vuMCCubeChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnCubeEnabledChecked wxCommandEvent &  event  )  [protected]
 

Definition at line 2106 of file vuMarchingCubes.cpp.

References MCGlobalData::cubeBrowser, DEBUG0, m_cube, m_gd, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuMarchingCubes::OnCubeSizeChange  ) 
 

Todo:
Think on code regarding a rescan (extra button?).

Definition at line 2304 of file vuMarchingCubes.cpp.

References MCGlobalData::compileData, MCGlobalData::compileNormals, MCGlobalData::cubeSize, DEBUG0, glResize(), m_base, m_gd, MarchingCubesBase::Origin(), vuGLCanvas::redraw(), MarchingCubesBase::Size1(), MarchingCubesBase::Size2(), and MarchingCubesBase::Size3().

Referenced by vuMCCubeSizeChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnCullLinesFrontBackChecked wxCommandEvent &  event  )  [protected]
 

Definition at line 2127 of file vuMarchingCubes.cpp.

References assert, MCGlobalData::cullMode, DEBUG0, DEBUG4, MCGlobalData::linesMode, m_base, m_cullBack, m_cullFront, m_gd, m_linesBack, m_linesFront, NULL, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuMarchingCubes::onDblClick wxMouseEvent &  event  )  [protected]
 

On a double click the cube under the "cursor" will be highlighted.

Bug:
There is a bug in the selection of the startin position. Maybe we change this code to some simpler one and think more about the stepping.

Definition at line 1965 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG7, MarchingCubesBase::getCubeType(), vuGLCanvas::getHeight(), GL_MODELVIEW_MATRIX, GL_PROJECTION_MATRIX, GL_VIEWPORT, GLdouble, glGetDoublev(), glGetIntegerv(), GLint, m_base, m_cubeHist, m_cubeSizeX, m_cubeSizeY, m_cubeSizeZ, max, MarchingCubesBase::maxSize(), OnSelectType(), outside(), vuGLCanvas::redraw(), vuMCHistogram::Select(), size, MarchingCubesBase::Size1(), MarchingCubesBase::Size2(), MarchingCubesBase::Size3(), MarchingCubesBase::valueAt(), x1, x2, y1, y2, z1, and z2.

Referenced by glOnMouse().

Here is the call graph for this function:

void vuMarchingCubes::OnDrawNormalsChecked wxCommandEvent &  event  )  [protected]
 

Definition at line 2168 of file vuMarchingCubes.cpp.

References DEBUG0, MCGlobalData::drawNormals, m_drawNormals, m_drawNormalsSize, m_gd, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuMarchingCubes::OnFrameChecked wxCommandEvent &  event  )  [protected]
 

Definition at line 2118 of file vuMarchingCubes.cpp.

References DEBUG0, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuMarchingCubes::OnLight1Checked wxCommandEvent &  event  )  [protected]
 

Definition at line 2080 of file vuMarchingCubes.cpp.

References DEBUG0, GL_LIGHT1, glDisable(), glEnable(), m_light1Pos, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuMarchingCubes::onMouseDown wxMouseEvent &  event  )  [protected]
 

Definition at line 1945 of file vuMarchingCubes.cpp.

References DEBUG0, MCGlobalData::drawObject, MCGlobalData::fpsThres, m_fps, m_gd, and vuBasicUtility::storeMousePosition().

Referenced by glOnMouse().

Here is the call graph for this function:

void vuMarchingCubes::onMouseLeftMoving wxMouseEvent &  event  )  [protected, virtual]
 

The function handles mouse drags with the left mouse button pressed.

When used with modifier keys different modes are realized. The following list describes the actions depending on the pressed modifier key:

  • None rotates the object arround the x and y axis,
  • Shift panes the object in x and y direction,
  • Ctrl moves light 0 in x and z direction.
  • Atl moves light 1 in x and z direction.

Reimplemented from vuBasicUtility.

Definition at line 1881 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG1, vuMCKeyVector::Get(), glResize(), m_angle, m_base, MarchingCubesBase::maxSize(), vuGLCanvas::redraw(), size, and vuBasicUtility::storeMousePosition().

Referenced by glOnMouse().

Here is the call graph for this function:

void vuMarchingCubes::onMouseRightMoving wxMouseEvent &  event  )  [protected, virtual]
 

This function implements the default zooming behaviour using the mouse -ms-

Reimplemented from vuBasicUtility.

Definition at line 1921 of file vuMarchingCubes.cpp.

References DEBUG0, m_base, m_light1Enabled, MarchingCubesBase::maxSize(), vuGLCanvas::redraw(), size, and vuBasicUtility::storeMousePosition().

Referenced by glOnMouse().

Here is the call graph for this function:

void vuMarchingCubes::onMouseUp wxMouseEvent &  event  )  [protected]
 

Definition at line 1955 of file vuMarchingCubes.cpp.

References DEBUG0, MCGlobalData::drawObject, m_gd, and vuGLCanvas::redraw().

Referenced by glOnMouse().

Here is the call graph for this function:

void vuMarchingCubes::OnNormalLengthChange float  l  ) 
 

Definition at line 2265 of file vuMarchingCubes.cpp.

References MCGlobalData::compileNormals, DEBUG0, m_gd, MCGlobalData::normalsLength, and vuGLCanvas::redraw().

Referenced by vuMCNormalLengthChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnProgress float  v  ) 
 

Updates the progress bar in the right side tab.

Definition at line 2224 of file vuMarchingCubes.cpp.

References DEBUG0, m_status, and m_statusText.

Referenced by vuMCProgress::operator()().

void vuMarchingCubes::OnRotateChecked wxCommandEvent &  event  )  [protected]
 

Definition at line 2096 of file vuMarchingCubes.cpp.

References DEBUG0, DEBUG4, and vuGLCanvas::redraw().

Here is the call graph for this function:

void vuMarchingCubes::OnSelectType int  n  ) 
 

Definition at line 2322 of file vuMarchingCubes.cpp.

References assert, MCGlobalData::cube, DEBUG0, DEBUG5, MCGlobalData::isObjectColor, m_cube, m_gd, m_objectColor, m_selectColor, MCGlobalData::objectColor, vuGLCanvas::redraw(), and vuMCRGBColor::tovuVector().

Referenced by onDblClick(), and vuMCSelectType::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnSetLineColor  ) 
 

Definition at line 2293 of file vuMarchingCubes.cpp.

References DEBUG0, MCGlobalData::lineColor, m_gd, m_lineColor, vuGLCanvas::redraw(), and vuMCRGBColor::tovuVector().

Referenced by vuMCLineColorChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnSetObjectColor  ) 
 

Definition at line 2276 of file vuMarchingCubes.cpp.

References DEBUG0, MCGlobalData::isObjectColor, m_cubeHist, m_gd, m_objectColor, m_selectColor, MCGlobalData::objectColor, vuGLCanvas::redraw(), vuMCHistogram::SetSelColor(), and vuMCRGBColor::tovuVector().

Referenced by vuMCObjectColorChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnThresChange  ) 
 

Definition at line 2251 of file vuMarchingCubes.cpp.

References DEBUG0, doResetThres(), doThresChange(), vuMCHistogram::Flush(), m_base, m_cubeHist, m_gd, MarchingCubesBase::marchCubes(), vuGLCanvas::redraw(), and MCGlobalData::thres.

Referenced by vuMCThresChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::OnUpdateModeChecked wxCommandEvent &  event  )  [protected]
 

Definition at line 2145 of file vuMarchingCubes.cpp.

References DEBUG0, m_thres, m_updateMode, and vuMCSlider::UpdateMode().

Here is the call graph for this function:

int vuMarchingCubes::outside vuVector point,
double *  size
[inline, private]
 

Takes a point and a volume size and returns, if the point is outside this volume.

The volume is considered to be double the size given in size.

Definition at line 2402 of file vuMarchingCubes.cpp.

References DEBUG0, and size.

Referenced by onDblClick().

void vuMarchingCubes::redraw  ) 
 

Redraws the gl context.

Definition at line 2179 of file vuMarchingCubes.cpp.

References DEBUG0, and vuGLCanvas::redraw().

Referenced by vuMCNormalLengthChange::operator()(), vuMCBackgroundChange::operator()(), and vuMCRender::operator()().

Here is the call graph for this function:

void vuMarchingCubes::resize  ) 
 

called, wenn the gl geometry is changed.

Definition at line 2188 of file vuMarchingCubes.cpp.

References DEBUG0, glResize(), and vuGLCanvas::redraw().

Referenced by vuMCResize::operator()().

Here is the call graph for this function:

void vuMarchingCubes::rotate float  ax,
float  ay
[private]
 

Rotate the object in x an y direction.

Definition at line 2345 of file vuMarchingCubes.cpp.

References glPopMatrix(), glPushMatrix(), glRotatef(), and glTranslatef().

Here is the call graph for this function:

void vuMarchingCubes::setBackground  ) 
 

Definition at line 2214 of file vuMarchingCubes.cpp.

References vuMCRGBColor::Alpha(), vuMCRGBColor::Blue(), DEBUG0, glClearColor(), vuMCRGBColor::Green(), m_backColor, vuMCRGBColor::Red(), and vuGLCanvas::redraw().

Referenced by createGLNotebook(), and vuMCBackgroundChange::operator()().

Here is the call graph for this function:

void vuMarchingCubes::setCamera vuCamera cam  ) 
 

Abstract function needs to be overwritten.

Definition at line 1289 of file vuMarchingCubes.cpp.

References DEBUG0.


Friends And Related Function Documentation

friend class vuMCMCBHistoCallback [friend]
 

Definition at line 961 of file vuMarchingCubes.h.

Referenced by init().

friend class vuMCMCBProgressCallback [friend]
 

Definition at line 960 of file vuMarchingCubes.h.

Referenced by init().


Member Data Documentation

vuMCKeyVector* vuMarchingCubes::m_angle [private]
 

Holds the Rotation angle of the object.

Definition at line 1059 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), glRender(), and onMouseLeftMoving().

float vuMarchingCubes::m_avgFps [private]
 

Definition at line 1118 of file vuMarchingCubes.h.

Referenced by glRender().

vuMCRGBColor* vuMarchingCubes::m_backColor [private]
 

Light Color.

Definition at line 1080 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), glInit(), glRender(), and setBackground().

MarchingCubesBase* vuMarchingCubes::m_base [private]
 

Shortcut the the MarchingCubesBase methods.

This variable is set, when the data is created.

Todo:
How can we make sure, that m_base is valid when function are called?

Definition at line 1033 of file vuMarchingCubes.h.

Referenced by doThresChange(), glRender(), glResize(), init(), OnCubeSizeChange(), OnCullLinesFrontBackChecked(), onDblClick(), onMouseLeftMoving(), onMouseRightMoving(), and OnThresChange().

vuMCBitField* vuMarchingCubes::m_cube [private]
 

Manipulates and displayes the cube setup.

Definition at line 1107 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), OnCubeEnabledChecked(), and OnSelectType().

vuMCKeyValue* vuMarchingCubes::m_cube0 [private]
 

Cubes of type 0 are handled separatly so the historgram does show anything meaningful.

Definition at line 1050 of file vuMarchingCubes.h.

Referenced by vuMCMCBHistoCallback::Clear(), createInfoNotebook(), and vuMCMCBHistoCallback::Inc().

vuMCKeyValue* vuMarchingCubes::m_cube255 [private]
 

Cubes of type 255 are also handled separatly.

Definition at line 1052 of file vuMarchingCubes.h.

Referenced by vuMCMCBHistoCallback::Clear(), createInfoNotebook(), and vuMCMCBHistoCallback::Inc().

wxCheckBox* vuMarchingCubes::m_cubeEnabled [private]
 

Definition at line 1105 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook().

vuMCHistogram* vuMarchingCubes::m_cubeHist [private]
 

This widget shows the number of occurrences of all cube types.

Definition at line 1056 of file vuMarchingCubes.h.

Referenced by vuMCMCBHistoCallback::Clear(), createInfoNotebook(), vuMCMCBHistoCallback::Flush(), vuMCMCBHistoCallback::Inc(), init(), OnChar(), OnCubeChange(), onDblClick(), OnSetObjectColor(), and OnThresChange().

vuMCKeyValue* vuMarchingCubes::m_cubeOther [private]
 

Indicates the number of cubes of other types.

Definition at line 1054 of file vuMarchingCubes.h.

Referenced by vuMCMCBHistoCallback::Clear(), createInfoNotebook(), vuMCMCBHistoCallback::Inc(), and init().

vuMCSlider* vuMarchingCubes::m_cubeSizeX [private]
 

Definition at line 1110 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), glRender(), and onDblClick().

vuMCSlider* vuMarchingCubes::m_cubeSizeY [private]
 

Definition at line 1111 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), glRender(), and onDblClick().

vuMCSlider* vuMarchingCubes::m_cubeSizeZ [private]
 

Definition at line 1112 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), glRender(), and onDblClick().

vuMCKeyValue* vuMarchingCubes::m_cubesTotal [private]
 

Indicates the number of cubes total.

Definition at line 1048 of file vuMarchingCubes.h.

Referenced by vuMCMCBHistoCallback::Clear(), createInfoNotebook(), and init().

wxCheckBox* vuMarchingCubes::m_cullBack [private]
 

Definition at line 1095 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and OnCullLinesFrontBackChecked().

wxCheckBox* vuMarchingCubes::m_cullFront [private]
 

Definition at line 1096 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and OnCullLinesFrontBackChecked().

vu1* vuMarchingCubes::m_Data [private]
 

The raycaster owned by the utility.

Definition at line 1026 of file vuMarchingCubes.h.

Referenced by glInit(), and init().

wxCheckBox* vuMarchingCubes::m_doMeshStatistics [private]
 

Definition at line 1104 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook().

wxCheckBox* vuMarchingCubes::m_drawFrame [private]
 

Definition at line 1094 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and glRender().

wxCheckBox* vuMarchingCubes::m_drawNormals [private]
 

Definition at line 1108 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), init(), and OnDrawNormalsChecked().

vuMCSlider* vuMarchingCubes::m_drawNormalsSize [private]
 

Definition at line 1109 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), init(), and OnDrawNormalsChecked().

float vuMarchingCubes::m_fps [private]
 

Definition at line 1117 of file vuMarchingCubes.h.

Referenced by glRender(), and onMouseDown().

int vuMarchingCubes::m_fpsCount [private]
 

Definition at line 1115 of file vuMarchingCubes.h.

Referenced by glRender().

int vuMarchingCubes::m_fpsTime [private]
 

Definition at line 1114 of file vuMarchingCubes.h.

Referenced by glRender().

vuMCSlider* vuMarchingCubes::m_fpsWatermark [private]
 

Definition at line 1116 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and glRender().

vuMCRGBColor* vuMarchingCubes::m_frameColor [private]
 

Definition at line 1085 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCSlider* vuMarchingCubes::m_frameRadius [private]
 

Definition at line 1099 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and init().

MCGlobalData vuMarchingCubes::m_gd [private]
 

Global data used by several classes in the marching cubes engine.

Definition at line 1036 of file vuMarchingCubes.h.

Referenced by addTop(), createGLNotebook(), createSettingsNotebook(), doThresChange(), glRender(), glResize(), vuMCMCBHistoCallback::Inc(), init(), OnChangeFrame(), OnCubeChange(), OnCubeEnabledChecked(), OnCubeSizeChange(), OnCullLinesFrontBackChecked(), OnDrawNormalsChecked(), onMouseDown(), onMouseUp(), OnNormalLengthChange(), OnSelectType(), OnSetLineColor(), OnSetObjectColor(), and OnThresChange().

wxImageList* vuMarchingCubes::m_imageList [private]
 

Images for the Page headers on m_notebook.

Definition at line 1039 of file vuMarchingCubes.h.

Referenced by addRight().

vuMCKeyVector* vuMarchingCubes::m_light0Pos [private]
 

Holds an displays the position of light 0.

Definition at line 1064 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), and glRender().

wxCheckBox* vuMarchingCubes::m_light1Enabled [private]
 

Light 1 can be enabled.

Definition at line 1066 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), glRender(), and onMouseRightMoving().

vuMCKeyVector* vuMarchingCubes::m_light1Pos [private]
 

Holds an displays the position of light 1.

Definition at line 1068 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), glRender(), and OnLight1Checked().

vuMCRGBColor* vuMarchingCubes::m_lightColor [private]
 

Definition at line 1081 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCGrayColor* vuMarchingCubes::m_lightDiffuse [private]
 

Definition at line 1082 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCGrayColor* vuMarchingCubes::m_lightShiny [private]
 

Definition at line 1084 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCGrayColor* vuMarchingCubes::m_lightSpecular [private]
 

Definition at line 1083 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCRGBColor* vuMarchingCubes::m_lineColor [private]
 

Definition at line 1086 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and OnSetLineColor().

wxCheckBox* vuMarchingCubes::m_linesBack [private]
 

Definition at line 1097 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and OnCullLinesFrontBackChecked().

wxCheckBox* vuMarchingCubes::m_linesFront [private]
 

Definition at line 1098 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and OnCullLinesFrontBackChecked().

vuMCKeyValue* vuMarchingCubes::m_meshSize [private]
 

Indicates the memory usage of the complete mesh.

Definition at line 1073 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), doThresChange(), vuMCMCBHistoCallback::Inc(), and init().

vuMCSlider* vuMarchingCubes::m_mouseSpeed [private]
 

Definition at line 1093 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook().

vuMCKeyValue* vuMarchingCubes::m_numIndices [private]
 

Definition at line 1071 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), doResetThres(), and doThresChange().

vuMCKeyValue* vuMarchingCubes::m_numTriangles [private]
 

Definition at line 1069 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), doResetThres(), and doThresChange().

vuMCKeyValue* vuMarchingCubes::m_numVertices [private]
 

Definition at line 1070 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), doResetThres(), and doThresChange().

vuMCRGBColor* vuMarchingCubes::m_objectColor [private]
 

Definition at line 1088 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), glRender(), OnCubeChange(), OnSelectType(), and OnSetObjectColor().

vuMCGrayColor* vuMarchingCubes::m_objectDiffuse [private]
 

Definition at line 1089 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCGrayColor* vuMarchingCubes::m_objectShiny [private]
 

Definition at line 1091 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCGrayColor* vuMarchingCubes::m_objectSpecular [private]
 

Definition at line 1090 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), and glRender().

vuMCKeyVector* vuMarchingCubes::m_pos [private]
 

Holds and shows the position of the opbject.

Definition at line 1061 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), and glRender().

wxRadioBox* vuMarchingCubes::m_rotateX [private]
 

Definition at line 1100 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and glRender().

wxRadioBox* vuMarchingCubes::m_rotateY [private]
 

Definition at line 1101 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and glRender().

wxRadioBox* vuMarchingCubes::m_rotateZ [private]
 

Definition at line 1102 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and glRender().

vuMCRGBColor* vuMarchingCubes::m_selectColor [private]
 

Definition at line 1087 of file vuMarchingCubes.h.

Referenced by createGLNotebook(), init(), OnCubeChange(), OnSelectType(), and OnSetObjectColor().

vuMCKeyVector* vuMarchingCubes::m_size [private]
 

Definition at line 1057 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), glInit(), and init().

wxGauge* vuMarchingCubes::m_status [private]
 

Definition at line 1077 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), vuMCMCBProgressCallback::End(), OnProgress(), vuMCMCBProgressCallback::Start(), and vuMCMCBProgressCallback::Update().

wxStaticText* vuMarchingCubes::m_statusText [private]
 

This label should be set to explain the status shonw in the m_status.

Definition at line 1076 of file vuMarchingCubes.h.

Referenced by createInfoNotebook(), vuMCMCBProgressCallback::End(), OnProgress(), vuMCMCBProgressCallback::SetText(), and vuMCMCBProgressCallback::Start().

vuMCSlider* vuMarchingCubes::m_thres [private]
 

This slider holds the threshold for the marching cubes alogrithm.

Definition at line 1042 of file vuMarchingCubes.h.

Referenced by addTop(), createSettingsNotebook(), doThresChange(), and OnUpdateModeChecked().

wxCheckBox* vuMarchingCubes::m_updateMode [private]
 

Definition at line 1103 of file vuMarchingCubes.h.

Referenced by createSettingsNotebook(), and OnUpdateModeChecked().

vuMCKeyValue* vuMarchingCubes::m_zoom [private]
 

Definition at line 1062 of file vuMarchingCubes.h.

Referenced by createInfoNotebook().

GLdouble vuMarchingCubes::x1 [private]
 

Definition at line 1120 of file vuMarchingCubes.h.

Referenced by glRender(), and onDblClick().

GLdouble vuMarchingCubes::x2 [private]
 

Definition at line 1121 of file vuMarchingCubes.h.

Referenced by glRender(), and onDblClick().

GLdouble vuMarchingCubes::y1 [private]
 

Definition at line 1120 of file vuMarchingCubes.h.

Referenced by glRender(), and onDblClick().

GLdouble vuMarchingCubes::y2 [private]
 

Definition at line 1121 of file vuMarchingCubes.h.

Referenced by glRender(), and onDblClick().

GLdouble vuMarchingCubes::z1 [private]
 

Definition at line 1120 of file vuMarchingCubes.h.

Referenced by glRender(), and onDblClick().

GLdouble vuMarchingCubes::z2 [private]
 

Definition at line 1121 of file vuMarchingCubes.h.

Referenced by glRender(), and onDblClick().


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:21:24 2004 for vuVolume by  doxygen 1.3.9.1