OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::components::UiComponent Class Reference

#include "UiComponent.h"

Inheritance diagram for ot::components::UiComponent:
ot::ServiceBase MockupUIComponent

Public Types

enum  entitySelectionType { FACE , EDGE , SHAPE , TRANSFORM }
 
enum  entitySelectionAction {
  PORT , REMOVE_FACE , BOOLEAN_ADD , BOOLEAN_SUBTRACT ,
  BOOLEAN_INTERSECT , TRANSFORM_SHAPES , CHAMFER_EDGE , BLEND_EDGE
}
 

Public Member Functions

 UiComponent (const std::string &_name, const std::string &_type, const std::string &_url, serviceID_t _id, ApplicationBase *_application)
 
virtual ~UiComponent ()
 
void addMenuPage (const std::string &_pageName)
 Will add a new menu page in the UI.
 
void addMenuGroup (const std::string &_pageName, const std::string &_groupName)
 Will add a new menu group in the specified menu page at the UI.
 
void addMenuSubGroup (const std::string &_pageName, const std::string &_groupName, const std::string &_subgroupName)
 Will add a new menu subgroup in the specified menu group at the UI.
 
void addMenuButton (const std::string &_pageName, const std::string &_groupName, const std::string &_buttonName, const std::string &_text, const LockTypeFlags &_lockTypes, const std::string &_iconName, const std::string &_iconFolder=std::string("Default"), const std::string &_keySequence=std::string(""))
 Will add a new ToolButton in the specified menu group at the UI.
 
void addMenuButton (ot::MenuButtonDescription &_menuButtonDescription, const LockTypeFlags &_lockTypes, const std::string &_iconName, const std::string &_iconFolder=std::string("Default"), const std::string &_keySequence=std::string(""))
 
void addMenuButton (const std::string &_pageName, const std::string &_groupName, const std::string &_subgroupName, const std::string &_buttonName, const std::string &_text, const LockTypeFlags &_lockTypes, const std::string &_iconName, const std::string &_iconFolder=std::string("Default"), const std::string &_keySequence=std::string(""))
 Will add a new ToolButton in the specified menu sub group at the UI.
 
void addMenuCheckbox (const std::string &_pageName, const std::string &_groupName, const std::string &_checkboxName, const std::string &_checkboxText, bool _isChecked, const LockTypeFlags &_lockTypes)
 Will add a new CheckBox in the specified menu group at the UI.
 
void addMenuCheckbox (const std::string &_pageName, const std::string &_groupName, const std::string &_subgroupName, const std::string &_checkboxName, const std::string &_checkboxText, bool _isChecked, const LockTypeFlags &_lockTypes)
 Will add a new CheckBox in the specified menu sub group at the UI.
 
void addMenuLineEdit (const std::string &_pageName, const std::string &_groupName, const std::string &_lineEditName, const std::string &_labelText, const std::string &_initialText, const LockTypeFlags &_lockTypes)
 Will add a new LineEdit in the specified menu group at the UI.
 
void addMenuLineEdit (const std::string &_pageName, const std::string &_groupName, const std::string &_subgroupName, const std::string &_lineEditName, const std::string &_labelText, const std::string &_initialText, const LockTypeFlags &_lockTypes)
 Will add a new LineEdit in the specified menu group at the UI.
 
void activateMenuPage (const std::string &_pageName)
 
void addShortcut (const std::string &_keySequence)
 Will add a new shortcut The shortcut will be listened application wide.
 
void createRubberband (const std::string &_note, const std::string &_configurationJson)
 Will create a rubberband and start the sequence according to the configuration.
 
void setControlToolTip (const std::string &_controlName, const std::string &_toolTipText) const
 Will set the tool tip for the specified object that is placed in the menu.
 
void setControlToolTip (const std::string &_pageName, const std::string &_groupName, const std::string &_controlName, const std::string &_toolTipText) const
 Will set the tool tip for the specified object that is placed in the menu.
 
void setControlToolTip (const std::string &_gepaName, const std::string &_groupName, const std::string &_subgroupName, const std::string &_controlName, const std::string &_toolTipText) const
 Will set the tool tip for the specified object that is placed in the menu.
 
