HOG2
|
#include "Trackball.h"
#include "Common.h"
#include "GLUThog.h"
#include "TextBox.h"
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
Go to the source code of this file.
Functions | |
int | hog_main (int argc, char **argv) |
int | main (int argc, char **argv) |
pRecContext | GetContext (unsigned long windowID) |
pRecContext | getCurrentContext () |
void | RunHOGGUI (int argc, char **argv, int windowDimension) |
void | RunHOGGUI (int argc, char *argv[], int xDimension, int yDimension) |
void | createMenus () |
void | processMenuEvents (int option) |
void | keyPressed (unsigned char key, int, int) |
Called when a key is pressed, and no other keys are held down. More... | |
void | mouseMovedNoButton (int x, int y) |
void | mouseMovedButton (int x, int y) |
Called when the mouse is moved with a button pressed down. More... | |
if (state==GLUT_DOWN) | |
static void | mousePan (int x, int y, pRecContext pContextInfo) |
static void | mouseDolly (int x, int y, pRecContext pContextInfo) |
void | renderScene (void) |
Renders the scene. More... | |
void | resizeWindow (int x, int y) |
Called when the window is resized. More... | |
void | resizeGL (pRecContext pContextInfo, CGRect viewRect) |
Handles resizing of GL need context update and if the window dimensions change, a window dimension update, reseting of viewport and an update of the projection matrix. More... | |
void | updateProjection (pRecContext pContextInfo, int viewPort) |
Update the projection matrix based on camera and view info. More... | |
void | updateModelView (pRecContext pContextInfo, int currPort) |
Updates the viewpoint of the model. More... | |
void | drawCStringGL (char *cstrOut, GLuint fontList) |
Draws a CString in OpenGL. More... | |
void | appendTextToBuffer (const char *tempStr) |
void | submitTextToBuffer (const char *val) |
void | DrawGraphics (Graphics::Display &display, int port) |
void | drawGL (pRecContext pContextInfo) |
Main OpenGL drawing function. More... | |
void | buildGL (void) |
End OpenGL drawing function - for visualizing trajectory merging. More... | |
Variables | |
pRecContext | pContextInfo |
GLint | gDollyPanStartPoint [2] = {0, 0} |
GLfloat | gTrackBallRotation [4] = {0.0f, 0.0f, 0.0f, 0.0f} |
GLboolean | gDolly = GL_FALSE |
GLboolean | gPan = GL_FALSE |
GLboolean | gTrackball = GL_FALSE |
pRecContext | gTrackingContextInfo = NULL |
int | gCurrButton = -1 |
pRecContext | backup |
double | fps = 30.0 |
int | modifiers = glutGetModifiers() |
Called when a mouse button is pressed. More... | |
TextBox * | myTextBox = 0 |
void appendTextToBuffer | ( | const char * | tempStr | ) |
Definition at line 691 of file GLUThog.cpp.
References recContext::message, myTextBox, pContextInfo, point3d, and TextBox::setColor().
void buildGL | ( | void | ) |
End OpenGL drawing function - for visualizing trajectory merging.
Initializes OpenGL.
Definition at line 1086 of file GLUThog.cpp.
References CGSize::height, pContextInfo, resizeGL(), SetLighting(), CGRect::size, and CGSize::width.
Referenced by RunHOGGUI().
void createMenus | ( | ) |
Definition at line 100 of file GLUThog.cpp.
Referenced by RunHOGGUI().
void drawCStringGL | ( | char * | cstrOut, |
GLuint | fontList | ||
) |
Draws a CString in OpenGL.
Definition at line 680 of file GLUThog.cpp.
void drawGL | ( | pRecContext | pContextInfo | ) |
Main OpenGL drawing function.
Definition at line 987 of file GLUThog.cpp.
References recFrustum::bottom, recContext::camera, recContext::currPort, recContext::display, TextBox::draw(), DrawGraphics(), Graphics::Display::EndFrame(), recFrustum::far, recCamera::frust, HandleFrame(), recFrustum::left, myTextBox, recFrustum::near, recContext::numPorts, pContextInfo, recFrustum::right, setViewport(), Graphics::Display::StartFrame(), TextBox::stepTime(), recFrustum::top, updateModelView(), recCamera::viewHeight, and recCamera::viewWidth.
Referenced by renderScene().
void DrawGraphics | ( | Graphics::Display & | display, |
int | port | ||
) |
Definition at line 714 of file GLUThog.cpp.
References Graphics::Display::backgroundDrawCommands, Graphics::Display::backgroundLineSegments, DrawCircle(), Graphics::Display::drawCommands, DrawText(), DrawTextCentered(), FrameCircle(), Graphics::Display::kFillNGon, Graphics::Display::kFillOval, Graphics::Display::kFillRectangle, Graphics::Display::kFrameNGon, Graphics::Display::kFrameOval, Graphics::Display::kFrameRectangle, Graphics::Display::kLine, Graphics::Display::lineSegments, Graphics::Display::text, and Graphics::textAlignCenter.
Referenced by drawGL().
pRecContext GetContext | ( | unsigned long | windowID | ) |
Definition at line 44 of file GLUThog.cpp.
References pContextInfo.
pRecContext getCurrentContext | ( | ) |
Definition at line 49 of file GLUThog.cpp.
int hog_main | ( | int | argc, |
char ** | argv | ||
) |
Referenced by main().
if | ( | state | = = GLUT_DOWN | ) |
Definition at line 244 of file GLUThog.cpp.
References addToRotationTrackball(), recContext::camera, recRotation::cameraRotation, recContext::currPort, gCurrButton, gDolly, gDollyPanStartPoint, recContext::globalCamera, gPan, gTrackball, gTrackBallRotation, gTrackingContextInfo, HandleMouseClick(), kLeftButton, kMiddleButton, kMouseDown, kRightButton, modifiers, recContext::moveAllPortsTogether, recContext::numPorts, pContextInfo, point3d, recCamera::rotations, startTrackball(), recCamera::thirdPerson, recCamera::viewHeight, recCamera::viewOriginX, recCamera::viewOriginY, recCamera::viewWidth, and recRotation::worldRotation.
Referenced by DynamicPotentialSearch< state, action, environment >::DoSingleSearchStep(), measureAverageRatio(), MCEnvironment::OpenGLDraw(), Map2DHeading::OpenGLDraw(), Directional2DEnvironment::OpenGLDraw(), MM< state, action, environment, priorityQueue >::PrintHDist(), fMM< state, action, environment, priorityQueue >::PrintHDist(), and updateProjection().
void keyPressed | ( | unsigned char | key, |
int | , | ||
int | |||
) |
Called when a key is pressed, and no other keys are held down.
Definition at line 113 of file GLUThog.cpp.
Referenced by RunHOGGUI().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 14 of file GLUThog.cpp.
References hog_main().
|
static |
Definition at line 459 of file GLUThog.cpp.
References recCamera::aperture, recContext::camera, recContext::currPort, gDollyPanStartPoint, recContext::moveAllPortsTogether, recContext::numPorts, pContextInfo, updateProjection(), recCamera::viewPos, and recVec::z.
Referenced by mouseMovedButton().
void mouseMovedButton | ( | int | x, |
int | y | ||
) |
Called when the mouse is moved with a button pressed down.
Definition at line 176 of file GLUThog.cpp.
Referenced by RunHOGGUI().
void mouseMovedNoButton | ( | int | x, |
int | y | ||
) |
Definition at line 124 of file GLUThog.cpp.
Referenced by RunHOGGUI().
|
static |
Definition at line 437 of file GLUThog.cpp.
References recContext::camera, recContext::currPort, gDollyPanStartPoint, recContext::moveAllPortsTogether, recContext::numPorts, pContextInfo, recCamera::viewPos, recVec::x, recVec::y, and recVec::z.
Referenced by mouseMovedButton().
void processMenuEvents | ( | int | option | ) |
Definition at line 104 of file GLUThog.cpp.
void renderScene | ( | void | ) |
Renders the scene.
Used by GLUT for it's display function. Wraps the drawGL() function.
Definition at line 493 of file GLUThog.cpp.
Referenced by RunHOGGUI().
void resizeGL | ( | pRecContext | pContextInfo, |
CGRect | viewRect | ||
) |
Handles resizing of GL need context update and if the window dimensions change, a window dimension update, reseting of viewport and an update of the projection matrix.
Definition at line 533 of file GLUThog.cpp.
References recContext::globalCamera, CGSize::height, recContext::numPorts, CGRect::origin, pContextInfo, setPortCamera(), CGRect::size, updateProjection(), recCamera::viewHeight, recCamera::viewOriginX, recCamera::viewOriginY, recCamera::viewWidth, CGSize::width, CGPoint::x, and CGPoint::y.
Referenced by buildGL(), and resizeWindow().
void resizeWindow | ( | int | x, |
int | y | ||
) |
Called when the window is resized.
Specific format for GLUT.
Definition at line 513 of file GLUThog.cpp.
Referenced by RunHOGGUI().
void RunHOGGUI | ( | int | argc, |
char ** | argv, | ||
int | windowDimension | ||
) |
Definition at line 54 of file GLUThog.cpp.
void RunHOGGUI | ( | int | argc, |
char * | argv[], | ||
int | xDimension, | ||
int | yDimension | ||
) |
Definition at line 59 of file GLUThog.cpp.
References buildGL(), createMenus(), HandleWindowEvent(), initialConditions(), keyPressed(), kWindowCreated, mouseMovedButton(), mouseMovedNoButton(), mousePressedButton(), pContextInfo, ProcessCommandLineArgs(), renderScene(), and resizeWindow().
void submitTextToBuffer | ( | const char * | val | ) |
Definition at line 704 of file GLUThog.cpp.
References recContext::message, myTextBox, pContextInfo, point3d, and TextBox::setColor().
void updateModelView | ( | pRecContext | pContextInfo, |
int | currPort | ||
) |
Updates the viewpoint of the model.
Definition at line 598 of file GLUThog.cpp.
References recContext::camera, recRotation::cameraRotation, recContext::currPort, gTrackBallRotation, gTrackingContextInfo, recContext::moveAllPortsTogether, pContextInfo, recCamera::rotations, recCamera::thirdPerson, recCamera::viewDir, recCamera::viewPos, recCamera::viewUp, recRotation::worldRotation, recVec::x, recVec::y, and recVec::z.
Referenced by drawGL().
void updateProjection | ( | pRecContext | pContextInfo, |
int | viewPort | ||
) |
Update the projection matrix based on camera and view info.
Should be called when viewport size, eye z position, or camera aperture changes. Also call if far or near changes which is determined by shape size in this case.
Definition at line 560 of file GLUThog.cpp.
References recCamera::aperture, recFrustum::bottom, recContext::camera, recFrustum::far, recCamera::frust, if(), recFrustum::left, recFrustum::near, recContext::numPorts, pContextInfo, recFrustum::right, recFrustum::top, recCamera::viewHeight, and recCamera::viewWidth.
Referenced by mouseDolly(), mouseMovedButton(), and resizeGL().
pRecContext backup |
Definition at line 41 of file GLUThog.cpp.
double fps = 30.0 |
Definition at line 42 of file GLUThog.cpp.
Referenced by renderScene().
int gCurrButton = -1 |
Definition at line 38 of file GLUThog.cpp.
Referenced by if(), and mouseMovedButton().
GLboolean gDolly = GL_FALSE |
Definition at line 34 of file GLUThog.cpp.
Referenced by if(), and mouseMovedButton().
GLint gDollyPanStartPoint[2] = {0, 0} |
Definition at line 32 of file GLUThog.cpp.
Referenced by if(), mouseDolly(), mouseMovedNoButton(), and mousePan().
GLboolean gPan = GL_FALSE |
Definition at line 35 of file GLUThog.cpp.
Referenced by if(), mouseMovedButton(), and mouseMovedNoButton().
GLboolean gTrackball = GL_FALSE |
Definition at line 36 of file GLUThog.cpp.
Referenced by if(), and mouseMovedButton().
GLfloat gTrackBallRotation[4] = {0.0f, 0.0f, 0.0f, 0.0f} |
Definition at line 33 of file GLUThog.cpp.
Referenced by if(), mouseMovedButton(), and updateModelView().
pRecContext gTrackingContextInfo = NULL |
Definition at line 37 of file GLUThog.cpp.
Referenced by if(), mouseMovedNoButton(), and updateModelView().
int modifiers = glutGetModifiers() |
Called when a mouse button is pressed.
Definition at line 241 of file GLUThog.cpp.
Referenced by if().
TextBox* myTextBox = 0 |
Definition at line 689 of file GLUThog.cpp.
Referenced by appendTextToBuffer(), drawGL(), and submitTextToBuffer().
pRecContext pContextInfo |
Definition at line 31 of file GLUThog.cpp.
Referenced by AddViewport(), appendTextToBuffer(), buildGL(), cameraLookAt(), cameraLookingAt(), cameraMoveTo(), cameraOffset(), DoKeyboardCallbacks(), DoKeyboardCommand(), drawGL(), GetActivePort(), GetContext(), getCurrentContext(), GetHeading(), GetNumPorts(), GetOGLPos(), GlobalHOGToViewport(), GlobalHOGToViewportX(), GlobalHOGToViewportY(), HandleFrame(), HandleJoystickMovement(), HandleMouse(), HandleMouseClick(), HandleWindowEvent(), if(), initialConditions(), keyPressed(), mouseDolly(), mouseMovedButton(), mouseMovedNoButton(), mousePan(), MoveViewport(), ReinitViewports(), renderScene(), resetCamera(), resizeGL(), resizeWindow(), RunHOGGUI(), SaveScreenshot(), SetActivePort(), SetNumPorts(), setPortCamera(), setViewport(), SetZoom(), submitTextToBuffer(), updateModelView(), updateProjection(), ViewportToGlobalHOG(), and ViewportToGlobalHOGX().