00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _gLWTankViewer_h
00022 #define _gLWTankViewer_h
00023
00024 #include <GLW/GLWScrollW.h>
00025 #include <GLW/GLWPanel.h>
00026 #include <GLW/GLWDropDownText.h>
00027 #include <GLW/GLWToolTip.h>
00028 #include <tank/TankModel.h>
00029 #include <tankgraph/TankMesh.h>
00030 #include <vector>
00031
00032 class GLWTankViewer : public GLWidget,
00033 public GLWDropDownI
00034 {
00035 public:
00036 GLWTankViewer(float x = 0.0f, float y = 0.0f,
00037 int numH = 0, int numV = 0);
00038 virtual ~GLWTankViewer();
00039
00040 void selectModelByName(const char *name);
00041 const char *getModelName();
00042 void setTeam(int team);
00043
00044
00045 virtual void select(unsigned int id, const int pos, GLWSelectorEntry value);
00046
00047
00048 virtual void draw();
00049 virtual void simulate(float frameTime);
00050 virtual void mouseDown(int button, float x, float y, bool &skipRest);
00051 virtual void mouseUp(int button, float x, float y, bool &skipRest);
00052 virtual void mouseDrag(int button, float mx, float my, float x, float y,
00053 bool &skipRest);
00054 virtual void mouseWheel(float x, float y, float z, bool &skipRest);
00055
00056 REGISTER_CLASS_HEADER(GLWTankViewer);
00057 protected:
00058 struct ModelEntry
00059 {
00060 TankModel *model;
00061 TankMesh *mesh;
00062 };
00063
00064 GLWDropDownText catagoryChoice_;
00065 GLWScrollW scrollBar_;
00066 GLWPanel infoWindow_;
00067 ToolTip toolTip_;
00068 std::vector<ModelEntry> models_;
00069 int numH_, numV_;
00070 float rot_;
00071 float rotXY_, rotYZ_;
00072 float rotXYD_, rotYZD_;
00073 float totalTime_;
00074 int selected_;
00075 int team_;
00076
00077 void setTankModels(std::vector<ModelEntry> &models);
00078 virtual void drawItem(int pos, bool selected);
00079 virtual void drawCaption(int pos);
00080
00081 private:
00082 GLWTankViewer(const GLWTankViewer &);
00083 const GLWTankViewer & operator=(const GLWTankViewer &);
00084
00085 };
00086
00087 #endif // _gLWTankViewer_h
00088