void setControlsEnabledState (const std::list< std::string > &_enabledControls, const std::list< std::string > &_disabledControls) const
 Will set the enabled state of the provided controls.
 
void setLineEditValues (const std::string &_controlName, const std::string &_text, bool _errorState=false) const
 Will set the provided values to the line edit.
 
void setCheckboxValues (const std::string &_controlName, bool _checkedState) const
 Will set tthe provided values to the checkbox.
 
void lockUI (const LockTypeFlags &_lockTypes) const
 Will lock the UI Elements that belong to the provided lock type.
 
void unlockUI (const LockTypeFlags &_lockTypes) const
 Will unlock the UI Elements that belong to the provided lock type.
 
void setProgressInformation (std::string message, bool continuous)
 Will set the progress bar text. This also turns on the progress bar visibility.
 
void setProgress (int percentage)
 Will set the percentage of the progress bar.
 
void closeProgressInformation (void)
 Will hide the progress bar.
 
void switchMenuTab (const std::string &_pageName) const
 Will switch current menu tab to the one provided.
 
void registerForModelEvents (void) const
 Will register for model events at the UI.
 
void deregisterForModelEvents (void) const
 Will deregister from the model events at the UI.
 
void addIconSearchPath (const std::string &_iconPath)
 Will add the provided path to the uiService icon manager This function has no effect when running in release mode.
 
void notifyUiSetupCompleted (void)
 Will notify the ui that this service completed its frontend setup.
 
void displayMessage (const std::string &_message) const
 Will display a message in the Frontends output window.
 
void displayStyledMessage (const StyledTextBuilder &_builder) const
 Will display a styled text message in the Frontends output window.
 
void displayErrorPrompt (const std::string &_message) const
 Will display a message in a error prompt dialog.
 
void displayWarningPrompt (const std::string &_message) const
 Will display a message in a warning prompt dialog.
 
void displayInformationPrompt (const std::string &_message) const
 Will display a message in a information prompt dialog.
 
void addControlNameToList (std::list< std::string > &_list, const std::string &_pageName, const std::string &_groupName, const std::string &_controlName)
 Will add the control name of the item that is located at the menu.
 
void addControlNameToList (std::list< std::string > &_list, const std::string &_pageName, const std::string &_groupName, const std::string &_subgroupName, const std::string &_controlName)
 Will add the control name of the item that is located at the menu.
 
void removeUIElements (const std::list< std::string > &_itemList)
 Will remove the specified UI elements from the UI.
 
void removeAllUIElements (void)
 Will remove all UI elements this service has created.
 
void enterEntitySelectionMode (UID _visualizationModelUID, entitySelectionType _selectionType, bool _allowMultipleSelection, const std::string &_filter, entitySelectionAction _actionType, const std::string &_message, const std::map< std::string, std::string > &_options, ot::serviceID_t _serviceToReplyTo) const
 
void freeze3DView (UID _visualizationModelUID, bool _flag)
 
void refreshSelection (UID _visualizationModelUID)
 
void refreshAllViews (UID visualizationModelID)
 
void sendUpdatedControlState (void)
 
void setControlState (const std::string controlName, bool enabled)
 
bool sendMessage (bool _queue, JsonDocument &_doc, std::string &_response)
 
- Public Member Functions inherited from ot::ServiceBase
 ServiceBase ()
 Constructor.
 
 ServiceBase (const std::string &_name, const std::string &_type)
 Constructor.
 
 ServiceBase (const std::string &_name, const std::string &_type, const std::string &_url, serviceID_t _id, const std::string &_siteId=std::string())
 Constructor.
 
 ServiceBase (const ServiceBase &_other)
 Copy constructor.
 
ServiceBaseoperator= (const ServiceBase &_other)
 
bool operator== (const ServiceBase &_other) const
 
bool operator!= (const ServiceBase &_other) const
 
virtual ~ServiceBase ()
 Deconstructor.
 
void setServiceID (serviceID_t _id)
 Set the service ID.
 
void setServiceURL (const std::string &_url)
 Set the service URL.
 
void setServiceName (const std::string &_name)
 Set the service name.
 
void setServiceType (const std::string &_type)
 Set the service type.
 
