VR-Forces 4.1.1 Class Documentation
DtVrfEntityMenu.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtVrfEntityMenu.h,v $ $Revision: 1.3 $ $State: Exp $
7 ******************************************************************************/
8 
11 
13 
14 #pragma once
15 
19 
20 #include <vrvCoreQt/DtMenuItem.h>
21 
22 class QEvent;
23 
24 namespace makVrf
25 {
26  class DtVrfBackendState;
27  class DtVrfEntityMenu;
28 
30  {
31  Q_OBJECT
32 
33  public:
35  {
36  NoOtherOptions = 0,
37  AllObjectsAreVrfSimulated = 0x00000001,
38  AllEditable = 0x00000002,
39  };
40 
41  DtVrfEntityAction(const std::string&, makVrv::DtDe&);
42  virtual ~DtVrfEntityAction();
43 
44  virtual QAction* registerEntityAction(QAction*);
45  virtual void validate(QAction*) = 0;
46 
48  virtual bool selectionMatchesTypes(const makVrv::DtSelectionManager::IdSet&,
49  const std::vector<makVrv::DtElementEntry::ObjectType>&, MatchFlags flags = AllObjectsAreVrfSimulated) const;
50 
51  protected:
52  virtual void executeEntityAction(const makVrv::DtSelectionManager::IdSet&,
53  const boost::function<void (std::string, DtSimulationAddress addr)>& function,
54  DtSimulationAddress addr = DtSimSendToAll);
55 
56  virtual void executeAggregateAction(const makVrv::DtSelectionManager::IdSet&, bool ignoreSubordinates,
57  const boost::function<void (std::string, DtSimulationAddress addr)>& function,
58  DtSimulationAddress addr = DtSimSendToAll);
59 
60  virtual void slot_onValidate(QAction*);
61  virtual void slot_backendUpdated(const DtVrfBackendState&, int, QAction*);
62 
63  virtual void on_aboutToShow();
64 
65  boost::signal<void ()> signal_validateMenuItem;
66 
67  protected slots:
68  virtual void onActionDestroyed();
69 
70  protected:
73  };
74 
76  {
77  Q_OBJECT
78 
79  public:
81  DtVrfEntityMenu(const QString& title, QWidget* parent, makVrv::DtDe&);
82 
84  virtual ~DtVrfEntityMenu();
85 
86  protected:
87  virtual bool eventFilter(QObject *, QEvent *);
88  virtual void actionAdded(QEvent*);
89  virtual bool shouldAddAsPartOfMenu(const QList<QAction*>& acts, QAction* toMatch) const;
90 
91  virtual void validateMenuItems(int terrainPatchOffset);
92 
93  protected:
94  std::vector<std::pair<DtVrfEntityAction*, QAction*> > myEntityActions;
95  };
96 }

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)