VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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  InSameSession = 0x00000004,
99  AllDeletable = 0x00000008
100  };
101 
102  DtVrfEntityAction(const std::string&, makVrv::DtDe&);
103  virtual ~DtVrfEntityAction();
104 
105  virtual QAction* registerEntityAction(QAction*);
106  virtual void validate(QAction*) = 0;
107 
109  virtual bool selectionMatchesTypes(const makVrv::DtSelectionManager::IdSet&,
110  const std::vector<makVrv::DtElementEntry::ObjectType>&, MatchFlags flags = AllObjectsAreVrfSimulated) const;
111 
113  virtual bool needsToBeJoinedToSession() const;
114 
115  virtual bool joinedToSession() const;
116  bool validateAlways() const { return myValidateAlways; };
117 
118  protected:
119  virtual void executeEntityAction(const makVrv::DtSelectionManager::IdSet&,
120  const boost::function<void (const DtUUID&, DtSimulationAddress addr)>& function,
121  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
122 
123  virtual void executeAggregateAction(const makVrv::DtSelectionManager::IdSet&, bool ignoreSubordinates,
124  const boost::function<void (const DtUUID&, DtSimulationAddress addr)>& function,
125  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
126 
127  virtual void slot_onValidate(QAction*);
128  virtual void slot_backendUpdated(const DtVrfBackendState&, int, QAction*);
129 
130  virtual void on_aboutToShow();
131 
132  boost::signal<void ()> signal_validateMenuItem;
133 
134  protected slots:
135  virtual void onActionDestroyed();
136 
137  protected:
140  };
141 
143  {
144  Q_OBJECT
145 
146  public:
148  DtVrfEntityMenu(const QString& title, QWidget* parent, makVrv::DtDe&);
149 
151  virtual ~DtVrfEntityMenu();
152 
153  protected:
154  virtual bool eventFilter(QObject *, QEvent *);
155  virtual void actionAdded(QEvent*);
156  virtual bool shouldAddAsPartOfMenu(const QList<QAction*>& acts, QAction* toMatch) const;
157 
158  virtual void validateMenuItems(int terrainPatchOffset);
159 
160  protected:
161  std::vector<std::pair<DtVrfEntityAction*, QAction*> > myEntityActions;
162  };
163 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)