void setSiteId (const std::string &_id)
 Set the site ID.
 
void setSessionCount (int _count)
 Set the session count.
 
serviceID_t getServiceID (void) const
 Return the service ID.
 
int getServiceIDAsInt (void) const
 Return the service ID as an Integer (The service ID is an Integer stored as a String)
 
int getSessionCount (void) const
 Return the session count.
 
const std::string & getServiceURL (void) const
 Return the service URL.
 
std::string getServiceName (void) const
 Return the service name.
 
std::string getServiceType (void) const
 Return the service type.
 
std::string getSiteId (void) const
 Return the site ID.
 
BasicServiceInformation getBasicServiceInformation (void) const
 

Protected Member Functions

bool controlNameExists (const std::string &_name) const
 Will return true if the provided control was created here Usually used in debug mode.
 

Protected Attributes

ApplicationBasem_application
 
std::list< std::string > m_uiElements
 The application base this component belings to.
 
std::map< std::string, bool > m_uiControlState
 List of all UI elements that werde created by this component.
 
std::map< std::string, bool > m_uiControlStateInUI
 
- Protected Attributes inherited from ot::ServiceBase
serviceID_t m_serviceID
 
std::string m_serviceURL
 Service ID.
 
std::string m_serviceName
 Service URL.
 
std::string m_serviceType
 Service name.
 
std::string m_siteId
 Service type.
 
int m_sessionCount
 Site ID.
 

Friends

class ApplicationBase
 

Member Enumeration Documentation

◆ entitySelectionAction

Enumerator
PORT 
REMOVE_FACE 
BOOLEAN_ADD 
BOOLEAN_SUBTRACT 
BOOLEAN_INTERSECT 
TRANSFORM_SHAPES 
CHAMFER_EDGE 
BLEND_EDGE 

◆ entitySelectionType

Enumerator
FACE 
EDGE 
SHAPE 
TRANSFORM 

Constructor & Destructor Documentation

◆ UiComponent()

ot::components::UiComponent::UiComponent ( const std::string & _name,
const std::string & _type,
const std::string & _url,
serviceID_t _id,
ApplicationBase * _application )

◆ ~UiComponent()

ot::components::UiComponent::~UiComponent ( )
virtual

Member Function Documentation

◆ activateMenuPage()

void ot::components::UiComponent::activateMenuPage ( const std::string & _pageName)

◆ addControlNameToList() [1/2]

void ot::components::UiComponent::addControlNameToList ( std::list< std::string > & _list,
const std::string & _pageName,
const std::string & _groupName,
const std::string & _controlName )

Will add the control name of the item that is located at the menu.

Parameters
_listThe list to add the item to
_pageNameThe name of the page the controls' group is located at
_groupNameThe name of the group the controls' subgroup is located at
_controlNameThe name of the control

◆ addControlNameToList() [2/2]

void ot::components::UiComponent::addControlNameToList ( std::list< std::string > & _list,
const std::string & _pageName,
const std::string & _groupName,
const std::string & _subgroupName,
const std::string & _controlName )

Will add the control name of the item that is located at the menu.

Parameters
_listThe list to add the item to
_pageNameThe name of the page the controls' group is located at
_groupNameThe name of the group the controls' subgroup is located at
_subgroupNameThe name of the subgroup the control is located at
_controlNameThe name of the control

◆ addIconSearchPath()

void ot::components::UiComponent::addIconSearchPath ( const std::string & _iconPath)

Will add the provided path to the uiService icon manager This function has no effect when running in release mode.

◆ addMenuButton() [1/3]

void ot::components::UiComponent::addMenuButton ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _buttonName,
const std::string & _text,
const LockTypeFlags & _lockTypes,
const std::string & _iconName,
const std::string & _iconFolder = std::string("Default"),
const std::string & _keySequence = std::string("") )

Will add a new ToolButton in the specified menu group at the UI.

Parameters
_pageNameThe name of the page the group is located at
_groupNameThe name of the group to add the action at
_buttonNameThe name of the button
_textThe text of the button
_keySequenceThe shortcut key sequence to trigger this button (you can use ot::ui::keySequenceToString() for help, include openTwin/uiTypes)
_lockTypesThe lock type groups that this control belongs to (refer to documentation)
_iconNameThe name of the icon that should be displayed in the action (refer to documentation)
_iconFolderThe folder the icon is located at (refer to documentation)

