GLWTankViewer Class Reference

#include <GLWTankViewer.h>

Inheritance diagram for GLWTankViewer:

GLWidget GLWDropDownI MetaClass

List of all members.

Public Member Functions

 GLWTankViewer (float x=0.0f, float y=0.0f, int numH=0, int numV=0)
virtual ~GLWTankViewer ()
void selectModelByName (const char *name)
const char * getModelName ()
void setTeam (int team)
virtual void select (unsigned int id, const int pos, GLWSelectorEntry value)
virtual void draw ()
virtual void simulate (float frameTime)
virtual void mouseDown (int button, float x, float y, bool &skipRest)
virtual void mouseUp (int button, float x, float y, bool &skipRest)
virtual void mouseDrag (int button, float mx, float my, float x, float y, bool &skipRest)
virtual void mouseWheel (float x, float y, float z, bool &skipRest)
 REGISTER_CLASS_HEADER (GLWTankViewer)

Protected Member Functions

void setTankModels (std::vector< ModelEntry > &models)
virtual void drawItem (int pos, bool selected)
virtual void drawCaption (int pos)

Protected Attributes

GLWDropDownText catagoryChoice_
GLWScrollW scrollBar_
GLWPanel infoWindow_
ToolTip toolTip_
std::vector< ModelEntrymodels_
int numH_
int numV_
float rot_
float rotXY_
float rotYZ_
float rotXYD_
float rotYZD_
float totalTime_
int selected_
int team_

Private Member Functions

 GLWTankViewer (const GLWTankViewer &)
const GLWTankVieweroperator= (const GLWTankViewer &)

Classes

struct  ModelEntry


Detailed Description

Definition at line 32 of file GLWTankViewer.h.


Constructor & Destructor Documentation

GLWTankViewer::GLWTankViewer ( float  x = 0.0f,
float  y = 0.0f,
int  numH = 0,
int  numV = 0 
)

Definition at line 38 of file GLWTankViewer.cpp.

References GLWDropDownText::addText(), catagoryChoice_, GLWDropDown::getCurrentEntry(), TankModelStore::getModelCatagories(), ScorchedContext::getTankModels(), infoWindow_, ScorchedClient::instance(), LANG_RESOURCE, select(), GLWDropDown::setCurrentPosition(), GLWDropDown::setHandler(), GLWidget::setToolTip(), and ToolTip::ToolTipHelp.

GLWTankViewer::~GLWTankViewer (  )  [virtual]

Definition at line 88 of file GLWTankViewer.cpp.

GLWTankViewer::GLWTankViewer ( const GLWTankViewer  )  [private]


Member Function Documentation

void GLWTankViewer::selectModelByName ( const char *  name  ) 

Definition at line 436 of file GLWTankViewer.cpp.

References DIALOG_ASSERT, TankModel::getName(), models_, selected_, and LangStringUtil::strcmp().

Referenced by PlayerDialog::nextPlayer().

const char * GLWTankViewer::getModelName (  ) 

Definition at line 195 of file GLWTankViewer.cpp.

References models_, and selected_.

Referenced by PlayerDialog::buttonDown().

void GLWTankViewer::setTeam ( int  team  ) 

Definition at line 93 of file GLWTankViewer.cpp.

References catagoryChoice_, GLWScrollW::getCurrent(), GLWDropDownText::getCurrentText(), int(), models_, scrollBar_, select(), selected_, GLWScrollW::setCurrent(), and team_.

Referenced by PlayerDialog::draw(), and PlayerDialog::select().

void GLWTankViewer::select ( unsigned int  id,
const int  pos,
GLWSelectorEntry  value 
) [virtual]

Implements GLWDropDownI.

Definition at line 117 of file GLWTankViewer.cpp.

