HOG2
|
#include "FPUtil.h"
#include <ostream>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <GL/gl.h>
#include "Colors.h"
#include "Graphics.h"
Go to the source code of this file.
Classes | |
class | recVec |
A generic vector (essentially the same as a point, but offers normalization) More... | |
class | line2d |
** More... | |
Macros | |
#define | point3d Graphics::point |
Functions | |
bool | operator== (const recVec &l1, const recVec &l2) |
std::ostream & | operator<< (std::ostream &out, const recVec &loc) |
void | DrawPyramid (GLfloat x, GLfloat y, GLfloat z, GLfloat height, GLfloat width) |
Draw a pyramid with the tip at the given location, given height, and width from center to edge as width. More... | |
void | DrawBox (GLfloat x, GLfloat y, GLfloat z, GLfloat radius) |
void | DrawBoxFrame (GLfloat xx, GLfloat yy, GLfloat zz, GLfloat rad) |
void | DrawCircle (GLdouble _x, GLdouble _y, GLdouble tRadius, int segments=32, float rotation=0) |
void | FrameCircle (GLdouble _x, GLdouble _y, GLdouble tRadius, GLdouble lineWidth, int segments=32, float rotation=0) |
void | DrawSphere (GLdouble _x, GLdouble _y, GLdouble _z, GLdouble tRadius) |
void | DrawSquare (GLdouble _x, GLdouble _y, GLdouble _z, GLdouble tRadius) |
void | DrawCylinder (GLfloat xx, GLfloat yy, GLfloat zz, GLfloat innerRad, GLfloat outerRad, GLfloat height) |
void | OutlineRect (GLdouble left, GLdouble top, GLdouble right, GLdouble bottom, double zz) |
void | DrawText (double x, double y, double z, double scale, const char *res) |
void | DrawTextCentered (double x, double y, double z, double scale, const char *res) |
void | SetLighting (GLfloat ambientf=0.2f, GLfloat diffusef=1.0f, GLfloat specularf=1.0f) |
template<typename T > | |
std::string | to_string_with_precision (const T a_value, const int n=6) |
Variables | |
static const double | ONE = 1.0 |
static const double | TWO = 2.0 |
static const double | ROOT_TWO = 1.414213562 |
static const double | ONE_OVER_ROOT_TWO = 1.0/ROOT_TWO |
static const double | ROOT_THREE = 1.732050808 |
static const double | TWOPI = 6.283185307179586476925287 |
static const double | PI = 3.141592653589793238462643 |
static const double | PID180 = PI/180 |
static const double | PID2 = PI/2 |
static const double | PID3 = PI/3 |
static const double | PID4 = PI/4 |
static const double | PID6 = PI/6 |
static const double | PID8 = PI/8 |
static const double | ROOT2D2 = 0.7071067811865475 |
#define point3d Graphics::point |
void DrawBox | ( | GLfloat | x, |
GLfloat | y, | ||
GLfloat | z, | ||
GLfloat | radius | ||
) |
Definition at line 285 of file GLUtil.cpp.
References indices, and vertices3.
Referenced by VoxelGrid::OpenGLDraw(), Voxels::OpenGLDraw(), PancakePuzzle< N >::OpenGLDraw(), TOH< patternDisks >::OpenGLDraw(), and Fling::OpenGLDraw().
void DrawBoxFrame | ( | GLfloat | xx, |
GLfloat | yy, | ||
GLfloat | zz, | ||
GLfloat | rad | ||
) |
Definition at line 252 of file GLUtil.cpp.
Referenced by AirplaneEnvironment::OpenGLDraw(), and Voxels::OpenGLDraw().
void DrawCircle | ( | GLdouble | _x, |
GLdouble | _y, | ||
GLdouble | tRadius, | ||
int | segments = 32 , |
||
float | rotation = 0 |
||
) |
Definition at line 421 of file GLUtil.cpp.
References rotation, and TWOPI.
Referenced by DoDrawCommands(), DrawGraphics(), and DrawLines().
void DrawCylinder | ( | GLfloat | xx, |
GLfloat | yy, | ||
GLfloat | zz, | ||
GLfloat | innerRad, | ||
GLfloat | outerRad, | ||
GLfloat | height | ||
) |
Definition at line 309 of file GLUtil.cpp.
Referenced by AirplaneEnvironment::OpenGLDraw(), and TOH< patternDisks >::OpenGLDraw().
void DrawPyramid | ( | GLfloat | x, |
GLfloat | y, | ||
GLfloat | z, | ||
GLfloat | height, | ||
GLfloat | width | ||
) |
Draw a pyramid with the tip at the given location, given height, and width from center to edge as width.
Definition at line 185 of file GLUtil.cpp.
References height, ROOT2D2, and width.
Referenced by SearchUnit::OpenGLDraw().
void DrawSphere | ( | GLdouble | _x, |
GLdouble | _y, | ||
GLdouble | _z, | ||
GLdouble | tRadius | ||
) |
Definition at line 433 of file GLUtil.cpp.
References PID2, point3d, and TWOPI.
Referenced by MapUnit::OpenGLDraw(), AbsMapUnit::OpenGLDraw(), SearchUnit::OpenGLDraw(), NaryTree::OpenGLDraw(), Map2DConstrainedEnvironment::OpenGLDraw(), MCEnvironment::OpenGLDraw(), MNAgentEnvironment::OpenGLDraw(), Directional2DEnvironment::OpenGLDraw(), MapEnvironment::OpenGLDraw(), Fling::OpenGLDraw(), and GraphDistanceHeuristic::OpenGLDraw().
void DrawSquare | ( | GLdouble | _x, |
GLdouble | _y, | ||
GLdouble | _z, | ||
GLdouble | tRadius | ||
) |
Definition at line 396 of file GLUtil.cpp.
Referenced by CanonicalGraphEnvironment::OpenGLDraw(), CanonicalGrid::CanonicalGrid::OpenGLDraw(), and GraphEnvironment::OpenGLDraw().
void DrawText | ( | double | x, |
double | y, | ||
double | z, | ||
double | scale, | ||
const char * | res | ||
) |
Definition at line 526 of file GLUtil.cpp.
Referenced by AStarDelay::DrawEdge(), Prop::DrawEdge(), DrawGraphics(), GraphEnvironment::GLLabelState(), MapOverlay::OpenGLDraw(), CanonicalGraphEnvironment::OpenGLDraw(), and GraphEnvironment::OpenGLDraw().
void DrawTextCentered | ( | double | x, |
double | y, | ||
double | z, | ||
double | scale, | ||
const char * | res | ||
) |
Definition at line 542 of file GLUtil.cpp.
References width.
Referenced by DrawGraphics(), CanonicalGraphEnvironment::OpenGLDraw(), and GraphEnvironment::OpenGLDraw().
void FrameCircle | ( | GLdouble | _x, |
GLdouble | _y, | ||
GLdouble | tRadius, | ||
GLdouble | lineWidth, | ||
int | segments = 32 , |
||
float | rotation = 0 |
||
) |
Definition at line 407 of file GLUtil.cpp.
References rotation, and TWOPI.
Referenced by DoDrawCommands(), and DrawGraphics().
std::ostream& operator<< | ( | std::ostream & | out, |
const recVec & | loc | ||
) |
Definition at line 27 of file GLUtil.cpp.
Definition at line 22 of file GLUtil.cpp.
void OutlineRect | ( | GLdouble | left, |
GLdouble | top, | ||
GLdouble | right, | ||
GLdouble | bottom, | ||
double | zz | ||
) |
Definition at line 384 of file GLUtil.cpp.
Referenced by CanonicalGraphEnvironment::OpenGLDraw(), and GraphEnvironment::OpenGLDraw().
void SetLighting | ( | GLfloat | ambientf = 0.2f , |
GLfloat | diffusef = 1.0f , |
||
GLfloat | specularf = 1.0f |
||
) |
Definition at line 565 of file GLUtil.cpp.
std::string to_string_with_precision | ( | const T | a_value, |
const int | n = 6 |
||
) |
Definition at line 185 of file GLUtil.h.
Referenced by IncrementalBGS< state, action >::DoSingleSearchStep(), BOAStar< state, action, environment >::DoSingleSearchStep(), IncrementalBTS< state, action >::DoSingleSearchStep(), BOAStar< state, action, environment >::DrawFrontier(), HandleCommand(), IncrementalBGS< state, action >::InitializeSearch(), IncrementalBTS< state, action >::InitializeSearch(), SVGDrawCircle(), SVGDrawNGon(), SVGDrawRect(), SVGFrameCircle(), SVGFrameNGon(), and SVGFrameRect().
|
static |
Definition at line 62 of file GLUtil.h.
Referenced by GraphEnvironment::DrawStateLabel().
|
static |
Definition at line 66 of file GLUtil.h.
Referenced by MeroBUtil::graphGenerator::genFig1(), PropUtil::graphGenerator::genFig1(), PropUtil::graphGenerator::genFig2(), GraphInconsistencyExamples::GetExpoGraph(), GetHeading(), CanonicalGrid::CanonicalGrid::GLDrawLine(), MapEnvironment::GLDrawLine(), and TOH< patternDisks >::OpenGLDraw().
|
static |
Definition at line 68 of file GLUtil.h.
Referenced by DrawSphere().
|
static |
Definition at line 73 of file GLUtil.h.
Referenced by DrawPyramid().
|
static |
Definition at line 63 of file GLUtil.h.
Referenced by VoxelGrid::GCost(), and VoxelGrid::HCost().
|
static |
Definition at line 61 of file GLUtil.h.
Referenced by AddMapEdges(), CanonicalGrid::CanonicalGrid::CanonicalGrid(), VoxelGrid::GCost(), WeightedMap2DEnvironment::GCost(), Map2DSectorAbstraction::HCost(), VoxelGrid::HCost(), GraphMapHeuristic::HCost(), GraphMapInconsistentHeuristic::HCost(), OctileHeuristic::HCost(), OldSearchCode::MapSearchEnvironment::heuristic(), OldSearchCode::MapGraphSearchEnvironment::heuristic(), and MapEnvironment::MapEnvironment().
|
static |
Definition at line 65 of file GLUtil.h.
Referenced by MCEnvironment::ApplyAction(), SteeringEnvironment::ApplyAction(), Map2DHeading::BuildAngleTables(), Directional2DEnvironment::BuildAngleTables(), RoboticArm::BuildSinCosTables(), DrawCircle(), DrawCylinder(), DrawSphere(), FrameCircle(), MCEnvironment::GetActions(), RoboticArm::HCost(), LocalDrawCircle(), MCEnvironment::OpenGLDraw(), Map2DHeading::OpenGLDraw(), SteeringEnvironment::OpenGLDraw(), Directional2DEnvironment::OpenGLDraw(), SVGDrawNGon(), and SVGFrameNGon().