This class provides an information about datum (phisical characteristic parameter).
#include <DDS_DicItem.h>
Classes | |
struct | UnitData |
Public Types | |
enum | Type { String, Float, Integer, List, Unknown } |
enum | Data { MinValue = 0x01, MaxValue = 0x02, DefaultValue = 0x04 } |
typedef TCollection_AsciiString | UnitSystem |
Public Member Functions | |
Standard_EXPORT | DDS_DicItem () |
Standard_EXPORT TCollection_AsciiString | GetId () const |
Get the identifier of parameter. More... | |
Standard_EXPORT DDS_DicItem::Type | GetType () const |
Get the type of parameter. More... | |
Standard_EXPORT TCollection_ExtendedString | GetLabel () const |
Get the label of the parameter. More... | |
Standard_EXPORT TCollection_ExtendedString | GetFilter () const |
Get the filter (regular expression) for the parameter values. More... | |
Standard_EXPORT TCollection_ExtendedString | GetRequired () const |
Get the Required attribute of the parameter. More... | |
Standard_EXPORT DDS_MsgType | GetWarningLevel () const |
Get the wrong value warning level of the parameter. More... | |
Standard_EXPORT TCollection_ExtendedString | GetLongDescription () const |
Get the long description of the parameter. More... | |
Standard_EXPORT TCollection_ExtendedString | GetShortDescription () const |
Get the short description of the parameter. More... | |
Standard_EXPORT TCollection_AsciiString | GetComponent () const |
Get the name of the component (parameter owner). More... | |
virtual Standard_EXPORT TCollection_AsciiString | GetUnits () const |
Get the parameter measure units for active units system. More... | |
virtual Standard_EXPORT TCollection_AsciiString | GetUnits (const UnitSystem &) const |
Get the parameter measure units for specified units system theSystem. More... | |
Standard_EXPORT TCollection_ExtendedString | GetDefaultValue () const |
Get the default value of the parameter for active units system. More... | |
Standard_EXPORT TCollection_ExtendedString | GetDefaultValue (const UnitSystem &) const |
Get the default value of the parameter for specified units system theSystem. More... | |
Standard_EXPORT Standard_Real | GetMinValue () const |
Get the minimum value of the parameter for active units system. More... | |
Standard_EXPORT Standard_Real | GetMinValue (const UnitSystem &) const |
Get the minimum value of the parameter for the specified units system theSystem. More... | |
Standard_EXPORT Standard_Real | GetMaxValue () const |
Get the maximum value of the parameter for active units system. More... | |
Standard_EXPORT Standard_Real | GetMaxValue (const UnitSystem &) const |
Get the maximum value of the parameter for specified units system theSystem. More... | |
virtual Standard_EXPORT Standard_Integer | GetPrecision () const |
Get the precision (number of digits after decimal point) of the parameter for active units system. More... | |
virtual Standard_EXPORT Standard_Integer | GetPrecision (const UnitSystem &) const |
Get the precision (number of digits after decimal point) of the parameter for specified units system theSystem. More... | |
virtual Standard_EXPORT TCollection_AsciiString | GetFormat (const Standard_Boolean=Standard_True) const |
Get the format string of the parameter for active units system. More... | |
virtual Standard_EXPORT TCollection_AsciiString | GetFormat (const UnitSystem &, const Standard_Boolean=Standard_True) const |
Get the format string of the parameter for specified units system theSystem. More... | |
Standard_EXPORT TCollection_ExtendedString | GetNameOfValues () const |
Get the name of a list referenced by the parameter. More... | |
Standard_EXPORT Standard_Boolean | GetListOfValues (Handle(TColStd_HArray1OfExtendedString)&, Handle(TColStd_HArray1OfInteger)&) const |
Get item names and item identifiers of a list referenced by the parameter. More... | |
Standard_EXPORT Standard_Boolean | GetListOfValues (Handle(TColStd_HArray1OfExtendedString)&, Handle(TColStd_HArray1OfInteger)&, Handle(TColStd_HArray1OfExtendedString)&) const |
Get item names, item identifiers and item icons of a list referenced by the parameter. More... | |
Standard_EXPORT Standard_Boolean | GetSpecialValues (TColStd_MapOfReal &) const |
Get special values of the parameter. More... | |
Standard_EXPORT Standard_Real | GetMinZoom () const |
Get minimum value of lateral zooming. More... | |
Standard_EXPORT Standard_Real | GetMaxZoom () const |
Get maximum value of lateral zooming. More... | |
Standard_EXPORT Standard_Real | GetZoomOrder () const |
Get order of lateral zooming. More... | |
virtual Standard_EXPORT Standard_Real | ToSI (const Standard_Real) const |
Convert value theVal to the default SI units according to the active units system. More... | |
virtual Standard_EXPORT Standard_Real | FromSI (const Standard_Real) const |
Convert value theVal from the default SI units according to the active units system. More... | |
virtual Standard_EXPORT Standard_Real | ToSI (const Standard_Real, const UnitSystem &) const |
Convert value to the default SI units according to the units system theUnitsSystem. More... | |
virtual Standard_EXPORT Standard_Real | FromSI (const Standard_Real, const UnitSystem &) const |
Convert value from the default SI units according to the units system theUnitsSystem. More... | |
Standard_EXPORT Standard_Boolean | HasData (const Standard_Integer) const |
Check data existence. More... | |
Standard_EXPORT TCollection_ExtendedString | GetOption (const TCollection_AsciiString &) const |
Get option for specified name name. More... | |
Standard_EXPORT Standard_Boolean | GetOptionNames (TColStd_SequenceOfAsciiString &) const |
Get names of all existing options. More... | |
Protected Member Functions | |
Standard_EXPORT void | SetId (const TCollection_AsciiString &) |
Set item's identify string. More... | |
Standard_EXPORT void | SetComponent (const Handle(Standard_Transient)&) |
Set item's component pointer. More... | |
Standard_EXPORT void | SetLabel (const TCollection_AsciiString &) |
Set item's label string. More... | |
Standard_EXPORT void | SetFilter (const TCollection_AsciiString &) |
Set item's filter string. More... | |
Standard_EXPORT void | SetRequired (const TCollection_AsciiString &) |
Set item's required value. More... | |
Standard_EXPORT void | SetWarningLevel (const Standard_Integer &) |
Set item's warning level value. More... | |
Standard_EXPORT void | SetMinZoom (const Standard_Real &) |
Set item's minimum zoom value. More... | |
Standard_EXPORT void | SetMaxZoom (const Standard_Real &) |
Set item's maximum zoom value. More... | |
Standard_EXPORT void | SetZoomOrder (const Standard_Real &) |
Set item's zoom order value. More... | |
Standard_EXPORT void | SetShortDescription (const TCollection_ExtendedString &) |
Set item's short description. More... | |
Standard_EXPORT void | SetLongDescription (const TCollection_ExtendedString &) |
Set item's long description. More... | |
Standard_EXPORT bool | SetOption (const TCollection_AsciiString &, const TCollection_AsciiString &) |
Add item's option. More... | |
Standard_EXPORT void | SetType (const DDS_DicItem::Type &) |
Set item's type value. More... | |
Standard_EXPORT void | SetMin (const Standard_Real &) |
Set item's minimum value. More... | |
Standard_EXPORT void | SetMax (const Standard_Real &) |
Set item's maximum value. More... | |
Standard_EXPORT void | SetDefaultValue (const Standard_Real &) |
Set item's default value as a real number. More... | |
Standard_EXPORT void | SetDefaultValue (const TCollection_AsciiString &) |
Set item's default value as a string. More... | |
Standard_EXPORT void | SetListOfValues (const Handle(TColStd_HArray1OfExtendedString)&, const Handle(TColStd_HArray1OfInteger)&) |
Set item's value list. More... | |
Standard_EXPORT void | SetListOfValues (const Handle(TColStd_HArray1OfExtendedString)&, const Handle(TColStd_HArray1OfInteger)&, const Handle(TColStd_HArray1OfExtendedString)&) |
Set item's value list and icons. More... | |
Standard_EXPORT | DDS_DicItem (const DDS_DicItem &) |
Copy constructor (put in private section to prevent object copying). More... | |
Standard_EXPORT void | operator= (const DDS_DicItem &) |
Assignment operator (put in private section to prevent object copying). More... | |
virtual Standard_EXPORT void | FillDataMap (TCollection_AsciiString, const LDOM_Element &, const LDOM_Element &, const LDOM_Element &, const TColStd_SequenceOfAsciiString &) |
Parse record from XML file and retrieve information relevant for the dictionary item. More... | |
Private Types | |
typedef NCollection_DataMap < TCollection_AsciiString, TCollection_ExtendedString > | OptionsMap |
Private Member Functions | |
Standard_EXPORT void | PrepareFormats (const TCollection_AsciiString &) |
Prepare formats for all units systems. More... | |
Standard_EXPORT void | GetDefaultFormat () |
Restore default formats for all the units systems. More... | |
Standard_EXPORT UnitSystem | GetActiveUnitSystem () const |
Get the active units system. More... | |
Standard_EXPORT void | GetStringFormat (const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, TCollection_AsciiString &) |
Get format for the string. More... | |
Standard_EXPORT void | GetIntegerFormat (const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const Standard_Character, TCollection_AsciiString &) |
Get format for the integer. More... | |
Standard_EXPORT void | GetFloatFormat (const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const Standard_Character, TCollection_AsciiString &) |
Returns format for the float. More... | |
Standard_EXPORT void | Split (const TCollection_AsciiString &, Handle(TColStd_HArray1OfExtendedString)&) |
Split the string theStr separated by spaces. More... | |
Standard_EXPORT UnitData * | GetUnitData (const UnitSystem &) const |
Get units structure for specified units system sys. More... | |
Handle (TColStd_HArray1OfExtendedString) myListRef | |
Handle (TColStd_HArray1OfInteger) myListRefID | |
Handle (TColStd_HArray1OfExtendedString) myListRefIcons | |
Handle (Standard_Transient) myComponent | |
Private Attributes | |
TCollection_AsciiString | myId |
TCollection_ExtendedString | myLabel |
TCollection_ExtendedString | myFilter |
TCollection_ExtendedString | myRequired |
Standard_Integer | myType |
Standard_Integer | myWarnLevel |
TCollection_ExtendedString | myLongDescr |
TCollection_ExtendedString | myShortDescr |
Standard_Real | myMax |
Standard_Real | myMin |
Standard_Real | myDefValue |
TCollection_ExtendedString | myDefString |
Standard_Integer | myData |
TCollection_ExtendedString | myListName |
Standard_Real | myMinZoom |
Standard_Real | myMaxZoom |
Standard_Real | myZoomOrder |
OptionsMap | myOptions |
NCollection_DataMap < UnitSystem, UnitData > | myUnitData |
Friends | |
class | DDS_DicGroup |
|
private |
typedef TCollection_AsciiString DDS_DicItem::UnitSystem |
enum DDS_DicItem::Data |
enum DDS_DicItem::Type |
Standard_EXPORT DDS_DicItem::DDS_DicItem | ( | ) |
|
protected |
|
protectedvirtual |
theID | item identifier |
theDatum | datum XML node |
theCompElement | component XML node |
theDocElement | document XML node |
theSystems | units system names |
References DDS_MT_ALARM, DDS_MT_ERROR, DDS_MT_INFO, DDS_MT_NONE, DDS_MT_WARNING, DefaultValue, Float, Handle(), Integer, KeyWord(), List, MaxValue, MinValue, myData, myDefString, myDefValue, myFilter, myId, myLabel, myListName, myLongDescr, myMax, myMaxZoom, myMin, myMinZoom, myOptions, myRequired, DDS_DicItem::UnitData::myScale, myShortDescr, myType, myUnitData, DDS_DicItem::UnitData::myUnits, myWarnLevel, DDS_DicItem::UnitData::myZero, myZoomOrder, PrepareFormats(), Split(), String, and Unknown.
|
virtual |
theVal | value being converted |
References GetActiveUnitSystem().
|
virtual |
theVal | value being converted |
theUnitsSystem | units system |
References GetUnitData(), DDS_DicItem::UnitData::myScale, and DDS_DicItem::UnitData::myZero.
|
private |
References Handle().
TCollection_AsciiString DDS_DicItem::GetComponent | ( | ) | const |
References Handle().
|
private |
References Float, Integer, DDS_DicItem::UnitData::myFormat, myType, myUnitData, and String.
TCollection_ExtendedString DDS_DicItem::GetDefaultValue | ( | ) | const |
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.
References GetActiveUnitSystem().
TCollection_ExtendedString DDS_DicItem::GetDefaultValue | ( | const UnitSystem & | theSystem | ) | const |
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.
theSystem | units system |
References Float, FromSI(), Integer, List, myDefString, myDefValue, myType, and String.
TCollection_ExtendedString DDS_DicItem::GetFilter | ( | ) | const |
References myFilter.
|
private |
theFlags | format flags |
theWidth | field width |
thePrecision | precision |
theTypePrefix | type prefix |
theType | floating point value type |
theFormat | returning format string |
|
virtual |
If argument theCanonical is true
, format string is reduced according to the sprintf() specification (without extra non standard qualifiers).
theCanonical | 'canonical form' flag |
References GetActiveUnitSystem().
|
virtual |
If argument theCanonical is true
, format string is reduced according to the sprintf() specification (without extra non standard qualifiers).
theSystem | units system |
theCanonical | 'canonical form' flag |
References GetUnitData(), and DDS_DicItem::UnitData::myFormat.
TCollection_AsciiString DDS_DicItem::GetId | ( | ) | const |
References myId.
|
private |
theFlags | format flags |
theWidth | field width |
thePrecision | precision |
theTypePrefix | type prefix |
theType | integer value type |
theFormat | returning format string |
TCollection_ExtendedString DDS_DicItem::GetLabel | ( | ) | const |
References myLabel.
Standard_Boolean DDS_DicItem::GetListOfValues | ( | Handle(TColStd_HArray1OfExtendedString)& | theStrings, |
Handle(TColStd_HArray1OfInteger)& | theIntegers | ||
) | const |
These sequences are empty if the list reference is not defined. In this case, other properties (Type, DefaultValue, MaxValue, MinValue) should be used.
theStrings | returning items names |
theIntegers | returning items identifiers |
true
if returning lists are not empty Standard_Boolean DDS_DicItem::GetListOfValues | ( | Handle(TColStd_HArray1OfExtendedString)& | theStrings, |
Handle(TColStd_HArray1OfInteger)& | theIntegers, | ||
Handle(TColStd_HArray1OfExtendedString)& | theIcons | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. These sequences are empty if the list reference is not defined. In this case, other properties (Type, DefaultValue, MaxValue, MinValue) should be used.
theStrings | returning items names |
theIntegers | returning items identifiers |
theIcons | returning items icons |
true
if returning lists are not empty TCollection_ExtendedString DDS_DicItem::GetLongDescription | ( | ) | const |
References myLongDescr.
Standard_Real DDS_DicItem::GetMaxValue | ( | ) | const |
Standard_Real DDS_DicItem::GetMaxValue | ( | const UnitSystem & | theUnitsSystem | ) | const |
Standard_Real DDS_DicItem::GetMaxZoom | ( | ) | const |
References myMaxZoom.
Standard_Real DDS_DicItem::GetMinValue | ( | ) | const |
Standard_Real DDS_DicItem::GetMinValue | ( | const UnitSystem & | theUnitsSystem | ) | const |
Standard_Real DDS_DicItem::GetMinZoom | ( | ) | const |
References myMinZoom.
TCollection_ExtendedString DDS_DicItem::GetNameOfValues | ( | ) | const |
This string is empty if the list reference is not defined. In this case, other properties (Type, DefaultValue, MaxValue, MinValue) should be used.
References myListName.
TCollection_ExtendedString DDS_DicItem::GetOption | ( | const TCollection_AsciiString & | name | ) | const |
If option is not found, empty string is returned.
name | option name |
References myOptions.
Standard_Boolean DDS_DicItem::GetOptionNames | ( | TColStd_SequenceOfAsciiString & | names | ) | const |
|
virtual |
References GetActiveUnitSystem().
|
virtual |
If specified units system doesn't exist, zero is returned.
theSystem | units system |
References GetUnitData(), and DDS_DicItem::UnitData::myPrecision.
TCollection_ExtendedString DDS_DicItem::GetRequired | ( | ) | const |
References myRequired.
TCollection_ExtendedString DDS_DicItem::GetShortDescription | ( | ) | const |
References myShortDescr.
Standard_Boolean DDS_DicItem::GetSpecialValues | ( | TColStd_MapOfReal & | theMap | ) | const |
theMap | returning map of the special values |
true
if returning map is not empty
|
private |
theFlags | format flags |
theWidth | field width |
thePrecision | precision |
theTypePrefix | type prefix |
theFormat | returning format string |
DDS_DicItem::Type DDS_DicItem::GetType | ( | ) | const |
References myType.
|
private |
|
virtual |
References GetActiveUnitSystem().
|
virtual |
If specified units system doesn't exist, empty string is returned.
theSystem | units system |
References GetUnitData(), and DDS_DicItem::UnitData::myUnits.
DDS_MsgType DDS_DicItem::GetWarningLevel | ( | ) | const |
References myWarnLevel.
Standard_Real DDS_DicItem::GetZoomOrder | ( | ) | const |
References myZoomOrder.
|
private |
|
private |
|
private |
|
private |
Standard_Boolean DDS_DicItem::HasData | ( | const Standard_Integer | flag | ) | const |
|
protected |
|
private |
theFormat | format string |
References Float, FromSI(), GetDefaultFormat(), GetFloatFormat(), GetIntegerFormat(), GetStringFormat(), Integer, List, DDS_DicItem::UnitData::myFormat, DDS_DicItem::UnitData::myPrecision, myType, myUnitData, DDS_DicItem::UnitData::myUnits, and String.
theComponent | component pointer. |
|
protected |
theDefVal | default value. |
References DefaultValue, myData, and myDefValue.
|
protected |
theDefStr | default value. |
References myDefString.
|
protected |
theFilter | filter string. |
References myFilter.
|
protected |
theId | identify string. |
References myId.
|
protected |
theLabel | label string. |
References myLabel.
|
protected |
theStrings | list of value strings. |
theIntegers | list of integer values associated with string item. |
|
protected |
theStrings | list of value strings. |
theIntegers | list of integer values associated with string item. |
theIcons | list of icons associated with string item. |
|
protected |
theLongDescr | long description string. |
References myLongDescr.
|
protected |
|
protected |
theMaxZoom | maximum zoom value. |
References myMaxZoom.
|
protected |
|
protected |
theMinZoom | minimum zoom value. |
References myMinZoom.
|
protected |
theOptionName | option name string. |
theOptionValue | option value string. |
References myOptions.
|
protected |
theRequired | required value string. |
References myRequired.
|
protected |
theShortDescr | short description string. |
References myShortDescr.
|
protected |
theType | item value type. |
References myType.
|
protected |
theWarningLevel | warning level value. |
References myWarnLevel.
|
protected |
theZoomOrder | zoom order value. |
References myZoomOrder.
|
private |
theStr | source string |
aRes | returning substrings array |
|
virtual |
theVal | value being converted |
References GetActiveUnitSystem().
|
virtual |
theVal | value being converted |
theUnitsSystem | units system |
References GetUnitData(), DDS_DicItem::UnitData::myScale, and DDS_DicItem::UnitData::myZero.
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |