VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtUiElement Class Reference

Base class of the ui element class chain. Properties available through designer for all ui elements are: display-units (string) - Units to display for this element on the screen, if supported. See unitConversion.h for possible values source-units (string) - Units of the source reader/writer item for this element on the screen, if supported. See unitConversion.h for possible values element-type (string) - Override the element (reader/writer) type of the data element to the given supplied element type enable_if_checked (string) - Name of control (check box) that, if checked, will enable or disable this control item disable_if_checked (string) - Name of control (check box) that, if checked, will disable or enable this control item disable_if_multiple_selection (bool) - If true will disable this item if multiple items are selected.

Inherits QObject.

Inherited by DtGuiObjectsThatUseThisSystem, DtGuiSystemSupportsEntityKinds, DtUiAggregateCompositionEditor, DtUiAggregateFormationEditor, DtUiAirborneFuelConsumptionModelDataPoints, DtUiApplicableTargets, DtUiArticulatedPartsElement, DtUiArtPartElement, DtUiAvailableAmmunition, DtUiBooleanElement, DtUiBoundingVolumeElement, DtUiBVSPCalculationElement, DtUiCanAggregate, DtUiCanCreateObject, DtUiDetonationParametersConfigurationWidget, DtUiDiGuyElement, DtUiDisplayWidgetCanvas, DtUiEntityEnumeration, DtUiEntityTypeElement, DtUiEnvironmentalSignatureModifier, DtUiGuiAmmunitionApplicableTargets, DtUiGuiAmmunitionUsedBySystems, DtUiGuiAmmunitionWarhead, DtUiGuiCreatePalette, DtUiGuiDefaultOverlay, DtUiGuiEntityFile, DtUiGuiKeywords, DtUiGuiLabel, DtUiGuiMenuIcon, DtUiGuiScrollArea, DtUiGuiSystemAvailableParameters, DtUiHealthCheck, DtUiHitProbabilityConfigurationWidget, DtUiListBoxElement, DtUiMapAwareElement, DtUiMinefieldTableElement, DtUiObjectGeometryElement, DtUiObjectTypeListElement, DtUiPlatformUsed, DtUiPropertiesDisplayContainer, DtUiPropertiesTable, DtUiPushButtonElement, DtUiSensorSensitivityElement, DtUiSensorSignaturesElement, DtUiSimulationObjectCountries, DtUiSimulationObjectGroupElement, DtUiSimulationObjectTags, DtUiSystemElement, DtUiSystemFilename, DtUiSystemTemplateName, DtUiTargetRegion, DtUITrajectoryTableParameterElement, DtUiUniqueNameElement, and DtUiVectorElement.

Public Types

typedef boost::function
< DtUiElement *(makVrv::DtDe &)> 
CreatorFunction
 
typedef std::map< std::string,
CreatorFunction
UiElementFactoryMap
 

Public Slots

virtual void toggleDisplayed (bool display)
 

Signals

void uiEvent (const DtUiElementEvent &)
 
void changed ()
 

Public Member Functions

 DtUiElement (makVrv::DtDe &)
 
virtual ~DtUiElement ()
 
virtual bool blockSignals (bool)
 
virtual void init (QWidget *widget, QWidget *label, DtReaderWriter *originalData, DtReaderWriter *backupData, DtElementChangedCallbackFcn=boost::bind(&DtUiElement::theNullFunction, _1))
 
virtual void init (QWidget *widget, QWidget *label, const std::vector< DtReaderWriter * > &originalData, const std::vector< DtReaderWriter * > &backupData, DtElementChangedCallbackFcn=boost::bind(&DtUiElement::theNullFunction, _1))
 
virtual void init (QWidget *widget, QWidget *label, const DtObjectType &, const DtString &platformType, DtElementChangedCallbackFcn=boost::bind(&DtUiElement::theNullFunction, _1))
 
virtual DtString displayUnits () const
 
virtual void setDisplayUnits (const DtString &units)
 
virtual void setLabelText (const QString &)
 
virtual DtString sourceUnits () const
 
virtual void setSourceUnits (const DtString &units)
 
virtual void setFromSystemParameterData (const DtSystemParameterData *data, const DtComponentSystemDefinition *)
 
virtual void objectParametersModified ()
 
virtual void connectedTo (QObject *)
 
virtual void processUiEvent (const DtUiElementEvent &)
 
virtual void setModelModified (DtModelSetEntry *)
 
virtual DtString uniqueName () const
 
virtual bool supportsSystems () const
 
virtual const DtStringplatformType () const
 
virtual void setPlatformType (const DtString &)
 
