VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
newCrowdItemDialog.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2015 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
8 
9 #pragma once
10 
11 #if !defined(Q_MOC_RUN)
13 #include <vrfGuiCore/vrfMenu.h>
17 #include "newCrowdItemDialogUi.hpp"
19 #endif
20 
21 #include <QDialog>
22 
23 class QTreeWidgetItem;
24 
25 namespace makVrf
26 {
27  class DtRateEntryWidget;
28  class DtCreateObjectPalette;
29 
30  namespace makVrfQt
31  {
32  class DtVrfTaskSetMenu;
33  }
34 
38 
40  {
41  public:
42  DtNewCrowdMenuManager() : makVrv::DtMenuManager()
43  {
44  }
45 
46  void clear()
47  {
48  myMenuItems.clear();
49  myMenus.clear();
50  }
51  };
52 
54  {
55  public:
56  DtNewCrowdMenuAssembler(makVrv::DtDe&, QWidget*, QMenuBar*);
57 
59  {
61  myMenuManager.clear();
62 
63  myMenuBuilders.clear();
64  myMenuItemBuilders.clear();
65  }
66 
67  virtual void unregisterMenu(const std::string& s)
68  {
69  makVrv::DtMenu* b = menuBuilder(s);
70 
71  if (b)
72  {
73  MenuBuilderMap::iterator iter = myMenuBuilders.begin();
74 
75  while (iter != myMenuBuilders.end())
76  {
77  if (iter->second == b)
78  {
82  MenuBuilderMap::iterator iter2;
83  iter2 = iter;
84  ++iter;
85  myMenuBuilders.erase(iter);
86  }
87  else
88  {
89  ++iter;
90  }
91  }
92  }
93  }
94 
96  QMenuBar* menuBar()
97  {
98  return myMenuBar;
99  }
100 
102  virtual QWidget* menuWindow();
103 
105  virtual makVrv::DtMenuManager& menuManager();
106 
109  {
110  return myMenuManager.findMenu(path);
111  }
112 
113  protected:
114  QWidget* myMainWindow;
115  QMenuBar* myMenuBar;
117  };
118 
123  {
124  Q_OBJECT
125 
126  public:
127 
129  DtNewCrowdItemDialog(makVrv::DtDe& de, QWidget* parent = NULL, const Qt::WindowFlags& flags = 0);
130 
132  virtual ~DtNewCrowdItemDialog();
133 
135  virtual bool init(DtCreateItemData* initialData = NULL);
136 
138  virtual void disableMenus();
139 
141  virtual void enableMenus();
142 
144  virtual void enableMenu(QMenu* qtMenu, bool b);
145 
152  virtual void completeCreation(int num, const DtString & placement,
153  const QString & stringType, bool useDefaultSpeed,
154  double minSpeed, double maxSpeed);
155 
157  virtual void setEntity(const makVrf::DtEntityMapperKey& x);
158 
159  virtual void addSetRequest(const DtSetDataRequest&);
160  virtual void addTaskRequest(const DtSimTask&);
161 
163  virtual const DtCreateItemData & crowdCreationData();
164 
165  protected:
167  virtual void slot_onDialogCreated();
168 
170  virtual void slot_onDialogDestroyed();
171 
172  protected slots:
173 
175  virtual void accept();
176 
178  virtual void onCreateObjectName(QTreeWidgetItem* i, int col);
179 
180  virtual void displayEntityPalette();
181 
182  protected:
183 
185  virtual void setupGui();
186 
188  //virtual void setupUi(QWidget* p);
189 
191  virtual void closeEvent(QCloseEvent* e);
192 
194  virtual bool createMenus();
195  virtual void createEntityPalette();
196  virtual void createTaskMenu();
197  virtual void createSetMenu();
198 
199  virtual void finalizeMenus();
200  virtual void finalizeTaskMenu();
201  virtual void finalizeSetMenu();
202 
203  virtual void setupMenuForCrowdDialog(makVrf::DtVrfTaskSetMenu*);
204 
207  virtual void slot_createObjectType(const makVrf::DtEntityMapperKey& x);
208 
210  virtual void slot_addSetRequest(std::vector<DtUUID> names, const DtSetDataRequest&);
211 
213  virtual void slot_addTaskRequest(std::vector<DtUUID> names, const DtSimTask&);
214 
217  virtual void keyPressEvent(QKeyEvent *e);
218  virtual void paletteItemsAdded();
219 
220  signals:
221 
223  void closing();
224 
227  void accepted(const DtCreateItemData&);
228 
229  protected:
230 
231  Ui::NewCrowdItemDialogUi myUiImpl;
232 
234 
236 
241 
243  QString myEntityText;
245 
249  };
250 }
DtRateEntryWidget * mySetSpeed
Definition: newCrowdItemDialog.h:246
Definition: vrfTaskSetMenu.h:51
Definition: entityMapperKey.h:23
makVrf::DtVrfTaskSetMenu * mySetMenu
Definition: newCrowdItemDialog.h:239
This class represents the dialog that is part of the multiple entity creation task. It allows the user to select the type of entity to create plus its associated the task/set.
Definition: newCrowdItemDialog.h:122
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
QWidget * myMainWindow
Definition: newCrowdItemDialog.h:114
QMenu * findMenu(const makVrv::DtMenuPath &path)
Returns the QMenu for the given path.
Definition: newCrowdItemDialog.h:108
makVrv::DtMenu * mySetMenuBuilder
Definition: newCrowdItemDialog.h:240
Ui::NewCrowdItemDialogUi myUiImpl
Definition: newCrowdItemDialog.h:231
QMenuBar * menuBar()
If main menu, returns menu bar to add menu to.
Definition: newCrowdItemDialog.h:96
Contains makVrv::DtMenuManager class.
makVrf::DtVrfTaskSetMenu * myTaskMenu
Definition: newCrowdItemDialog.h:237
makVrv::DtDe & myDe
Definition: newCrowdItemDialog.h:233
DtSetDataRequest is an abstract base class from which real setDataRequests can derive. It manages the read/write capability; derived classes need only use and register read/writatble data types for derived information.
Definition: setDataRequest.h:41
DtCreateItemData myCreateItem
Definition: newCrowdItemDialog.h:244
DtCreateObjectPalette * myCreateObjectPalettePanel
Definition: newCrowdItemDialog.h:235
virtual ~DtNewCrowdMenuAssembler()
Definition: newCrowdItemDialog.h:58
DtRateEntryWidget * myMinSpeed
Definition: newCrowdItemDialog.h:247
Simple line text entry widget that will allow the user to enter a rate value.
Definition: rateEntryWidget.h:28
The menu manager can be used to lookup registered QMenu and QAction objects based on their menu paths...
Definition: DtMenuManager.h:38
makVrf::DtEntityMapperKey * myEntityMapperKey
Definition: newCrowdItemDialog.h:242
Definition: newCrowdItemDialogInterface.h:96
DtNewCrowdMenuManager()
Definition: newCrowdItemDialog.h:42
void clear()
Definition: newCrowdItemDialog.h:46
Definition: newCrowdItemDialog.h:53
a Class which represents a menu path. The specific strings are not menu text, but the names used when...
Definition: DtMenuPath.h:27
This class implements the logic behind the DtNewCrowdItemDialog.
Definition: newCrowdItemDialog.h:39
virtual void unregisterMenu(const std::string &s)
Definition: newCrowdItemDialog.h:67
A widget class for showing different items of supplied types to the logic tthat can be created...
Definition: createObjectPalette.h:71
The abstract base menu class.
Definition: DtMenu.h:23
DtNewCrowdMenuManager myMenuManager
Definition: newCrowdItemDialog.h:116
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
DtRateEntryWidget * myMaxSpeed
Definition: newCrowdItemDialog.h:248
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
QString myEntityText
Definition: newCrowdItemDialog.h:243
makVrv::DtMenu * myTaskMenuBuilder
Definition: newCrowdItemDialog.h:238
QMenuBar * myMenuBar
Definition: newCrowdItemDialog.h:115
Definition: newCrowdItemDialogInterface.h:22
Used by menu classes to modify menu registrations in a menu.
Definition: configurableMenu.h:120

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)