VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vrfEntityMenu.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
18 
19 #include <vrvCoreQt/DtMenuItem.h>
20 
21 class QEvent;
22 
23 namespace makVrf
24 {
25  class DtVrfBackendState;
26  class DtVrfEntityMenu;
27 
29  {
30  public:
33 
36 
37  protected:
39  };
40 
42  {
43  public:
46 
49 
50  protected:
52  };
53 
55  {
56  public:
59 
62 
63  protected:
65  };
66 
68  {
69  public:
72 
75 
76  protected:
78  };
79 
81  {
82  Q_OBJECT
83 
84  public:
86  {
87  NoOtherOptions = 0,
88  AllObjectsAreVrfSimulated = 0x00000001,
89  AllEditable = 0x00000002,
90  };
91 
92  DtVrfEntityAction(const std::string&, makVrv::DtDe&);
93  virtual ~DtVrfEntityAction();
94 
95  virtual QAction* registerEntityAction(QAction*);
96  virtual void validate(QAction*) = 0;
97 
99  virtual bool selectionMatchesTypes(const makVrv::DtSelectionManager::IdSet&,
100  const std::vector<makVrv::DtElementEntry::ObjectType>&, MatchFlags flags = AllObjectsAreVrfSimulated) const;
101 
103  virtual bool needsToBeJoinedToSession() const;
104 
105  virtual bool joinedToSession() const;
106  bool validateAlways() const { return myValidateAlways; };
107 
108  protected:
109  virtual void executeEntityAction(const makVrv::DtSelectionManager::IdSet&,
110  const boost::function<void (const DtUUID&, DtSimulationAddress addr)>& function,
111  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
112 
113  virtual void executeAggregateAction(const makVrv::DtSelectionManager::IdSet&, bool ignoreSubordinates,
114  const boost::function<void (const DtUUID&, DtSimulationAddress addr)>& function,
115  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
116 
117  virtual void slot_onValidate(QAction*);
118  virtual void slot_backendUpdated(const DtVrfBackendState&, int, QAction*);
119 
120  virtual void on_aboutToShow();
121 
122  boost::signal<void ()> signal_validateMenuItem;
123 
124  protected slots:
125  virtual void onActionDestroyed();
126 
127  protected:
130  };
131 
133  {
134  Q_OBJECT
135 
136  public:
138  DtVrfEntityMenu(const QString& title, QWidget* parent, makVrv::DtDe&);
139 
141  virtual ~DtVrfEntityMenu();
142 
143  protected:
144  virtual bool eventFilter(QObject *, QEvent *);
145  virtual void actionAdded(QEvent*);
146  virtual bool shouldAddAsPartOfMenu(const QList<QAction*>& acts, QAction* toMatch) const;
147 
148  virtual void validateMenuItems(int terrainPatchOffset);
149 
150  protected:
151  std::vector<std::pair<DtVrfEntityAction*, QAction*> > myEntityActions;
152  };
153 }

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)