My Project
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ParticlePlot Class Reference

#include <ParticlePlot.h>

Inheritance diagram for ParticlePlot:
GlutWindow2d GlutWindow

Public Member Functions

 ParticlePlot (const char *title, int width=800, int height=800)
 
virtual ~ParticlePlot ()
 
void reinitPlotter ()
 
void spawnAsThread ()
 
virtual void draw ()
 
void setData (Matrix &heightValues, double *xPos, double *yPos, particleT *currParticles, const double &refX, const double &refY)
 
void setDataMapOnly (Matrix &heightValues, double *xPos, double *yPos, const double &refX, const double &refY)
 
void setMap (Matrix &heightValues, double *xPos, double *yPos)
 
void setParticles (particleT *currParticles)
 
void addVehiclePath (const double &x, const double &y)
 
void addReferencePath (const double &x, const double &y)
 
void setMapBoundary (const double &minX, const double &maxX, const double &minY, const double &maxY)
 
void setString (const std::string &str)
 
void processNormalKeys (unsigned char key, int x, int y)
 
- Public Member Functions inherited from GlutWindow2d
 GlutWindow2d (const char *title, int width=800, int height=800)
 
virtual ~GlutWindow2d ()
 
virtual void reshape (int w, int h)
 
virtual void display ()
 
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 ()
 
- Public Member Functions inherited from GlutWindow
 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)
 

Protected Member Functions

void drawAxes ()
 draws the axes and grid on the screen More...
 
- Protected Member Functions inherited from GlutWindow2d
virtual void init ()
 
void drawZoomCircle ()
 
void setProjectiveSettings ()
 
void drawText2d (const char *txt, float x, float y, float r, float g, float b, void *font)
 
- Protected Member Functions inherited from GlutWindow
void initFunctionPtrs ()
 
double degToRad (const double &angle)
 

Protected Attributes

pthread_t * viewerThreadID
 the handle of the thread More...
 
double * vertices
 the vertices of the grid More...
 
double * colors
 the color of each vertex in the grid More...
 
int size
 the size of the vertices and color arrays More...
 
int numQuads
 the number of quads in the grid we are trying to display More...
 
double refX
 current north/east reference point More...
 
double refY
 
Point3d particles [MAX_PARTICLES]
 the particles to display on the screen More...
 
pthread_mutex_t dataLock
 the mutex lock for the data so that the drawer isn't trying to display it while the user is setting it More...
 
bool followPositionFlag
 whether or not to follow a position on the screen More...
 
Point2d cameraCenterPosition
 if the user wants to follow a position on the screen, this specifies that position More...
 
std::vector< Point2dvehiclePath
 the following two are two sequences of paths to display on the screen. More...
 
std::vector< Point2dreferencePath
 
Point2d mapCoords1
 coordinates of places to display the text on the screen More...
 
Point2d mapCoords2
 
Point2d mapBoundaries [4]
 bounding vertices of current search map More...
 
std::string displayString
 string to display at the bottom of the screen More...
 
- Protected Attributes inherited from GlutWindow2d
double zoomFactor
 
double mouseStartZoom
 
double panXOffset
 
double panYOffset
 
double mousePanXOffset
 
double mousePanYOffset
 
bool drawZoomCircleFlag
 
double zoomDrawRadius
 
- Protected Attributes inherited from GlutWindow
int windowID
 
char * myTitle
 
int windowHeight
 
int windowWidth
 
int buttonDown
 
int mouseStartX
 
int mouseStartY
 
bool windowLaunched
 

Additional Inherited Members

- Static Protected Member Functions inherited from GlutWindow
static void _reshape (int w, int h)
 
static void _idle ()
 
static void _display ()
 
static void _mouse (int button, int state, int x, int y)
 
static void _processNormalKeys (unsigned char key, int x, int y)
 
static void _processSpecialKeys (int key, int x, int y)
 
static void _mouseMotion (int x, int y)
 
- Static Protected Attributes inherited from GlutWindow
static GlutWindowmyWindow
 

