[Gcblue-commits] gcb_wx/include/graphics tcBoundingBoxVisitor.h, NONE, 1.1 tcDatabaseBrowsePanel.h,
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-08-17 01:27:14
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv21395/include/graphics Modified Files: tc3DModel.h tc3DWindow.h tcDatabaseInfoWindow.h tcDatabaseViewer.h tcMapObject.h tcMapOverlay.h tcMapView.h Added Files: tcBoundingBoxVisitor.h tcDatabaseBrowsePanel.h tcDatabaseInfoPanel.h tcScrollBar.h Log Message: Update for server name change --- NEW FILE: tcDatabaseBrowsePanel.h --- /** ** @file tcDatabaseBrowsePanel.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _DATABASEBROWSEPANEL_H_ #define _DATABASEBROWSEPANEL_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tc3DWindow.h" namespace osg { class Texture2D; } class tcScrollBar; /** * Class to browse database platform list */ class tcDatabaseBrowsePanel : public tc3DWindow { struct BrowseItem { std::string className; ///< dir name or filename without the .py extension struct { float x; float y; float width; float height; } drawBox; ///< location to draw to screen osg::Vec4 color; enum {OFF = 0, OVER = 1, ON = 2} drawState; }; public: void Draw(); void OnEnterWindow(wxMouseEvent& event); void OnLButtonDown(wxMouseEvent& event); void OnLeaveWindow(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); void OnScrollbarUpdated(wxCommandEvent& event); const std::string& GetDisplayClass() const; void SelectDisplayClass(const std::string& className); void SetClassificationMask(unsigned int mask); void Set3DViewer(tc3DViewer* viewer_); tcDatabaseBrowsePanel(wxWindow* parent, const wxPoint& pos, const wxSize& size, const wxString& name="BrowsePanel", tc3DWindow* graphicsHost=0); virtual ~tcDatabaseBrowsePanel(); private: unsigned int classificationMask; ///< mask for current platform type on browse list std::string displayClassName; ///< class name of current platform displayed std::vector<BrowseItem> browseInfo; wxPoint mousePosition; bool mouseOver; tcScrollBar* scrollBar; float yOffset; void BuildBrowseInfo(); void ClearMouseOver(); bool ProcessMouseClick(const wxPoint& pos); void UpdateDrawInfo(); DECLARE_EVENT_TABLE() }; #endif --- NEW FILE: tcDatabaseInfoPanel.h --- /** ** @file tcDatabaseInfoPanel.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _tcDatabaseInfoPanel_H_ #define _tcDatabaseInfoPanel_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tc3DWindow.h" #include <stdarg.h> namespace database { class tcDatabaseObject; class tcGenericDBObject; class tcMissileDBObject; class tcTorpedoDBObject; } class tcScrollBar; /** * Window class for subpanel for display info for database object */ class tcDatabaseInfoPanel : public tc3DWindow { public: virtual void Draw(); /// set database class name to display info for void SetDatabaseClassName(const std::string& className); /// set id of game object to display info for (must be classified if track) void SetDatabaseObject(long id); void SetViewMode(int mode); tcDatabaseInfoPanel(wxWindow* parent, const wxPoint& pos, const wxSize& size, const wxString& name = "DBpanel", tc3DWindow* graphicsHost = 0); virtual ~tcDatabaseInfoPanel(); private: enum ViewMode { POPUP = 0, ///< compact view for popups EMBED = 1 ///< mode for database viewer screen } viewMode; ///< mode automatically selected based on hostParent argument to constructor long objId; ///< id of obj or track to display info for std::string databaseClassName; ///< class name of database object, empty if not looked up yet tcScrollBar* scrollBar; float yOffset; ///< offset for scrolling float yCurrent; ///< used to track how much space the text needs for scrolling void DrawDatabaseInfo(); void DrawDatabaseInfo(database::tcGenericDBObject* genericData, float yStart); void DrawDatabaseInfo(database::tcMissileDBObject* missileData, float yStart); void DrawDatabaseInfo(database::tcTorpedoDBObject* torpedoData, float yStart); void DrawLauncherInfo(database::tcGenericDBObject* genericData, float& y); void DrawSensorInfo(database::tcGenericDBObject* genericData, float& y); void PrintText(float x, float& y, const char* formatString, ...); database::tcDatabaseObject* GetDatabaseObject(); void LoadImageList(); bool IsEmbedded() const; bool IsPopup() const; void OnScrollbarUpdated(wxCommandEvent& event); DECLARE_EVENT_TABLE() }; #endif Index: tcDatabaseViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDatabaseViewer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcDatabaseViewer.h 21 Apr 2006 23:28:31 -0000 1.3 --- tcDatabaseViewer.h 17 Aug 2006 01:27:10 -0000 1.4 *************** *** 38,41 **** --- 38,42 ---- class tc3DViewer; class tcButton; + class tcDatabaseBrowsePanel; namespace osg *************** *** 68,71 **** --- 69,73 ---- const std::string& GetDisplayClass() const; void SelectDisplayClass(const std::string& className); + void SelectDisplayClass(wxCommandEvent& event); void SetClassificationMask(unsigned int mask); void Set3DViewer(tc3DViewer* viewer_); *************** *** 82,90 **** unsigned int classificationMask; ///< mask for current platform type on browse list std::string displayClassName; ///< class name of current platform displayed ! std::vector<BrowseItem> browseInfo; tcDatabaseInfoWindow* databaseInfoWindow; tc3DViewer* viewer; std::vector<tcButton*> buttons; const wxRealPoint basePosition; wxPoint mousePosition; --- 84,94 ---- unsigned int classificationMask; ///< mask for current platform type on browse list std::string displayClassName; ///< class name of current platform displayed ! tcDatabaseBrowsePanel* browsePanel; tcDatabaseInfoWindow* databaseInfoWindow; tc3DViewer* viewer; std::vector<tcButton*> buttons; + + const wxRealPoint basePosition; wxPoint mousePosition; *************** *** 102,108 **** void InitializeButtons(); void InitializeDatabaseInfoWindow(); ! bool ProcessMouseClick(std::vector<BrowseItem>& info, wxPoint pos); void SetButtonOn(size_t idx); - void UpdateDrawInfo(std::vector<BrowseItem>& info); DECLARE_EVENT_TABLE() --- 106,111 ---- void InitializeButtons(); void InitializeDatabaseInfoWindow(); ! void InitializeBrowsePanel(); void SetButtonOn(size_t idx); DECLARE_EVENT_TABLE() Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** tcMapView.h 4 May 2006 22:47:06 -0000 1.29 --- tcMapView.h 17 Aug 2006 01:27:10 -0000 1.30 *************** *** 62,80 **** SYMBOL_SMALLSURFACE = 2, SYMBOL_LARGESURFACE = 3, ! SYMBOL_AIR = 4, ! SYMBOL_FIXEDWING = 5, ! SYMBOL_MISSILE = 6, ! SYMBOL_HELO = 7, ! SYMBOL_SUBSURFACE = 8, ! SYMBOL_SUBMARINE = 9, ! SYMBOL_TORPEDO = 10, ! SYMBOL_FIXED = 11, ! SYMBOL_MARK = 12, ! SYMBOL_SENSOR = 13, ! SYMBOL_TARGET = 14, ! SYMBOL_PIE = 15 }; ! #define MAX_SYMBOL 16 enum teSymbology --- 62,82 ---- SYMBOL_SMALLSURFACE = 2, SYMBOL_LARGESURFACE = 3, ! SYMBOL_CARRIER = 4, ! SYMBOL_AIR = 5, ! SYMBOL_FIXEDWING = 6, ! SYMBOL_MISSILE = 7, ! SYMBOL_HELO = 8, ! SYMBOL_SUBSURFACE = 9, ! SYMBOL_SUBMARINE = 10, ! SYMBOL_TORPEDO = 11, ! SYMBOL_FIXED = 12, ! SYMBOL_AIRFIELD = 13, ! SYMBOL_MARK = 14, ! SYMBOL_SENSOR = 15, ! SYMBOL_TARGET = 16, ! SYMBOL_PIE = 17 }; ! #define MAX_SYMBOL 18 enum teSymbology *************** *** 92,95 **** --- 94,99 ---- float mfHeading; double mfLon,mfLat; + float speed_kts; + float alt_m; teSymbol meSymbol; teAffiliation meAffiliation; *************** *** 106,110 **** meAffiliation = UNKNOWN; meSymbol = SYMBOL_UNKNOWN; ! mbExists=0;mbFocus=0;mnColor=0;mfHeading=0;mfLon=0;mfLat=0;mnID=0; mnFlags = 0; isStaleTrack = false; --- 110,114 ---- meAffiliation = UNKNOWN; meSymbol = SYMBOL_UNKNOWN; ! mbExists=0;mbFocus=0;mnColor=0;mfHeading=0;mfLon=0;mfLat=0;mnID=0;speed_kts=0;alt_m=0; mnFlags = 0; isStaleTrack = false; *************** *** 318,321 **** --- 322,326 ---- void OnSize(wxSizeEvent& event); void Refresh(); + void UpdateMapObjectColors(); void ActivateCmd(teMapCmdType aeCmd); void DeactivateCmd(); Index: tcMapOverlay.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapOverlay.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcMapOverlay.h 22 Mar 2006 01:23:29 -0000 1.3 --- tcMapOverlay.h 17 Aug 2006 01:27:10 -0000 1.4 *************** *** 65,68 **** --- 65,69 ---- /// redraw overlay during next call to Draw() void Redraw(); + void SetColor(osg::Vec4& color); virtual tcUpdateStream& operator<<(tcUpdateStream& stream); Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tc3DModel.h 18 Jun 2006 00:47:51 -0000 1.23 --- tc3DModel.h 17 Aug 2006 01:27:10 -0000 1.24 *************** *** 29,32 **** --- 29,33 ---- #include "tcSmoker.h" #include <osg/ref_ptr> + #include <osg/BoundingBox> #include <osg/Group> #include <osg/LOD> *************** *** 37,40 **** --- 38,42 ---- class tcParticleEffect; + namespace osgParticle { *************** *** 122,126 **** osg::ref_ptr<osg::Node> GetNode(); ///< transformed to camera frame unsigned int GetNumParents(); ! const osg::BoundingBox& GetBoundingBox() const; float GetRadius(); float GetRadiusGeneric(); --- 124,129 ---- osg::ref_ptr<osg::Node> GetNode(); ///< transformed to camera frame unsigned int GetNumParents(); ! const osg::BoundingBox& GetBoundingBox(); ! const osg::BoundingBox& GetBoundingBoxConst() const; float GetRadius(); float GetRadiusGeneric(); *************** *** 190,193 **** --- 193,200 ---- int genericMode; + osg::BoundingBox boundingBox; + bool boundingBoxComputed; + + void DisableSmoke(); void EnableSmoke(); --- NEW FILE: tcScrollBar.h --- /** ** @file tcScrollBar.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _TCSCROLLBAR_H_ #define _TCSCROLLBAR_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tc3DWindow.h" #include <string> namespace osg { class Texture2D; } class TiXmlNode; /** * GUI scroll bar class */ class tcScrollBar : public tc3DWindow { public: virtual void Draw(); void SetBackgroundAlpha(float val); void SetBarFraction(float val); tcScrollBar(tc3DWindow *parent, const wxPoint& pos, const wxSize& size, const wxString& name = "ScrollBar"); virtual ~tcScrollBar(); protected: float barFraction; float ybar; tcRect barRect; tcRect buttonUpRect; tcRect buttonDownRect; bool isMouseOver; bool leftButtonDown; bool scrollDrag; bool overArrowUp; ///< true if mouse is over up arrow bool overArrowDown; ///< true if mouse if over down arrow bool overScrollBar; wxPoint scrollDragStart; float ybarStart; bool autoScroll; ///< true if mouse is down long enough on up/down arrow, will auto scroll float autoScrollIncrement; ///< set to 0 when left button is not down over up/down arrow unsigned int buttonDownTime; float backgroundAlpha; ///< transparency value for solid color background virtual void OnEnterWindow(wxMouseEvent& event); virtual void OnLButtonDown(wxMouseEvent& event); virtual void OnLButtonDClick(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnMouseMove(wxMouseEvent& event); virtual void OnLeaveWindow(wxMouseEvent& event); private: const float clickScrollAmount; ///< amount to scroll by when up/down arrow clicked osg::ref_ptr<osg::Texture2D> arrowUp; osg::ref_ptr<osg::Texture2D> arrowDown; osg::ref_ptr<osg::Texture2D> arrowUpOver; osg::ref_ptr<osg::Texture2D> arrowDownOver; float lastybar; void LoadImages(); void SendScrollbarUpdated(); void UpdateAutoScroll(); void UpdateYbar(float ynew); }; #endif Index: tcDatabaseInfoWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcDatabaseInfoWindow.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcDatabaseInfoWindow.h 21 Apr 2006 23:28:31 -0000 1.5 --- tcDatabaseInfoWindow.h 17 Aug 2006 01:27:10 -0000 1.6 *************** *** 40,43 **** --- 40,46 ---- } + class tcDatabaseInfoPanel; + + /** * Window class to display info for database object *************** *** 105,118 **** float xImage; ///< x coordinate of image float yImage; ///< y coordinate of image static tc3DWindow* parent; void DrawDatabaseInfo(); - void DrawDatabaseInfo(database::tcGenericDBObject* genericData, float yStart); - void DrawDatabaseInfo(database::tcMissileDBObject* missileData, float yStart); - void DrawDatabaseInfo(database::tcTorpedoDBObject* torpedoData, float yStart); void DrawDatabaseImages(); - void DrawLauncherInfo(database::tcGenericDBObject* genericData, float& y); - void DrawSensorInfo(database::tcGenericDBObject* genericData, float& y); void PrintText(float x, float& y, const char* formatString, ...); --- 108,117 ---- float xImage; ///< x coordinate of image float yImage; ///< y coordinate of image + tcDatabaseInfoPanel* infoPanel; static tc3DWindow* parent; void DrawDatabaseInfo(); void DrawDatabaseImages(); void PrintText(float x, float& y, const char* formatString, ...); Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** tc3DWindow.h 18 Jun 2006 00:47:51 -0000 1.26 --- tc3DWindow.h 17 Aug 2006 01:27:10 -0000 1.27 *************** *** 195,198 **** --- 195,200 ---- void SetBackgroundDraw(bool state); void SetResizeable2D(bool abState) {resizeable2DSurface = abState;} ///< @see tc3DWindow::OnSize + unsigned char GetStencilLayer() const; + void SetStencilLayer(unsigned char n); ///< set to 0 to deactivate virtual void SetYMirror(int y) {yMirror = y;} virtual void Thaw(); *************** *** 248,251 **** --- 250,255 ---- wxRect iconPosition; ///< minimized, icon pos of window const int iconSize; + unsigned char stencilLayer; ///< Set non-zero to keep window graphics in window (0/off by default) + static tc3DViewer* viewer; *************** *** 324,327 **** --- 328,332 ---- void LogStatus(); void UpdateChildren(); + void UpdateStencil(); DECLARE_EVENT_TABLE() Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tcMapObject.h 22 Mar 2006 01:23:29 -0000 1.11 --- tcMapObject.h 17 Aug 2006 01:27:10 -0000 1.12 *************** *** 72,75 **** --- 72,77 ---- static void SetMapView(tcMapView *mv); + static void LoadMarker(const std::string& filename); + virtual tcUpdateStream& operator<<(tcUpdateStream& stream); virtual tcUpdateStream& operator>>(tcUpdateStream& stream); *************** *** 86,90 **** static tcMapView *mapView; ///< used to translate lat/lon coords into screen coords - static void LoadMarker(); private: bool useRelativeCoords; ///< interpret lat_rad and lon_rad as rel screen coords [0-1] --- 88,91 ---- --- NEW FILE: tcBoundingBoxVisitor.h --- /** ** @file tcBoundingBoxVisitor.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** You should have received a copy of the GNU General Public License ** along with GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ** ** Based on code by Farshid Lashkari posted to the osg-users list on April 18, 2006 */ #ifndef _TCBOUNDINGBOXVISITOR_H_ #define _TCBOUNDINGBOXVISITOR_H_ #if _MSC_VER > 1000 #pragma once #endif #include <osg/NodeVisitor> #include <osg/BoundingBox> namespace osg { class Geode; }; class tcBoundingBoxVisitor : public osg::NodeVisitor { public : tcBoundingBoxVisitor(const osg::Matrix &mat); virtual void apply(osg::Node &node); virtual void apply(osg::Geode &geode); virtual void apply(osg::Transform& node); osg::BoundingBox getBound() const; private: osg::BoundingBox m_bb; osg::Matrix m_curMatrix; }; #endif |