VR-Forces 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 <vlpi/enumDictionary.h>
19 
20 class QTreeWidget;
21 class QTreeWidgetItem;
22 class QAbstractButton;
23 class QFrame;
28 
29 namespace makVrv
30 {
31  class DtBaseConnection;
32 }
33 
35 {
36  Q_OBJECT
37 
38 public:
39 
42 
44  virtual ~DtUiArticulatedPartsElement() override;
45 
47 
48  virtual void setEnabled(bool) override;
49 
50  virtual DtVector attachPointFor(int part) const;
51 
52  static DtSimArtPartDescriptor* findPartDescInList(DtSimArtPartDescriptorList* descList, int partType);
53 
54  static bool calculatePartPositionsAndOrientationFromDescriptors(int partNum,
55  const DtSimArtPartDescriptorList& descList, DtVector& endPoint, DtVector& attachPoint, DtTaitBryan& orientation);
56 
57 protected:
58  virtual void removePartsForSystem(const DtComponentSystemDescriptor* def, std::list<const DtRwVariableBindings*>* list = nullptr);
59  virtual void removePartsForSystem(const DtComponentSystemDefinition* def, const DtString& systemName, std::list<const DtRwVariableBindings*>* list = nullptr);
60 
61  virtual void addPartsForSystem(const DtComponentSystemDescriptor* def);
62  virtual void addPartsForSystem(const DtComponentSystemDefinition* def);
63 
64  virtual void updateEnableState();
65 
66  virtual void setFromParameters(const std::vector<DtReaderWriter*>& parentRw) override;
67  virtual void processUiEvent(const DtUiElementEvent&) override;
68 
69  virtual void createControls(QWidget*) override;
70 
71  virtual void elementChanged() override;
72 
74  virtual QString uniqueDisplayName(const QString& baseName, const DtRwString* system = 0);
75 
76  virtual DtArticulatedPartEditDialog* createArticulatedPartEditDialog(QWidget* p);
77 
78  virtual DtArticulatedPartSelectionDialog* createArticulatedPartSelectionDialog(QWidget* p);
79 
81  virtual void addPartToGui(const DtSimArtPartDescriptor* partDesc, const QString& partName, const std::list<QString>& sources);
82 
84  virtual void refreshGui();
85 
86  virtual void updateLabelTitle() override;
87  virtual void decorateElement() override;
88 
90  virtual void addPartLocationMark();
91 
93  virtual void removePartLocationMark();
94 
96  virtual void slot_facadesCreated(const DtDisplayDefinitionWidget::Facades&);
97 
99  virtual void slot_viewChangeComplete();
100 
102  void disableAllPartAnimations();
103 
104  virtual bool isWheel(int partNum, DtVector& maxRot, DtVector& minRot, DtVector& rotRate) const;
105  virtual void animateArticulatedPart(QTreeWidgetItem*);
106  virtual bool getPartPosition(int partNum, DtVector& endPosition, DtVector& attachPosition, DtTaitBryan& hpr,
107  bool includeEntityRotation, bool& hasEndPoint, bool transformWithOrigin = true) const;
108 
109  virtual void updatePartArticulation(QTreeWidgetItem*);
110 
111  virtual DtEntityType munitionForArtPart(int partNum) const;
112  virtual bool hasArtPartType(const DtSimulationModelSetLoader::TargetingControlAndRangeTables&, int partNum, const DtComponentSystemDefinition*& foundDefinition,
113  const DtComponentSystemDefinition*& systemMatch) const;
114  virtual bool hasArtPartType(const DtComponentSystemDefinition*, int partNum, DtString systemPath, const DtComponentSystemDefinition*& foundDefinition) const;
115 
116 protected slots:
117  virtual void fireTheWeapon();
118  virtual void choosePartToAdd();
119  virtual void addPart(DtArtPartType partNum);
120  virtual void removePart();
121  virtual void onSelectionChanged();
122  virtual void openEditWindow();
123  virtual void onItemChanged(QTreeWidgetItem*, int);
124  virtual void doneWithAdd(bool);
125  virtual void acceptEdit();
126  virtual void rejectEdit();
127 
128 public:
131  QAbstractButton* myAddButton;
132  QAbstractButton* myRemoveButton;
133  QAbstractButton* myEditButton;
134  QAbstractButton* myWarningButton;
135 
136  static QString theAttachPointSuffix;
137  static QString theEndPointSuffix;
138 
139 protected:
142  std::vector<DtString> myMissingPlatforms;
143  std::map<DtArtPartType, DtSimArtPartDescriptor> myModelParts;
144  std::map<DtArtPartType, DtSimArtPartDescriptor> myComponentDefaultParts;
145  QString myMarkedPart;
149 
150  std::set<int> myFacadeParts;
151 };
152 
155 {
156  Q_OBJECT
157 public:
158  DtArticulatedPartSelectionDialog(makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags f = 0);
159  virtual ~DtArticulatedPartSelectionDialog() override;
160 
161  virtual void setAvailableParts(const DtEnumDictionary::EnumMap& availableParts,
162  const std::set<DtArtPartType>& partsWithVisualModelDefaults);
163 
164 protected:
165  virtual void closeEvent(QCloseEvent*) override;
166  virtual void reject() override;
167  virtual void accept() override;
168 
169 protected slots:
170 
171  void validateSelection();
172 
173 signals:
174  void addPart(DtArtPartType partNum);
175  void done(bool);
176 
177 protected:
178  Ui::DtArticulatedPartSelectionDialogUi myUiImpl;
180 };
181 
QAbstractButton * myRemoveButton
Definition: uiArticulatedPartsElement.h:132
std::map< DtArtPartType, DtSimArtPartDescriptor > myComponentDefaultParts
Definition: uiArticulatedPartsElement.h:144
bool myDialogDisplayed
Definition: uiArticulatedPartsElement.h:141
DtDisplayDefinitionWidget::Facades myFacades
Definition: uiArticulatedPartsElement.h:146
std::map< DtArtPartType, DtSimArtPartDescriptor > myModelParts
Definition: uiArticulatedPartsElement.h:143
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.
makVrv::DtBaseConnection * myBaseConnection
Definition: uiArticulatedPartsElement.h:148
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:147
virtual void processUiEvent(const DtUiElementEvent &)
Process ui event. Default does nothing.
Definition: uiElement.h:244
Dialog for selecting an articulated from the provided list.
Definition: uiArticulatedPartsElement.h:154
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:137
boost::function< DtUiElement *(makVrv::DtDe &)> CreatorFunction
Definition: uiElement.h:198
Definition: uiArticulatedPartsElement.h:34
std::shared_ptr< DtArticulatedPartEditDialog > DtArticulatedPartEditDialogShdPtr
Definition: articulatedPartEditDialog.h:117
bool myCurrentlyEnabled
Definition: uiArticulatedPartsElement.h:140
virtual void elementChanged()
std::map< const DtComponentSystemDefinition *, std::pair< const DtTargetingControlTable *, const DtRangeProbabilityTable * > > TargetingControlAndRangeTables
Returns the targeting control and range tables.
Definition: simulationModelSetLoader.h:1002
Ui::DtArticulatedPartSelectionDialogUi myUiImpl
Definition: uiArticulatedPartsElement.h:178
virtual void decorateElement()
Sets element decoration depending on the isModified state of the element. This version changes myLabe...
QAbstractButton * myAddButton
Definition: uiArticulatedPartsElement.h:131
Instances of DtSimArtPartDescriptorList are lists of DtSimArtPartDescriptors. This is an optional par...
Definition: simArtPartDescriptorList.h:16
Reader/Writer class which specifies the contents of a DtComponentSystem. This lists the sensors...
Definition: componentSystemDefinition.h:31
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:35
QTreeWidget * myTree
Definition: uiArticulatedPartsElement.h:130
DtArticulatedPartEditDialogShdPtr myCurrentDialog
Definition: uiArticulatedPartsElement.h:129
QAbstractButton * myWarningButton
Definition: uiArticulatedPartsElement.h:134
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
std::vector< makVrf::DtVrfObjectFacadeInterface * > Facades
Definition: displayDefinitionWidget.h:193
QAbstractButton * myEditButton
Definition: uiArticulatedPartsElement.h:133
virtual void setEnabled(bool)
If this item is not enabled it cannot be modified.
QString myMarkedPart
Definition: uiArticulatedPartsElement.h:145
Descriptor for a DtComponentSystem. Specified a system being added to an entity. This does not actual...
Definition: componentSystemDescriptor.h:25
static QString theAttachPointSuffix
Definition: uiArticulatedPartsElement.h:136
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:142
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:150
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:76
makVrv::DtDe & myDe
Definition: uiArticulatedPartsElement.h:179
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:193

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)