Constructor & Destructor Documentation

ParticlePlot::ParticlePlot ( const char *  title,
int  width = 800,
int  height = 800 
)

Basic constructor

ParticlePlot::~ParticlePlot ( )
virtual

Basic destructor

Member Function Documentation

void ParticlePlot::addReferencePath ( const double &  x,
const double &  y 
)

Appends this x,y onto the reference path

void ParticlePlot::addVehiclePath ( const double &  x,
const double &  y 
)

Appends this x,y position onto the vehicle path

void ParticlePlot::draw ( )
virtual

This function is called from the display function automatically.

This function needs to be overriden to draw the scene. This function is called from the display function automatically.

Implements GlutWindow2d.

void ParticlePlot::drawAxes ( )
protected

draws the axes and grid on the screen

void ParticlePlot::processNormalKeys ( unsigned char  key,
int  x,
int  y 
)
virtual

This function is called when an ascii key is pressed.

Parameters
keyThe key that was pressed
xThe x location of the cursor when the key was pressed
yThe y location of the cursor when the key was pressed

Reimplemented from GlutWindow2d.

void ParticlePlot::reinitPlotter ( )

Reinitiatlization function

This function reinitializes the plotter by removing all reference data.

void ParticlePlot::setData ( Matrix &  heightValues,
double *  xPos,
double *  yPos,
particleT currParticles,
const double &  refX,
const double &  refY 
)

sets the map data and the particle data. /param heightValues - the matrix of height values for the position in xPos and yPos /param xPos - the x position of the height values /param yPos - the y position of the height values /param currParticles - a pointer to the current list of particles /param refX - the x position of where to reference the map and particles from /param refY - the y position of where to reference the map and particles from

void ParticlePlot::setDataMapOnly ( Matrix &  heightValues,
double *  xPos,
double *  yPos,
const double &  refX,
const double &  refY 
)
void ParticlePlot::setMap ( Matrix &  heightValues,
double *  xPos,
double *  yPos 
)

Sets the map and creates the open gl vertices and color lists

void ParticlePlot::setMapBoundary ( const double &  minX,
const double &  maxX,
const double &  minY,
const double &  maxY 
)

Set current map boundaries

void ParticlePlot::setParticles ( particleT currParticles)

Copys the particles in the viewer

void ParticlePlot::setString ( const std::string &  str)

Sets the display string

void ParticlePlot::spawnAsThread ( )

This function will spawn the viewer as a separate thread and start the viewer.

Member Data Documentation

Point2d ParticlePlot::cameraCenterPosition
protected

if the user wants to follow a position on the screen, this specifies that position

double* ParticlePlot::colors
protected

the color of each vertex in the grid

pthread_mutex_t ParticlePlot::dataLock
protected

the mutex lock for the data so that the drawer isn't trying to display it while the user is setting it

std::string ParticlePlot::displayString
protected

string to display at the bottom of the screen

bool ParticlePlot::followPositionFlag
protected

whether or not to follow a position on the screen

Point2d ParticlePlot::mapBoundaries[4]
protected

bounding vertices of current search map

Point2d ParticlePlot::mapCoords1
protected

coordinates of places to display the text on the screen

Point2d ParticlePlot::mapCoords2
protected
int ParticlePlot::numQuads
protected

the number of quads in the grid we are trying to display

Point3d ParticlePlot::particles[MAX_PARTICLES]
protected

the particles to display on the screen

std::vector<Point2d> ParticlePlot::referencePath
protected
double ParticlePlot::refX
protected

current north/east reference point

double ParticlePlot::refY
protected
int ParticlePlot::size
protected

the size of the vertices and color arrays

std::vector<Point2d> ParticlePlot::vehiclePath
protected

the following two are two sequences of paths to display on the screen.

double* ParticlePlot::vertices
protected

the vertices of the grid

pthread_t* ParticlePlot::viewerThreadID
protected

the handle of the thread


The documentation for this class was generated from the following files: