VR-Forces 4.0.4 Class Documentation
include/bhave3DGui/bhavePdgDrawerMenu.h
Go to the documentation of this file.
00001 /******************************************************************************
00002 ** Copyright (c) 2011 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 ******************************************************************************/
00005 
00006 #pragma once
00007 
00008 #include <bhave3DGui/bhave3DGuiDefines.h>
00009 #include <vrvCore/DtDe.h>
00010 #include <vrvCoreQt/DtMenuItem.h>
00011 #include <bhave3DGui/bhavePdgDrawerManager.h>
00012 #include <bhave3DGui/bhavePdgThread.h>
00013 #include <vrfGuiConstants/vrfMenuIds.h>
00014 
00015 #include <string>
00016 #include <vrvCoreQt/DtMenu.h>
00017 #include <QMenu>
00018 
00019 namespace BHAVE
00020 {
00021    namespace BHAVE3DGui
00022    {
00023       class DT_DLL_bhave3DGui DtBhavePdgDrawerMenuItem;
00024       class DT_DLL_bhave3DGui DtBhavePdgDrawerMenu;
00025 
00028       class DT_DLL_bhave3DGui DtBhavePdgDrawerMenuQObject : public QObject
00029       {
00030          Q_OBJECT
00031       public:
00032          DtBhavePdgDrawerMenuQObject(DtBhavePdgDrawerMenu*);
00033 
00034       protected slots:
00036          virtual void onPdgGenerated(int result);
00037 
00038       protected:
00039          DtBhavePdgDrawerMenu* myParentMenu;
00040       };
00041 
00044       class DT_DLL_bhave3DGui DtBhavePdgDrawerMenu : public makVrv::DtMenu
00045       {
00046       public:
00047          DtBhavePdgDrawerMenu(makVrv::DtDe& de, const std::deque<DtBhavePdgDrawerMenuItem*>& subMenus, DtBhavePdgThread* pdgThread);
00048          virtual ~DtBhavePdgDrawerMenu();
00049          virtual QMenu* createMenu(makVrv::DtDe&, QWidget* parent);
00050 
00052          virtual void toggleDrawer(DtString drawType);
00053 
00056          virtual void setCheckOnDrawerItem(DtString drawType, bool check);
00057 
00059          virtual void slot_onTerrainGeometryLoaded();
00060 
00061       protected:
00063          virtual void slot_onTerrainLoaded(const std::string& terrain);
00064 
00066          virtual void slot_onTerrainCleared();
00067 
00068          std::deque<DtBhavePdgDrawerMenuItem*> mySubMenus; 
00069          DtBhavePdgDrawerManager* myPdgDrawerMgr;
00070          DtString myActiveDrawer;
00071          DtBhavePdgDrawerMenuQObject myInnerQObject;
00072       };
00073 
00076       class DT_DLL_bhave3DGui DtBhavePdgDrawerMenuItem : public makVrv::DtMenuItem
00077       {
00078          Q_OBJECT
00079       public:
00080          DtBhavePdgDrawerMenuItem(std::string name, makVrv::DtDe& de);
00081          virtual ~DtBhavePdgDrawerMenuItem();
00082 
00085          virtual void setMenuParent(DtBhavePdgDrawerMenu* parent);
00086 
00088          virtual DtString type() = 0;
00089 
00091          virtual DtString menuText() = 0;
00092 
00093          virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00094 
00096          virtual void setEnabled(bool enable);
00097 
00099          virtual void setChecked(bool check);
00100 
00101       protected slots:
00103          virtual void on_triggered();
00104 
00105       protected:
00106          makVrv::DtDe& myDe;
00107          QAction* myAction;
00108          QWidget* myParent;
00109          DtBhavePdgDrawerMenu* myMenuParent;
00110       };   
00111    
00112 
00117       class DT_DLL_bhave3DGui DtBhavePdgDrawGroundPlatformAction : public DtBhavePdgDrawerMenuItem
00118       {
00119          Q_OBJECT
00120 
00121       public:
00124          DtBhavePdgDrawGroundPlatformAction(makVrv::DtDe& de)
00125             : DtBhavePdgDrawerMenuItem(DtBhavePdgDrawGroundPlatformActionId, de) {} 
00126          virtual ~DtBhavePdgDrawGroundPlatformAction() {}
00127 
00129          inline virtual DtString type() { return DtString("groundplatform"); }
00130 
00132          inline virtual DtString menuText() { return DtString("Ground Platform"); }
00133       };
00134 
00139       class DT_DLL_bhave3DGui DtBhavePdgDrawLifeformAction : public DtBhavePdgDrawerMenuItem
00140       {
00141          Q_OBJECT
00142 
00143       public:
00144          DtBhavePdgDrawLifeformAction(makVrv::DtDe& de)
00145             : DtBhavePdgDrawerMenuItem(DtBhavePdgDrawLifeformActionId, de) {}
00146          virtual ~DtBhavePdgDrawLifeformAction() {}
00147          inline virtual DtString type() { return DtString("lifeform"); }
00148          inline virtual DtString menuText() {return DtString("Lifeform"); }
00149       };
00150    }
00151 }

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)