[Gcblue-commits] gcb_wx/include/graphics tcAltitudeBarControl.h,NONE,1.1 tcControl.h,NONE,1.1 tc3DMo
Status: Alpha
Brought to you by:
ddcforge
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29552/include/graphics Modified Files: tc3DModel.h tc3DTerrain.h tc3DViewer.h tc3DWindow.h tcMapView.h tcParticleEffect.h Added Files: tcAltitudeBarControl.h tcControl.h Log Message: Text message "message center" GUI screen Index: tcParticleEffect.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcParticleEffect.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcParticleEffect.h 7 Nov 2004 03:40:43 -0000 1.3 --- tcParticleEffect.h 23 Nov 2004 23:30:46 -0000 1.4 *************** *** 54,58 **** AFTERBURNER = 2, DAMAGE = 4, ! GUN = 8 }; --- 54,59 ---- AFTERBURNER = 2, DAMAGE = 4, ! GUN = 8, ! BUBBLES = 16 }; *************** *** 63,67 **** tcParticleEffect(int smokeModeCode); ! ~tcParticleEffect(); private: --- 64,68 ---- tcParticleEffect(int smokeModeCode); ! virtual ~tcParticleEffect(); private: Index: tc3DModel.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DModel.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tc3DModel.h 6 Nov 2004 15:13:40 -0000 1.9 --- tc3DModel.h 23 Nov 2004 23:30:33 -0000 1.10 *************** *** 90,94 **** float GetRadius(); float GetRadiusGeneric(); ! bool IsSmokeEnabled() const {return smokeTrail.valid();} void Load(std::string model_name); void ProcessAnimations(std::vector<animationDBInfo>& animDBInfo); --- 90,94 ---- float GetRadius(); float GetRadiusGeneric(); ! bool IsSmokeEnabled() const {return smokeTrail != 0;} void Load(std::string model_name); void ProcessAnimations(std::vector<animationDBInfo>& animDBInfo); *************** *** 110,115 **** private: ! osg::ref_ptr<tcParticleEffect> smokeTrail; osgParticle::tcParticlePlacer* smokePlacer; int smokeMode; --- 110,116 ---- private: ! tcParticleEffect* smokeTrail; osgParticle::tcParticlePlacer* smokePlacer; + osg::Vec3 smokeSource; ///< position of smoke emitter in model coordinates int smokeMode; Index: tc3DTerrain.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DTerrain.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tc3DTerrain.h 26 Jul 2004 01:44:40 -0000 1.12 --- tc3DTerrain.h 23 Nov 2004 23:30:34 -0000 1.13 *************** *** 41,44 **** --- 41,49 ---- class tcTerrainTextureFactory; + namespace osg + { + class Texture2D; + } + /** * Class to use Demeter terrain library to display 3D terrain *************** *** 74,77 **** --- 79,85 ---- osg::ref_ptr<Demeter::Terrain> terrain; ///< Demeter terrain object osg::ref_ptr<osg::Geode> terrainNode; ///< drawable terrain object to place into osg scenegraph + osg::ref_ptr<osg::Geometry> waterSurface; + osg::ref_ptr<osg::Texture2D> waterTexture; + tcTerrainTextureFactory* texFactory; *************** *** 96,99 **** --- 104,108 ---- double YToLat(float y); void CheckElevations(); + void InitWaterSurface(); void UpdateElevations(); void UpdateElevationsSlowly(); --- NEW FILE: tcControl.h --- /** ** @file tcControl.h ** Defines base class for ObjectControl GUI view */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** 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 _TCCONTROL_H_ #define _TCCONTROL_H_ #if _MSC_VER > 1000 #pragma once #endif class tcGameObject; class tc3DWindow; /** * Parent class for control */ class tcControl { public: virtual void Draw(tc3DWindow* graphics) = 0; virtual bool IsActive() const; virtual void OnLButtonDown(wxMouseEvent& event) = 0; virtual void OnLButtonUp(wxMouseEvent& event) = 0; virtual void OnMouseMove(wxMouseEvent& event) = 0; virtual void SetActive(bool state); virtual void SetGameObject(tcGameObject* gameObj); static void SetUseEnglishUnits(bool state); tcControl(); virtual ~tcControl(); protected: bool isActive; tcGameObject* obj; static bool useEnglishUnits; ///< true to use english units }; #endif Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tc3DWindow.h 14 Nov 2004 22:52:20 -0000 1.10 --- tc3DWindow.h 23 Nov 2004 23:30:46 -0000 1.11 *************** *** 166,171 **** virtual bool IsWindowMinimized() const; void LoadBackgroundImage(char* fileName); ! osg::Image* LoadImage(const char* fileName); ! osg::Texture2D* LoadTexture(const char* fileName); virtual void Maximize(); virtual void Minimize(); --- 166,171 ---- virtual bool IsWindowMinimized() const; void LoadBackgroundImage(char* fileName); ! static osg::Image* LoadImage(const char* fileName); ! static osg::Texture2D* LoadTexture(const char* fileName); virtual void Maximize(); virtual void Minimize(); *************** *** 243,247 **** void FinishDraw(); void HideUnusedObjects(); ! wxString PrependImagePath(const char* fileName); virtual void OnChar(wxKeyEvent& event); --- 243,247 ---- void FinishDraw(); void HideUnusedObjects(); ! static wxString PrependImagePath(const char* fileName); virtual void OnChar(wxKeyEvent& event); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tcMapView.h 7 Nov 2004 03:40:43 -0000 1.5 --- tcMapView.h 23 Nov 2004 23:30:46 -0000 1.6 *************** *** 361,364 **** --- 361,365 ---- osg::Geometry* DrawNTDSAirRW(teAffiliation affil); osg::Geometry* DrawNTDSMissile(teAffiliation affil); + osg::Geometry* DrawNTDSSubsurface(teAffiliation affil); osg::Geometry* DrawNTDSUnknown(teAffiliation affil); Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tc3DViewer.h 7 Nov 2004 03:40:43 -0000 1.5 --- tc3DViewer.h 23 Nov 2004 23:30:35 -0000 1.6 *************** *** 53,64 **** --- 53,73 ---- { public: + enum FogMode + { + FOG_OFF = 0, ///< deactivate fog + FOG_AIR = 1, ///< for above ground view + FOG_WATER = 2 ///< for underwater view + }; osg::ref_ptr<osgUtil::SceneView> sceneView; + osg::ref_ptr<osgUtil::SceneView> sceneViewFar; osg::ref_ptr<osgUtil::SceneView> guiView; osg::ref_ptr<osg::DisplaySettings> displaySettings; osg::ref_ptr<osg::NodeVisitor> updateVisitor; + osg::ref_ptr<osg::NodeVisitor> updateVisitorFar; osg::ref_ptr<osgUtil::CullVisitor> cullVisitor; osg::ref_ptr<osg::NodeVisitor> guiUpdateVisitor; osg::ref_ptr<osg::FrameStamp> frameStamp; + osg::ref_ptr<osg::FrameStamp> frameStampFar; osg::ref_ptr<osg::FrameStamp> guiFrameStamp; osg::ref_ptr<osgText::Text> viewerText; ///< text for debug/basic viewer info display *************** *** 71,74 **** --- 80,84 ---- osg::ref_ptr<osg::Group> worldObjects; ///< add unit objects to this group osg::ref_ptr<osg::Group> rootnode; + osg::ref_ptr<osg::Group> rootnodeFar; osg::ref_ptr<osgParticle::ParticleSystemUpdater> particleSystemUpdater; *************** *** 141,145 **** void SetCameraEl(float el); void SetCameraRange(float range_m); ! void SetTerrainActive(bool state); void SetText(const char *s); --- 151,155 ---- void SetCameraEl(float el); void SetCameraRange(float range_m); ! void SetFogMode(int mode); void SetTerrainActive(bool state); void SetText(const char *s); *************** *** 210,213 **** --- 220,224 ---- void InitGuiView(); void InitSceneView(wxPoint pos, wxSize size); + void InitSceneViewFar(wxPoint pos, wxSize size); void InitState(); void InitText(); --- NEW FILE: tcAltitudeBarControl.h --- /** ** @file tcAltitudeBarControl.h */ /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** 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 _TCALTITUDEBARCONTROL_H_ #define _TCALTITUDEBARCONTROL_H_ #if _MSC_VER > 1000 #pragma once #endif #include "tcRect.h" #include "tcControl.h" #include <osg/ref_ptr> #include <osg/Vec4> class tcGameObject; class tc3DWindow; namespace osg { class Texture2D; } /** * Altitude bar control */ class tcAltitudeBarControl : public tcControl { public: virtual void Draw(tc3DWindow* graphics); virtual void OnLButtonDown(wxMouseEvent& event); virtual void OnLButtonUp(wxMouseEvent& event); virtual void OnMouseMove(wxMouseEvent& event); tcAltitudeBarControl(float x, float y, float width, float height); virtual ~tcAltitudeBarControl(); protected: tcRect barRect; tcRect upRect; ///< region for up icon tcRect downRect; ///< region for down icon float fontSize; float fontSizeLarge; ///< for main altitude display float increaseScaleThresh; ///< increase if current is > (maxscale * increaseScaleThresh) float decreaseScaleThresh; ///< decrease if current is < (maxscale * decreaseScaleThresh) bool mouseOverBar; bool mouseOverUp; bool mouseOverDown; wxPoint mousePosition; osg::ref_ptr<osg::Texture2D> upIcon; osg::ref_ptr<osg::Texture2D> upOverIcon; osg::ref_ptr<osg::Texture2D> downIcon; osg::ref_ptr<osg::Texture2D> downOverIcon; osg::Vec4 color; osg::Vec4 colorDim; osg::Vec4 neutralColor; osg::Vec4 dangerColor; osg::Vec4 warnColor; osg::Vec4 overColor; tcRect currentRect; ///< filled rect with current altitude or depth tcRect overRect; ///< filled semi-transparent rect for mouse over position float yGoal; ///< y position of goal altitude or depth float yTerrain; ///< y position of ground or ocean bottom float yLimit; ///< y pos of max altitude or depth float currentGoal; /// current goal altitude or depth float currentValue; ///< current altitude or depth float currentScale; ///< altitude or depth of current max scale bool isDepth; ///< true if depth control (submarine) void LoadIcons(); void UpdateDrawParameters(); }; #endif |