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

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)