virtual void setObjectTypes (const std::vector< DtObjectType > &)
 
virtual void aboutToShow ()
 
const std::vector
< DtReaderWriter * > & 
values () const
 
const std::vector
< DtReaderWriter * > & 
backupValues () const
 
virtual bool isModified () const
 
virtual bool isValid () const
 
virtual void decorateElement ()
 
virtual void setFromParameters (DtReaderWriter *parentRw)
 
virtual void setFromParameters (const std::vector< DtComponentSystemDefinition * > &)
 
virtual void setFromParameters (const std::vector< DtReaderWriter * > &parentRw)
 
virtual bool restoreFromBackup ()
 
QHBoxLayout * findLayoutThatHas (QWidget *w, QBoxLayout *layout)
 
QBoxLayout * findUsableLayoutFor (QWidget *w)
 
const std::vector< DtObjectType > & objectTypes () const
 
const std::vector
< DtComponentSystemDefinition * > & 
systems () const
 
virtual void sendEvent (const DtUiElementEvent &)
 
virtual bool allValuesTheSame () const
 
virtual bool isMixedValue () const
 
virtual void setEnabled (bool)
 
virtual bool enabled () const
 
virtual void setControllingCheckBox (QCheckBox *)
 
QCheckBoxcontrollingCheckBox ()
 
virtual void populateParentValues (std::string elementName)
 

Static Public Member Functions

static void registerUiTypes ()
 
static DtUiElementcreateUiElement (makVrv::DtDe &, const DtString &type)
 
static bool hasCreator (const DtString &)
 
static void theNullFunction (DtUiElement *)
 
static UiElementFactoryMapelementFactory ()
 
static QString mixedText ()
 
static void setMixedText (const QString &)
 

Public Attributes

QWidget * myWidget
 
QWidget * myLabel
 

Protected Slots

virtual void elementChanged ()
 
virtual void enableIfChecked ()
 
virtual void disableIfChecked ()
 

Protected Member Functions

virtual double sourceToDisplayUnits (double) const
 
virtual double displayToSourceUnits (double) const
 
virtual QString units () const
 
virtual void updateLabelTitle ()
 
virtual QString labelTitle () const
 
virtual void createControls (QWidget *parent)
 

Protected Attributes

DtString myDisplayUnits
 
DtString mySourceUnits
 
std::vector< DtReaderWriter * > myValues
 
std::vector< DtReaderWriter * > myBackupValues
 
DtReaderWritermyParentValue
 
bool myIsNew
 
DtElementChangedCallbackFcn myElementChangedCallbackFunction
 
DtUnit mySource
 
DtUnit myDestination
 
makVrv::DtDemyDe
 
DtString myPlatformType
 
std::vector< DtObjectTypemyObjectTypes
 
std::vector
< DtComponentSystemDefinition * > 
mySystems
 
const DtComponentSystemDefinitionmySystemDefinition
 
bool myEnabled
 
std::vector< QObject * > myConnectedTo
 
int myUniqueId
 
QCheckBoxmyControllingCheckBox
 
QToolButtonmyRevertToParentButton
 

Static Protected Attributes

static UiElementFactoryMap theFactory
 

Member Typedef Documentation

typedef std::map<std::string, CreatorFunction> DtUiElement::UiElementFactoryMap

Constructor & Destructor Documentation

DtUiElement::DtUiElement ( makVrv::DtDe )

Constructor.

virtual DtUiElement::~DtUiElement ( )
virtual

Destructor.

Member Function Documentation

virtual bool DtUiElement::blockSignals ( bool  )
virtual
virtual void DtUiElement::init ( QWidget *  widget,
QWidget *  label,
DtReaderWriter originalData,
DtReaderWriter backupData,
DtElementChangedCallbackFcn  = boost::bind(&DtUiElement::theNullFunction, _1) 
)
virtual

Reimplemented in DtUiMapAwareElement.

virtual void DtUiElement::init ( QWidget *  widget,
QWidget *  label,
const std::vector< DtReaderWriter * > &  originalData,
const std::vector< DtReaderWriter * > &  backupData,
DtElementChangedCallbackFcn  = boost::bind(&DtUiElement::theNullFunction, _1) 
)
virtual

Reimplemented in DtUiMapAwareElement.