◆ addMenuButton() [2/3]

void ot::components::UiComponent::addMenuButton ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _subgroupName,
const std::string & _buttonName,
const std::string & _text,
const LockTypeFlags & _lockTypes,
const std::string & _iconName,
const std::string & _iconFolder = std::string("Default"),
const std::string & _keySequence = std::string("") )

Will add a new ToolButton in the specified menu sub group at the UI.

Parameters
_pageNameThe name of the page the group is located at
_groupNameThe name of the group the subgroup is located at
_subgroupNameThe name of the subgorup the button will be placed at
_buttonNameThe name of the button
_textThe text of the button
_lockTypesThe lock type groups that this control belongs to (refer to documentation)
_iconNameThe name of the icon that should be displayed in the action (refer to documentation)
_iconFolderThe folder the icon is located at (refer to documentation)
_keySequenceThe shortcut key sequence to trigger this button (you can use ot::ui::keySequenceToString() for help, include openTwin/uiTypes)

◆ addMenuButton() [3/3]

void ot::components::UiComponent::addMenuButton ( ot::MenuButtonDescription & _menuButtonDescription,
const LockTypeFlags & _lockTypes,
const std::string & _iconName,
const std::string & _iconFolder = std::string("Default"),
const std::string & _keySequence = std::string("") )

◆ addMenuCheckbox() [1/2]

void ot::components::UiComponent::addMenuCheckbox ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _checkboxName,
const std::string & _checkboxText,
bool _isChecked,
const LockTypeFlags & _lockTypes )

Will add a new CheckBox in the specified menu group at the UI.

Parameters
_pageNameThe name of the page the group is located at
_groupNameThe name of the group to add the CheckBox at
_buttonNameThe name of the CheckBox
_iconNameThe name of the icon that should be displayed in the action (refer to documentation)
_lockTypesThe lock type groups that this control belongs to (refer to documentation)

◆ addMenuCheckbox() [2/2]

void ot::components::UiComponent::addMenuCheckbox ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _subgroupName,
const std::string & _checkboxName,
const std::string & _checkboxText,
bool _isChecked,
const LockTypeFlags & _lockTypes )

Will add a new CheckBox in the specified menu sub group at the UI.

Parameters
_pageNameThe name of the page the group is located at
_groupNameThe name of the group the subgroup is located at
_subgroupNameThe name of the subgorup the CheckBox will be placed at
_buttonNameThe name of the CheckBox
_iconNameThe name of the icon that should be displayed in the action (refer to documentation)
_lockTypesThe lock type groups that this control belongs to (refer to documentation)

◆ addMenuGroup()

void ot::components::UiComponent::addMenuGroup ( const std::string & _pageName,
const std::string & _groupName )

Will add a new menu group in the specified menu page at the UI.

Parameters
_pageNameThe name of the page to add the group at
_groupNameThe name of the group

◆ addMenuLineEdit() [1/2]

void ot::components::UiComponent::addMenuLineEdit ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _lineEditName,
const std::string & _labelText,
const std::string & _initialText,
const LockTypeFlags & _lockTypes )

Will add a new LineEdit in the specified menu group at the UI.

Parameters
_pageNameThe name of the page the group is located at
_groupNameThe name of the group to add the LineEdit at
_buttonNameThe name of the LineEdit
_iconNameThe name of the icon that should be displayed in the action (refer to documentation)
_lockTypesThe lock type groups that this control belongs to (refer to documentation)

◆ addMenuLineEdit() [2/2]

void ot::components::UiComponent::addMenuLineEdit ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _subgroupName,
const std::string & _lineEditName,
const std::string & _labelText,
const std::string & _initialText,
const LockTypeFlags & _lockTypes )

Will add a new LineEdit in the specified menu group at the UI.

Parameters
_pageNameThe name of the page the group is located at
_groupNameThe name of the group the subgroup is located at
_subgroupNameThe name of the subgorup the LineEdit will be placed at
_buttonNameThe name of the LineEdit
_iconNameThe name of the icon that should be displayed in the action (refer to documentation)
_lockTypesThe lock type groups that this control belongs to (refer to documentation)

