VR-Forces 4.3.1 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 
107  protected:
108  virtual void executeEntityAction(const makVrv::DtSelectionManager::IdSet&,
109  const boost::function<void (std::string, DtSimulationAddress addr)>& function,
110  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
111 
112  virtual void executeAggregateAction(const makVrv::DtSelectionManager::IdSet&, bool ignoreSubordinates,
113  const boost::function<void (std::string, DtSimulationAddress addr)>& function,
114  DtSimulationAddress addr = DtSimSendToAll, bool clearAndRequestNewTasks = false);
115 
116  virtual void slot_onValidate(QAction*);
117  virtual void slot_backendUpdated(const DtVrfBackendState&, int, QAction*);
118 
119  virtual void on_aboutToShow();
120 
121  boost::signal<void ()> signal_validateMenuItem;
122 
123  protected slots:
124  virtual void onActionDestroyed();
125 
126  protected:
129  };
130 
132  {
133  Q_OBJECT
134 
135  public:
137  DtVrfEntityMenu(const QString& title, QWidget* parent, makVrv::DtDe&);
138 
140  virtual ~DtVrfEntityMenu();
141 
142  protected:
143  virtual bool eventFilter(QObject *, QEvent *);
144  virtual void actionAdded(QEvent*);
145  virtual bool shouldAddAsPartOfMenu(const QList<QAction*>& acts, QAction* toMatch) const;
146 
147  virtual void validateMenuItems(int terrainPatchOffset);
148 
149  protected:
150  std::vector<std::pair<DtVrfEntityAction*, QAction*> > myEntityActions;
151  };
152 }

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)