From 12f6dc28cce12f299ac6e3eb322ff783cfb999ca Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 25 May 2007 09:47:27 +0000 Subject: [PATCH] Porting to Qt 4 --- src/DDS/DDS.pro | 4 +- src/DDS/DDS_DicGroup.cxx | 51 ++++--- src/DDS/DDS_DicGroup.h | 30 ++-- src/DDS/DDS_DicItem.cxx | 285 ++++++++++++++++++++++++++--------- src/DDS/DDS_DicItem.h | 153 +++++++++---------- src/DDS/DDS_Dictionary.cxx | 295 +++++++++++++++++++++++-------------- src/DDS/DDS_Dictionary.h | 54 ++++--- src/DDS/DDS_KeyWords.cxx | 119 ++++++++------- src/DDS/DDS_KeyWords.h | 12 +- src/DDS/Makefile.am | 16 +- 10 files changed, 628 insertions(+), 391 deletions(-) diff --git a/src/DDS/DDS.pro b/src/DDS/DDS.pro index f4d677c45..adb04a714 100644 --- a/src/DDS/DDS.pro +++ b/src/DDS/DDS.pro @@ -18,9 +18,9 @@ CONFIG -= debug release debug_and_release CONFIG += qt thread debug dll shared win32:DEFINES += WIN32 -DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=1 OCC_VERSION_MAINTENANCE=1 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS +DEFINES += OCC_VERSION_MAJOR=6 OCC_VERSION_MINOR=2 OCC_VERSION_MAINTENANCE=0 LIN LINTEL CSFDB No_exception HAVE_CONFIG_H HAVE_LIMITS_H HAVE_WOK_CONFIG_H OCC_CONVERT_SIGNALS -HEADERS = DDS.h +HEADERS = DDS.h HEADERS += DDS_DicGroup.h HEADERS += DDS_DicItem.h HEADERS += DDS_Dictionary.h diff --git a/src/DDS/DDS_DicGroup.cxx b/src/DDS/DDS_DicGroup.cxx index 56197a523..3bb337ad3 100644 --- a/src/DDS/DDS_DicGroup.cxx +++ b/src/DDS/DDS_DicGroup.cxx @@ -35,29 +35,33 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_DicGroup, MMgt_TShared) /*! \class DDS_DicGroup - - This class to provide set of DDS_DicItem objects from one component. + \brief This class provides a set of DDS_DicItem objects from one component. */ /*! - Constructor. Create the group with name \aname. + \brief Constructor. + + Create the group with name \a name. + + \param name group name */ DDS_DicGroup::DDS_DicGroup( const TCollection_AsciiString& name ) : MMgt_TShared(), -myName( name ), -myActiveSystem( UNIT_SYSTEM_SI ) + myName( name ), + myActiveSystem( UNIT_SYSTEM_SI ) { } /*! - Copy constructor. + \brief Copy constructor (put in private section to prevent object copying). */ DDS_DicGroup::DDS_DicGroup( const DDS_DicGroup& ) { } /*! - Get the name of group (component). + \brief Get the name of group (component). + \return group name */ TCollection_AsciiString DDS_DicGroup::GetName() const { @@ -65,8 +69,8 @@ TCollection_AsciiString DDS_DicGroup::GetName() const } /*! - Returns the names list of defined unit systems. - Parameter \atheSystems will contains the sequence of string names. + \brief Get the names of all defined units systems. + \param theSystemsSeq returning sequence of names */ void DDS_DicGroup::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystemSeq ) const { @@ -81,7 +85,12 @@ void DDS_DicGroup::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystemSeq ) } /*! - Returns the label of unit system \aname. If unit system not found then empty string returned. + \brief Get the label of units system \a name. + + If units system is not found, empty string is returned. + + \param make units system name + \return units system label */ TCollection_ExtendedString DDS_DicGroup::GetUnitSystemLabel( const TCollection_AsciiString& name ) const { @@ -92,7 +101,8 @@ TCollection_ExtendedString DDS_DicGroup::GetUnitSystemLabel( const TCollection_A } /*! - Gets the name of active unit system. + \brief Get the name of active units system. + \return active units system name */ TCollection_AsciiString DDS_DicGroup::GetActiveUnitSystem() const { @@ -100,7 +110,8 @@ TCollection_AsciiString DDS_DicGroup::GetActiveUnitSystem() const } /*! - Sets the name of active unit system. + \brief Set the active unit system. + \param theSystem name of the units system to be made active */ void DDS_DicGroup::SetActiveUnitSystem( const TCollection_AsciiString& theSystem ) { @@ -109,14 +120,16 @@ void DDS_DicGroup::SetActiveUnitSystem( const TCollection_AsciiString& theSystem } /*! - Assignment operator. + \brief Assignment operator (put in private section to prevent object copying). */ void DDS_DicGroup::operator=( const DDS_DicGroup& ) { } /*! - Fill the internal data structures from XML parsed structures. Internal. + \brief Fill the internal data structures from XML parsed structures. + \param theComponentData component data DOM node + \param theDocElement document element DOM node */ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM_Element& theDocElement ) { @@ -174,10 +187,14 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM } /*! - Gets dictionary item with specified identifier \atheID. - If dictionary item not found then null handle returned. + \brief Get the dictionary item with specified identifier \a theID. + + If dictionary item is not found, null handle is returned. + + \param theID item identifier + \return dictionary item */ -Handle(DDS_DicItem) DDS_DicGroup::GetDicItem( const TCollection_AsciiString& theID ) const +Handle_DDS_DicItem DDS_DicGroup::GetDicItem( const TCollection_AsciiString& theID ) const { Handle(DDS_DicItem) aDicItem; // get dictionary item by id diff --git a/src/DDS/DDS_DicGroup.h b/src/DDS/DDS_DicGroup.h index a804776ea..9fc525b77 100644 --- a/src/DDS/DDS_DicGroup.h +++ b/src/DDS/DDS_DicGroup.h @@ -32,39 +32,37 @@ class LDOM_Element; class TColStd_SequenceOfAsciiString; -DEFINE_STANDARD_HANDLE(DDS_DicGroup, MMgt_TShared) - -class DDS_DicGroup : public MMgt_TShared +class Standard_EXPORT DDS_DicGroup : public MMgt_TShared { public: DDS_DicGroup( const TCollection_AsciiString& ); - TCollection_AsciiString GetName() const; + TCollection_AsciiString GetName() const; - Standard_EXPORT Handle(DDS_DicItem) GetDicItem( const TCollection_AsciiString& ) const; + Handle_DDS_DicItem GetDicItem( const TCollection_AsciiString& ) const; - Standard_EXPORT void GetUnitSystems( TColStd_SequenceOfAsciiString& ) const; - Standard_EXPORT TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString& ) const; + void GetUnitSystems( TColStd_SequenceOfAsciiString& ) const; + TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString& ) const; - Standard_EXPORT TCollection_AsciiString GetActiveUnitSystem() const; - Standard_EXPORT void SetActiveUnitSystem( const TCollection_AsciiString& ); + TCollection_AsciiString GetActiveUnitSystem() const; + void SetActiveUnitSystem( const TCollection_AsciiString& ); private: DDS_DicGroup( const DDS_DicGroup& ); - void operator=( const DDS_DicGroup& ); + void operator=( const DDS_DicGroup& ); - void FillDataMap( const LDOM_Element&, const LDOM_Element& ); + void FillDataMap( const LDOM_Element&, const LDOM_Element& ); private: typedef NCollection_DataMap UnitSystemMap; private: - TCollection_AsciiString myName; - DDS_IndexedDataMapOfDicItems myDataMap; - UnitSystemMap myUnitSystem; - TCollection_AsciiString myActiveSystem; + TCollection_AsciiString myName; + DDS_IndexedDataMapOfDicItems myDataMap; + UnitSystemMap myUnitSystem; + TCollection_AsciiString myActiveSystem; friend class DDS_Dictionary; @@ -72,6 +70,8 @@ public: DEFINE_STANDARD_RTTI(DDS_DicGroup) }; +DEFINE_STANDARD_HANDLE(DDS_DicGroup, MMgt_TShared) + DEFINE_BASECOLLECTION(DDS_BaseCollectionOfDicGroups, Handle(DDS_DicGroup)) DEFINE_INDEXEDDATAMAP(DDS_IndexedDataMapOfDicGroups, DDS_BaseCollectionOfDicGroups, TCollection_AsciiString, Handle(DDS_DicGroup)) diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index 48ce715a9..12a942705 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -37,40 +37,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 +80,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 +89,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 +98,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 +107,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 +116,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 +125,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 +134,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 +143,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 +156,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 +165,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 +182,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 +194,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 +208,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 +220,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 +234,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 +244,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 +262,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 +276,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 +310,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 +324,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 +362,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 +377,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 +398,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 +425,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 +449,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 +458,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 +467,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 +476,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 +487,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 +498,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 +514,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 +530,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 +540,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 +556,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 +572,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, @@ -814,7 +932,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 +957,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 +985,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 +1029,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 +1081,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 +1205,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 +1241,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 +1256,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 { diff --git a/src/DDS/DDS_DicItem.h b/src/DDS/DDS_DicItem.h index b32639900..f6c7dcc87 100644 --- a/src/DDS/DDS_DicItem.h +++ b/src/DDS/DDS_DicItem.h @@ -38,16 +38,10 @@ class TColStd_SequenceOfInteger; class TColStd_SequenceOfAsciiString; class TColStd_SequenceOfExtendedString; -// Class, containing all information about one parameter: -// unique : id -// obligative: label, type, short description, required -// optional : format, units, -// min value, max value, default value. - -class DDS_DicItem : public MMgt_TShared +class Standard_EXPORT DDS_DicItem : public MMgt_TShared { public: - /*! Enum describes type of datum value */ + //! Enum describes type of datum value enum Type { String, //!< String type of value @@ -57,7 +51,7 @@ public: Unknown //!< Unknown or undefined type of value }; - /*! Enum describes the flags for existance of domain data */ + //! Enum describes the flags for existance of domain data enum Data { MinValue = 0x01, //!< Flag of minimum value definition existence @@ -65,7 +59,7 @@ public: DefaultValue = 0x04 //!< Flag of default value definition existence }; - // This struct is intended for map of Format, Units, Precision and Scale + //! This struct is intended for map of Format, Units, Precision and Scale struct UnitData { Standard_Real myZero; @@ -80,88 +74,88 @@ public: public: DDS_DicItem(); - Standard_EXPORT TCollection_AsciiString GetId() const; - Standard_EXPORT DDS_DicItem::Type GetType() const; - Standard_EXPORT TCollection_ExtendedString GetLabel() const; - Standard_EXPORT TCollection_ExtendedString GetFilter() const; - Standard_EXPORT TCollection_ExtendedString GetRequired() const; - Standard_EXPORT DDS_MsgType GetWarningLevel() const; - Standard_EXPORT TCollection_ExtendedString GetLongDescription() const; - Standard_EXPORT TCollection_ExtendedString GetShortDescription() const; - Standard_EXPORT TCollection_AsciiString GetComponent() const; + TCollection_AsciiString GetId() const; + DDS_DicItem::Type GetType() const; + TCollection_ExtendedString GetLabel() const; + TCollection_ExtendedString GetFilter() const; + TCollection_ExtendedString GetRequired() const; + DDS_MsgType GetWarningLevel() const; + TCollection_ExtendedString GetLongDescription() const; + TCollection_ExtendedString GetShortDescription() const; + TCollection_AsciiString GetComponent() const; - Standard_EXPORT TCollection_AsciiString GetUnits() const; - Standard_EXPORT TCollection_AsciiString GetUnits( const UnitSystem& ) const; + TCollection_AsciiString GetUnits() const; + TCollection_AsciiString GetUnits( const UnitSystem& ) const; - Standard_EXPORT TCollection_ExtendedString GetDefaultValue() const; - Standard_EXPORT TCollection_ExtendedString GetDefaultValue( const UnitSystem& ) const; + TCollection_ExtendedString GetDefaultValue() const; + TCollection_ExtendedString GetDefaultValue( const UnitSystem& ) const; - Standard_EXPORT Standard_Real GetMinValue() const; - Standard_EXPORT Standard_Real GetMinValue( const UnitSystem& ) const; + Standard_Real GetMinValue() const; + Standard_Real GetMinValue( const UnitSystem& ) const; - Standard_EXPORT Standard_Real GetMaxValue() const; - Standard_EXPORT Standard_Real GetMaxValue( const UnitSystem& ) const; + Standard_Real GetMaxValue() const; + Standard_Real GetMaxValue( const UnitSystem& ) const; - Standard_EXPORT Standard_Integer GetPrecision() const; - Standard_EXPORT Standard_Integer GetPrecision( const UnitSystem& ) const; + Standard_Integer GetPrecision() const; + Standard_Integer GetPrecision( const UnitSystem& ) const; - Standard_EXPORT TCollection_AsciiString GetFormat( const Standard_Boolean = Standard_True ) const; - Standard_EXPORT TCollection_AsciiString GetFormat( const UnitSystem&, - const Standard_Boolean = Standard_True ) const; - Standard_EXPORT TCollection_ExtendedString GetNameOfValues() const; - Standard_EXPORT Standard_Boolean GetListOfValues( Handle(TColStd_HArray1OfExtendedString)&, - Handle(TColStd_HArray1OfInteger)& ) const; - Standard_EXPORT Standard_Boolean GetListOfValues( Handle(TColStd_HArray1OfExtendedString)&, - Handle(TColStd_HArray1OfInteger)&, - Handle(TColStd_HArray1OfExtendedString)& ) const; - Standard_EXPORT Standard_Boolean GetSpecialValues( TColStd_MapOfReal& ) const; + TCollection_AsciiString GetFormat( const Standard_Boolean = Standard_True ) const; + TCollection_AsciiString GetFormat( const UnitSystem&, + const Standard_Boolean = Standard_True ) const; + TCollection_ExtendedString GetNameOfValues() const; + Standard_Boolean GetListOfValues( Handle(TColStd_HArray1OfExtendedString)&, + Handle(TColStd_HArray1OfInteger)& ) const; + Standard_Boolean GetListOfValues( Handle(TColStd_HArray1OfExtendedString)&, + Handle(TColStd_HArray1OfInteger)&, + Handle(TColStd_HArray1OfExtendedString)& ) const; + Standard_Boolean GetSpecialValues( TColStd_MapOfReal& ) const; - Standard_EXPORT Standard_Real GetMinZoom() const; - Standard_EXPORT Standard_Real GetMaxZoom() const; - Standard_EXPORT Standard_Real GetZoomOrder() const; + Standard_Real GetMinZoom() const; + Standard_Real GetMaxZoom() const; + Standard_Real GetZoomOrder() const; - Standard_EXPORT Standard_Real ToSI( const Standard_Real ) const; - Standard_EXPORT Standard_Real FromSI( const Standard_Real ) const; + Standard_Real ToSI( const Standard_Real ) const; + Standard_Real FromSI( const Standard_Real ) const; - Standard_EXPORT Standard_Real ToSI( const Standard_Real, const UnitSystem& ) const; - Standard_EXPORT Standard_Real FromSI( const Standard_Real, const UnitSystem& ) const; + Standard_Real ToSI( const Standard_Real, const UnitSystem& ) const; + Standard_Real FromSI( const Standard_Real, const UnitSystem& ) const; - Standard_EXPORT Standard_Boolean HasData( const Standard_Integer ) const; + Standard_Boolean HasData( const Standard_Integer ) const; - Standard_EXPORT TCollection_ExtendedString GetOption( const TCollection_AsciiString& ) const; - Standard_EXPORT Standard_Boolean GetOptionNames( TColStd_SequenceOfAsciiString& ) const; + TCollection_ExtendedString GetOption( const TCollection_AsciiString& ) const; + Standard_Boolean GetOptionNames( TColStd_SequenceOfAsciiString& ) const; private: DDS_DicItem( const DDS_DicItem& ); - void operator=( const DDS_DicItem& ); - void FillDataMap( TCollection_AsciiString, const LDOM_Element&, - const LDOM_Element&, const LDOM_Element&, - const TColStd_SequenceOfAsciiString& ); - void PrepareFormats( const TCollection_AsciiString& ); - void GetDefaultFormat(); - UnitSystem GetActiveUnitSystem() const; - - void GetStringFormat( const TCollection_AsciiString&, - const TCollection_AsciiString&, - const TCollection_AsciiString&, - const TCollection_AsciiString&, - TCollection_AsciiString& ); - void GetIntegerFormat( const TCollection_AsciiString&, - const TCollection_AsciiString&, - const TCollection_AsciiString&, - const TCollection_AsciiString&, - const Standard_Character, - TCollection_AsciiString& ); - void GetFloatFormat( const TCollection_AsciiString&, - const TCollection_AsciiString&, - const TCollection_AsciiString&, - const TCollection_AsciiString&, - const Standard_Character, - TCollection_AsciiString& ); - void Split( const TCollection_AsciiString&, - Handle(TColStd_HArray1OfExtendedString)& ); - - UnitData* GetUnitData( const UnitSystem& ) const; + void operator=( const DDS_DicItem& ); + void FillDataMap( TCollection_AsciiString, const LDOM_Element&, + const LDOM_Element&, const LDOM_Element&, + const TColStd_SequenceOfAsciiString& ); + void PrepareFormats( const TCollection_AsciiString& ); + void GetDefaultFormat(); + UnitSystem GetActiveUnitSystem() const; + + void GetStringFormat( const TCollection_AsciiString&, + const TCollection_AsciiString&, + const TCollection_AsciiString&, + const TCollection_AsciiString&, + TCollection_AsciiString& ); + void GetIntegerFormat( const TCollection_AsciiString&, + const TCollection_AsciiString&, + const TCollection_AsciiString&, + const TCollection_AsciiString&, + const Standard_Character, + TCollection_AsciiString& ); + void GetFloatFormat( const TCollection_AsciiString&, + const TCollection_AsciiString&, + const TCollection_AsciiString&, + const TCollection_AsciiString&, + const Standard_Character, + TCollection_AsciiString& ); + void Split( const TCollection_AsciiString&, + Handle(TColStd_HArray1OfExtendedString)& ); + + UnitData* GetUnitData( const UnitSystem& ) const; private: typedef NCollection_DataMap OptionsMap; @@ -185,14 +179,12 @@ private: Standard_Integer myData; - // valueList TCollection_ExtendedString myListName; Handle(TColStd_HArray1OfExtendedString) myListRef; Handle(TColStd_HArray1OfInteger) myListRefID; Handle(TColStd_HArray1OfExtendedString) myListRefIcons; - // presentation Standard_Real myMinZoom; Standard_Real myMaxZoom; Standard_Real myZoomOrder; @@ -200,7 +192,6 @@ private: Handle(Standard_Transient) myComponent; OptionsMap myOptions; - // unitData NCollection_DataMap myUnitData; friend class DDS_DicGroup; diff --git a/src/DDS/DDS_Dictionary.cxx b/src/DDS/DDS_Dictionary.cxx index dd741872f..25e6cdcb8 100644 --- a/src/DDS/DDS_Dictionary.cxx +++ b/src/DDS/DDS_Dictionary.cxx @@ -39,14 +39,16 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared) /*! \class DDS_Dictionary - - This class to provide information about used datums, reading them from 'xml' file + \brief This class provides an information about used datums, + reading them from XML file. - Datum is the set of parameters described a phisical characteristic. These parameters loaded from - special XML which has following format: + There is the only instance of the class DDS_Dictionary in the application + which can be retrieved by method Get(). - \hr + Datum is a set of parameters describing a phisical characteristic. + These parameters are loaded from the XML file which has the following format: + \verbatim @@ -89,70 +91,87 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared) - \hr - - In description of datum file format used internal keys as XML tag and attributes names. - Concrete XML keywords defined by DDS_KeyWords class. - - Describe datum file format more detailed. XML file should have one main tag named as "dictionary" (key "D_URI"). - This tag should contains one or several components. Component is a independent set of datums and unit systems. - Components defined as XML tag named "component" (key "COMPONENT") with attribute "name" (key COMPONENT_NAME). - Component name used as component identifier and should be unique. Component tag can contains: - - \li Tag "unit_systems" (key UNIT_SYSTEMS) defines set of used unit systems. Should exist at least one unit - system named SI ("System International"). If this system not exist then it will be defined automatically. - Each unit system defined by XML tag "unit system" (key UNIT_SYSTEM) under tag "unit_systems" with attributes - "name" (key UNIT_SYSTEM_NAME) and "label" (key UNIT_SYSTEM_LABEL). Name is identifier of unit system. Label is - human readable description. - - \li One or several tag "datum" (key DATUM). For this tag can be defined following attributes: - - \lo Identifier (key DATUM_ID) specify the unique id string for the datum. - \lo Label (key DATUM_LABEL) specify human readable name of the datum. - \lo Units of measure (key DATUM_UNITS) for given unit system. Attribute name consist of a name - of unit system and a keyword got from DDS_KeyWords by key DATUM_UNITS. For example for unit system - named SI and default keyword attribute name will be "SIunits". This attribute should be specified - for each deaclared unit system. Value of this attribute should be string describs units of measure. - Possible designations for units of measure and their multiple prefixes see in package UnitsAPI of - library OpenCascade (files Units.dat and Lexi_Expr.dat). Units of measure will be used for numeric - value conversion from one unit system to another one. - \lo Format (key DATUM_FORMAT) specify the format string which will be used during initial formatting - of value. This string should be specified in sprintf() format. - \lo Filter (key DATUM_FILTER) specify the regualr expression. Each user entered string will be checked up - on matching to this expression (if it defined). Non matched strings will be rejected. - \lo Required value (key DATUM_REQUIRED). If this attributed defined and value is true then user can't - leave a input filed blank (parameter must be always entered). - - Tag "description" (key DESCR) can be defined under the tag "datum". This tag contains two sub tags: - \lo "short description" (key SHORT_D) specify a brief datum description text - \lo "long description" (key LONG_D) specify a detailed description text - - Tag "options" (key OPTIONS) can be defined under the tag "datum". This tag contains one or more sub - tags "option" (key OPTION). Each of these XML elements should contain text option value and attribute - "name" (key OPTION_NAME) which specified option name. - - Each tag "datum" define most common parameters of phisical characteristic. - This parameters placed in two groups: - \lo Domain parameters under tag "domain" (key DY_DOMAIN). This tag can contains value description tag - (key VALUE_DESCR) for discrete data or list reference tag (key VALUE_LIST_REF) for enumerable data. - Discrete data described following parameters: - default value (key VD_DEFV) - maximum value (key VD_MAXV) - minimum value (key VD_MINV) - type of value (key VD_TYPE) - possible values: String, Integer, Float, List - Enumerable data described by "list reference" attribute (key VLR_LIST) which reference on - list (see "list definition" tag) by list id. - - \li One or several tag "list definition" (key VALUE_LIST). This tag define the list of items for enumerable - data. Attribute "list id" (key VALUE_LIST_ID) specify the identifier string for the list and attribute - "list name" (key VALUE_LIST_NAME) define a list name string. Each list item described by tag "list value" - (key VALUE_LIST_VALUE) under tag "list definition". Each this tag contains item string text and have - following attributes: - \lo "list item id" (key VALUE_LIST_VALUEID) - integer numerical identifier for item - \lo "list item icon" (key VALUE_LIST_VALUEICON) - icon file name for item - - Below the example of a XML file with use default keywords. + \endverbatim + + In above description of the datum XML file format internal keys are used as XML tags + and attributes names. Real XML keywords are defined by DDS_KeyWords class. + XML file should have one main tag named "dictionary" (key "D_URI"). This tag + should contain one or several components. + Component is an independent set of datums and units systems. + Components are defined by XML tag named "component" (key "COMPONENT") with + attribute "name" (key COMPONENT_NAME). + Component name is used as component identifier and should be unique. + + Component tag can contain: + + - Tag "unit_systems" (key UNIT_SYSTEMS) defines a set of used units systems. + At least one unit system named SI ("System International") should exist. + If this system does not exist, it will be created automatically. + Each units system is defined by XML tag "unit system" (key UNIT_SYSTEM) under + the tag "unit_systems" with attributes "name" (key UNIT_SYSTEM_NAME) + and "label" (key UNIT_SYSTEM_LABEL). Name is an identifier of the units system and + label is its human readable description. + + - One or several tags "datum" (key DATUM). For this tag the following attributes + can be defined: + -# Identifier (key DATUM_ID) specifies the unique id string for the datum. + -# Label (key DATUM_LABEL) specifies human readable name of the datum. + -# Measure units (key DATUM_UNITS) for the given units system. Attribute name + defines a name of units system and a keyword got from DDS_KeyWords by key DATUM_UNITS. + For example, for "SI" units system and default keyword the attribute name is "SIunits". + This attribute should be specified for each declared units system. + Value of this attribute should be a string describing measure units. + For possible designations for measure units and their multiple prefixes + please refer to the UnitsAPI package of the OpenCascade library + (files Units.dat and Lexi_Expr.dat). Measure units are used for numerical + values conversion from one units system to another one. + -# Format (key DATUM_FORMAT) specifies the format string which will be used + during initial formatting of the value. This string should be specified + in sprintf() format. + -# Filter (key DATUM_FILTER) specifies the regualr expression. The value (string) + entered by the user will be checked up to match to this regular expression + (if it defined). Non matched strings will be rejected. + -# Required value (key DATUM_REQUIRED). If this attributed si defined and its value + is \c true then user can't leave an input non-filled - parameter must be explicitly + entered by the user). + + - One or several tags "list definition" (key VALUE_LIST). Each such tag defines + the list of items for enumerable data. Attribute "list id" (key VALUE_LIST_ID) + specifies the identifier string for the list and attribute "list name" + (key VALUE_LIST_NAME) defines a list name string. Each list item is described + by tag "list value" (key VALUE_LIST_VALUE) under the tag "list definition". + Each this tag contains item string text and have the following attributes: + -# "list item id" (key VALUE_LIST_VALUEID) - integer numerical identifier for + the item + -# "list item icon" (key VALUE_LIST_VALUEICON) - icon file name for the item + + Tag "datum" can have child subtags "description" and "options". + + - Tag "description" (key DESCR) contains two sub tags: + -# "short description" (key SHORT_D) specifies a brief datum description text + -# "long description" (key LONG_D) specifies a detailed description text + + - Tag "options" (key OPTIONS) contains one or more sub tags "option" (key OPTION). + Each of these XML elements should contain text option value and attribute + "name" (key OPTION_NAME) which specifies option name. + + Each tag "datum" defines most common parameters of phisical characteristic. + These parameters are placed in two groups: + -# Domain parameters under the tag "domain" (key DY_DOMAIN). This tag can + contain value description tag (key VALUE_DESCR) for descrete data which is + described by following parameters: + - default value (key VD_DEFV) + - maximum value (key VD_MAXV) + - minimum value (key VD_MINV) + - type of value (key VD_TYPE), possible values are String, Integer, Float, List + -# list reference tag (key VALUE_LIST_REF) for enumerable data described by + "list reference" attribute (key VLR_LIST) which references to the list + (see "list definition" tag) by list id. + + Below is an example of the XML file using default keywords. + + \verbatim @@ -225,12 +244,14 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_Dictionary, MMgt_TShared) - - + \endverbatim */ /*! - Constructor. Creates the instance of dictionary. Private method. Use DDS_Dictionary::Get() instead. + \brief Constructor. + + Create an instance of the dictionary. Can not be used directly. + Use Get() method instead. */ DDS_Dictionary::DDS_Dictionary() : MMgt_TShared() @@ -238,22 +259,22 @@ DDS_Dictionary::DDS_Dictionary() } /*! - Copy constructor. Internal. + \brief Copy constructor (put in private section to prevent object copying). */ DDS_Dictionary::DDS_Dictionary( const DDS_Dictionary& ) { } /*! - Assigment operator. Internal. + \brief Assignment operator (put in private section to prevent object copying). */ void DDS_Dictionary::operator=( const DDS_Dictionary& ) { } /*! - Returns the names list of defined unit systems from all components. - Parameter \atheSystems will contains the sequence of string names. + \brief Get the names of defined units systems from all components. + \param theSystems returning sequence of units systems names. */ void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems ) const { @@ -277,9 +298,13 @@ void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems ) } /*! - Returns the names list of defined unit systems from the specified component \atheComponent. - Parameter \atheSystems will contains the sequence of string names. If component not found then - empty list returned. + \brief Get the names of defined units systems from the specified component + \a theComponent. + + If component is not found, empty list is returned. + + \param theSystems returning sequence of units systems names. + \param theComponent component name */ void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems, const TCollection_AsciiString& theComponent ) const @@ -290,8 +315,13 @@ void DDS_Dictionary::GetUnitSystems( TColStd_SequenceOfAsciiString& theSystems, } /*! - Returns the label of unit system \atheSystem. Function find the given unit system in - all components. If unit system not found in any component then empty string returned. + \brief Get the label of the units system \a theSystem. + + Searches the given units system in all components. If units system is not found + in any component, empty string is returned. + + \param theSystem units system + \return units system label */ TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection_AsciiString& theSystem ) const { @@ -302,9 +332,15 @@ TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection } /*! - Returns the label of unit system \atheSystem from component \atheComponent. Function find - the given unit system in the specified component only. If unit system not found in the - component then empty string returned. + \brief Get the label of the units system \a theSystem from the + component \a theComponent. + + Searches the specified units system in the specified component only. + If units system is not found, empty string is returned. + + \param theSystem units system + \param theComponent component name + \return units system label */ TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection_AsciiString& theSystem, const TCollection_AsciiString& theComponent ) const @@ -316,8 +352,12 @@ TCollection_ExtendedString DDS_Dictionary::GetUnitSystemLabel( const TCollection } /*! - Gets the name of active unit system from first got component. If any component exist then - active unit system name returned or empty string otherwise. + \brief Get the name of active units system from the first found component. + + If at least one component exists, then its active units system name + is returned. Otherwise, empty string is returned. + + \return active units system name */ TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem() const { @@ -328,8 +368,13 @@ TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem() const } /*! - Gets the name of active unit system from component \atheComponent. If this component exist - active unit system name returned or empty string otherwise. + \brief Get the name of active units system from the component \a theComponent. + + If this component exists, its active units system name is returned. + Otherwise, empty string is returned. + + \param theComponent component name + \return active units system name */ TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem( const TCollection_AsciiString& theComponent ) const { @@ -340,8 +385,12 @@ TCollection_AsciiString DDS_Dictionary::GetActiveUnitSystem( const TCollection_A } /*! - Sets the active unit system named \atheSystem. This unit system will be activated in all - existing components if component have it. + \brief Set the active units system. + + This units system will be activated in each existing component, + if it component has this units system. + + \param theSystem units system to be made active */ void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSystem ) { @@ -350,8 +399,12 @@ void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSyst } /*! - Sets the active unit system named \atheSystem for component \atheComponent. If specified unit - system doesn't exist in the component then function do nothing. + \brief Set the active units system for the component \a theComponent. + + If specified units system doesn't exist in the component, nothing happens. + + \param theSystem units system to be made active + \param theComponent component name */ void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSystem, const TCollection_AsciiString& theComponent ) @@ -361,9 +414,10 @@ void DDS_Dictionary::SetActiveUnitSystem( const TCollection_AsciiString& theSyst } /*! - Returns the instance of dictionary. Create instance if it is NULL. + \brief Get the only instance of the data dictionary. + \return the only instance of the data dictionary */ -Handle(DDS_Dictionary) DDS_Dictionary::Get() +Handle_DDS_Dictionary DDS_Dictionary::Get() { static Handle(DDS_Dictionary) sDictionary; @@ -374,8 +428,10 @@ Handle(DDS_Dictionary) DDS_Dictionary::Get() } /*! - Load datum definitions in the dictionary from XML file \atheFileName. Returns true if load - successed or false otherwise. + \brief Load datum definitions in the dictionary from the XML file + \a theFileName. + \param theFileName XML file name + \return \c true if loading is succeded or \c false otherwise. */ Standard_Boolean DDS_Dictionary::Load( const TCollection_AsciiString theFileName ) { @@ -404,8 +460,13 @@ Standard_Boolean DDS_Dictionary::Load( const TCollection_AsciiString theFileName } /*! - Gets XML keyword as LDOMString by specified \akey. If key doesn't exist then empty string - returned. This function provided for convenience. + \brief Get XML keyword as LDOMString by specified \a key. + + If key doesn't exist, empty string is returned. + This function is provided for convenience. + + \param key keyword name + \return keyword value */ LDOMString DDS_Dictionary::KeyWord( const TCollection_AsciiString& key ) { @@ -421,10 +482,15 @@ LDOMString DDS_Dictionary::KeyWord( const TCollection_AsciiString& key ) } /*! - Gets dictionary item with specified identifier \atheID from specified component \atheComponent. - If component or item not found then null handle returned. + \brief Get the data dictionary item by specified identifier \a theID + from the component \a theComponent. + + If the component or item is not found, null handle is returned. + \param theID data dictionary item ID + \param theComponent component name + \return handle to the data dictionary item */ -Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID, +Handle_DDS_DicItem DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID, const TCollection_AsciiString& theComponent ) const { Handle(DDS_DicItem) aDicItem; @@ -437,10 +503,15 @@ Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& t } /*! - Gets dictionary item with specified identifier \atheID. Function find the item in all components. - If item not found in any component then null handle returned. + \brief Get the data dictionary item by specified identifier \a theID. + + Function searches the item in all components. If item is not found + in all components, null handle is returned. + + \param theID data dictionary item ID + \return handle to the data dictionary item */ -Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID ) const +Handle_DDS_DicItem DDS_Dictionary::GetDicItem( const TCollection_AsciiString& theID ) const { Handle(DDS_DicItem) aDicItem; for ( Standard_Integer i = 1; i <= myGroupMap.Extent() && aDicItem.IsNull(); i++ ) @@ -449,7 +520,9 @@ Handle(DDS_DicItem) DDS_Dictionary::GetDicItem( const TCollection_AsciiString& t } /*! - Fill the internal data structures from XML parsed structures. Internal. + \brief Fill the internal data structures from the XML node. + \param theComponentData component XML node + \param theDocElement document XML node */ void DDS_Dictionary::FillDataMap( const LDOM_Element& theComponentData, const LDOM_Element& theDocElement ) { @@ -462,8 +535,11 @@ void DDS_Dictionary::FillDataMap( const LDOM_Element& theComponentData, const LD } /*! - Convert numeric value \atheValue from specified unit of measure \atheUnits to SI unit of measure - (mm for Length, radians for Angles, etc). Converted value returned. + \brief Convert numeric value \a theValue from specified measure units + \a theUnits to "SI" measure units (mm for Length, radians for Angles, etc). + \param theValue value being converted + \param theUnits measure units + \return converted value */ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard_CString theUnits ) { @@ -486,8 +562,11 @@ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard } /*! - Convert numeric value \atheValue to specified unit of measure \atheUnits from SI unit of measure - (mm for Length, radians for Angles, etc). Converted value returned. + \brief Convert numeric value \a theValue to specified measure units + \a theUnits from "SI" measure units (mm for Length, radians for Angles, etc). + \param theValue value being converted + \param theUnits measure units + \return converted value */ Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standard_CString theUnits ) { diff --git a/src/DDS/DDS_Dictionary.h b/src/DDS/DDS_Dictionary.h index 9a5d5a886..289eb7d5d 100644 --- a/src/DDS/DDS_Dictionary.h +++ b/src/DDS/DDS_Dictionary.h @@ -25,52 +25,50 @@ #include +DEFINE_STANDARD_HANDLE(DDS_Dictionary, MMgt_TShared) + class LDOM_Element; class TCollection_AsciiString; -DEFINE_STANDARD_HANDLE(DDS_Dictionary, MMgt_TShared) - -class DDS_Dictionary : public MMgt_TShared +class Standard_EXPORT DDS_Dictionary : public MMgt_TShared { public: - Standard_EXPORT static Handle(DDS_Dictionary) Get(); - - // Return instance of data dictionary. Create instance if it is NULL. - - Standard_EXPORT Handle(DDS_DicItem) GetDicItem( const TCollection_AsciiString& ) const; - Standard_EXPORT Handle(DDS_DicItem) GetDicItem( const TCollection_AsciiString&, - const TCollection_AsciiString& ) const; + static Handle_DDS_Dictionary Get(); - Standard_EXPORT void GetUnitSystems( TColStd_SequenceOfAsciiString& ) const; - Standard_EXPORT void GetUnitSystems( TColStd_SequenceOfAsciiString&, - const TCollection_AsciiString& ) const; - Standard_EXPORT TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString& ) const; - Standard_EXPORT TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString&, - const TCollection_AsciiString& ) const; - Standard_EXPORT TCollection_AsciiString GetActiveUnitSystem() const; - Standard_EXPORT TCollection_AsciiString GetActiveUnitSystem( const TCollection_AsciiString& ) const; - Standard_EXPORT void SetActiveUnitSystem( const TCollection_AsciiString& ); - Standard_EXPORT void SetActiveUnitSystem( const TCollection_AsciiString&, - const TCollection_AsciiString& ); + Handle_DDS_DicItem GetDicItem( const TCollection_AsciiString& ) const; + Handle_DDS_DicItem GetDicItem( const TCollection_AsciiString&, + const TCollection_AsciiString& ) const; + void GetUnitSystems( TColStd_SequenceOfAsciiString& ) const; + void GetUnitSystems( TColStd_SequenceOfAsciiString&, + const TCollection_AsciiString& ) const; + TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString& ) const; + TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString&, + const TCollection_AsciiString& ) const; + TCollection_AsciiString GetActiveUnitSystem() const; + TCollection_AsciiString GetActiveUnitSystem( const TCollection_AsciiString& ) const; + void SetActiveUnitSystem( const TCollection_AsciiString& ); + void SetActiveUnitSystem( const TCollection_AsciiString&, + const TCollection_AsciiString& ); + - static Standard_EXPORT Standard_Boolean Load( const TCollection_AsciiString ); + static Standard_Boolean Load( const TCollection_AsciiString ); - static Standard_EXPORT Standard_Real ToSI( const Standard_Real, const Standard_CString ); - static Standard_EXPORT Standard_Real FromSI( const Standard_Real, const Standard_CString ); + static Standard_Real ToSI( const Standard_Real, const Standard_CString ); + static Standard_Real FromSI( const Standard_Real, const Standard_CString ); - static Standard_EXPORT LDOMString KeyWord( const TCollection_AsciiString& ); + static LDOMString KeyWord( const TCollection_AsciiString& ); private: DDS_Dictionary(); DDS_Dictionary( const DDS_Dictionary& ); - void operator=( const DDS_Dictionary& ); + void operator=( const DDS_Dictionary& ); - void FillDataMap( const LDOM_Element&, const LDOM_Element& ); + void FillDataMap( const LDOM_Element&, const LDOM_Element& ); private: - DDS_IndexedDataMapOfDicGroups myGroupMap; + DDS_IndexedDataMapOfDicGroups myGroupMap; public: DEFINE_STANDARD_RTTI(DDS_Dictionary) diff --git a/src/DDS/DDS_KeyWords.cxx b/src/DDS/DDS_KeyWords.cxx index 626bd0fd0..61799d219 100644 --- a/src/DDS/DDS_KeyWords.cxx +++ b/src/DDS/DDS_KeyWords.cxx @@ -23,60 +23,66 @@ IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared) /*! \class DDS_KeyWords + \brief This class defines the pairs of internal keys and XML tags or + attributes names. - This object contains the pairs of internal keys and XML tag or attribute names. This class allow to user - define set of XML keywords used in datums definition file. + This class allows user to define a set of XML keywords used in the datums + definition (XML) file. Default keywords table: - \li D_URI - dictionary - \li COMPONENT - component - \li COMPONENT_NAME - name - \li UNIT_SYSTEMS - unitSystems - \li UNIT_SYSTEM - system - \li UNIT_SYSTEM_NAME - name - \li UNIT_SYSTEM_LABEL - label - \li DATUM - datum - \li DATUM_ID - id - \li DATUM_LABEL - label - \li DATUM_UNITS - units - \li DATUM_FORMAT - format - \li DATUM_FILTER - filter - \li DATUM_REQUIRED - required - \li VALUE_LIST - valueList - \li VALUE_LIST_ID - listid - \li VALUE_LIST_NAME - name - \li VALUE_LIST_TYPE - type - \li VALUE_LIST_VALUE - value - \li VALUE_LIST_VALUEID - id - \li VALUE_LIST_VALUEICON - icon - \li DY_DOMAIN - domain - \li WARNING_LEVEL - warningLevel - \li WRONG_VALUE - wrongValue - \li VALUE_DESCR - valueDescr - \li VALUE_LIST_REF - listRef - \li DESCR - description - \li LONG_D - longDescr - \li SHORT_D - shortDescr - \li VD_TYPE - type - \li VD_DEFV - default - \li VD_MAXV - max - \li VD_MINV - min - \li VD_SPEC - specVal - \li VLR_LIST - list - \li PRS - presentation - \li LATERAL_ZOOM - lateralZoom - \li LZ_MINV - min - \li LZ_MAXV - max - \li LZ_ORDER - order - \li OPTIONS - options - \li OPTION - option - \li OPTION_NAME - name + - \c D_URI - dictionary + - \c COMPONENT - component + - \c COMPONENT_NAME - name + - \c UNIT_SYSTEMS - unitSystems + - \c UNIT_SYSTEM - system + - \c UNIT_SYSTEM_NAME - name + - \c UNIT_SYSTEM_LABEL - label + - \c DATUM - datum + - \c DATUM_ID - id + - \c DATUM_LABEL - label + - \c DATUM_UNITS - units + - \c DATUM_FORMAT - format + - \c DATUM_FILTER - filter + - \c DATUM_REQUIRED - required + - \c VALUE_LIST - valueList + - \c VALUE_LIST_ID - listid + - \c VALUE_LIST_NAME - name + - \c VALUE_LIST_TYPE - type + - \c VALUE_LIST_VALUE - value + - \c VALUE_LIST_VALUEID - id + - \c VALUE_LIST_VALUEICON - icon + - \c DY_DOMAIN - domain + - \c WARNING_LEVEL - warningLevel + - \c WRONG_VALUE - wrongValue + - \c VALUE_DESCR - valueDescr + - \c VALUE_LIST_REF - listRef + - \c DESCR - description + - \c LONG_D - longDescr + - \c SHORT_D - shortDescr + - \c VD_TYPE - type + - \c VD_DEFV - default + - \c VD_MAXV - max + - \c VD_MINV - min + - \c VD_SPEC - specVal + - \c VLR_LIST - list + - \c PRS - presentation + - \c LATERAL_ZOOM - lateralZoom + - \c LZ_MINV - min + - \c LZ_MAXV - max + - \c LZ_ORDER - order + - \c OPTIONS - options + - \c OPTION - option + - \c OPTION_NAME - name + + There is the only instance of the class DDS_KeyWords in the application + which can be retrieved by method Get(). */ /*! - Constructor + \brief Constructor. + Create an instance of the object. Can not be used directly. + Use Get() method instead. */ - DDS_KeyWords::DDS_KeyWords() : MMgt_TShared() { @@ -134,10 +140,10 @@ DDS_KeyWords::DDS_KeyWords() } /*! - Returns the static instance of the class DDS_KeyWords + \brief Get the only instance of the class DDS_KeyWords. + \return the only instance of the class */ - -Handle(DDS_KeyWords) DDS_KeyWords::Get() +Handle_DDS_KeyWords DDS_KeyWords::Get() { static Handle(DDS_KeyWords) keyWords; @@ -148,10 +154,12 @@ Handle(DDS_KeyWords) DDS_KeyWords::Get() } /*! - Returns the XML keyword by specified internal key \a key. If the internal key isn't registered - then empty string will be returned. -*/ + \brief Get the XML keyword by specified internal key \a key. + If the internal key is not registered, empty string is returned. + \param key internal key + \return XML keyword +*/ TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString& key ) const { TCollection_AsciiString keyWord; @@ -161,9 +169,10 @@ TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString& } /*! - Register the pair of the internal key \a key and XML keyword \a keyWord. + \brief Register the pair of the internal key \a key and XML keyword \a keyWord. + \param key internal key + \param keyWord XML keyword */ - void DDS_KeyWords::SetKeyWord( const TCollection_AsciiString& key, const TCollection_AsciiString& keyWord ) { diff --git a/src/DDS/DDS_KeyWords.h b/src/DDS/DDS_KeyWords.h index 2161f71f3..f42fb4f66 100644 --- a/src/DDS/DDS_KeyWords.h +++ b/src/DDS/DDS_KeyWords.h @@ -29,14 +29,14 @@ DEFINE_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared) class TCollection_AsciiString; -class DDS_KeyWords : public MMgt_TShared +class Standard_EXPORT DDS_KeyWords : public MMgt_TShared { public: - Standard_EXPORT static Handle(DDS_KeyWords) Get(); + static Handle_DDS_KeyWords Get(); - Standard_EXPORT TCollection_AsciiString GetKeyWord( const TCollection_AsciiString& ) const; - Standard_EXPORT void SetKeyWord( const TCollection_AsciiString&, - const TCollection_AsciiString& ); + TCollection_AsciiString GetKeyWord( const TCollection_AsciiString& ) const; + void SetKeyWord( const TCollection_AsciiString&, + const TCollection_AsciiString& ); private: DDS_KeyWords(); @@ -46,7 +46,7 @@ private: TCollection_AsciiString> KeyWordMap; private: - KeyWordMap myKeyWord; + KeyWordMap myKeyWord; public: DEFINE_STANDARD_RTTI(DDS_KeyWords) diff --git a/src/DDS/Makefile.am b/src/DDS/Makefile.am index 508e544e9..0b8574348 100755 --- a/src/DDS/Makefile.am +++ b/src/DDS/Makefile.am @@ -25,15 +25,17 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am lib_LTLIBRARIES = libDDS.la -salomeinclude_HEADERS = DDS.h \ - DDS_DicGroup.h \ - DDS_DicItem.h \ - DDS_Dictionary.h \ +salomeinclude_HEADERS = \ + DDS.h \ + DDS_DicGroup.h \ + DDS_DicItem.h \ + DDS_Dictionary.h \ DDS_KeyWords.h -dist_libDDS_la_SOURCES = DDS_DicGroup.cxx \ - DDS_DicItem.cxx \ - DDS_Dictionary.cxx \ +dist_libDDS_la_SOURCES = \ + DDS_DicGroup.cxx \ + DDS_DicItem.cxx \ + DDS_Dictionary.cxx \ DDS_KeyWords.cxx libDDS_la_CPPFLAGS=$(CAS_CPPFLAGS) -- 2.39.2