VR-Forces 4.5 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  virtual void on_triggered();
38 
39  protected:
41  };
42 
44  {
45  public:
48 
51 
52  virtual void on_triggered();
53 
54  protected:
56  };
57 
59  {
60  public:
63 
66 
67  virtual void on_triggered();
68 
69  protected:
71  };
72 
74  {
75  public:
78 
81 
82  virtual void on_triggered();
83 
84  protected:
86  };
87 
89  {
90  Q_OBJECT
91 
92  public:
94  {
95  NoOtherOptions = 0,
96  AllObjectsAreVrfSimulated = 0x00000001,
97  AllEditable = 0x00000002,
98  };
99 
100  DtVrfEntityAction(const std::string&, makVrv::DtDe&);
101  virtual ~DtVrfEntityAction();
102 
103  virtual QAction* registerEntityAction(QAction*);
104  virtual void validate(QAction*) = 0;
105 
107  virtual bool selectionMatchesTypes(const makVrv::DtSelectionManager::IdSet&,
108  const std::vector<makVrv::DtElementEntry::ObjectType>&, MatchFlags flags = AllObjectsAreVrfSimulated) const;
109 
111  virtual bool needsToBeJoinedToSession() const;
112 
113  virtual bool joinedToSession() const;
114  bool validateAlways() const { return myValidateAlways; };
115 
116  protected:
117  virtual void executeEntityAction(const makVrv::DtSelectionManager::IdSet&,
118  const boost::function<void (const DtUUID&, DtSimulationAddress addr)>& function,
119  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
120 
121  virtual void executeAggregateAction(const makVrv::DtSelectionManager::IdSet&, bool ignoreSubordinates,
122  const boost::function<void (const DtUUID&, DtSimulationAddress addr)>& function,
123  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
124 
125  virtual void slot_onValidate(QAction*);
126  virtual void slot_backendUpdated(const DtVrfBackendState&, int, QAction*);
127 
128  virtual void on_aboutToShow();
129 
130  boost::signal<void ()> signal_validateMenuItem;
131 
132  protected slots:
133  virtual void onActionDestroyed();
134 
135  protected:
138  };
139 
141  {
142  Q_OBJECT
143 
144  public:
146  DtVrfEntityMenu(const QString& title, QWidget* parent, makVrv::DtDe&);
147 
149  virtual ~DtVrfEntityMenu();
150 
151  protected:
152  virtual bool eventFilter(QObject *, QEvent *);
153  virtual void actionAdded(QEvent*);
154  virtual bool shouldAddAsPartOfMenu(const QList<QAction*>& acts, QAction* toMatch) const;
155 
156  virtual void validateMenuItems(int terrainPatchOffset);
157 
158  protected:
159  std::vector<std::pair<DtVrfEntityAction*, QAction*> > myEntityActions;
160  };
161 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)