virtual void DtUiElement::init ( QWidget *  widget,
QWidget *  label,
const DtObjectType ,
const DtString platformType,
DtElementChangedCallbackFcn  = boost::bind(&DtUiElement::theNullFunction, _1) 
)
virtual
virtual DtString DtUiElement::displayUnits ( ) const
virtual
virtual void DtUiElement::setDisplayUnits ( const DtString units)
virtual
virtual void DtUiElement::setLabelText ( const QString &  )
virtual
virtual DtString DtUiElement::sourceUnits ( ) const
virtual
virtual void DtUiElement::setSourceUnits ( const DtString units)
virtual
virtual void DtUiElement::setFromSystemParameterData ( const DtSystemParameterData data,
const DtComponentSystemDefinition  
)
virtual

Sets data of this UiElement from the specified system parameter data. Sets things like sourceUnits, displayUnits, etc.

Reimplemented in DtUiPositionElement, DtUiUniqueNameElement, DtUiAirborneFuelConsumptionModelDataPoints, DtUiArtPartElement, DtUiDiGuyElement, DtUiSensorSensitivityElement, and DtUiArtPartTypeElement.

virtual void DtUiElement::objectParametersModified ( )
inlinevirtual

This method is called any time that any of the parameters for the object are modified. It is not called for the UI element that caused the modification itself, to avoid infinite loops. Default implementation does nothing.

virtual void DtUiElement::connectedTo ( QObject )
virtual

Called when this item is connected to any signal emitted by the given item.

Reimplemented in DtUiMapAwareElement.

virtual void DtUiElement::processUiEvent ( const DtUiElementEvent )
inlinevirtual
virtual void DtUiElement::setModelModified ( DtModelSetEntry )
virtual

Called when the model is modified. Default is no-op.

Reimplemented in DtUiAggregateCompositionEditor.

virtual DtString DtUiElement::uniqueName ( ) const
virtual

Returns a unique name for this element. If there is a myValue returns the name of that value, else returns "DtUiElement".

Reimplemented in DtUiDisplayWidgetCanvas, and DtUiSystemElement.

virtual bool DtUiElement::supportsSystems ( ) const
virtual

Returns true if this element supports systems.

Reimplemented in DtUiSystemElement.

virtual const DtString& DtUiElement::platformType ( ) const
virtual

Returns the type of platform this entity represents.

virtual void DtUiElement::setPlatformType ( const DtString )
virtual

Sets the type of platform for this entity.

virtual void DtUiElement::setObjectTypes ( const std::vector< DtObjectType > &  )
virtual

Sets the object type this element represents.

Reimplemented in DtUiEntityHealth.

virtual void DtUiElement::aboutToShow ( )
virtual

Called when about to show as part of a properties dialog. Default is no-op.

Reimplemented in DtUiPositionElement, DtUiArtPartElement, DtUiUniqueNameElement, and DtUiArtPartTypeElement.

const std::vector<DtReaderWriter*>& DtUiElement::values ( ) const
inline
const std::vector<DtReaderWriter*>& DtUiElement::backupValues ( ) const
inline
static void DtUiElement::registerUiTypes ( )
static

Factory methods for creating ui elements.

static DtUiElement* DtUiElement::createUiElement ( makVrv::DtDe ,
const DtString type 
)
static
static bool DtUiElement::hasCreator ( const DtString )
static
static void DtUiElement::theNullFunction ( DtUiElement )
static
virtual bool DtUiElement::isModified ( ) const
virtual
virtual bool DtUiElement::isValid ( ) const
virtual

Used to enable/disable the OK button. Default returns true.

Reimplemented in DtUiAirborneFuelConsumptionModelDataPoints.

virtual void DtUiElement::decorateElement ( )
virtual
virtual void DtUiElement::setFromParameters ( DtReaderWriter parentRw)
virtual

Calls setFromParameters with std::vector of parameter.

virtual void DtUiElement::setFromParameters ( const std::vector< DtComponentSystemDefinition * > &  )
virtual

For those UI elements that work with system definitions this method will be implemented. For those that do not the default is to simply set the member to contain the systems defined.

Reimplemented in DtUiSystemTemplateName, DtUiSystemFilename, DtGuiObjectsThatUseThisSystem, DtGuiSystemSupportsEntityKinds, DtUiDamageTableConfigurationWidget, DtUiGuiSystemAvailableParameters, DtUiApplicableTargets, DtUiAvailableAmmunition, DtUiSystemHealth, DtUiTargetRegion, and DtUiSystemTags.

virtual void DtUiElement::setFromParameters ( const std::vector< DtReaderWriter * > &  parentRw)
virtual

