X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FDDS%2FDDS_DicItem.cxx;h=b1f2f5a95f5833670ba1a4b8efbb9f568e50b75c;hb=e6caa123c65e3c4a3017364ec5bb4225fd898465;hp=48ce715a9c76315bb92f71f77f727bfa4fac6900;hpb=f830c97c748d8f8a6a7eccc8e3a58e19066a1181;p=modules%2Fgui.git diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index 48ce715a9..b1f2f5a95 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -1,11 +1,14 @@ -// Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful +// This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. @@ -16,6 +19,7 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "DDS_DicItem.h" #include "DDS_Dictionary.h" @@ -37,40 +41,42 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_DicItem, MMgt_TShared) /*! \class DDS_DicItem - - This class to provide information about datum (phisical characteristic parameter). + \brief This class provides an information about datum (phisical characteristic parameter). */ /*! - Constructor. Creates the instance of empty dictionary item. + \brief Constructor. + + Creates the instance of empty dictionary item. */ DDS_DicItem::DDS_DicItem() : myType( 0 ), -myDefValue( 0 ), -myMax( 0 ), -myMin( 0 ), -myMinZoom( 0.1 ), -myMaxZoom( 10 ), -myZoomOrder( 2 ) + myMax( 0 ), + myMin( 0 ), + myDefValue( 0 ), + myMinZoom( 0.1 ), + myMaxZoom( 10 ), + myZoomOrder( 2 ) { } /*! - Copy constructor. Internal. + \brief Copy constructor (put in private section to prevent object copying). */ DDS_DicItem::DDS_DicItem( const DDS_DicItem& ) { } /*! - Assignment operator. Internal. + \brief Assignment operator (put in private section to prevent object copying). */ void DDS_DicItem::operator=( const DDS_DicItem& ) { } /*! - Gets the identifier of parameter. + \brief Get the identifier of parameter. + \return parameter ID */ TCollection_AsciiString DDS_DicItem::GetId() const { @@ -78,7 +84,8 @@ TCollection_AsciiString DDS_DicItem::GetId() const } /*! - Gets the type of parameter. + \brief Get the type of parameter. + \return parameter type */ DDS_DicItem::Type DDS_DicItem::GetType() const { @@ -86,7 +93,8 @@ DDS_DicItem::Type DDS_DicItem::GetType() const } /*! - Gets the label of the parameter. + \brief Get the label of the parameter. + \return parameter label */ TCollection_ExtendedString DDS_DicItem::GetLabel() const { @@ -94,7 +102,8 @@ TCollection_ExtendedString DDS_DicItem::GetLabel() const } /*! - Gets the filter (regular expression) for the parameter values. + \brief Get the filter (regular expression) for the parameter values. + \return parameter filter */ TCollection_ExtendedString DDS_DicItem::GetFilter() const { @@ -102,7 +111,8 @@ TCollection_ExtendedString DDS_DicItem::GetFilter() const } /*! - Gets the Required attribute of the parameter. + \brief Get the Required attribute of the parameter. + \return Required attribute */ TCollection_ExtendedString DDS_DicItem::GetRequired() const { @@ -110,7 +120,8 @@ TCollection_ExtendedString DDS_DicItem::GetRequired() const } /*! - Gets the wrong value warning level of the parameter. + \brief Get the wrong value warning level of the parameter. + \return warning level */ DDS_MsgType DDS_DicItem::GetWarningLevel() const { @@ -118,7 +129,8 @@ DDS_MsgType DDS_DicItem::GetWarningLevel() const } /*! - Gets the long description of the parameter. + \brief Get the long description of the parameter. + \return long description */ TCollection_ExtendedString DDS_DicItem::GetLongDescription() const { @@ -126,7 +138,8 @@ TCollection_ExtendedString DDS_DicItem::GetLongDescription() const } /*! - Gets the short description of the parameter. + \brief Get the short description of the parameter. + \return short description */ TCollection_ExtendedString DDS_DicItem::GetShortDescription() const { @@ -134,7 +147,8 @@ TCollection_ExtendedString DDS_DicItem::GetShortDescription() const } /*! - Gets the name of component - owner of parameter. + \brief Get the name of the component (parameter owner). + \return component name */ TCollection_AsciiString DDS_DicItem::GetComponent() const { @@ -146,7 +160,8 @@ TCollection_AsciiString DDS_DicItem::GetComponent() const } /*! - Gets the parameter unit of measure for active unit system. + \brief Get the parameter measure units for active units system. + \return parameter units */ TCollection_AsciiString DDS_DicItem::GetUnits() const { @@ -154,8 +169,12 @@ TCollection_AsciiString DDS_DicItem::GetUnits() const } /*! - Gets the parameter unit of measure for specified unit system \atheSystem. - If specified unit system doesn't exist then empty string returned. + \brief Get the parameter measure units for specified units system \a theSystem. + + If specified units system doesn't exist, empty string is returned. + + \param theSystem units system + \return parameter units */ TCollection_AsciiString DDS_DicItem::GetUnits( const UnitSystem& theSystem ) const { @@ -167,8 +186,11 @@ TCollection_AsciiString DDS_DicItem::GetUnits( const UnitSystem& theSystem ) con } /*! - Gets the minimum value of parameter for active unit system. - Returned value converted to SI. + \brief Get the minimum value of the parameter for active units system. + + Returned value is converted to SI. + + \return minimum value */ Standard_Real DDS_DicItem::GetMinValue() const { @@ -176,8 +198,13 @@ Standard_Real DDS_DicItem::GetMinValue() const } /*! - Gets the minimum value of parameter for specified unit system \atheSystem. - Returned value converted to SI. + \brief Get the minimum value of the parameter for the specified + units system \a theSystem. + + Returned value is converted to SI. + + \param theUnitsSystem units system + \return minimum value */ Standard_Real DDS_DicItem::GetMinValue( const UnitSystem& theUnitsSystem ) const { @@ -185,8 +212,11 @@ Standard_Real DDS_DicItem::GetMinValue( const UnitSystem& theUnitsSystem ) const } /*! - Gets the maximum value of parameter for active unit system. + \brief Get the maximum value of the parameter for active units system. + Returned value converted to SI. + + \return maximum value */ Standard_Real DDS_DicItem::GetMaxValue() const { @@ -194,8 +224,13 @@ Standard_Real DDS_DicItem::GetMaxValue() const } /*! - Gets the maximum value of parameter for specified unit system \atheSystem. + \brief Get the maximum value of the parameter for specified + units system \a theSystem. + Returned value converted to SI. + + \param theUnitsSystem units system + \return maximum value */ Standard_Real DDS_DicItem::GetMaxValue( const UnitSystem& theUnitsSystem ) const { @@ -203,7 +238,9 @@ Standard_Real DDS_DicItem::GetMaxValue( const UnitSystem& theUnitsSystem ) const } /*! - Gets the precision (number of digit after decimal point) of parameter for active unit system. + \brief Get the precision (number of digits after decimal point) + of the parameter for active units system. + \return parameter precision */ Standard_Integer DDS_DicItem::GetPrecision() const { @@ -211,8 +248,13 @@ Standard_Integer DDS_DicItem::GetPrecision() const } /*! - Gets the precision (number of digit after decimal point) of parameter for specified - unit system \atheSystem. If specified unit system doesn't exist then zero returned. + \brief Get the precision (number of digits after decimal point) of the parameter + for specified units system \a theSystem. + + If specified units system doesn't exist, zero is returned. + + \param theSystem units system + \return parameter precision */ Standard_Integer DDS_DicItem::GetPrecision( const UnitSystem& theSystem ) const { @@ -224,9 +266,13 @@ Standard_Integer DDS_DicItem::GetPrecision( const UnitSystem& theSystem ) const } /*! - Gets the default value of parameter for active unit system. Default value returned as string. - If type of value is numeric (Float or Integer) and default value defined then returned number - converted to SI. + \brief Get the default value of the parameter for active units system. + + Default value is returned as string. + If type of the value is numerical (Float or Integer) and default value + is defined, then the returning value is converted to SI. + + \return default value */ TCollection_ExtendedString DDS_DicItem::GetDefaultValue() const { @@ -234,9 +280,15 @@ TCollection_ExtendedString DDS_DicItem::GetDefaultValue() const } /*! - Gets the default value of parameter for specified unit system \atheSystem. Default value returned - as string. If type of value is numeric (Float or Integer) and default value defined then returned - number converted to SI. + \brief Get the default value of the parameter for specified + units system \a theSystem. + + Default value is returned as string. + If type of the value is numerical (Float or Integer) and default value + is defined, then the returning value is converted to SI. + + \param theSystem units system + \return default value */ TCollection_ExtendedString DDS_DicItem::GetDefaultValue( const UnitSystem& theSystem ) const { @@ -262,9 +314,13 @@ TCollection_ExtendedString DDS_DicItem::GetDefaultValue( const UnitSystem& theSy } /*! - Gets the format string of parameter for active unit system. If argument \atheCanonical - is true then format string will be reduced to sprintf() specification (without extra - non standard qualifiers). + \brief Get the format string of the parameter for active units system. + + If argument \a theCanonical is \c true, format string is reduced according + to the sprintf() specification (without extra non standard qualifiers). + + \param theCanonical 'canonical form' flag + \return format string */ TCollection_AsciiString DDS_DicItem::GetFormat( const Standard_Boolean theCanonical ) const { @@ -272,9 +328,15 @@ TCollection_AsciiString DDS_DicItem::GetFormat( const Standard_Boolean theCanoni } /*! - Gets the format string of parameter for specified unit system \atheSystem. If argument - \atheCanonical is true then format string will be reduced to sprintf() specification - (without extra non standard qualifiers). + \brief Get the format string of the parameter for specified + units system \a theSystem. + + If argument \a theCanonical is \c true, format string is reduced according + to the sprintf() specification (without extra non standard qualifiers). + + \param theSystem units system + \param theCanonical 'canonical form' flag + \return format string */ TCollection_AsciiString DDS_DicItem::GetFormat( const UnitSystem& theSystem, const Standard_Boolean theCanonical ) const @@ -304,8 +366,14 @@ TCollection_AsciiString DDS_DicItem::GetFormat( const UnitSystem& theSystem, } /*! - Gets name of a list referenced by the parameter. This string is empty if the list - refernce is not defined - then use other properties: Type, DefaultValue, MaxValue, MinValue + \brief Get the name of a list referenced by the parameter. + + This string is empty if the list reference is not defined. + In this case, other properties (Type, DefaultValue, MaxValue, MinValue) + should be used. + + \return referenced list name + \sa GetListOfValues() */ TCollection_ExtendedString DDS_DicItem::GetNameOfValues() const { @@ -313,8 +381,17 @@ TCollection_ExtendedString DDS_DicItem::GetNameOfValues() const } /*! - Gets item names and item ids of a list referenced by the parameter. This sequences is empty if - the list reference is not defined - then use other properties: Type, DefaultValue, MaxValue, MinValue + \brief Get item names and item identifiers of a list referenced + by the parameter. + + These sequences are empty if the list reference is not defined. + In this case, other properties (Type, DefaultValue, MaxValue, MinValue) + should be used. + + \param theStrings returning items names + \param theIntegers returning items identifiers + \return \c true if returning lists are not empty + \sa GetNameOfValues() */ Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedString)& theStrings, Handle(TColStd_HArray1OfInteger)& theIntegers ) const @@ -325,8 +402,20 @@ Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedS } /*! - Gets item names, item ids and item icons of a list referenced by the parameter. This sequences is empty - if the list reference is not defined - then use other properties: Type, DefaultValue, MaxValue, MinValue + \brief Get item names, item identifiers and item icons of a list + referenced by the parameter. + + \overload + + These sequences are empty if the list reference is not defined. + In this case, other properties (Type, DefaultValue, MaxValue, MinValue) + should be used. + + \param theStrings returning items names + \param theIntegers returning items identifiers + \param theIcons returning items icons + \return \c true if returning lists are not empty + \sa GetNameOfValues() */ Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedString)& theStrings, Handle(TColStd_HArray1OfInteger)& theIntegers, @@ -340,7 +429,9 @@ Standard_Boolean DDS_DicItem::GetListOfValues( Handle(TColStd_HArray1OfExtendedS /*! - Gets special values of the parameter. + \brief Get special values of the parameter. + \param theMap returning map of the special values + \return \c true if returning map is not empty */ Standard_Boolean DDS_DicItem::GetSpecialValues( TColStd_MapOfReal& theMap ) const { @@ -362,7 +453,8 @@ Standard_Boolean DDS_DicItem::GetSpecialValues( TColStd_MapOfReal& theMap ) cons } /*! - Gets minimum value of lateral zooming + \brief Get minimum value of lateral zooming. + \return lateral zooming minimum value */ Standard_Real DDS_DicItem::GetMinZoom() const { @@ -370,7 +462,8 @@ Standard_Real DDS_DicItem::GetMinZoom() const } /*! - Gets maximum value of lateral zooming + \brief Get maximum value of lateral zooming. + \return lateral zooming maximum value */ Standard_Real DDS_DicItem::GetMaxZoom() const { @@ -378,7 +471,8 @@ Standard_Real DDS_DicItem::GetMaxZoom() const } /*! - Gets order of lateral zooming + \brief Get order of lateral zooming. + \return lateral zooming order */ Standard_Real DDS_DicItem::GetZoomOrder() const { @@ -386,7 +480,10 @@ Standard_Real DDS_DicItem::GetZoomOrder() const } /*! - Convert value \atheVal to default SI units according to active unit system. + \brief Convert value \a theVal to the default SI units + according to the active units system. + \param theVal value being converted + \return value converted to SI */ Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal ) const { @@ -394,7 +491,10 @@ Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal ) const } /*! - Convert value \atheVal from default SI units according to active unit system. + \brief Convert value \a theVal from the default SI units + according to the active units system. + \param theVal value being converted + \return value converted from SI */ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal ) const { @@ -402,7 +502,11 @@ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal ) const } /*! - Convert value to default SI units according to unit system \atheUnitsSystem. + \brief Convert value to the default SI units according to the + units system \a theUnitsSystem. + \param theVal value being converted + \param theUnitsSystem units system + \return value converted to the specified units system */ Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal, const UnitSystem& theUnitsSystem ) const { @@ -414,7 +518,11 @@ Standard_Real DDS_DicItem::ToSI( const Standard_Real theVal, const UnitSystem& t } /*! - Convert value from default SI units according to unit system \atheUnitsSystem. + \brief Convert value from the default SI units according to the + units system \a theUnitsSystem. + \param theVal value being converted + \param theUnitsSystem units system + \return value converted from the specified units system */ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal, const UnitSystem& theUnitsSystem ) const { @@ -426,7 +534,9 @@ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal, const UnitSystem& } /*! - Returns 'true' if data specified by \aflag exist. + \brief Check data existence. + \param flag data flag + \return \c true if data specified by \a flag exists */ Standard_Boolean DDS_DicItem::HasData( const Standard_Integer flag ) const { @@ -434,7 +544,12 @@ Standard_Boolean DDS_DicItem::HasData( const Standard_Integer flag ) const } /*! - Returns options for specified name \aname. If option not found then empty string returned. + \brief Get option for specified name \a name. + + If option is not found, empty string is returned. + + \param name option name + \return option value */ TCollection_ExtendedString DDS_DicItem::GetOption( const TCollection_AsciiString& name ) const { @@ -445,8 +560,9 @@ TCollection_ExtendedString DDS_DicItem::GetOption( const TCollection_AsciiString } /*! - Returns names list of existing options in the specified sequence \anames. - If list not empty retunrs 'true' otherwise 'false'. + \brief Get names of all existing options. + \param names returning list of options + \return \c true if list is not empty */ Standard_Boolean DDS_DicItem::GetOptionNames( TColStd_SequenceOfAsciiString& names ) const { @@ -460,7 +576,13 @@ Standard_Boolean DDS_DicItem::GetOptionNames( TColStd_SequenceOfAsciiString& nam /*! - Parse record in XML file and retrieve information relevant for this dictionary item + \brief Parse record from XML file and retrieve information relevant for + the dictionary item. + \param theID item identifier + \param theDatum datum XML node + \param theCompElement component XML node + \param theDocElement document XML node + \param theSystems units system names */ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element& theDatum, const LDOM_Element& theCompElement, const LDOM_Element& theDocElement, @@ -653,9 +775,9 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element { // Read the text in the element "value" //LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); - LDOM_Node aNode = aListItemValue.getFirstChild(); - const LDOM_Text& aText = (const LDOM_Text&) aNode; - LDOM_Text aListItemTxt(aText); + LDOM_Node aNode = aListItemValue.getFirstChild(); + const LDOM_Text& aText = (const LDOM_Text&) aNode; + LDOM_Text aListItemTxt(aText); if ( !aListItemTxt.isNull() ) { // adding ID and text value to sequence @@ -708,21 +830,41 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element LDOM_Element anOpt = theDatum.GetChildByTagName( DDS_Dictionary::KeyWord( "OPTIONS" ) ); if ( !anOpt.isNull() ) { - LDOM_NodeList anOptions = anOpt.getElementsByTagName( DDS_Dictionary::KeyWord( "OPTION" ) ); + LDOM_NodeList anOptions = anOpt.GetAttributesList();//anOpt.getElementsByTagName( DDS_Dictionary::KeyWord( "OPTION" ) ); for ( Standard_Integer oi = 0; oi < anOptions.getLength(); oi++ ) { LDOM_Node node = anOptions.item( oi ); - if ( node.getNodeType() != LDOM_Node::ELEMENT_NODE ) - continue; - - LDOM_Element& elem = (LDOM_Element&)node; - TCollection_AsciiString name = elem.getAttribute( DDS_Dictionary::KeyWord( "OPTION_NAME" ) ); + LDOM_Node::NodeType t = node.getNodeType(); + TCollection_AsciiString name; TCollection_ExtendedString value; - const LDOM_Node aNode = elem.getFirstChild(); - LDOM_Text anOptTxt( (const LDOM_Text&)(aNode) ); - if ( !anOptTxt.isNull() ) - value = anOptTxt.getData(); + + if( t==LDOM_Node::ELEMENT_NODE ) + { + const LDOM_Element& elem = ( const LDOM_Element& )node; + name = elem.getAttribute( DDS_Dictionary::KeyWord( "OPTION_NAME" ) ); + + const LDOM_Node aNode = elem.getFirstChild(); + LDOM_Text anOptTxt( (const LDOM_Text&)(aNode) ); + if ( !anOptTxt.isNull() ) + value = anOptTxt.getData(); + } + else if( t==LDOM_Node::ATTRIBUTE_NODE ) + { + const LDOM_Attr& attr = ( const LDOM_Attr& )node; + name = ( Standard_CString )attr.getName().GetString(); + LDOMString v = attr.getValue(); + if( v.Type()==LDOMBasicString::LDOM_Integer ) + { + Standard_Integer ival; + v.GetInteger( ival ); + value = TCollection_ExtendedString( ival ); + } + else + value = ( Standard_CString )v.GetString(); + } + else + continue; if ( !name.IsEmpty() && value.Length() && !myOptions.IsBound( name ) ) myOptions.Bind( name, value ); @@ -753,7 +895,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element else if ( anUnitData.myUnits.ToCString()[0] ) // treat '%' as unit with scale 100 anUnitData.myScale = 0.01; } - catch( Standard_Failure ) { + catch( Standard_Failure ) { anUnitData.myUnits.Clear(); } @@ -814,7 +956,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element } /*! - Returns default formats for each unit systems + \brief Restore default formats for all the units systems. */ void DDS_DicItem::GetDefaultFormat() { @@ -839,7 +981,12 @@ void DDS_DicItem::GetDefaultFormat() } /*! - Returns format for the string + \brief Get format for the string. + \param theFlags format flags + \param theWidth field width + \param thePrecision precision + \param theTypePrefix type prefix + \param theFormat returning format string */ void DDS_DicItem::GetStringFormat( const TCollection_AsciiString& theFlags, const TCollection_AsciiString& theWidth, @@ -862,7 +1009,13 @@ void DDS_DicItem::GetStringFormat( const TCollection_AsciiString& theFlags, } /*! - Returns format for the integer + \brief Get format for the integer. + \param theFlags format flags + \param theWidth field width + \param thePrecision precision + \param theTypePrefix type prefix + \param theType integer value type + \param theFormat returning format string */ void DDS_DicItem::GetIntegerFormat( const TCollection_AsciiString& theFlags, const TCollection_AsciiString& theWidth, @@ -900,7 +1053,13 @@ void DDS_DicItem::GetIntegerFormat( const TCollection_AsciiString& theFlags, } /*! - Returns format for the float + \brief Returns format for the float. + \param theFlags format flags + \param theWidth field width + \param thePrecision precision + \param theTypePrefix type prefix + \param theType floating point value type + \param theFormat returning format string */ void DDS_DicItem::GetFloatFormat( const TCollection_AsciiString& theFlags, const TCollection_AsciiString& theWidth, @@ -946,9 +1105,10 @@ void DDS_DicItem::GetFloatFormat( const TCollection_AsciiString& theFlags, } /*! - Prepares formats for each unit systems + \brief Prepare formats for all units systems. + \param theFormat format string */ -void DDS_DicItem::PrepareFormats( const TCollection_AsciiString& theFormat ) +void DDS_DicItem::PrepareFormats( const TCollection_AsciiString& theFormat ) { for ( NCollection_DataMap::Iterator it( myUnitData ); it.More(); it.Next() ) { @@ -1069,7 +1229,9 @@ void DDS_DicItem::PrepareFormats( const TCollection_AsciiString& theFormat ) } /*! - Split the string \atheStr by spaces and returns substrings in array \aaRes. + \brief Split the string \a theStr separated by spaces. + \param theStr source string + \param aRes returning substrings array */ void DDS_DicItem::Split( const TCollection_AsciiString& theStr, Handle(TColStd_HArray1OfExtendedString)& aRes ) { @@ -1103,7 +1265,9 @@ void DDS_DicItem::Split( const TCollection_AsciiString& theStr, Handle(TColStd_H } /*! - Returns unit structure for given unit system \asys. + \brief Get units structure for specified units system \a sys. + \param sys units system + \return units system information structure */ DDS_DicItem::UnitData* DDS_DicItem::GetUnitData( const UnitSystem& sys ) const { @@ -1116,7 +1280,8 @@ DDS_DicItem::UnitData* DDS_DicItem::GetUnitData( const UnitSystem& sys ) const } /*! - Gets the active unit system. + \brief Get the active units system. + \return active units system */ DDS_DicItem::UnitSystem DDS_DicItem::GetActiveUnitSystem() const { @@ -1126,3 +1291,188 @@ DDS_DicItem::UnitSystem DDS_DicItem::GetActiveUnitSystem() const aSystem = aComponent->GetActiveUnitSystem(); return aSystem; } + +/*! + \brief Set item's identify string. + \param theId identify string. +*/ +void DDS_DicItem::SetId( const TCollection_AsciiString& theId ) +{ + myId = theId; +} + +/*! + \brief Set item's component pointer. + \param theComponent component pointer. +*/ +void DDS_DicItem::SetComponent( const Handle(Standard_Transient)& theComponent ) +{ + myComponent = theComponent; +} + +/*! + \brief Set item's label string. + \param theLabel label string. +*/ +void DDS_DicItem::SetLabel( const TCollection_AsciiString& theLabel ) +{ + myLabel = theLabel; +} + +/*! + \brief Set item's filter string. + \param theFilter filter string. +*/ +void DDS_DicItem::SetFilter( const TCollection_AsciiString& theFilter ) +{ + myFilter = theFilter; +} + +/*! + \brief Set item's required value. + \param theRequired required value string. +*/ +void DDS_DicItem::SetRequired( const TCollection_AsciiString& theRequired ) +{ + myRequired = theRequired; +} + +/*! + \brief Set item's warning level value. + \param theWarningLevel warning level value. +*/ +void DDS_DicItem::SetWarningLevel( const Standard_Integer& theWarningLevel ) +{ + myWarnLevel = theWarningLevel; +} + +/*! + \brief Set item's minimum zoom value. + \param theMinZoom minimum zoom value. +*/ +void DDS_DicItem::SetMinZoom( const Standard_Real& theMinZoom ) +{ + myMinZoom = theMinZoom; +} + +/*! + \brief Set item's maximum zoom value. + \param theMaxZoom maximum zoom value. +*/ +void DDS_DicItem::SetMaxZoom( const Standard_Real& theMaxZoom ) +{ + myMaxZoom = theMaxZoom; +} + +/*! + \brief Set item's zoom order value. + \param theZoomOrder zoom order value. +*/ +void DDS_DicItem::SetZoomOrder( const Standard_Real& theZoomOrder ) +{ + myZoomOrder = theZoomOrder; +} + +/*! + \brief Set item's short description. + \param theShortDescr short description string. +*/ +void DDS_DicItem::SetShortDescription( const TCollection_ExtendedString& theShortDescr ) +{ + myShortDescr = theShortDescr; +} + +/*! + \brief Set item's long description. + \param theLongDescr long description string. +*/ +void DDS_DicItem::SetLongDescription( const TCollection_ExtendedString& theLongDescr ) +{ + myLongDescr = theLongDescr; +} + +/*! + \brief Add item's option. + \param theOptionName option name string. + \param theOptionValue option value string. +*/ +bool DDS_DicItem::SetOption( const TCollection_AsciiString& theOptionName, + const TCollection_AsciiString& theOptionValue ) +{ + return myOptions.Bind( theOptionName, theOptionValue ); +} + +/*! + \brief Set item's type value. + \param theType item value type. +*/ +void DDS_DicItem::SetType( const DDS_DicItem::Type& theType ) +{ + myType = theType; +} + +/*! + \brief Set item's minimum value. + \param theMinVal minimum possible value. +*/ +void DDS_DicItem::SetMin( const Standard_Real& theMinVal ) +{ + myData |= MinValue; + myMin = theMinVal; +} + +/*! + \brief Set item's maximum value. + \param theMaxVal maximum possible value. +*/ +void DDS_DicItem::SetMax( const Standard_Real& theMaxVal ) +{ + myData |= MaxValue; + myMax = theMaxVal; +} + +/*! + \brief Set item's default value as a real number. + \param theDefVal default value. +*/ +void DDS_DicItem::SetDefaultValue( const Standard_Real& theDefVal ) +{ + myData |= DefaultValue; + myDefValue = theDefVal; +} + +/*! + \brief Set item's default value as a string. + \param theDefStr default value. +*/ +void DDS_DicItem::SetDefaultValue( const TCollection_AsciiString& theDefStr ) +{ + myDefString = theDefStr; +} + +/*! + \brief Set item's value list. + \param theStrings list of value strings. + \param theIntegers list of integer values associated with string item. +*/ +void DDS_DicItem::SetListOfValues( const Handle(TColStd_HArray1OfExtendedString)& theStrings, + const Handle(TColStd_HArray1OfInteger)& theIntegers ) +{ + myListRef = theStrings; + myListRefID = theIntegers; +} + +/*! + \brief Set item's value list and icons. + \param theStrings list of value strings. + \param theIntegers list of integer values associated with string item. + \param theIcons list of icons associated with string item. +*/ +void DDS_DicItem::SetListOfValues( const Handle(TColStd_HArray1OfExtendedString)& theStrings, + const Handle(TColStd_HArray1OfInteger)& theIntegers, + const Handle(TColStd_HArray1OfExtendedString)& theIcons ) +{ + myListRef = theStrings; + myListRefID = theIntegers; + myListRefIcons = theIcons; +}