References GLWSelectorEntry::getDataText(), TankModelStore::getModels(), ScorchedContext::getTankModels(), ScorchedClient::instance(), TankModel::isOfAi(), TankModel::isOfCatagory(), TankModel::isOfTeam(), GLWTankViewer::ModelEntry::mesh, GLWTankViewer::ModelEntry::model, setTankModels(), and team_.

Referenced by GLWTankViewer(), and setTeam().

void GLWTankViewer::draw (  )  [virtual]

Reimplemented from GLWidget.

Definition at line 236 of file GLWTankViewer.cpp.

References catagoryChoice_, GLState::DEPTH_OFF, GLState::DEPTH_ON, GLWDropDownText::draw(), GLWScrollW::draw(), GLWPanel::draw(), drawCaption(), drawItem(), GLWidget::drawShadedRoundBox(), GLWScrollW::getCurrent(), TankType::getDescription(), GLWidget::getH(), GLWTranslate::getPosX(), GLWTranslate::getPosY(), ScorchedContext::getTankModels(), GLWidget::getW(), GLWidget::getX(), GLWidget::getY(), GL_AMBIENT, GL_DIFFUSE, GL_LIGHT1, GL_LINE_LOOP, GL_POSITION, glBegin(), glColor3f(), glEnd(), glLightfv(), glPopMatrix(), glPushMatrix(), glRotatef(), glScalef(), glTranslatef(), glVertex2f(), GLWidget::h_, infoWindow_, ScorchedClient::instance(), GLWToolTip::instance(), LANG_STRING, models_, numH_, numV_, rot_, scrollBar_, selected_, ToolTip::setText(), TankHalfSquareSize, TankPadding, TankSquareSize, toolTip_, ToolTip::ToolTipInfo, GLWidget::w_, GLWidget::x_, and GLWidget::y_.

void GLWTankViewer::simulate ( float  frameTime  )  [virtual]

Reimplemented from GLWidget.

Definition at line 206 of file GLWTankViewer.cpp.

References rot_, rotXY_, rotXYD_, rotYZ_, rotYZD_, scrollBar_, GLWScrollW::simulate(), and totalTime_.

void GLWTankViewer::mouseDown ( int  button,
float  x,
float  y,
bool &  skipRest 
) [virtual]

Reimplemented from GLWidget.

Definition at line 331 of file GLWTankViewer.cpp.

References catagoryChoice_, GLWScrollW::getCurrent(), GLWidget::h_, GLWidget::inBox(), int(), models_, GLWDropDown::mouseDown(), GLWScrollW::mouseDown(), numH_, numV_, scrollBar_, selected_, GLWidget::w_, GLWidget::x_, and GLWidget::y_.

void GLWTankViewer::mouseUp ( int  button,
float  x,
float  y,
bool &  skipRest 
) [virtual]

Reimplemented from GLWidget.

Definition at line 360 of file GLWTankViewer.cpp.

References GLWScrollW::mouseUp(), and scrollBar_.

void GLWTankViewer::mouseDrag ( int  button,
float  mx,
float  my,
float  x,
float  y,
bool &  skipRest 
) [virtual]

Reimplemented from GLWidget.

Definition at line 355 of file GLWTankViewer.cpp.

References GLWScrollW::mouseDrag(), and scrollBar_.

void GLWTankViewer::mouseWheel ( float  x,
float  y,
float  z,
bool &  skipRest 
) [virtual]

Reimplemented from GLWidget.

Definition at line 365 of file GLWTankViewer.cpp.

References GLWScrollW::getCurrent(), GLWidget::h_, GLWidget::inBox(), scrollBar_, GLWScrollW::setCurrent(), GLWidget::w_, GLWidget::x_, and GLWidget::y_.

GLWTankViewer::REGISTER_CLASS_HEADER ( GLWTankViewer   ) 

void GLWTankViewer::setTankModels ( std::vector< ModelEntry > &  models  )  [protected]

Definition at line 150 of file GLWTankViewer.cpp.

