#include <GlutWindow2d.h>
|
| | GlutWindow2d (const char *title, int width=800, int height=800) |
| |
| virtual | ~GlutWindow2d () |
| |
| virtual void | reshape (int w, int h) |
| |
| virtual void | display () |
| |
| virtual void | draw ()=0 |
| |
| virtual void | processNormalKeys (unsigned char key, int x, int y) |
| |
| virtual void | processSpecialKeys (int key, int x, int y) |
| |
| virtual void | mouse (int button, int state, int x, int y) |
| |
| virtual void | mouseMotion (int x, int y) |
| |
| virtual void | positionCamera () |
| |
| | GlutWindow (const char *title, int width=800, int height=800) |
| |
| virtual | ~GlutWindow () |
| |
| int | getWidth () const |
| |
| int | getHeight () const |
| |
| int | getButton () const |
| |
| virtual void | idle () |
| |
| virtual void | run () |
| |
| void | drawText (const char *txt, float x, float y, float r, float g, float b, void *font) |
| |
| GlutWindow2d::GlutWindow2d |
( |
const char * |
title, |
|
|
int |
width = 800, |
|
|
int |
height = 800 |
|
) |
| |
| GlutWindow2d::~GlutWindow2d |
( |
| ) |
|
|
virtual |
| void GlutWindow2d::display |
( |
| ) |
|
|
virtual |
| virtual void GlutWindow2d::draw |
( |
| ) |
|
|
pure virtual |
Override this function to draw the scene. This function is called from the display function automatically.
Implemented in ParticlePlot.
| void GlutWindow2d::drawText2d |
( |
const char * |
txt, |
|
|
float |
x, |
|
|
float |
y, |
|
|
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
void * |
font |
|
) |
| |
|
protected |
This will draw the given string to the screen at the location given by x,y- (relative to the current window properties). the color defaults to a gray
| void GlutWindow2d::drawZoomCircle |
( |
| ) |
|
|
protected |
Draws the zoom circle when changing the zoom factor
| void GlutWindow2d::init |
( |
| ) |
|
|
protectedvirtual |
Setups and Initializes the window
Implements GlutWindow.
| void GlutWindow2d::mouse |
( |
int |
button, |
|
|
int |
state, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
virtual |
This is used in conjunction with mouseMotion to provide the camera movement.
- Parameters
-
| button | The button that was pressed |
| x | The x location of the cursor when the button was pressed |
| y | The y location of the cursor when the button was pressed |
This is used in conjunction with mouseMotion to provide the camera movement. Moving the mouse with the left button down rotates the camera around a fixed point (specified by viewX, viewY, viewZ). Moving the mouse with the right button down zooms the camera in and out
If you would like to perform other operations with the mouse, override this function, you may want to consider calling Glut_Window::mouse() in that routine to maintain the mouse interface.
- Parameters
-
| button | The button that was pressed |
| x | The x location of the cursor when the button was pressed |
| y | The y location of the cursor when the button was pressed |
Reimplemented from GlutWindow.
| void GlutWindow2d::mouseMotion |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
virtual |
This routine is called whenever a mouse movement event has occured.
- Parameters
-
| x | The x location of the mouse |
| y | The y location of the mouse |
This routine is called whenever a mouse movement event has occured. If you are overriding it, consider calling Glut_Window::mouse_motion() in your descendant classes, to maintain the mouse interface
- Parameters
-
| x | The x location of the mouse |
| y | The y location of the mouse |
Reimplemented from GlutWindow.
| void GlutWindow2d::positionCamera |
( |
| ) |
|
|
virtual |
Overide this function to change the location from which the scene is rendered. It currently uses information from the mouse and the special keyboard keys to set its direction
Reimplemented from GlutWindow.
| void GlutWindow2d::processNormalKeys |
( |
unsigned char |
key, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
virtual |
This function is called when an ascii key is pressed.
- Parameters
-
| key | The key that was pressed |
| x | The x location of the cursor when the key was pressed |
| y | The y location of the cursor when the key was pressed |
Reimplemented from GlutWindow.
Reimplemented in ParticlePlot.
| void GlutWindow2d::processSpecialKeys |
( |
int |
key, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
|
virtual |
This function is used to perform actions when one of the non-ascii keys are presed.
- Parameters
-
| key | The key that was pressed |
| x | The x location of the cursor when the key was pressed |
| y | The y location of the cursor when the key was pressed |
This function is used to perform actions when one of the non-ascii keys are presed. In the base class, the arrow keys are used to move the center of the field of view around in the plane, while PAGE_UP & PAGE_DOWN are used to change the Z value of the center of view.
If you would like to perform other options with the special keys, then when overriding this function, you may want to consider calling GlutWindow2d::processSpecialKeys(key, x, y) in the overridden function to maintain the same base functionality.
- Parameters
-
| key | The key that was pressed |
| x | The x location of the cursor when the key was pressed |
| y | The y location of the cursor when the key was pressed |
Reimplemented from GlutWindow.
| void GlutWindow2d::reshape |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
|
virtual |
This performs generic graphics matrix setup operations, and will be called if the user resizes the window
- Parameters
-
| w | Width of the window |
| h | Height of the window |
Implements GlutWindow.
| void GlutWindow2d::setProjectiveSettings |
( |
| ) |
|
|
protected |
Set the projection parameters
| bool GlutWindow2d::drawZoomCircleFlag |
|
protected |
Whether or not to draw the zoom circle
| double GlutWindow2d::mousePanXOffset |
|
protected |
Remember where the pan x offset started from when the mouse is clicked
| double GlutWindow2d::mousePanYOffset |
|
protected |
Remember where the pan y offset started from when the mouse is clicked
| double GlutWindow2d::mouseStartZoom |
|
protected |
Remember where the zoom started from
| double GlutWindow2d::panXOffset |
|
protected |
The value for the panning in the x direction
| double GlutWindow2d::panYOffset |
|
protected |
The value for the panning in the y direction
| double GlutWindow2d::zoomDrawRadius |
|
protected |
The zoom radius for drawing purposes
| double GlutWindow2d::zoomFactor |
|
protected |
Factor to adjust the zoom
The documentation for this class was generated from the following files: