[Gcblue-commits] gcb_wx/include/graphics tc3DViewer.h,1.2,1.3 tc3DWindow.h,1.5,1.6 tcMapObject.h,1.6
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-10-21 04:11:17
|
Update of /cvsroot/gcblue/gcb_wx/include/graphics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9417/include/graphics Modified Files: tc3DViewer.h tc3DWindow.h tcMapObject.h tcMapView.h tcXmlWindow.h Log Message: Changes related to GDI+ replacement Index: tcXmlWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcXmlWindow.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tcXmlWindow.h 7 Oct 2004 22:01:12 -0000 1.3 --- tcXmlWindow.h 21 Oct 2004 04:10:58 -0000 1.4 *************** *** 50,58 **** TiXmlDocument* config; ///< XML auto-configuration file for window - void AddXMLControls(); ///< adds XML controls to window that can be added automatically virtual void OnButtonCommand(wxCommandEvent& event); private: static unsigned ref_count; DECLARE_EVENT_TABLE() }; --- 50,59 ---- TiXmlDocument* config; ///< XML auto-configuration file for window virtual void OnButtonCommand(wxCommandEvent& event); private: static unsigned ref_count; + void AddXMLControls(); ///< adds XML controls to window that can be added automatically + DECLARE_EVENT_TABLE() }; Index: tc3DWindow.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DWindow.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tc3DWindow.h 7 Oct 2004 22:01:12 -0000 1.5 --- tc3DWindow.h 21 Oct 2004 04:10:58 -0000 1.6 *************** *** 143,146 **** --- 143,150 ---- const osg::Vec4& color, float fontSize, osgText::Text::AlignmentType alignment); + void DrawGeometry(osg::Geometry* geometry, float x, float y); + + /// workaround method for inverted coordinates + void DrawGeometryR(osg::Geometry* geometry, float x, float y); void MeasureText(osgText::Font* font, float fontSize, const char* s, *************** *** 150,153 **** --- 154,158 ---- void EraseOpaque(); virtual void Freeze(); + osgText::Font* GetDefaultFont(); bool IsActive() const {return mbActive;} bool IsBackgroundEnabled() const; *************** *** 167,170 **** --- 172,176 ---- void SetBlend(bool blendingOn); void SetBaseRenderBin(int n); + void SetName(const char* s); void SetOpaque(); void SetPixel(int x, int y, unsigned int value); *************** *** 220,225 **** --- 226,233 ---- osg::MatrixTransform* CreateDrawTransform(); + void FinishDraw(); void HideUnusedObjects(); wxString PrependImagePath(const char* fileName); + virtual void OnChar(wxKeyEvent& event); virtual void OnEnterWindow(wxMouseEvent& event); *************** *** 241,245 **** long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); private: ! osg::ref_ptr<osg::Geode> root; ///< root node for drawables osg::ref_ptr<osg::Switch> switchNode; ///< node to enable/disable window osg::ref_ptr<osg::MatrixTransform> transform; ///< transform node for 3D draw objects --- 249,254 ---- long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); private: ! osg::ref_ptr<osg::Geode> root; ///< root node for drawables ! osg::ref_ptr<osg::Group> groupRoot; ///< root node for transforms osg::ref_ptr<osg::Switch> switchNode; ///< node to enable/disable window osg::ref_ptr<osg::MatrixTransform> transform; ///< transform node for 3D draw objects *************** *** 260,263 **** --- 269,275 ---- unsigned int rectIdx; + std::vector<osg::ref_ptr<osg::MatrixTransform> > transformPool; + unsigned int transformIdx; + void CreateBackgroundQuad(); *************** *** 268,271 **** --- 280,284 ---- osg::Geometry* GetRectObject(); osgText::Text* GetTextObject(); + osg::MatrixTransform* GetTransformObject(); void InitGraphicsObjects(); Index: tcMapView.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapView.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcMapView.h 16 Oct 2004 14:57:08 -0000 1.2 --- tcMapView.h 21 Oct 2004 04:10:58 -0000 1.3 *************** *** 32,36 **** #include "wx/msw/private.h" //for MS Windows specific definitions #endif ! #include "tcwindow.h" #include "simmath.h" #include "commandlist.h" --- 32,36 ---- #include "wx/msw/private.h" //for MS Windows specific definitions #endif ! #include "tc3DWindow.h" #include "simmath.h" #include "commandlist.h" *************** *** 39,42 **** --- 39,48 ---- #include "wxcommands.h" + namespace osg + { + class Image; + class Geometry; + } + class tcMapData; class tcMapObject; *************** *** 50,54 **** #define HEADING_UNKNOWN (float)-456.7 #define SCROLL_DELAY 8 ! #define SYMBOLOGY_PATH "images\\symbology\\" enum teSymbol --- 56,60 ---- #define HEADING_UNKNOWN (float)-456.7 #define SCROLL_DELAY 8 ! #define SYMBOLOGY_PATH "symbology\\" enum teSymbol *************** *** 146,150 **** #define N_PENS 10 ! class tcMapView : public tcWindow { public: --- 152,156 ---- #define N_PENS 10 ! class tcMapView : public tc3DWindow { public: *************** *** 177,185 **** } void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void CalcViewParameters(void); virtual void Freeze(); tcPoint GeoToScreen(tcPoint pgeo); tcPoint GeoToScreen(float afLon, float afLat); float GeoExtentToScreen(float afExtent_rad); Gdiplus::Pen* GetPen() {return mpPen;} Gdiplus::Pen* GetPenThin() {return mpPenThin;} --- 183,193 ---- } void AttachCommandInterface(tcCommandQueue *apCommandInterface) {mpCommandInterface=apCommandInterface;} ! void CalcViewParameters(); virtual void Freeze(); tcPoint GeoToScreen(tcPoint pgeo); tcPoint GeoToScreen(float afLon, float afLat); float GeoExtentToScreen(float afExtent_rad); + + /* Gdiplus::Pen* GetPen() {return mpPen;} Gdiplus::Pen* GetPenThin() {return mpPenThin;} *************** *** 187,190 **** --- 195,199 ---- Gdiplus::Font* GetFont() {return mpFont;} Gdiplus::Font* GetFontSmall() {return mpFontSmall;} + */ int PointInView(tcPoint& p); *************** *** 198,206 **** //void SetWindow(RECT& r); void SetViewBounds(tcGeoRect& r) {mrectViewBounds = r;} ! void SetYMirror(int y) ! { ! tcWindow::SetYMirror(y); ! terrainView->SetYMirror(y); ! } virtual void Thaw(); --- 207,211 ---- //void SetWindow(RECT& r); void SetViewBounds(tcGeoRect& r) {mrectViewBounds = r;} ! virtual void Thaw(); *************** *** 218,221 **** --- 223,227 ---- tcTerrainView *terrainView; + /* Gdiplus::Pen *mpPen; ///< GDI+ objects Gdiplus::Pen *mpPenThin; *************** *** 223,226 **** --- 229,234 ---- Gdiplus::Font *mpFont; Gdiplus::Font *mpFontSmall; + */ + osg::Vec4 ConvertColor(unsigned int nColor); virtual void OnSize(wxSizeEvent& event); *************** *** 277,289 **** void ClearMapCmd() {meMapCmd = MC_NONE;} ! int Draw(); ! void DrawGrid(Gdiplus::Graphics *apGraphics); ! void DrawScaleBar(Gdiplus::Graphics *apGraphics); ! void DrawSelectionBox(Gdiplus::Graphics *graphics); ! void DrawTerrainText(Gdiplus::Graphics *apGraphics); ! void DrawMapCmd(Gdiplus::Graphics *apGraphics, tcMapObj *pMO, teMapCmdType type); ! void DrawNavPoints(Gdiplus::Graphics *apGraphics); void DrawIndicator(int anType); ! void DrawSpecial(Gdiplus::Graphics *graphics); size_t GetHookCount(); long GetHookID(size_t idx = 0); --- 285,297 ---- void ClearMapCmd() {meMapCmd = MC_NONE;} ! void Draw(); ! void DrawGrid(); ! void DrawScaleBar(); ! void DrawSelectionBox(); ! void DrawTerrainText(); ! void DrawMapCmd(tcMapObj *pMO, teMapCmdType type); ! void DrawNavPoints(); void DrawIndicator(int anType); ! void DrawSpecial(); size_t GetHookCount(); long GetHookID(size_t idx = 0); *************** *** 323,328 **** std::vector<tcPoint> maNavPointGeo; std::vector<tcPoint> maNavPointScreen; ! Gdiplus::Image* maSymbolA[4][MAX_SYMBOL]; ! Gdiplus::Image* maSymbolB[4][MAX_SYMBOL]; teSymbology meSymbology; float mfSymbolXOffset, mfSymbolYOffset; --- 331,336 ---- std::vector<tcPoint> maNavPointGeo; std::vector<tcPoint> maNavPointScreen; ! osg::ref_ptr<osg::Geometry> maSymbolA[4][MAX_SYMBOL]; ! osg::ref_ptr<osg::Geometry> maSymbolB[4][MAX_SYMBOL]; teSymbology meSymbology; float mfSymbolXOffset, mfSymbolYOffset; *************** *** 332,351 **** void Build2525(); void BuildNTDS(); - UINT32 GetAffiliationColor(teAffiliation a); - Gdiplus::Image* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); - Gdiplus::Image* LoadSymbolImage(char *azSymbolName); ! void DrawNTDSSurface(Gdiplus::Graphics *apGraphics, teAffiliation affil); ! void DrawNTDSGround(Gdiplus::Graphics* graphics, teAffiliation affil); ! void DrawNTDSAirFW(Gdiplus::Graphics *apGraphics, teAffiliation affil); ! void DrawNTDSAirRW(Gdiplus::Graphics *apGraphics, teAffiliation affil); ! void DrawNTDSMissile(Gdiplus::Graphics *apGraphics, teAffiliation affil); ! void DrawNTDSUnknown(Gdiplus::Graphics *apGraphics, teAffiliation affil); ! int DrawSymbol(Gdiplus::Graphics *apGraphics, tcMapObj *pMO); ! int DrawSymbol2(Gdiplus::Graphics* graphics, tcMapObj* pMO); ! Gdiplus::Graphics* GetGraphicsFromImage(Gdiplus::Image* apImage); void UpdateScreenNavPoints(); --- 340,364 ---- void Build2525(); void BuildNTDS(); ! osg::Vec4 GetAffiliationColor(teAffiliation a); ! osg::Geometry* GetSymbol(teAffiliation aeAffiliation, teSymbol aeSymbol); ! osg::Image* LoadSymbolImage(const char *azSymbolName); ! void AddArcPrimitive(osg::Geometry* symbol, osg::Vec3Array* vertices, ! float xc, float yc, float width, float height, ! float startAngle, float stopAngle, unsigned int nPoints); ! osg::Geometry* CreateSymbolGeometry(); ! osg::Geometry* CreateTexturedSymbol(const char* symbolName); ! osg::Geometry* DrawNTDSSurface(teAffiliation affil); ! osg::Geometry* DrawNTDSGround(teAffiliation affil); ! osg::Geometry* DrawNTDSAirFW(teAffiliation affil); ! osg::Geometry* DrawNTDSAirRW(teAffiliation affil); ! osg::Geometry* DrawNTDSMissile(teAffiliation affil); ! osg::Geometry* DrawNTDSUnknown(teAffiliation affil); + void DrawSymbol2(tcMapObj* pMO); ! ! //Gdiplus::Graphics* GetGraphicsFromImage(Gdiplus::Image* apImage); void UpdateScreenNavPoints(); *************** *** 361,368 **** void ChangeTheater(float lon_deg, float lat_deg); int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! int Draw(); ! void DrawGrid(Gdiplus::Graphics* apGraphics); ! void DrawIcon(Gdiplus::Graphics* graphics); ! void DrawTheaterBox(Gdiplus::Graphics *apGraphics); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); --- 374,380 ---- void ChangeTheater(float lon_deg, float lat_deg); int CreateSurfaces(tcGraphicsEngine* apGraphicsEngine); ! void Draw(); ! void DrawGrid(); ! void DrawTheaterBox(); void OnLButtonDown(wxMouseEvent& event); void OnMouseMove(wxMouseEvent& event); *************** *** 384,388 **** tcGeoRect mrectTheater; ///< active theater view region ! int DrawSymbol(Gdiplus::Graphics *apGraphics, tsWorldMapObj *pMO); }; } --- 396,400 ---- tcGeoRect mrectTheater; ///< active theater view region ! void DrawSymbol(tsWorldMapObj *pMO); }; } Index: tc3DViewer.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tc3DViewer.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tc3DViewer.h 7 Oct 2004 22:01:12 -0000 1.2 --- tc3DViewer.h 21 Oct 2004 04:10:58 -0000 1.3 *************** *** 29,35 **** #include "wx/wx.h" - //#include "wx/msw/private.h" // for MS Windows specific definitions #include <osg/FrameStamp> #include <osg/NodeVisitor> #include <osgUtil/SceneView> #include <osgUtil/Optimizer> --- 29,35 ---- #include "wx/wx.h" #include <osg/FrameStamp> #include <osg/NodeVisitor> + #include <osgUtil/CullVisitor> #include <osgUtil/SceneView> #include <osgUtil/Optimizer> *************** *** 56,59 **** --- 56,60 ---- osg::ref_ptr<osg::DisplaySettings> displaySettings; osg::ref_ptr<osg::NodeVisitor> updateVisitor; + osg::ref_ptr<osgUtil::CullVisitor> cullVisitor; osg::ref_ptr<osg::NodeVisitor> guiUpdateVisitor; osg::ref_ptr<osg::FrameStamp> frameStamp; *************** *** 117,121 **** float GetCameraRange() {return cameraRange;} osg::Vec3 GetCameraPosition(); - osg::MatrixTransform* GetDrawMatrixTransform(); double GetGameTime() const {return gameTime;} osg::Vec3 GetObjectPosition(tcGameObject *obj); --- 118,121 ---- Index: tcMapObject.h =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/include/graphics/tcMapObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tcMapObject.h 14 Sep 2004 02:01:45 -0000 1.6 --- tcMapObject.h 21 Oct 2004 04:10:58 -0000 1.7 *************** *** 1,6 **** ! /* ! ** tcMapObject.h ! ** ! ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** All rights reserved. --- 1,6 ---- ! /** ! ** @file tcMapObject.h ! */ ! /* Copyright (C) 2004 Dewitt Colclough (de...@tw...) ** All rights reserved. *************** *** 19,23 **** ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /// @file tcMapObject.h header for eventual replacement of tcMapObj #ifndef _TCMAPOBJECT_H_ --- 19,23 ---- ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! #ifndef _TCMAPOBJECT_H_ *************** *** 30,39 **** #ifndef WX_PRECOMP #include "wx/wx.h" - #ifdef WIN32 - #include "wx/msw/private.h" // for MS Windows specific definitions - #endif // WIN32 #endif // WX_PRECOMP #include "simmath.h" /** --- 30,37 ---- #ifndef WX_PRECOMP #include "wx/wx.h" #endif // WX_PRECOMP #include "simmath.h" + #include <osg/Vec4> /** *************** *** 61,71 **** { public: ! UINT32 color; bool isActive; ! virtual void Draw(Gdiplus::Graphics *graphics); ! UINT32 GetColor() const {return color;} void SetActive(bool active) {isActive = active;} ! void SetColor(UINT32 argbColor) {color = argbColor;} void SetMarkerActive(bool active) {markerEnabled = active;} void SetUseScreenCoords(bool active) {useRelativeCoords = active;} --- 59,69 ---- { public: ! osg::Vec4 color; bool isActive; ! virtual void Draw(); ! osg::Vec4 GetColor() const {return color;} void SetActive(bool active) {isActive = active;} ! void SetColor(osg::Vec4 c) {color = c;} void SetMarkerActive(bool active) {markerEnabled = active;} void SetUseScreenCoords(bool active) {useRelativeCoords = active;} *************** *** 95,99 **** std::string caption; ///< text to display ! virtual void Draw(Gdiplus::Graphics *graphics); tcMapTextObject(); --- 93,97 ---- std::string caption; ///< text to display ! virtual void Draw(); tcMapTextObject(); |