VR-Forces 4.0.4 Class Documentation
examples/guiLocalCreateObject/guiLocalCreateObjectMenu.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2012 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 
00006 //\file guiLocalCreateObjectMenu.h
00007 
00008 //This file defines all the menus and menu items that will be used for the object demo
00009 //Note that this demo expectes to be working on ground-db.mtf
00010 
00011 #include <vrfGuiCore/DtVrfStateViewCollectionManager.h>
00012 #include <vrvCoreQt/DtMenuItem.h>
00013 #include <vrvCoreQt/DtMenu.h>
00014 
00015 #pragma once
00016 
00017 namespace makVrf
00018 {
00019    class DtVrfObjectFacadeInterface;
00020 }
00021 
00022 namespace makVrv
00023 {
00024    class DtIntervisibilityElement;
00025 }
00026 
00027 //New main menu. This menu will be used to hold the Object Demo menu items
00028 class DtGuiLocalCreateObjectMenu : public makVrv::DtMenu
00029 {
00030 public:
00031    DtGuiLocalCreateObjectMenu(makVrv::DtDe& de);
00032    virtual ~DtGuiLocalCreateObjectMenu();
00033 
00034 protected:
00035    virtual QMenu* createMenu(makVrv::DtDe& de, QWidget* parent );
00036 };
00037 
00038 //Base class for creating object demo menu items.  Override the create() method to create the
00039 //appropriate local object
00040 class DtGuiLocalCreateObjectMenuItem : public makVrv::DtMenuItem
00041 {
00042 public:
00043    DtGuiLocalCreateObjectMenuItem(makVrv::DtDe&, const std::string& item);
00044 
00045    virtual ~DtGuiLocalCreateObjectMenuItem();
00046 
00047 protected:
00048    virtual void on_triggered();
00049    virtual void remove();
00050    virtual makVrf::DtVrfObjectFacadeInterface* create() = 0;
00051 
00052    //Called when an object is to be deleted.  If our interface, set to 0 and uncheck menu item if checked
00053    virtual void objectAboutToBeDeleted(makVrf::DtVrfObjectFacadeInterface*);
00054 
00055 protected:
00056    makVrv::DtDe& myDe;
00057    makVrf::DtVrfObjectFacadeInterface* myInterface;
00058    QAction* myAction;
00059 };
00060 
00061 //Menu item for creating a line
00062 class DtGuiLocalCreateObjectLine : public DtGuiLocalCreateObjectMenuItem
00063 {
00064 public:
00065    DtGuiLocalCreateObjectLine(makVrv::DtDe& de);
00066    virtual ~DtGuiLocalCreateObjectLine();
00067 
00068      //Build a menu item (via an action).
00069    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00070 
00071 protected:
00072    virtual  makVrf::DtVrfObjectFacadeInterface* create();
00073 
00074 };
00075 
00076 //Menu item for creating an area
00077 class DtGuiLocalCreateObjectArea : public DtGuiLocalCreateObjectMenuItem
00078 {
00079 public:
00080    DtGuiLocalCreateObjectArea(makVrv::DtDe& de);
00081    virtual ~DtGuiLocalCreateObjectArea();
00082 
00083      //Build a menu item (via an action).
00084    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00085 
00086 protected:
00087    virtual  makVrf::DtVrfObjectFacadeInterface* create();
00088 
00089 };
00090 
00091 //Menu item for creating a waypoint
00092 class DtGuiLocalCreateObjectWaypoint : public DtGuiLocalCreateObjectMenuItem
00093 {
00094 public:
00095    DtGuiLocalCreateObjectWaypoint(makVrv::DtDe& de);
00096    virtual ~DtGuiLocalCreateObjectWaypoint();
00097 
00098      //Build a menu item (via an action).
00099    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00100 
00101 protected:
00102    virtual  makVrf::DtVrfObjectFacadeInterface* create();
00103 
00104 };
00105 
00106 //Menu item for creating a M1A2
00107 class DtGuiLocalCreateObjectM1A2 : public DtGuiLocalCreateObjectMenuItem
00108 {
00109 public:
00110    DtGuiLocalCreateObjectM1A2(makVrv::DtDe& de);
00111    virtual ~DtGuiLocalCreateObjectM1A2();
00112 
00113      //Build a menu item (via an action).
00114    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00115 
00116 protected:
00117    virtual  makVrf::DtVrfObjectFacadeInterface* create();
00118 
00119 };
00120 
00121 //Menu item for creating a Airbus 320
00122 class DtGuiLocalCreateObjectAirbus320 : public DtGuiLocalCreateObjectMenuItem
00123 {
00124 public:
00125    DtGuiLocalCreateObjectAirbus320(makVrv::DtDe& de);
00126    virtual ~DtGuiLocalCreateObjectAirbus320();
00127 
00128      //Build a menu item (via an action).
00129    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00130 
00131 protected:
00132    virtual  makVrf::DtVrfObjectFacadeInterface* create();
00133 
00134 };
00135 
00136 //Creates an intervisibility fan
00137 class DtGuiLocalCreateObjectFan : public makVrv::DtMenuItem
00138 {
00139 public:
00140    DtGuiLocalCreateObjectFan(makVrv::DtDe&);
00141    virtual ~DtGuiLocalCreateObjectFan();
00142 
00143 protected:
00144      //Build a menu item (via an action).
00145    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00146    virtual void on_triggered();
00147 
00148 protected:
00149    makVrv::DtIntervisibilityElement*   myElement;
00150    makVrv::DtDe& myDe;
00151    QAction* myAction;
00152 };
00153 
00154 //Creates intervisibility line and attaches to M1A2 and Airbus
00155 class DtGuiLocalCreateObjectAttachedLine : public makVrv::DtMenuItem
00156 {
00157 public:
00158    DtGuiLocalCreateObjectAttachedLine(makVrv::DtDe&);
00159    virtual ~DtGuiLocalCreateObjectAttachedLine();
00160 
00161 protected:
00162    //Build a menu item (via an action).
00163    virtual QAction* createAction(makVrv::DtDe&, QWidget* parent);
00164    virtual void on_aboutToShow();
00165    virtual void on_triggered();
00166 
00167    //Called when state views are removed, if m1a2 or airbus, also remove this line if
00168    //created
00169    virtual void slot_stateViewAboutToBeRemoved(const makVrv::DtStateView<makVrv::DtVrlinkSimulatedBaseState>&);
00170 
00171 protected:
00172    makVrv::DtIntervisibilityElement*   myElement;
00173    makVrv::DtDe& myDe;
00174    QAction* myAction;
00175 };

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)