Reimplemented in DtUiDisplayWidgetCanvas, DtUiGuiScrollArea, DtUiGuiIconLists, DtUiGuiMenuIcon, DtUiSimulationObjectCountries, DtUiSimulationObjectTags, DtUiGuiDefaultOverlay, DtUiGuiCreatePalette, DtUiCanAggregate, DtUiCanCreateObject, DtUiNonPropagatingEntityTypeEnumeration, DtUiPropertiesTable, DtUiEntityEnumeration, DtUiGuiEntityFile, DtUiAggregateFormationEditor, DtUiGuiAmmunitionApplicableTargets, DtUiPlatformUsed, DtUiAggregateCompositionEditor, DtUiAggregateAssembliesElement, DtUiHitProbabilityConfigurationWidget, DtUiSystemElement, DtUiGuiAmmunitionUsedBySystems, DtUiGuiKeywords, DtUiDamageTableConfigurationWidget, DtUiDetonationParametersConfigurationWidget, DtUiUniqueNameElement, DtUiArtPartElement, DtUiApplicableTargets, DtUiBoundingVolumeElement, DtUiArticulatedPartsElement, DtUiDiGuyElement, DtUiAvailableAmmunition, DtUiEntityHealth, DtUiEnvironmentalSignatureModifier, DtUiSensorSensitivityElement, DtUiMultiSystemElement, DtUiSensorSignaturesElement, DtUiVectorElement, DtUiGuiAmmunitionWarhead, DtUiAggregateLoadoutsElement, DtUiGuiLabel, DtUiIntegerElement, DtUiTargetRegion, DtUiBVSPCalculationElement, DtUiSingleSystemElement, DtUiObjectGeometryElement, DtUiSimulationObjectGroupElement, DtUiObjectTypeListElement, DtUiAirborneFuelConsumptionModelDataPoints, DtUiScriptedMovementSystemElement, DtUiListBoxElement, DtUiPositionElement, DtUITrajectoryTableParameterElement, DtUiMinefieldTableElement, DtUiStringElement, DtUiBooleanElement, DtUiOrientationElement, DtUiEntityTypeElement, and DtUiRealElement.

virtual bool DtUiElement::restoreFromBackup ( )
virtual

Restores this element from a backup created with the specified name. Optionally deletes the backup entry after restoring.

Returns
True if successfully restored.
QHBoxLayout* DtUiElement::findLayoutThatHas ( QWidget *  w,
QBoxLayout *  layout 
)

iterates through the items in layout to find w. Also checks sub-layouts

QBoxLayout* DtUiElement::findUsableLayoutFor ( QWidget *  w)

Returns the existing HBoxLayout owned by w. If there is an existing layout that is not an HBox, retruns null If w has no layout then calls findLayoutThatHas on the parent.

static UiElementFactoryMap& DtUiElement::elementFactory ( )
inlinestatic
const std::vector<DtObjectType>& DtUiElement::objectTypes ( ) const
inline
const std::vector<DtComponentSystemDefinition*>& DtUiElement::systems ( ) const
inline
virtual void DtUiElement::sendEvent ( const DtUiElementEvent )
virtual
virtual bool DtUiElement::allValuesTheSame ( ) const
virtual
static QString DtUiElement::mixedText ( )
static
static void DtUiElement::setMixedText ( const QString &  )
static
virtual bool DtUiElement::isMixedValue ( ) const
virtual

If widget is line edit and the value is mixedText returns true, else the subclass will need to return this value.

virtual void DtUiElement::setEnabled ( bool  )
virtual
virtual bool DtUiElement::enabled ( ) const
virtual
virtual void DtUiElement::setControllingCheckBox ( QCheckBox )
virtual
QCheckBox* DtUiElement::controllingCheckBox ( )
inline
virtual void DtUiElement::populateParentValues ( std::string  elementName)
virtual

caches the data from the parent file into myParentValues in case the user reverts it

virtual void DtUiElement::toggleDisplayed ( bool  display)
virtualslot

Reimplemented in DtUiEntityEnumeration.

virtual void DtUiElement::elementChanged ( )
protectedvirtualslot
virtual void DtUiElement::enableIfChecked ( )
protectedvirtualslot

Connected to if the enable_if_checked property is set, and there is a matching check box for the enable_if_checked property. Will enable/disable the item based on the check state of the sender.

Reimplemented in DtUiNonPropagatingEntityTypeEnumeration.

virtual void DtUiElement::disableIfChecked ( )
protectedvirtualslot

Connected to if the disable_if_checked property is set, and there is a matching check box for the disable_if_checked property. Will enable/disable the item based on the check state of the sender.

Reimplemented in DtUiNonPropagatingEntityTypeEnumeration.

void DtUiElement::uiEvent ( const DtUiElementEvent )
signal
void DtUiElement::changed ( )
signal
virtual double DtUiElement::sourceToDisplayUnits ( double  ) const
protectedvirtual
virtual double DtUiElement::displayToSourceUnits ( double  ) const
protectedvirtual
virtual QString DtUiElement::units ( ) const
protectedvirtual
virtual void DtUiElement::updateLabelTitle ( )
protectedvirtual

