GLWTankViewer.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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         // Inhertied from GLWDropDownI
00045         virtual void select(unsigned int id, const int pos, GLWSelectorEntry value);
00046 
00047         // Inhertied from GLWidget
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 

Generated on Mon Feb 16 15:14:46 2009 for Scorched3D by  doxygen 1.5.3