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 <vrfutil/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();
45 
47 
48  virtual void setEnabled(bool);
49 
50  virtual DtVector attachPointFor(int part) const;
51 
52 protected:
53  virtual void removePartsForSystem(const DtComponentSystemDescriptor* def);
54  virtual void removePartsForSystem(const DtComponentSystemDefinition* def, const DtString& systemName);
55 
56  virtual void addPartsForSystem(const DtComponentSystemDescriptor* def);
57  virtual void addPartsForSystem(const DtComponentSystemDefinition* def);
58 
59  virtual void updateEnableState();
60 
61  virtual void setFromParameters(const std::vector<DtReaderWriter*>& parentRw);
62  virtual void processUiEvent(const DtUiElementEvent&);
63 
64  virtual void createControls(QWidget*);
65 
66  virtual void elementChanged();
67 
69  virtual QString uniqueDisplayName(const QString& baseName, const DtRwString* system = 0);
70 
71  virtual DtArticulatedPartEditDialog* createArticulatedPartEditDialog(QWidget* p);
72 
73  virtual DtArticulatedPartSelectionDialog* createArticulatedPartSelectionDialog(QWidget* p);
74 
76  virtual void addPartToGui(const DtSimArtPartDescriptor* partDesc, const QString& partName, const std::list<QString>& sources);
77 
79  virtual void refreshGui();
80 
81  virtual void updateLabelTitle();
82  virtual void decorateElement();
83 
85  virtual void addPartLocationMark();
86 
88  virtual void removePartLocationMark();
89 
91  virtual void slot_facadesCreated(const DtDisplayDefinitionWidget::Facades&);
92 
94  void disableAllPartAnimations();
95 
96  virtual bool isWheel(int partNum, DtVector& maxRot, DtVector& minRot, DtVector& rotRate) const;
97  virtual void animateArticulatedPart(QTreeWidgetItem*);
98  virtual bool getPartPosition(int partNum, DtVector& bodyPosition, DtTaitBryan& hpr, bool includeEntityRotation, bool& endPoint, bool transformWithOrigin = true) const;
99 
100  virtual DtEntityType munitionForArtPart(int partNum) const;
101  virtual bool hasArtPartType(const DtSimulationModelSetLoader::TargetingControlAndRangeTables&, int partNum, const DtComponentSystemDefinition*& foundDefinition,
102  const DtComponentSystemDefinition*& systemMatch) const;
103  virtual bool hasArtPartType(const DtComponentSystemDefinition*, int partNum, DtString systemPath, const DtComponentSystemDefinition*& foundDefinition) const;
104 
105 protected slots:
106  virtual void fireTheWeapon();
107  virtual void choosePartToAdd();
108  virtual void addPart(DtArtPartType partNum);
109  virtual void removePart();
110  virtual void onSelectionChanged();
111  virtual void openEditWindow();
112  virtual void onItemChanged(QTreeWidgetItem*, int);
113  virtual void doneWithAdd(bool);
114  virtual void acceptEdit();
115  virtual void rejectEdit();
116 
117 public:
120  QAbstractButton* myAddButton;
121  QAbstractButton* myRemoveButton;
122  QAbstractButton* myEditButton;
123  QAbstractButton* myWarningButton;
124 
125  static QString theAttachPointSuffix;
126  static QString theEndPointSuffix;
127 
128 protected:
131  std::vector<DtString> myMissingPlatforms;
132  std::map<DtArtPartType, DtSimArtPartDescriptor> myModelParts;
133  std::map<DtArtPartType, DtSimArtPartDescriptor> myComponentDefaultParts;
134  QString myMarkedPart;
138 
139  std::set<int> myFacadeParts;
140 };
141 
144 {
145  Q_OBJECT
146 public:
147  DtArticulatedPartSelectionDialog(makVrv::DtDe& de, QWidget* parent, Qt::WindowFlags f = 0);
149 
150  virtual void setAvailableParts(const DtEnumDictionary::EnumMap& availableParts,
151  const std::set<DtArtPartType>& partsWithVisualModelDefaults);
152 
153 protected:
154  virtual void closeEvent(QCloseEvent*);
155  virtual void reject();
156  virtual void accept();
157 
158 protected slots:
159 
160  void validateSelection();
161 
162 signals:
163  void addPart(DtArtPartType partNum);
164  void done(bool);
165 
166 protected:
167  Ui::DtArticulatedPartSelectionDialogUi myUiImpl;
169 };
170 
QAbstractButton * myRemoveButton
Definition: uiArticulatedPartsElement.h:121
std::map< DtArtPartType, DtSimArtPartDescriptor > myComponentDefaultParts
Definition: uiArticulatedPartsElement.h:133
bool myDialogDisplayed
Definition: uiArticulatedPartsElement.h:130
DtDisplayDefinitionWidget::Facades myFacades
Definition: uiArticulatedPartsElement.h:135
std::map< DtArtPartType, DtSimArtPartDescriptor > myModelParts
Definition: uiArticulatedPartsElement.h:132
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:137
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:136
virtual void processUiEvent(const DtUiElementEvent &)
Process ui event. Default does nothing.
Definition: uiElement.h:234
Dialog for selecting an articulated from the provided list.
Definition: uiArticulatedPartsElement.h:143
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:126
boost::function< DtUiElement *(makVrv::DtDe &)> CreatorFunction
Definition: uiElement.h:188
Definition: uiArticulatedPartsElement.h:34
bool myCurrentlyEnabled
Definition: uiArticulatedPartsElement.h:129
virtual void elementChanged()
std::map< const DtComponentSystemDefinition *, std::pair< const DtTargetingControlTable *, const DtRangeProbabilityTable * > > TargetingControlAndRangeTables
Returns the targeting control and range tables.
Definition: simulationModelSetLoader.h:944
Ui::DtArticulatedPartSelectionDialogUi myUiImpl
Definition: uiArticulatedPartsElement.h:167
virtual void decorateElement()
Sets element decoration depending on the isModified state of the element. This version changes myLabe...
QAbstractButton * myAddButton
Definition: uiArticulatedPartsElement.h:120
DtComponentSystemDefinition.
Definition: componentSystemDefinition.h:25
The DtBaseConnection is an abstract class.
Definition: DtBaseConnection.h:35
QTreeWidget * myTree
Definition: uiArticulatedPartsElement.h:119
DtArticulatedPartEditDialogShdPtr myCurrentDialog
Definition: uiArticulatedPartsElement.h:118
QAbstractButton * myWarningButton
Definition: uiArticulatedPartsElement.h:123
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:20
std::vector< makVrf::DtVrfObjectFacadeInterface * > Facades
Definition: displayDefinitionWidget.h:183
QAbstractButton * myEditButton
Definition: uiArticulatedPartsElement.h:122
virtual void setEnabled(bool)
If this item is not enabled it cannot be modified.
QString myMarkedPart
Definition: uiArticulatedPartsElement.h:134
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:125
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:131
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:139
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
makVrv::DtDe & myDe
Definition: uiArticulatedPartsElement.h:168
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:183

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)