Updates label title based on valid units.

Reimplemented in DtUiArticulatedPartsElement, DtUiMultiSystemElement, DtUiVectorElement, and DtUiAirborneFuelConsumptionModelDataPoints.

virtual QString DtUiElement::labelTitle ( ) const
protectedvirtual

Returns the unmodified label title.

Reimplemented in DtUiVectorElement.

virtual void DtUiElement::createControls ( QWidget *  parent)
protectedvirtual

If additional widgets or connections need to be made do it here. The parent is the myWidget member.

Reimplemented in DtUiDisplayWidgetCanvas, DtUiGuiScrollArea, DtUiGuiIconLists, DtUiGuiMenuIcon, DtUiSimulationObjectCountries, DtUiSimulationObjectTags, DtUiGuiDefaultOverlay, DtUiGuiCreatePalette, DtUiCanAggregate, DtUiCanCreateObject, DtUiSystemTemplateName, DtUiSystemFilename, DtUiPropertiesTable, DtUiEntityEnumeration, DtGuiObjectsThatUseThisSystem, DtUiGuiEntityFile, DtUiSystemElement, DtUiGuiAmmunitionApplicableTargets, DtUiPlatformUsed, DtGuiSystemSupportsEntityKinds, DtUiHitProbabilityConfigurationWidget, DtUiGuiAmmunitionUsedBySystems, DtUiGuiKeywords, DtUiAggregateFormationEditor, DtUiDamageTableConfigurationWidget, DtUiDetonationParametersConfigurationWidget, DtUiGuiSystemAvailableParameters, DtUiApplicableTargets, DtUiArticulatedPartsElement, DtUiVectorElement, DtUiEnvironmentalSignatureModifier, DtUiBoundingVolumeElement, DtUiArtPartElement, DtUiAvailableAmmunition, DtUiHealthCheck, DtUiArtPartTypeElement, DtUiUniqueNameElement, DtUiMultiSystemElement, DtUiGuiAmmunitionWarhead, DtUiRealElement, DtUiGuiLabel, DtUiDiGuyElement, DtUiSingleSystemElement, DtUiTargetRegion, DtUiAggregateCompositionEditor, DtUiObjectGeometryElement, DtUiSimulationObjectGroupElement, DtUITrajectoryTableParameterElement, DtUiSensorSensitivityElement, DtUiSensorSignaturesElement, DtUiMinefieldTableElement, DtUiIntegerElement, DtUiObjectTypeListElement, DtUiEntityTypeElement, DtUiStringElement, DtUiAirborneFuelConsumptionModelDataPoints, DtUiListBoxElement, DtUiPositionElement, DtUiPropertiesDisplayContainer, DtUiPushButtonElement, DtUiScriptedMovementSystemElement, DtUiBVSPCalculationElement, DtUiBooleanElement, DtUiComboBoxElement, DtUiOrientationElement, and DtUiRandomizedObjectElement.

Member Data Documentation

QWidget* DtUiElement::myWidget
QWidget* DtUiElement::myLabel
UiElementFactoryMap DtUiElement::theFactory
staticprotected
DtString DtUiElement::myDisplayUnits
protected
DtString DtUiElement::mySourceUnits
protected
std::vector<DtReaderWriter*> DtUiElement::myValues
protected

Assumes 1 - 1 order that original and backup are same index in lists.

std::vector<DtReaderWriter*> DtUiElement::myBackupValues
protected
DtReaderWriter* DtUiElement::myParentValue
protected
bool DtUiElement::myIsNew
protected
DtElementChangedCallbackFcn DtUiElement::myElementChangedCallbackFunction
protected
DtUnit DtUiElement::mySource
protected
DtUnit DtUiElement::myDestination
protected
makVrv::DtDe& DtUiElement::myDe
protected
DtString DtUiElement::myPlatformType
protected
std::vector<DtObjectType> DtUiElement::myObjectTypes
protected
std::vector<DtComponentSystemDefinition*> DtUiElement::mySystems
protected
const DtComponentSystemDefinition* DtUiElement::mySystemDefinition
protected
bool DtUiElement::myEnabled
protected
std::vector<QObject*> DtUiElement::myConnectedTo
protected
int DtUiElement::myUniqueId
protected
QCheckBox* DtUiElement::myControllingCheckBox
protected
QToolButton* DtUiElement::myRevertToParentButton
protected

The documentation for this class was generated from the following file:

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)