![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the simulationObjectEditorImpl library between VR-Forces 5.2 and 5.3.
This is the Simulation Object Editor (SOE) framework that toolkit users extend with custom UI elements for custom simulation object parameters, so the base class DtUiElement, the element event enumeration, and the DtSimulationModelSetLoader data access layer are the areas most likely to affect an existing integration.
The dominant new feature in 5.3 is hit zone editing: a set of new UI elements, dialogs, and 3D visualizers that let an author define per-zone damage geometry on a simulation object. That feature accounts for most of the additions below, and for the new element event types.
Changes that are internal to an implementation or limited to comments are not listed.
DtUiElementEvent::DtUiElementEventTypes is the enumeration every custom UI element switches on in its processUiEvent override. Eight new enumerators were appended in 5.3:
| Enumerator | Value |
|---|---|
DtUiSystemPropertiesChanged | 53 |
DtUiHitZoneDestroyed | 54 |
DtUiHitZoneDestroyAllVisualizations | 55 |
DtUiHitZoneRefreshSystems | 56 |
DtUiHitZoneRemoveFromSystems | 57 |
DtUiHitZoneSmokeParticleAddOrUpdateVisualizer | 58 |
DtUiHitZoneSmokeParticleDestroyVisualizer | 59 |
DtUiHitZoneModified | 60 |
In 5.2 the highest defined value was DtUiSetHeading = 52. Custom elements that invented their own event identifiers by casting integers above 52 into DtUiElementEventTypes will now collide with framework events, and the framework will dispatch those events to every element in the hierarchy. Review any code that constructs a DtUiElementEvent from a raw integer and move custom identifiers above the new maximum.
A switch over DtUiElementEventTypes that is compiled with -Wswitch (or the MSVC equivalent) and does not have a default label will now produce warnings for the eight unhandled enumerators. No existing enumerator was removed or renumbered, so correctly written processUiEvent overrides that compare against named enumerators continue to work without change.
The class interface of DtUiElement itself is otherwise unchanged. Elements derived from it compile against 5.3 without modification.
Both overloads now return the variable bindings alongside the system definition, so the return type changed from a map of definition pointers to a map of pairs. A new public alias, SystemDefinitions, names the type.
Call sites that iterate the result must dereference the pair. Use it->second.first where the code previously used it->second; it->second.second is the bindings object that supplies the per-instance parameter values for that system, and may be null when the system carries no overrides.
The second parameter changed from a bool to an int bitmask so that the SIDC reset option could be added alongside the existing save behavior:
Because bool converts implicitly to int, existing calls still compile and retain their meaning: true becomes 1, which is SaveAllIfAnyModified. Replace the literal with the named constant so that the intent survives future additions to the bitmask. Overrides in derived loaders must change their signature or they will silently stop overriding the base method.
A trailing iconSize parameter was added, and the default fill color changed from Qt::transparent to a fully transparent color with a non-zero blue component. The distinct value allows the symbol renderer to tell "no fill requested" apart from "fill requested with alpha zero". Callers that relied on the default fill and observed a genuinely unfilled symbol are unaffected; callers that passed Qt::transparent explicitly to suppress fill must now pass QColor(0, 0, 1, 0). Derived classes that override getUnfilledIcon must add the iconSize parameter.
The protected virtual used by the palette list to render an entity icon gained a size argument:
Subclasses that customize palette icon rendering must update the signature.
The dialog needs the complete descriptor list to resolve the attach chain when a part is parented to another part. Pass the list obtained from the owning DtUiArticulatedPartsElement.
Pass false for isMultihitDamage to preserve the 5.2 behavior. When true, the dialog also builds the damage-points controls and damagePointsTable() returns a populated table.
getPartPosition now reports the attach point and the end point separately rather than returning a single body position:
The 5.2 bodyPosition output corresponds to the 5.3 endPosition output. The new attachPosition output is the point at which the part attaches to its parent, which for an unparented part is the entity origin.
Both removePartsForSystem overloads gained a trailing optional out-parameter that collects the variable bindings belonging to the removed parts. Existing calls compile unchanged because the parameter defaults to nullptr, but overrides must add it:
The preferred ammunition for a target type was presented in 5.2 as a QComboBox embedded in the target row. In 5.3 each target row owns one child row per munition, so a target may be associated with more than one munition. The combo box machinery was removed:
| Removed in 5.3 | Replacement |
|---|---|
virtual QComboBox* createComboBox(QTreeWidgetItem* lei) | virtual QTreeWidgetItem* createMunitionChild(QTreeWidgetItem* parent, const DtEntityType& ammoType) |
virtual void preferredAmmunitionChanged() (slot) | Handled through the tree item change path |
std::map<QTreeWidgetItem*, QComboBox*> myPreferredAmmunition (public member) | No replacement; walk the child items of the target row |
Because rows are now two levels deep, code that iterated myTargetPriorities top-level items and assumed each was a target type should use the new helpers:
This widget received the largest reorganization of any existing element. The following table lists the source-visible changes.
| 5.2 declaration | 5.3 status |
|---|---|
virtual void clearAllData() (public) | Removed. Use clearGraphData() followed by clearDataTypes(). |
virtual void updateDataKey(const QString& displayName, const DtString& key) (public) | Signature changed to updateDataKey(const QString& displayName, const DtString& key, std::vector<DtReaderWriter*>& values). |
virtual void setupGraphDataFor() (public, no arguments) | Moved to protected slots. External callers must use setupGraphDataFor(const DtString&). |
virtual void resetGraphData() (public) | Moved to public slots. Still callable directly. |
virtual void setFromParameters(const std::vector<DtReaderWriter*>&) (protected) | Moved to public. |
virtual bool multiLinesPerGraph() const (protected) | Moved to public. |
virtual void setupGraphDataFor(const DtString& key, const PlotData&) (protected) | Gained a trailing bool andClear = false argument. |
The public additions on the same class are setMultipleLinesPerGraph(bool), resetGraphDataForCurrentlySelected() (a public slot), and the protected changeDataValue(QLineEdit*).
PlotData::curve is now default-initialized to nullptr. Code that constructed a PlotData and relied on reading an indeterminate curve value was already incorrect; no action is required.
changeData moved from the plain protected section to protected slots. The access level is unchanged and overrides remain valid, but the method is now connected internally to the widget's edit signals. A derived class that also connects changeData to those signals will see it invoked twice; remove the redundant connection.
The widget also gained a rangeChanged() signal and an itemSelectionChanged() protected slot.
The following overrides were removed from the derived class. The base class declarations in DtUiDamageTableConfigurationWidget are unchanged, so the base implementation now runs for these operations:
A class derived from DtUiMultiHitDamageConfigurationWidget that called one of these through a qualified name such as DtUiMultiHitDamageConfigurationWidget::createEmptyDamageCalcSurface must call the base class version instead. The new updateData() override replaces the removed changeData() override as the point at which the multi-hit tables are refreshed.
addResource now returns the tree item it created so that the caller can attach further decoration. setupBins takes the name of the reader/writer variable that stores the bin so that the combo box can be bound to the correct variable when a system exposes more than one bin.
Existing calls compile unchanged. Overrides must add the parameter.
DtSimulationObjectEditorTagSelectorWidget derives from DtTagSelectorWidget, whose header moved from the vrfGuiCoreQt library to vrfGuiCommonQt:
The class name and interface are unchanged. Code that included the old path directly must update the include and link against vrfGuiCommonQt.
The MIL-STD symbol editor now hosts the new SIDC picker, and the legacy font-and-fill controls were separated into their own container. The public member layout changed:
| 5.2 member | 5.3 member |
|---|---|
QWidget* myMilStd | QWidget* myMilStd (retained, now holds the SIDC picker and the legacy container) |
| — | QWidget* myLegacyIconWidget |
| — | QWidget* myLegacyIconSet |
| — | QLabel* myLegacyLabel |
| — | QToolButton* myLegacyEdit |
| — | makVrf::DtSidcPickWidget* mySidcPickWidget |
Code that reparented or restyled myMilStd to reach the font tree and fill controls must now target myLegacyIconSet. The editor also emits a new sidcChanged(const QString&) signal, and DtVisualEditor itself emits sidcChanged(const QString&); the protected slots onSidcChanged(const QString&), sidcChanged(), expandFontSection(), and collapseFontSection() were added.
Two decorative QFrame members were removed from the widget and from its nested per-force structure:
Code that adjusted the separators' appearance must be deleted; the separators are now drawn by the style sheet.
Hit zones are the principal new feature in 5.3. A hit zone is a named, oriented box on a simulation object that can be damaged independently, optionally with an associated smoke particle effect. The feature spans nine new headers.
The UI element that presents the hit zone list for the selected simulation object and drives the add, edit, and delete operations. Register it with the element factory the same way as any other DtUiElement subclass through DtUiHitZoneElement::CreatorFunction. The element owns the dialogs and the 3D visualizers, keeps the visualizers synchronized with the display widget's entity facades, and publishes the following signals:
Notable public methods include openEditDialog(DtRwHitZone*), openAddDialog(DtRwHitZone*), refreshAllHitZoneVisualizations(), removeAllHitZoneVisualizations(), retrieveHitZoneListModifiedVariableFromLdr(), and canBeDamaged(DtRwHitZone*).
A combo box element that binds a system parameter to a zone identifier drawn from the object's hit zone list. It overrides setFromSystemParameterData, processUiEvent, and aboutToShow, and exposes retrieveHitZoneListModifiedVariableFromLdr() for access to the loader's modified list. Use it in a system .ui file to let an author associate a component system with a hit zone.
The edit dialog for a single DtRwHitZone. It edits the zone offset, dimensions, damage parameter set, and the optional smoke particle model and offset. Smoke associations are carried as a map from zone identifier to an offset-and-model pair:
The dialog emits signal_hitZoneLocationOrSizeChanged, signal_hitZoneAlterFinished, signal_resetVisuals, signal_HitZoneSmokeParticleVisualizerAddOrMove, and signal_HitZoneSmokeParticleVisualizerDelete so that the owning element can keep the 3D display in step with the edits.
The add dialog. It reads the damage states declared by the visual model through makVrv::DtModelSemanticsMapper and offers them as candidate zones, with a manual-entry path for models that declare none. hitZonesToBeAdded() returns the zones the user accepted.
vrfHitZoneVisualizer.h defines the box visualizer used to show a zone in the 3D preview, together with the HitZoneColor structure and the standard color and alpha constants (DtHitZoneVisualizerRegularColor, DtHitZoneVisualizerSelectedColor, DtHitZoneVisualizerEditColor, DtHitZoneVisualizerDamagedColor, DtHitZoneVisualizerBorderColor, and the matching alpha constants). vrfHitZoneSmokeParticleVisualizer.h defines the marker visualizer for the smoke emission point. Both attach to an element through setAttachedTo(makVrv::DtElementID) and are positioned with setOffset.
hitZoneUiEventQVariant.h and hitZoneSmokeParticleUiEventQVariant.h define the payload structures carried in the QVariant value of a DtUiElementEvent for the new hit zone event types. Both are registered with Q_DECLARE_METATYPE, so they can be extracted with QVariant::value<>:
Two table elements for the system property dialog. The first edits a DtBallisticMunitionOverrideList, the second a DtAdditionalWeaponList. Both follow the standard element contract, overriding createControls, both setFromParameters overloads, setFromSystemParameterData, and setLabelText, and both provide a static CreatorFunction.
A subclass of DtUiAvailableAmmunition that replaces the "Default Amount" column with a weapon selection combo box populated from the system's additional weapons list. Selecting the (default) entry clears the weapon name on the DtAmmunitionListEntry; any other selection writes that weapon name onto the entry. It overrides clearAmmunitionTable and addNewAmmunitionEntryToTable.
A combo box element that binds an integer reader/writer to a resource bin selection. It overrides createControls, setFromParameters, and elementChanged, and provides CreatorFunction.
A read-only, formatted display of the simulation object's SIDC code, added alongside the existing DtUiGuiLabel and DtUiGuiDescription elements in the same header. It overrides setEnabled, setFromParameters, elementChanged, and isModified, and exposes the protected slot sidcChanged(const QString&).
| Declaration | Purpose |
|---|---|
virtual DtRwHitZoneDamageParameters* hitZoneDamageParametersManager() | Access to the loaded hit zone damage parameter set. |
virtual DtRwHitZoneDamageParameters* createHitZoneDamageParameters() const | Factory hook for the parameter set; override to substitute a derived type. |
virtual bool loadHitZoneParameters(const DtFilename&, bool inMasterSMS, DtSimulationModelSet*) | Loads a hit zone parameter file. |
virtual DtRwHitZoneList* addOrUpdateHitZoneData(const DtEntityType&) | Creates or returns the hit zone list on an entity. |
virtual DtRwString* addOrUpdateSidc(const DtEntityType&) | Adds a default SIDC to an entity that has none. |
virtual void setSidc(EntityData* data, const DtString& sidc) | Writes a SIDC onto an entity. |
virtual std::vector<DtComponentSystemDefinition*> systems() const | Returns every known system definition. |
virtual bool removeDeprecatedSystems(EntityData* data) | Strips systems that are no longer defined in the model set. |
An override that filters the system database by category and state repository type:
The systemTypes enumeration gained two enumerators, and systemTypeToString returns the matching strings:
| Enumerator | String |
|---|---|
Movement | "movement" |
Damage | "damage" |
The enumerators were appended after Weapon and before Other, so the numeric value of Other changed. Do not persist systemTypes values as integers across versions.
DtUiSystemElement also gained virtual void revertSystems(systemTypes). DtUiSingleSystemElement gained the public member QAbstractButton* myRevertButton and the protected slot onRevertButtonClicked(). DtUiMultiSystemElement gained virtual bool selectedSystemInherited() const and virtual bool restoreRemovedInheritedSystem(const DtSystemDefinitionInfo&), which restores an inherited system that the author previously removed by writing the removal marker rather than emitting a full system definition.
Two static utilities were added for computing part geometry from a descriptor list without an instantiated element:
The protected virtuals slot_viewChangeComplete() and updatePartArticulation(QTreeWidgetItem*) were also added.
The display widget grew the plumbing needed to render hit zones in the 3D preview:
uniqueIDForModelSet() moved from the protected section to the public section; existing derived class usage is unaffected. The widget also gained the public slot setSidc(const QString&), and DtDisplayWidgetDe gained virtual double fixedFrameRate() const override.
damagePointsTable() returns a newly allocated table and is meaningful only when the dialog was initialized with isMultihitDamage set to true. setupGui() rebuilds the control set for the current damage system type and is called from init.
simulationObjectEditorMenuIds.h defines one new identifier:
simulationObjectEditorPreferencesMenu.h defines the matching menu item class DtShowHitZonesMode, which follows the same pattern as DtShowBoundingVolumes and DtShowDarkMode: a makVrv::DtMenuItem subclass with createAction, on_triggered, and on_aboutToShow. Register it if you build a custom preferences menu from individual item classes rather than from the stock menu.
| Class | Addition |
|---|---|
DtSimulationObjectEditorApplication | virtual void createDebugLog(const std::string& fileName, makVrv::DtDebugLog::PrintLevel level) override |
DtSimulationObjectEditorWindow | virtual void setStatusBarVisible(bool) override, virtual bool isStatusBarVisible() const (both no-ops; the SOE window has no status bar) |
DtSimulationObjectEditorList | virtual void clearAllIcons(), virtual void changeMilStdSymbolDisplay(int) (slot), and the MIL-STD symbol standard selector widgets |
DtEmbarkationEditor | virtual void clampSlotToTerrainChanged(), QCheckBox* myClampSlotToTerrain |
DtTrailingEffectsWidget | virtual void enableButtons(), virtual void updateSpeedValue(), QLabel* mySpeedValue |
DtUiAvailableAmmunition | virtual void updateTableHeight() |
DtSimulationModelSetUpgradeWizard | QRadioButton* myAggregateTacticalLevelButton, QRadioButton* myVrEngageButton, QLabel* myVrEngageLabel |
DtRegenerateFilesWizard | QCheckBox* myResetSIDC |
| Header | Breaking | Additions |
|---|---|---|
articulatedPartEditDialog.h | setPart signature | — |
damageTableConfigurationDialog.h | init signature | damagePointsTable, setupGui, damage points surface factories |
displayDefinitionWidget.h | — | Hit zone display and smoke particle support; setSidc slot; uniqueIDForModelSet made public; DtDisplayWidgetDe::fixedFrameRate |
embarkationEditor.h | — | Clamp-slot-to-terrain control |
regenerateFilesWizard.h | regenerateEntityFiles signature | SIDC reset control |
simulationModelSetLoader.h | systemDefinitionsFor return type; addMissingVariablesAndArticulatedPartsFromPlatformsAndSystems flags; getUnfilledIcon signature and default | Hit zone parameter access; SIDC helpers; systems; removeDeprecatedSystems |
simulationModelSetUpgradeWizard.h | — | Aggregate tactical and VR-Engage upgrade options |
simulationObjectEditorApplication.h | — | createDebugLog override |
simulationObjectEditorComponentSystemDatabase.h | — | findSystemsForCategoryAndSRType |
simulationObjectEditorList.h | DtEntityPaletteItem::getPixmap signature | clearAllIcons; MIL-STD symbol standard selector |
simulationObjectEditorMenuIds.h | — | DtShowHitZonesModeId |
simulationObjectEditorPreferencesMenu.h | — | DtShowHitZonesMode |
simulationObjectEditorTagSelectorWidget.h | Base header moved to vrfGuiCommonQt | — |
simulationObjectEditorWindow.h | — | Status bar visibility overrides |
trailingEffectsWidget.h | — | Speed value readout |
uiApplicableTargets.h | Preferred-ammunition combo box removed | Munition child row helpers |
uiArticulatedPartsElement.h | getPartPosition and removePartsForSystem signatures | Static descriptor helpers; updatePartArticulation; slot_viewChangeComplete |
uiAvailableAmmunition.h | — | updateTableHeight |
uiDamageTableConfigurationWidget.h | changeData became a slot | rangeChanged signal; itemSelectionChanged slot |
uiElement.h | Element event enumeration extended | Eight hit zone and system property event types |
uiGraphDataWidget.h | clearAllData removed; updateDataKey and setupGraphDataFor signature changes; access level changes | setMultipleLinesPerGraph; resetGraphDataForCurrentlySelected; changeDataValue |
uiGuiSpecificInformation.h | — | DtUiGuiSidc |
uiMultiHitDamageConfigurationWidget.h | Five overrides removed | updateData override |
uiMultiSystemElement.h | — | selectedSystemInherited; restoreRemovedInheritedSystem |
uiResourceEditor.h | addResource return type; setupBins signature | removeResourcesFromSystemDefinitions |
uiSingleSystemElement.h | — | Revert button and slot |
uiSystemElement.h | systemTypes enumerator values shifted | Movement and Damage system types; revertSystems |
visualEditors.h | MIL-STD symbol widget members split | SIDC picker and sidcChanged signals |
visualSettingsWidget.h | Separator QFrame members removed | — |
hitZoneModificationDialog.h | New | DtHitZoneModificationDialog |
hitZoneModificationWithModelDialog.h | New | DtHitZoneModificationWithModelDialog |
hitZoneSmokeParticleUiEventQVariant.h | New | DtHitZoneSmokeParticleVisualizerUiData |
hitZoneUiEventQVariant.h | New | DtHitZoneUiEventData |
uiBallisticSystemListElements.h | New | DtUiMunitionOverrideListElement, DtUiAdditionalWeaponListElement |
uiHitZoneIdElement.h | New | DtUiHitZoneIdElement |
uiHitZonesElement.h | New | DtUiHitZoneElement |
uiResourceBinElement.h | New | DtUiResourceBinElement |
uiWeaponAmmunitionElement.h | New | DtUiWeaponAmmunitionElement |
vrfHitZoneSmokeParticleVisualizer.h | New | DtVrfHitZoneSmokeParticleVisualizer |
vrfHitZoneVisualizer.h | New | DtVrfHitZoneVisualizer, HitZoneColor, color constants |
Return to VR-Forces 5.3 API Migration Guide.
[Home]