Space Comps
 All Classes Files Functions Variables
Public Slots | Signals | Public Member Functions | List of all members
CollisionDisplay3D Class Reference

The view containing 3D visualization. More...

#include <collisiondisplay3d.h>

Inheritance diagram for CollisionDisplay3D:
CollisionDisplay

Public Slots

void start ()
 Reinitializes counters and lists and begins the timer. More...
 
void stop ()
 Stops the timer and clears lists. More...
 
void step ()
 Performs one step of the display. More...
 
- Public Slots inherited from CollisionDisplay
virtual void start ()=0
 Slot used to initialize the display. More...
 
virtual void stop ()=0
 Slot used to stop the display. More...
 
virtual void step ()=0
 Slot used to step the display. More...
 

Signals

void finished ()
 Signals that the display has finished. More...
 
- Signals inherited from CollisionDisplay
virtual void finished ()=0
 Signals that the display is no longer running. More...
 

Public Member Functions

 CollisionDisplay3D (QWindow *parent=0)
 Constructs a CollisionDisplay3D. More...
 
- Public Member Functions inherited from CollisionDisplay
 CollisionDisplay ()
 Constructs a CollisionDisplay. More...
 
QTimer * getTimer ()
 Returns a pointer to the timer. More...
 
int getNumCollisions ()
 Returns the number of collisions seen so far. More...
 
void setQAlgorithm (QAlgorithm *qalgorithm)
 Gives a pointer to the QAlgorithm to the display. More...
 
int getDisplayTimestep ()
 Returns the display timestep. More...
 

Additional Inherited Members

- Protected Attributes inherited from CollisionDisplay
QTimer * timer
 
QAlgorithmqalg
 
int numCollisions
 
int displayTimestep
 
MultiQueuepositionQueue
 
std::queue< int > collisionTimesteps
 

Detailed Description

The view containing 3D visualization.

CollisionDisplay3D inherits from the Qt3D class QGLView to display a 3D visualization of a simulation. It keeps track of and draws QParticle3Ds for each particle of the simulation and allows interaction with the view to change the viewing location.

Constructor & Destructor Documentation

CollisionDisplay3D::CollisionDisplay3D ( QWindow *  parent = 0)
explicit

Constructs a CollisionDisplay3D.

Calls CollisionDisplay's constructor to initialize common members and builds the boundary cube representing the space in which the simulation runs.

Parameters
parentthe parent window, if one exists.

Member Function Documentation

void CollisionDisplay3D::finished ( )
signal

Signals that the display has finished.

Signals that the display has finished, so CollisionSystem can start a new simulation or exit safely once QAlgorithm::finished() occurs.

void CollisionDisplay3D::start ( )
slot

Reinitializes counters and lists and begins the timer.

Reinitializes the timestep and collision counters and builds the list of QParticle3Ds from an Algorithm's list of particles. Starts the display timer to begin updating the display.

void CollisionDisplay3D::step ( )
slot

Performs one step of the display.

Increments the display timestep and checks it against the TIMESTEP_LIMIT to see if the display should continue running. If so, attempts to update the position of each QParticle3D and mark them as colliding if they will collide within the specified window. Finally, updates the timer interval to allow the framerate to be changed in real time.

void CollisionDisplay3D::stop ( )
slot

Stops the timer and clears lists.

Stops the timer so the display no longer updates and clears the list of QParticle3Ds. Emits the finished() signal.


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