◆ addMenuPage()

void ot::components::UiComponent::addMenuPage ( const std::string & _pageName)

Will add a new menu page in the UI.

Parameters
_pageNameThe name of the page to add

◆ addMenuSubGroup()

void ot::components::UiComponent::addMenuSubGroup ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _subgroupName )

Will add a new menu subgroup in the specified menu group at the UI.

Parameters
_pageNameThe name of the page to add the group at
_groupNameThe name of the group

◆ addShortcut()

void ot::components::UiComponent::addShortcut ( const std::string & _keySequence)

Will add a new shortcut The shortcut will be listened application wide.

Parameters
_keySequenceThe shortcut key sequence to trigger this button (you can use ot::ui::keySequenceToString() for help, include openTwin/uiTypes)

◆ closeProgressInformation()

void ot::components::UiComponent::closeProgressInformation ( void )

Will hide the progress bar.

◆ controlNameExists()

bool ot::components::UiComponent::controlNameExists ( const std::string & _name) const
protected

Will return true if the provided control was created here Usually used in debug mode.

◆ createRubberband()

void ot::components::UiComponent::createRubberband ( const std::string & _note,
const std::string & _configurationJson )

Will create a rubberband and start the sequence according to the configuration.

Parameters
_noteThe note for the rubberband, the note will be attatched to the response once the rubberband sequence is over
_jsonThe json document describing the rubberband

◆ deregisterForModelEvents()

void ot::components::UiComponent::deregisterForModelEvents ( void ) const

Will deregister from the model events at the UI.

◆ displayErrorPrompt()

void ot::components::UiComponent::displayErrorPrompt ( const std::string & _message) const

Will display a message in a error prompt dialog.

Parameters
_messageThe message to display

◆ displayInformationPrompt()

void ot::components::UiComponent::displayInformationPrompt ( const std::string & _message) const

Will display a message in a information prompt dialog.

Parameters
_messageThe message to display

◆ displayMessage()

void ot::components::UiComponent::displayMessage ( const std::string & _message) const

Will display a message in the Frontends output window.

Parameters
_messageThe message to display.

◆ displayStyledMessage()

void ot::components::UiComponent::displayStyledMessage ( const StyledTextBuilder & _builder) const

Will display a styled text message in the Frontends output window.

Parameters
_builderStyledTextBuilder containing the message

◆ displayWarningPrompt()

void ot::components::UiComponent::displayWarningPrompt ( const std::string & _message) const

Will display a message in a warning prompt dialog.

Parameters
_messageThe message to display

◆ enterEntitySelectionMode()

void ot::components::UiComponent::enterEntitySelectionMode ( UID _visualizationModelUID,
entitySelectionType _selectionType,
bool _allowMultipleSelection,
const std::string & _filter,
entitySelectionAction _actionType,
const std::string & _message,
const std::map< std::string, std::string > & _options,
ot::serviceID_t _serviceToReplyTo ) const

◆ freeze3DView()

void ot::components::UiComponent::freeze3DView ( UID _visualizationModelUID,
bool _flag )

◆ lockUI()

void ot::components::UiComponent::lockUI ( const LockTypeFlags & _lockTypes) const

Will lock the UI Elements that belong to the provided lock type.

Parameters
_lockTypesThe lock type Groups to lock in the UI

◆ notifyUiSetupCompleted()

void ot::components::UiComponent::notifyUiSetupCompleted ( void )

Will notify the ui that this service completed its frontend setup.

◆ refreshAllViews()

void ot::components::UiComponent::refreshAllViews ( UID visualizationModelID)

◆ refreshSelection()

void ot::components::UiComponent::refreshSelection ( UID _visualizationModelUID)

◆ registerForModelEvents()

void ot::components::UiComponent::registerForModelEvents ( void ) const

Will register for model events at the UI.

◆ removeAllUIElements()

void ot::components::UiComponent::removeAllUIElements ( void )

Will remove all UI elements this service has created.

◆ removeUIElements()

void ot::components::UiComponent::removeUIElements ( const std::list< std::string > & _itemList)

Will remove the specified UI elements from the UI.