References TankModel::getName(), int(), TankModel::lessThan(), GLWTankViewer::ModelEntry::model, models_, numH_, scrollBar_, selected_, GLWScrollW::setCurrent(), GLWScrollW::setMax(), and LangStringUtil::strcmp().

Referenced by select().

void GLWTankViewer::drawItem ( int  pos,
bool  selected 
) [protected, virtual]

Definition at line 388 of file GLWTankViewer.cpp.

References TankMesh::draw(), TankMeshStore::getMesh(), Vector4::getOpenGLRotationMatrix(), GL_QUADS, glBegin(), glColor3f(), glEnd(), glVertex2f(), TankMeshStore::instance(), models_, rotXY_, rotYZ_, GLState::TEXTURE_OFF, and totalTime_.

Referenced by draw().

void GLWTankViewer::drawCaption ( int  pos  )  [protected, virtual]

Definition at line 376 of file GLWTankViewer.cpp.

References GLState::DEPTH_OFF, GLWFont::getGameFont(), GLWFont::instance(), LANG_RESOURCE_VAR_1, models_, and TankInfo.

Referenced by draw().

const GLWTankViewer& GLWTankViewer::operator= ( const GLWTankViewer  )  [private]


Member Data Documentation

GLWDropDownText GLWTankViewer::catagoryChoice_ [protected]

Definition at line 64 of file GLWTankViewer.h.

Referenced by draw(), GLWTankViewer(), mouseDown(), and setTeam().

GLWScrollW GLWTankViewer::scrollBar_ [protected]

Definition at line 65 of file GLWTankViewer.h.

Referenced by draw(), mouseDown(), mouseDrag(), mouseUp(), mouseWheel(), setTankModels(), setTeam(), and simulate().

GLWPanel GLWTankViewer::infoWindow_ [protected]

Definition at line 66 of file GLWTankViewer.h.

Referenced by draw(), and GLWTankViewer().

ToolTip GLWTankViewer::toolTip_ [protected]

Definition at line 67 of file GLWTankViewer.h.

Referenced by draw().

std::vector<ModelEntry> GLWTankViewer::models_ [protected]

Definition at line 68 of file GLWTankViewer.h.

Referenced by draw(), drawCaption(), drawItem(), getModelName(), mouseDown(), selectModelByName(), setTankModels(), and setTeam().

int GLWTankViewer::numH_ [protected]

Definition at line 69 of file GLWTankViewer.h.

Referenced by draw(), mouseDown(), and setTankModels().

int GLWTankViewer::numV_ [protected]

Definition at line 69 of file GLWTankViewer.h.

Referenced by draw(), and mouseDown().

float GLWTankViewer::rot_ [protected]

Definition at line 70 of file GLWTankViewer.h.

Referenced by draw(), and simulate().

float GLWTankViewer::rotXY_ [protected]

Definition at line 71 of file GLWTankViewer.h.

Referenced by drawItem(), and simulate().

float GLWTankViewer::rotYZ_ [protected]

Definition at line 71 of file GLWTankViewer.h.

Referenced by drawItem(), and simulate().

float GLWTankViewer::rotXYD_ [protected]

Definition at line 72 of file GLWTankViewer.h.

Referenced by simulate().

float GLWTankViewer::rotYZD_ [protected]

Definition at line 72 of file GLWTankViewer.h.

Referenced by simulate().

float GLWTankViewer::totalTime_ [protected]

Definition at line 73 of file GLWTankViewer.h.

Referenced by drawItem(), and simulate().

int GLWTankViewer::selected_ [protected]

Definition at line 74 of file GLWTankViewer.h.

Referenced by draw(), getModelName(), mouseDown(), selectModelByName(), setTankModels(), and setTeam().

int GLWTankViewer::team_ [protected]

Definition at line 75 of file GLWTankViewer.h.

Referenced by select(), and setTeam().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:03 2009 for Scorched3D by  doxygen 1.5.3