VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
uiArticulatedPartsElement.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2019 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 #include "ui_articulatedPartSelectionDialogUi.h"
18 #include <vrfutil/enumDictionary.h>
19 
20 class QTreeWidget;
21 class QTreeWidgetItem;
22 class QAbstractButton;
23 class QFrame;
28 
30 {
31  Q_OBJECT
32 
33 public:
34 
37 
39  virtual ~DtUiArticulatedPartsElement();
40 
42 
43  virtual void setEnabled(bool);
44 
45  virtual DtVector attachPointFor(int part) const;
46 
47 protected:
48  virtual void removePartsForSystem(const DtComponentSystemDescriptor* def);
49  virtual void removePartsForSystem(const DtComponentSystemDefinition* def, const DtString& systemName);
50 
51  virtual void addPartsForSystem(const DtComponentSystemDescriptor* def);
52  virtual void addPartsForSystem(const DtComponentSystemDefinition* def);
53 
54  virtual void updateEnableState();
55 
56  virtual void setFromParameters(const std::vector<DtReaderWriter*>& parentRw);
57  virtual void processUiEvent(const DtUiElementEvent&);
58 
59  virtual void createControls(QWidget*);
60 
61  virtual void elementChanged();
62 
64  virtual QString uniqueDisplayName(const QString& baseName, const DtRwString* system = 0);
65 
66  virtual DtArticulatedPartEditDialog* createArticulatedPartEditDialog(QWidget* p);
67 
68  virtual DtArticulatedPartSelectionDialog* createArticulatedPartSelectionDialog(QWidget* p);
69 
71  virtual void addPartToGui(DtArtPartType partNum, const QString& partName,
72  const QString& assocComp, const QString& comment, const std::list<QString>& sources);
73 
75  virtual void refreshGui();
76 
77  virtual void updateLabelTitle();
78  virtual void decorateElement();
79 
81  virtual void addPartLocationMark();
82 
84  virtual void removePartLocationMark();
85 
87  virtual void slot_facadesCreated(const DtDisplayDefinitionWidget::Facades&);
88 
90  void disableAllPartAnimations();
91 
92  virtual bool isWheel(int partNum, DtVector& maxRot, DtVector& minRot, DtVector& rotRate) const;
93 
94 protected slots:
95  virtual void choosePartToAdd();
96  virtual void addPart(DtArtPartType partNum);
97  virtual void removePart();
98  virtual void onSelectionChanged();
99  virtual void openEditWindow();
100  virtual void onItemChanged(QTreeWidgetItem*, int);
101  virtual void doneWithAdd(bool);
102  virtual void acceptEdit();
103  virtual void rejectEdit();
104 
105 public:
108  QAbstractButton* myAddButton;
109  QAbstractButton* myRemoveButton;
110  QAbstractButton* myEditButton;
111  QAbstractButton* myWarningButton;
112 
113  static QString theAttachPointSuffix;
114  static QString theEndPointSuffix;
115 
116 protected:
119  std::vector<DtString> myMissingPlatforms;
120  std::map<DtArtPartType, DtSimArtPartDescriptor> myModelParts;
121  std::map<DtArtPartType, DtSimArtPartDescriptor> myComponentDefaultParts;
122  QString myMarkedPart;
125 
126  std::set<int> myFacadeParts;
127 };
128 
131 {
132  Q_OBJECT
133 public:
134  DtArticulatedPartSelectionDialog(makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags f = 0);
136 
137  virtual void setAvailableParts(const DtEnumDictionary::EnumMap& availableParts,
138  const std::set<DtArtPartType>& partsWithVisualModelDefaults);
139 
140 protected:
141  virtual void closeEvent(QCloseEvent*);
142  virtual void reject();
143  virtual void accept();
144 
145 protected slots:
146 
147  void validateSelection();
148 
149 signals:
150  void addPart(DtArtPartType partNum);
151  void done(bool);
152 
153 protected:
154  Ui::DtArticulatedPartSelectionDialogUi myUiImpl;
156 };
157 
QAbstractButton * myRemoveButton
Definition: uiArticulatedPartsElement.h:109
std::map< DtArtPartType, DtSimArtPartDescriptor > myComponentDefaultParts
Definition: uiArticulatedPartsElement.h:121
bool myDialogDisplayed
Definition: uiArticulatedPartsElement.h:118
DtDisplayDefinitionWidget::Facades myFacades
Definition: uiArticulatedPartsElement.h:123
std::map< DtArtPartType, DtSimArtPartDescriptor > myModelParts
Definition: uiArticulatedPartsElement.h:120
virtual void createControls(QWidget *parent)
If additional widgets or connections need to be made do it here. The parent is the myWidget member...
virtual void setFromParameters(DtReaderWriter *parentRw)
Calls setFromParameters with std::vector of parameter.
A readable, writable type that holds an articulated part type, attached-to part type, attachment point, and a list of art-part params (DtSimArtPartParamList). The read/write name is not used for anything in particular, and therefore may be used for file readability.
Definition: simArtPartDescriptor.h:28
makVrv::DtSignalConnectionManager myConnections
Definition: uiArticulatedPartsElement.h:124
virtual void processUiEvent(const DtUiElementEvent &)
Process ui event. Default does nothing.
Definition: uiElement.h:231
Dialog for selecting an articulated from the provided list.
Definition: uiArticulatedPartsElement.h:130
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
static QString theEndPointSuffix
Definition: uiArticulatedPartsElement.h:114
boost::function< DtUiElement *(makVrv::DtDe &)> CreatorFunction
Definition: uiElement.h:185
Definition: uiArticulatedPartsElement.h:29
bool myCurrentlyEnabled
Definition: uiArticulatedPartsElement.h:117
virtual void elementChanged()
Ui::DtArticulatedPartSelectionDialogUi myUiImpl
Definition: uiArticulatedPartsElement.h:154
virtual void decorateElement()
Sets element decoration depending on the isModified state of the element. This version changes myLabe...
QAbstractButton * myAddButton
Definition: uiArticulatedPartsElement.h:108
DtComponentSystemDefinition.
Definition: componentSystemDefinition.h:25
QTreeWidget * myTree
Definition: uiArticulatedPartsElement.h:107
DtArticulatedPartEditDialogShdPtr myCurrentDialog
Definition: uiArticulatedPartsElement.h:106
QAbstractButton * myWarningButton
Definition: uiArticulatedPartsElement.h:111
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
std::vector< makVrf::DtVrfObjectFacadeInterface * > Facades
Definition: displayDefinitionWidget.h:180
QAbstractButton * myEditButton
Definition: uiArticulatedPartsElement.h:110
virtual void setEnabled(bool)
If this item is not enabled it cannot be modified.
QString myMarkedPart
Definition: uiArticulatedPartsElement.h:122
Descriptor for a DtComponentSystem. Specified a system being added to an entity. This does not actual...
Definition: componentSystemDescriptor.h:23
static QString theAttachPointSuffix
Definition: uiArticulatedPartsElement.h:113
Dialog which allows the user to view and edit the parameters for an articulated part.
Definition: articulatedPartEditDialog.h:29
std::vector< DtString > myMissingPlatforms
Definition: uiArticulatedPartsElement.h:119
The DtUiElement class is the base for which all UI elements are defined. If you wish to create a new ...
Definition: uiElement.h:97
std::set< int > myFacadeParts
Definition: uiArticulatedPartsElement.h:126
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
makVrv::DtDe & myDe
Definition: uiArticulatedPartsElement.h:155
std::map< int, DtEnumInfo > EnumMap
Definition: enumDictionary.h:116
DtBoost::shared_ptr< DtArticulatedPartEditDialog > DtArticulatedPartEditDialogShdPtr
Definition: articulatedPartEditDialog.h:116
virtual void updateLabelTitle()
Updates label title based on valid units.
#define DT_DLL_simulationObjectEditorimpl
This file is used to determine how to build.
Definition: simulationObjectEditorImplDefines.h:33
Base class of the ui element class chain. Properties available through designer for all ui elements a...
Definition: uiElement.h:180

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)