#include <vuBasicUtility.h>
Inheritance diagram for vuBasicUtility:
Public Member Functions | |
vuBasicUtility () | |
Window constructor. | |
virtual | ~vuBasicUtility () |
Window destructor. | |
virtual bool | init (const char *DataFile) |
Initializes the specifics of the utility window after the window itself has been created. | |
virtual void | close () |
Closes the utility window. | |
virtual void | DrawAgain ()=0 |
This function must rerender the scene completely. | |
virtual void | DrawFromImage ()=0 |
This function must take the data vuImage buffer from the last call to getCurrent Image and draw that on the screen. | |
virtual vuCamera * | getCamera ()=0 |
This function must return a pointer to the camera that is taking the picture of the scene. | |
virtual vuImage * | getCurrentImage ()=0 |
This function must return a pointer to the current vuImage buffer that the method can write to or read from. | |
virtual bool | IsReRendering () |
This will return true if the method is rerendering the scene on the screen and this will return false otherwise. | |
virtual void | setIsReRendering (bool isit) |
This sets the state of rerending the image on the screen to be the same as isit. | |
virtual void | notifyDataChanged () |
Notifies the utility that the volume data has been changed and that it should update its view. | |
void | useOpenGL (bool yesorno) |
!En-/disable OpenGL support. | |
virtual void | addTop (wxSizer *sizer) |
This method adds controls to the top of the window. | |
virtual void | addBottom (wxSizer *sizer) |
This method adds controls to the bottom of the window. | |
virtual void | addLeft (wxSizer *sizer) |
This method adds controls to the left of the window. | |
virtual void | addRight (wxSizer *sizer) |
This method adds controls to the right of the window. | |
const vuBasicGLCanvas * | getCanvas () |
Static Public Member Functions | |
const char * | getFileType () |
Returns the file type that the utility works on. | |
Protected Member Functions | |
virtual bool | glInit () |
Overridden to initialize OpenGL for the window's gl canvas. | |
virtual void | glRender () |
Overridden to render the scene using OpenGL. | |
virtual void | glResize () |
Overridden to do any resizing calcuations for the OpenGL canvas. | |
virtual void | glOnMouse (wxMouseEvent &ev) |
Overridden to process any mouse events associated with the gl canvas. | |
virtual void | OnChar (wxKeyEvent &event) |
Handler for key events. | |
virtual vu1 * | getVolume () |
Returns a pointer to the volume object. (usually m_Data). | |
virtual void | onMouse (wxMouseEvent &event) |
Use this function to add your own additional mouse behaviour:. | |
virtual void | onMouseRightMoving (wxMouseEvent &event) |
virtual void | onMouseLeftMoving (wxMouseEvent &event) |
void | storeMousePosition (wxMouseEvent &event) |
This function stores the last mouse click position. | |
virtual void | onKeyboard (wxKeyEvent &event) |
Use this function to add your own additional keyboard behaviour:. | |
virtual void | onKeyboardHelp (wxKeyEvent &event) |
This function opens a Help Window -ms-. | |
virtual void | onKeyboardKeyframer (wxKeyEvent &event) |
This function opens the Keyframer Window -ms-. | |
virtual void | onKeyboardZoom (wxKeyEvent &event) |
virtual void | onKeyboardRotate (wxKeyEvent &event) |
virtual void | onRender () |
virtual wxString | helpText () |
This callback defines the help text for the HelpPanel. -ms-. | |
Protected Attributes | |
vuBasicGLCanvas * | m_glCanvas |
The openGL canvas created by the window. | |
vuMainWindow * | m_Main |
The main window that owns this utility. | |
vuCamera * | m_camera |
The camera. | |
vuKeyFramerDialog * | m_keyframer |
The KeyFramer Dialog. | |
vuHelpPanel | m_helpPanel |
The Help Panel. | |
vuTFDesign | m_TFunc |
The transfer function. | |
int | m_MouseX |
Stores the last mouse position (used for rotating). | |
int | m_MouseY |
Stores the last mouse position (used for rotating). | |
bool | m_DrawPreview |
Flag that tracks, whether the preview will be rendered or not. | |
Private Member Functions | |
bool | init (vuMainWindow *main, const char *DataFile) |
The initialization method for the utility window. | |
Friends | |
class | vuBasicGLCanvas |
Make the BasicGLCanvas a friend of the class. |
This class is meant to be a base class for as many utility windows as possible. It implements a basic architecture for utility windows and provides hooks to add utility specific code. By overriding a few of the methods, a functional utility window can be created with minimum coding.
The basic window is created on the assumption that most utilities will have a main OpenGL canvas, with several widgets to configure the rendering to the window. The basic window creates this central OpenGL canvas, and allows widgets to be added above, below, and to the left and right of it. This is all done by overriding the add<area> methods (such as addTop()), creating controls, and adding them to the wxSizer. The sizers are set up so that the window is automatically laid out by the sizers, and resized properly when needed.
The basic window also makes it easier to render scenes to the main OpenGL canvas. It provides an OpenGL initialization method, initGL(), which can be overridden to initialize OpenGL as needed for the canvas. To render to the OpenGL canvas, the render() method is overridden. All the opengl and window draw setting up is handled internally, and the render() method needs only to implement the actual rendering code.
Finally, the basic window implements basic close() and DrawAgain() methods, so that these don't need to be implemented if they are not needed.
These functions need to be properely implemented for the key framer to work with the volume rendering method:
virtual void DrawAgain() = 0; virtual void DrawFromImage() = 0; virtual vuImage* getCurrentImage() = 0; virtual vuCamera* getCamera () = 0;
Definition at line 81 of file vuBasicUtility.h.
|
Window constructor.
Definition at line 60 of file vuBasicUtility.cpp. References m_camera, m_DrawPreview, m_glCanvas, m_keyframer, and m_Main. |
|
Window destructor.
Definition at line 73 of file vuBasicUtility.cpp. References m_Main, and vuMainWindow::notifyClosed(). |
Here is the call graph for this function:
|
This method adds controls to the bottom of the window.
Reimplemented in vuBCCFirstHitRaycaster, vuBCCRaycaster, vuBCCShearWarp, vuStandardFVR< SIZE >, vuSphericBrowser< SIZE, TYPE >, vuSphericRevolver< SIZE, TYPE >, vuShearWarp, vuStandardFVR< 1 >, vuStandardFVR< 3 >, vuSphericBrowser< 1, float >, vuSphericBrowser< SIZE, float >, vuSphericBrowser< 3, byte >, vuSphericBrowser< 1, byte >, vuSphericBrowser< 3, float >, vuSphericBrowser< 2, float >, vuSphericRevolver< 1, float >, vuSphericRevolver< 3, byte >, vuSphericRevolver< 1, byte >, vuSphericRevolver< 3, float >, and vuSphericRevolver< 2, float >. Definition at line 147 of file vuBasicUtility.h. Referenced by init(). |
|
This method adds controls to the left of the window.
Reimplemented in vuBCCShearWarp, and vuShearWarp. Definition at line 149 of file vuBasicUtility.h. Referenced by init(). |
|
This method adds controls to the right of the window.
Reimplemented in vuBCCSheetSplatter, vuCellProjector, vuStandardFVR< SIZE >, vuFVR, vuSphericBrowser< SIZE, TYPE >, vuSphericIBR< SIZE, TYPE >, vuSimpleFBR< SIZE, TYPE >, vuMarchingCubes, vuRaycast, vuSlicer, vuSpecFVR, vuSpectral, vuStandardFVR< 1 >, vuStandardFVR< 3 >, vuSphericBrowser< 1, float >, vuSphericBrowser< SIZE, float >, vuSphericBrowser< 3, byte >, vuSphericBrowser< 1, byte >, vuSphericBrowser< 3, float >, vuSphericBrowser< 2, float >, vuSphericIBR< 1, float >, vuSphericIBR< SIZE, float >, vuSphericIBR< 3, byte >, vuSphericIBR< 1, byte >, vuSphericIBR< 3, float >, vuSphericIBR< 2, float >, vuSimpleFBR< 3, byte >, and vuSimpleFBR< 1, byte >. Definition at line 151 of file vuBasicUtility.h. Referenced by init(). |
|
This method adds controls to the top of the window.
Reimplemented in vuMarchingCubes. Definition at line 145 of file vuBasicUtility.h. Referenced by init(). |
|
Closes the utility window. It sets the m_Main pointer to NULL and issues a window close request. Implements vuUtilityWindow. Definition at line 100 of file vuBasicUtility.cpp. References m_Main. |
|
|
|
|
Definition at line 130 of file vuBasicUtility.cpp. Referenced by vuBasicSubViewer::makeCanvasSizeEqual(). |
|
|
Returns the file type that the utility works on.
Reimplemented in vuBCCFirstHitRaycaster, vuBCCMarchingTetrahedra, vuBCCRaycaster, vuBCCShearWarp, vuBCCSheetSplatter, vuBccSplat, vuCellProjector, vuStandardFVR1F, vuStandardFVR3F, vuFVR, vuSphericBrowser1B, vuSphericBrowser1F, vuSphericBrowser2F, vuSphericBrowser3B, vuSphericBrowser3F, vuSphericFBR2F, vuSphericFourierBrowser2F, vuSphericIBR1B, vuSphericIBR1F, vuSphericIBR2F, vuSphericIBR3B, vuSphericIBR3F, vuSphericRevolver1B, vuSphericRevolver1F, vuSphericRevolver2F, vuSphericRevolver3B, vuSphericRevolver3F, vuSimpleFBR1B, vuSimpleFBR3B, vuMarchingCubes, vuRaycast, vuShearWarp, vuSlicer, vuSpecFVR, vuSpecSplat, vuSpectral, and vuSplat. Definition at line 134 of file vuBasicUtility.h. |
|
Returns a pointer to the volume object. (usually m_Data).
Reimplemented in vuBCCFirstHitRaycaster, vuBCCRaycaster, vuCellProjector, vuStandardFVR< SIZE >, vuSphericIBR< SIZE, TYPE >, vuSphericRevolver< SIZE, TYPE >, vuSimpleFBR< SIZE, TYPE >, vuMarchingCubes, vuRaycast, vuSpectral, vuStandardFVR< 1 >, vuStandardFVR< 3 >, vuSphericIBR< 1, float >, vuSphericIBR< SIZE, float >, vuSphericIBR< 3, byte >, vuSphericIBR< 1, byte >, vuSphericIBR< 3, float >, vuSphericIBR< 2, float >, vuSphericRevolver< 1, float >, vuSphericRevolver< 3, byte >, vuSphericRevolver< 1, byte >, vuSphericRevolver< 3, float >, vuSphericRevolver< 2, float >, vuSimpleFBR< 3, byte >, and vuSimpleFBR< 1, byte >. Definition at line 565 of file vuBasicUtility.cpp. Referenced by glRender(), OnChar(), onKeyboardKeyframer(), onKeyboardRotate(), onKeyboardZoom(), onMouseLeftMoving(), and onMouseRightMoving(). |
|
|
Overridden to process any mouse events associated with the gl canvas. These are mouse clicks and movements that originate within the gl canvas created by the vuBasicWindow. This method can implement tasks such as rotating the camera angle and such. Reimplemented in vuBCCMarchingTetrahedra, vuBCCShearWarp, vuBCCSheetSplatter, vuBccSplat, vuCellProjector, vuFVR, vuSphericBrowser< SIZE, TYPE >, vuMarchingCubes, vuShearWarp, vuSlicer, vuSpecFVR, vuSpecSplat, vuSplat, vuSphericBrowser< 1, float >, vuSphericBrowser< SIZE, float >, vuSphericBrowser< 3, byte >, vuSphericBrowser< 1, byte >, vuSphericBrowser< 3, float >, and vuSphericBrowser< 2, float >. Definition at line 237 of file vuBasicUtility.cpp. References onMouse(), onMouseLeftMoving(), onMouseRightMoving(), and storeMousePosition(). Referenced by vuBasicGLCanvas::OnMouse(). |
Here is the call graph for this function:
|
Here is the call graph for this function:
|
|
This callback defines the help text for the HelpPanel. -ms-.
Reimplemented in vuStandardFVR< SIZE >, vuSphericBrowser< SIZE, TYPE >, vuSphericRevolver< SIZE, TYPE >, vuStandardFVR< 1 >, vuStandardFVR< 3 >, vuSphericBrowser< 1, float >, vuSphericBrowser< SIZE, float >, vuSphericBrowser< 3, byte >, vuSphericBrowser< 1, byte >, vuSphericBrowser< 3, float >, vuSphericBrowser< 2, float >, vuSphericRevolver< 1, float >, vuSphericRevolver< 3, byte >, vuSphericRevolver< 1, byte >, vuSphericRevolver< 3, float >, and vuSphericRevolver< 2, float >. Definition at line 539 of file vuBasicUtility.cpp. Referenced by onKeyboardHelp(). |
|
The initialization method for the utility window. This method initializes the data members for the instance and sets up the user interface by calling the add<area>() methods. It can be overridden to initialize other members, but the overriding methods should call this one as well. Implements vuUtilityWindow. Definition at line 139 of file vuBasicUtility.cpp. References addBottom(), addLeft(), addRight(), addTop(), init(), m_glCanvas, m_Main, and vuBasicGLCanvas. |
Here is the call graph for this function:
|
|
This will return true if the method is rerendering the scene on the screen and this will return false otherwise.
Reimplemented in vuCellProjector, vuFVR, and vuSplat. Definition at line 210 of file vuBasicUtility.cpp. |
|
Notifies the utility that the volume data has been changed and that it should update its view.
Implements vuUtilityWindow. Reimplemented in vuCellProjector, vuFVR, vuSpecFVR, vuSpecSplat, vuSpectral, and vuSplat. Definition at line 26 of file vuBasicUtility.cpp. |
|
Handler for key events. Override this function in your Utility to customize reactions. Reimplemented in vuCellProjector, vuSphericBrowser< SIZE, TYPE >, vuMarchingCubes, vuSlicer, vuSpecFVR, vuSphericBrowser< 1, float >, vuSphericBrowser< SIZE, float >, vuSphericBrowser< 3, byte >, vuSphericBrowser< 1, byte >, vuSphericBrowser< 3, float >, and vuSphericBrowser< 2, float >. Definition at line 376 of file vuBasicUtility.cpp. References getVolume(), m_DrawPreview, m_glCanvas, onKeyboard(), onKeyboardHelp(), onKeyboardKeyframer(), onKeyboardRotate(), onKeyboardZoom(), vuGLCanvas::redraw(), and vu1::setIsReRendering(). Referenced by vuBasicGLCanvas::OnChar(). |
Here is the call graph for this function:
|
Use this function to add your own additional keyboard behaviour:.
Reimplemented in vuStandardFVR< SIZE >, vuFVR, vuSphericIBR< SIZE, TYPE >, vuSphericRevolver< SIZE, TYPE >, vuSimpleFBR< SIZE, TYPE >, vuRaycast, vuStandardFVR< 1 >, vuStandardFVR< 3 >, vuSphericIBR< 1, float >, vuSphericIBR< SIZE, float >, vuSphericIBR< 3, byte >, vuSphericIBR< 1, byte >, vuSphericIBR< 3, float >, vuSphericIBR< 2, float >, vuSphericRevolver< 1, float >, vuSphericRevolver< 3, byte >, vuSphericRevolver< 1, byte >, vuSphericRevolver< 3, float >, vuSphericRevolver< 2, float >, vuSimpleFBR< 3, byte >, and vuSimpleFBR< 1, byte >. Definition at line 410 of file vuBasicUtility.cpp. Referenced by OnChar(). |
|
This function opens a Help Window -ms-.
Definition at line 416 of file vuBasicUtility.cpp. References helpText(), m_helpPanel, vuHelpPanel::setHelpText(), and vuHelpPanel::setTitle(). Referenced by vuSphericBrowser< SIZE, TYPE >::OnChar(), and OnChar(). |
Here is the call graph for this function:
|
This function opens the Keyframer Window -ms-.
Definition at line 424 of file vuBasicUtility.cpp. References vu1::getCameraPtr(), getVolume(), m_keyframer, and vuKeyFramerDialog::setup(). Referenced by OnChar(). |
Here is the call graph for this function:
|
This function implements the default rotating behaviour using the keyboard -ms- Definition at line 466 of file vuBasicUtility.cpp. References vu1::getCameraPtr(), vu1::getCenter(), vuCamera::getPosition(), getVolume(), vuCamera::init(), m_glCanvas, vuVector::norm(), vuGLCanvas::redraw(), vuCamera::rotateAboutRight(), vuCamera::rotateAboutUp(), vu1::setIsReRendering(), and vuCamera::translateXYZ(). Referenced by OnChar(). |
Here is the call graph for this function:
|
This function implements the default zooming behaviour using the keyboard -ms- Definition at line 447 of file vuBasicUtility.cpp. References vu1::getCameraPtr(), getVolume(), glResize(), m_glCanvas, vuGLCanvas::redraw(), and vuCamera::translateXYZ(). Referenced by OnChar(). |
Here is the call graph for this function:
|
Use this function to add your own additional mouse behaviour:.
Reimplemented in vuBCCFirstHitRaycaster, vuBCCRaycaster, vuSphericIBR< SIZE, TYPE >, vuSphericRevolver< SIZE, TYPE >, vuSimpleFBR< SIZE, TYPE >, vuRaycast, vuSpectral, vuSphericIBR< 1, float >, vuSphericIBR< SIZE, float >, vuSphericIBR< 3, byte >, vuSphericIBR< 1, byte >, vuSphericIBR< 3, float >, vuSphericIBR< 2, float >, vuSphericRevolver< 1, float >, vuSphericRevolver< 3, byte >, vuSphericRevolver< 1, byte >, vuSphericRevolver< 3, float >, vuSphericRevolver< 2, float >, vuSimpleFBR< 3, byte >, and vuSimpleFBR< 1, byte >. Definition at line 260 of file vuBasicUtility.cpp. Referenced by glOnMouse(). |
|
This function implements the default rotating behaviour using the mouse -ms- Reimplemented in vuMarchingCubes. Definition at line 321 of file vuBasicUtility.cpp. References vuArcBall::attachCamera(), vu1::getCamera(), vu1::getCameraPtr(), vu1::getCenter(), vuCamera::getHeight(), vuCamera::getPosition(), getVolume(), vuCamera::getWidth(), vuCamera::init(), m_glCanvas, m_MouseX, m_MouseY, vuVector::norm(), vuGLCanvas::redraw(), vu1::setIsReRendering(), vuArcBall::setWinSize(), storeMousePosition(), vuCamera::translateXYZ(), and vuArcBall::turn(). Referenced by glOnMouse(). |
Here is the call graph for this function:
|
This function implements the default zooming behaviour using the mouse -ms- Reimplemented in vuMarchingCubes. Definition at line 297 of file vuBasicUtility.cpp. References vu1::getCameraPtr(), getVolume(), glResize(), m_glCanvas, vuGLCanvas::redraw(), vu1::setIsReRendering(), storeMousePosition(), and vuCamera::translateXYZ(). Referenced by glOnMouse(). |
Here is the call graph for this function:
|
This is the place for your rendering code. If you don't want to have the default preview behaviour, overwrite glRender() instead of onRender() -ms- Reimplemented in vuBCCFirstHitRaycaster, vuBCCRaycaster, and vuRaycast. Definition at line 528 of file vuBasicUtility.cpp. Referenced by glRender(). |
|
This sets the state of rerending the image on the screen to be the same as isit.
Reimplemented in vuCellProjector, vuFVR, and vuSplat. Definition at line 216 of file vuBasicUtility.cpp. |
|
This function stores the last mouse click position.
Definition at line 351 of file vuBasicUtility.cpp. References m_MouseX, and m_MouseY. Referenced by glOnMouse(), vuMarchingCubes::onMouseDown(), vuMarchingCubes::onMouseLeftMoving(), onMouseLeftMoving(), vuMarchingCubes::onMouseRightMoving(), and onMouseRightMoving(). |
|
!En-/disable OpenGL support. OpenGL is enabled by default. Deactivate it to get fancy direct framebuffer access. Use vuDrawTools then to. Definition at line 201 of file vuBasicUtility.cpp. References vuGLCanvas::disableOpenGL(), vuGLCanvas::enableOpenGL(), and m_glCanvas. Referenced by vuBCCSheetSplatter::glInit(), vuBCCSheetSplatter::glOnMouse(), vuShearWarp::init(), and vuBCCShearWarp::init(). |
Here is the call graph for this function:
|
Make the BasicGLCanvas a friend of the class.
Definition at line 214 of file vuBasicUtility.h. Referenced by init(). |
|
The camera.
Definition at line 205 of file vuBasicUtility.h. Referenced by vuBasicUtility(). |
|
Flag that tracks, whether the preview will be rendered or not.
Definition at line 226 of file vuBasicUtility.h. Referenced by glRender(), OnChar(), and vuBasicUtility(). |
|
The openGL canvas created by the window.
Definition at line 200 of file vuBasicUtility.h. Referenced by init(), OnChar(), onKeyboardRotate(), onKeyboardZoom(), onMouseLeftMoving(), onMouseRightMoving(), useOpenGL(), and vuBasicUtility(). |
|
The Help Panel.
Definition at line 211 of file vuBasicUtility.h. Referenced by onKeyboardHelp(). |
|
The KeyFramer Dialog.
Definition at line 208 of file vuBasicUtility.h. Referenced by onKeyboardKeyframer(), and vuBasicUtility(). |
|
The main window that owns this utility.
Definition at line 202 of file vuBasicUtility.h. Referenced by close(), init(), vuBasicUtility(), and ~vuBasicUtility(). |
|
Stores the last mouse position (used for rotating).
Definition at line 224 of file vuBasicUtility.h. Referenced by onMouseLeftMoving(), and storeMousePosition(). |
|
Stores the last mouse position (used for rotating).
Definition at line 224 of file vuBasicUtility.h. Referenced by onMouseLeftMoving(), and storeMousePosition(). |
|
The transfer function.
Reimplemented in vuBCCFirstHitRaycaster, vuBCCRaycaster, vuBCCShearWarp, vuBCCSheetSplatter, vuBccSplat, vuCellProjector, vuFVR, vuRaycast, vuShearWarp, vuSlicer, vuSpecFVR, vuSpecSplat, vuSpectral, and vuSplat. Definition at line 217 of file vuBasicUtility.h. |