◆ sendMessage()

bool ot::components::UiComponent::sendMessage ( bool _queue,
JsonDocument & _doc,
std::string & _response )

◆ sendUpdatedControlState()

void ot::components::UiComponent::sendUpdatedControlState ( void )

◆ setCheckboxValues()

void ot::components::UiComponent::setCheckboxValues ( const std::string & _controlName,
bool _checkedState ) const

Will set tthe provided values to the checkbox.

Parameters
_controlNameThe name of the checkbox
_checkedStateThe checked state to set

◆ setControlsEnabledState()

void ot::components::UiComponent::setControlsEnabledState ( const std::list< std::string > & _enabledControls,
const std::list< std::string > & _disabledControls ) const

Will set the enabled state of the provided controls.

Parameters
_enabledControlsThe names of the controls that should be enabled
_disabledControlsThe names of the controls that should be disabled

◆ setControlState()

void ot::components::UiComponent::setControlState ( const std::string controlName,
bool enabled )

◆ setControlToolTip() [1/3]

void ot::components::UiComponent::setControlToolTip ( const std::string & _controlName,
const std::string & _toolTipText ) const

Will set the tool tip for the specified object that is placed in the menu.

Parameters
_controlNameThe name of the control to set the tool tip at
_toolTipTextThe text of the tool tip

◆ setControlToolTip() [2/3]

void ot::components::UiComponent::setControlToolTip ( const std::string & _gepaName,
const std::string & _groupName,
const std::string & _subgroupName,
const std::string & _controlName,
const std::string & _toolTipText ) const

Will set the tool tip for the specified object that is placed in the menu.

Parameters
_pageNameThe name of the page the controls' group is located at
_groupNameThe name of the group the controls' subgroup is located at
_subgroupNameThe name of the subgroup the control is located at
_controlNameThe name of the control to set the tool tip at
_toolTipTextThe text of the tool tip

◆ setControlToolTip() [3/3]

void ot::components::UiComponent::setControlToolTip ( const std::string & _pageName,
const std::string & _groupName,
const std::string & _controlName,
const std::string & _toolTipText ) const

Will set the tool tip for the specified object that is placed in the menu.

Parameters
_pageNameThe name of the page the controls' group is located at
_groupNameThe name of the group the control is located at
_controlNameThe name of the control to set the tool tip at
_toolTipTextThe text of the tool tip

◆ setLineEditValues()

void ot::components::UiComponent::setLineEditValues ( const std::string & _controlName,
const std::string & _text,
bool _errorState = false ) const

Will set the provided values to the line edit.

Parameters
_controlNameThe name of the line edit
_textThe text to set
_errorStateThe error state to set

◆ setProgress()

void ot::components::UiComponent::setProgress ( int percentage)

Will set the percentage of the progress bar.

Parameters
percentageThe percentage for the progress bar

◆ setProgressInformation()

void ot::components::UiComponent::setProgressInformation ( std::string message,
bool continuous )

Will set the progress bar text. This also turns on the progress bar visibility.

Parameters
messageThe text for the progress bar
continuousIndicate whether the progress bar should show a continous animation (no percentages)

◆ switchMenuTab()

void ot::components::UiComponent::switchMenuTab ( const std::string & _pageName) const

Will switch current menu tab to the one provided.

Parameters
_pageNameThe name of the page

◆ unlockUI()

void ot::components::UiComponent::unlockUI ( const LockTypeFlags & _lockTypes) const

Will unlock the UI Elements that belong to the provided lock type.

Parameters
_lockTypesThe lock type Groups to unlock in the UI

Friends And Related Symbol Documentation

◆ ApplicationBase

friend class ApplicationBase
friend

Member Data Documentation

◆ m_application

ApplicationBase* ot::components::UiComponent::m_application
protected

◆ m_uiControlState

std::map<std::string, bool> ot::components::UiComponent::m_uiControlState
protected

List of all UI elements that werde created by this component.

◆ m_uiControlStateInUI

std::map<std::string, bool> ot::components::UiComponent::m_uiControlStateInUI
protected

◆ m_uiElements

std::list<std::string> ot::components::UiComponent::m_uiElements
protected

The application base this component belings to.


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