VR-Forces 5.0.2 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 
18 
20 #include "newCrowdItemDialogUi.hpp"
22 #endif
23 
24 #include <QDialog>
25 
26 class QTreeWidgetItem;
27 
28 namespace makVrf
29 {
30  class DtRateEntryWidget;
31 
32  namespace makVrfQt
33  {
34  class DtVrfTaskSetMenu;
35  }
36 
40 
42  {
43  public:
44  DtNewCrowdMenuManager() : makVrv::DtMenuManager()
45  {
46  }
47 
48  void clear()
49  {
50  myMenuItems.clear();
51  myMenus.clear();
52  }
53  };
54 
56  {
57  public:
58  DtNewCrowdMenuAssembler(makVrv::DtDe&, QWidget*, QMenuBar*);
59 
61  {
63  myMenuManager.clear();
64 
65  myMenuBuilders.clear();
66  myMenuItemBuilders.clear();
67  }
68 
69  virtual void unregisterMenu(const std::string& s)
70  {
71  makVrv::DtMenu* b = menuBuilder(s);
72 
73  if (b)
74  {
75  MenuBuilderMap::iterator iter = myMenuBuilders.begin();
76 
77  while (iter != myMenuBuilders.end())
78  {
79  if (iter->second == b)
80  {
84  MenuBuilderMap::iterator iter2;
85  iter2 = iter;
86  ++iter;
87  myMenuBuilders.erase(iter);
88  }
89  else
90  {
91  ++iter;
92  }
93  }
94  }
95  }
96 
98  QMenuBar* menuBar()
99  {
100  return myMenuBar;
101  }
102 
104  virtual QWidget* menuWindow();
105 
107  virtual makVrv::DtMenuManager& menuManager();
108 
111  {
112  return myMenuManager.findMenu(path);
113  }
114 
115  protected:
116  QWidget* myMainWindow;
117  QMenuBar* myMenuBar;
119  };
120 
125  {
126  Q_OBJECT
127 
128  public:
129 
131  DtNewCrowdItemDialog(makVrv::DtDe& de, QWidget* parent = NULL, const Qt::WindowFlags& flags = 0);
132 
134  virtual ~DtNewCrowdItemDialog();
135 
137  virtual bool init(DtCreateItemData* initialData = NULL);
138 
140  virtual void disableMenus();
141 
143  virtual void enableMenus();
144 
146  virtual void enableMenu(QMenu* qtMenu, bool b);
147 
154  virtual void completeCreation(int num, const DtString & placement,
155  const QString & stringType, bool useDefaultSpeed,
156  double minSpeed, double maxSpeed);
157 
159  virtual void setEntity(const makVrf::DtEntityMapperKey& x);
160 
161  virtual void addSetRequest(const DtSetDataRequest&);
162  virtual void addTaskRequest(const DtSimTask&);
163 
165  virtual const DtCreateItemData & crowdCreationData();
166 
167  protected:
169  virtual void slot_onDialogCreated();
170 
172  virtual void slot_onDialogDestroyed();
173 
174  protected slots:
175 
177  virtual void accept();
178 
180  virtual void onCreateObjectName(QTreeWidgetItem* i, int col);
181 
182  virtual void displayEntityPalette();
183 
184  protected:
185 
187  virtual void setupGui();
188 
190  //virtual void setupUi(QWidget* p);
191 
193  virtual void closeEvent(QCloseEvent* e);
194 
196  virtual bool createMenus();
197  virtual void createEntityPalette();
198  virtual void createTaskMenu();
199  virtual void createSetMenu();
200 
201  virtual void finalizeMenus();
202  virtual void finalizeTaskMenu();
203  virtual void finalizeSetMenu();
204 
205  virtual void setupMenuForCrowdDialog(makVrf::DtVrfTaskSetMenu*);
206 
209  virtual void slot_createObjectType(const makVrf::DtEntityMapperKey& x);
210 
212  virtual void slot_addSetRequest(std::vector<DtUUID> names, const DtSetDataRequest&);
213 
215  virtual void slot_addTaskRequest(std::vector<DtUUID> names, const DtSimTask&);
216 
219  virtual void keyPressEvent(QKeyEvent *e);
220  virtual void paletteItemsAdded();
221 
222  signals:
223 
225  void closing();
226 
229  void accepted(const DtCreateItemData&);
230 
231  protected:
232 
233  Ui::NewCrowdItemDialogUi myUiImpl;
234 
236 
238 
243 
245  QString myEntityText;
247 
251  };
252 }
DtRateEntryWidget * mySetSpeed
Definition: newCrowdItemDialog.h:248
Definition: vrfTaskSetMenu.h:51
Definition: entityMapperKey.h:23
makVrf::DtVrfTaskSetMenu * mySetMenu
Definition: newCrowdItemDialog.h:241
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:124
A widget class for showing different items of supplied types to the logic tthat can be created...
Definition: entityCreatePalette.h:68
#define DT_DLL_VRFGUICOREQT
Definition: vrfGuiCoreQt.h:26
QWidget * myMainWindow
Definition: newCrowdItemDialog.h:116
QMenu * findMenu(const makVrv::DtMenuPath &path)
Returns the QMenu for the given path.
Definition: newCrowdItemDialog.h:110
makVrv::DtMenu * mySetMenuBuilder
Definition: newCrowdItemDialog.h:242
Ui::NewCrowdItemDialogUi myUiImpl
Definition: newCrowdItemDialog.h:233
A Qt implementation of a DtMenuAssembler.
Definition: DtQtMenuAssembler.h:26
QMenuBar * menuBar()
If main menu, returns menu bar to add menu to.
Definition: newCrowdItemDialog.h:98
Contains makVrv::DtMenuManager class.
makVrf::DtVrfTaskSetMenu * myTaskMenu
Definition: newCrowdItemDialog.h:239
Contains makVrv::DtQtMenuAssembler class.
makVrv::DtDe & myDe
Definition: newCrowdItemDialog.h:235
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:246
virtual ~DtNewCrowdMenuAssembler()
Definition: newCrowdItemDialog.h:60
DtRateEntryWidget * myMinSpeed
Definition: newCrowdItemDialog.h:249
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:244
Definition: newCrowdItemDialogInterface.h:96
DtNewCrowdMenuManager()
Definition: newCrowdItemDialog.h:44
void clear()
Definition: newCrowdItemDialog.h:48
Definition: newCrowdItemDialog.h:55
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:41
virtual void unregisterMenu(const std::string &s)
Definition: newCrowdItemDialog.h:69
The abstract base menu class.
Definition: DtMenu.h:23
DtNewCrowdMenuManager myMenuManager
Definition: newCrowdItemDialog.h:118
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:250
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:70
QString myEntityText
Definition: newCrowdItemDialog.h:245
makVrv::DtMenu * myTaskMenuBuilder
Definition: newCrowdItemDialog.h:240
QMenuBar * myMenuBar
Definition: newCrowdItemDialog.h:117
DtEntityCreatePalette * myEntityPalettePanel
Definition: newCrowdItemDialog.h:237
Definition: newCrowdItemDialogInterface.h:22

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)