Version: 6.3.1
Data Structures | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends

DDS_DicItem Class Reference

This class provides an information about datum (phisical characteristic parameter).

#include <DDS_DicItem.h>

Inheritance diagram for DDS_DicItem:
Inheritance graph

Data Structures

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

 DDS_DicItem ()
 Constructor.
Standard_EXPORT
TCollection_AsciiString 
GetId () const
 Get the identifier of parameter.
Standard_EXPORT DDS_DicItem::Type GetType () const
 Get the type of parameter.
Standard_EXPORT
TCollection_ExtendedString 
GetLabel () const
 Get the label of the parameter.
Standard_EXPORT
TCollection_ExtendedString 
GetFilter () const
 Get the filter (regular expression) for the parameter values.
Standard_EXPORT
TCollection_ExtendedString 
GetRequired () const
 Get the Required attribute of the parameter.
Standard_EXPORT DDS_MsgType GetWarningLevel () const
 Get the wrong value warning level of the parameter.
Standard_EXPORT
TCollection_ExtendedString 
GetLongDescription () const
 Get the long description of the parameter.
Standard_EXPORT
TCollection_ExtendedString 
GetShortDescription () const
 Get the short description of the parameter.
Standard_EXPORT
TCollection_AsciiString 
GetComponent () const
 Get the name of the component (parameter owner).
Standard_EXPORT
TCollection_AsciiString 
GetUnits () const
 Get the parameter measure units for active units system.
Standard_EXPORT
TCollection_AsciiString 
GetUnits (const UnitSystem &) const
 Get the parameter measure units for specified units system theSystem.
Standard_EXPORT
TCollection_ExtendedString 
GetDefaultValue () const
 Get the default value of the parameter for active units system.
Standard_EXPORT
TCollection_ExtendedString 
GetDefaultValue (const UnitSystem &) const
 Get the default value of the parameter for specified units system theSystem.
Standard_EXPORT Standard_Real GetMinValue () const
 Get the minimum value of the parameter for active units system.
Standard_EXPORT Standard_Real GetMinValue (const UnitSystem &) const
 Get the minimum value of the parameter for the specified units system theSystem.
Standard_EXPORT Standard_Real GetMaxValue () const
 Get the maximum value of the parameter for active units system.
Standard_EXPORT Standard_Real GetMaxValue (const UnitSystem &) const
 Get the maximum value of the parameter for specified units system theSystem.
Standard_EXPORT Standard_Integer GetPrecision () const
 Get the precision (number of digits after decimal point) of the parameter for active units system.
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.
Standard_EXPORT
TCollection_AsciiString 
GetFormat (const Standard_Boolean=Standard_True) const
 Get the format string of the parameter for active units system.
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.
Standard_EXPORT
TCollection_ExtendedString 
GetNameOfValues () const
 Get the name of a list referenced by the parameter.
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.
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.
Standard_EXPORT Standard_Boolean GetSpecialValues (TColStd_MapOfReal &) const
 Get special values of the parameter.
Standard_EXPORT Standard_Real GetMinZoom () const
 Get minimum value of lateral zooming.
Standard_EXPORT Standard_Real GetMaxZoom () const
 Get maximum value of lateral zooming.
Standard_EXPORT Standard_Real GetZoomOrder () const
 Get order of lateral zooming.
Standard_EXPORT Standard_Real ToSI (const Standard_Real) const
 Convert value theVal to the default SI units according to the active units system.
Standard_EXPORT Standard_Real FromSI (const Standard_Real) const
 Convert value theVal from the default SI units according to the active units system.
Standard_EXPORT Standard_Real ToSI (const Standard_Real, const UnitSystem &) const
 Convert value to the default SI units according to the units system theUnitsSystem.
Standard_EXPORT Standard_Real FromSI (const Standard_Real, const UnitSystem &) const
 Convert value from the default SI units according to the units system theUnitsSystem.
Standard_EXPORT Standard_Boolean HasData (const Standard_Integer) const
 Check data existence.
Standard_EXPORT
TCollection_ExtendedString 
GetOption (const TCollection_AsciiString &) const
 Get option for specified name name.
Standard_EXPORT Standard_Boolean GetOptionNames (TColStd_SequenceOfAsciiString &) const
 Get names of all existing options.

Private Types

typedef NCollection_DataMap
< TCollection_AsciiString,
TCollection_ExtendedString > 
OptionsMap

Private Member Functions

 DDS_DicItem (const DDS_DicItem &)
 Copy constructor (put in private section to prevent object copying).
void operator= (const DDS_DicItem &)
 Assignment operator (put in private section to prevent object copying).
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.
void PrepareFormats (const TCollection_AsciiString &)
 Prepare formats for all units systems.
void GetDefaultFormat ()
 Restore default formats for all the units systems.
UnitSystem GetActiveUnitSystem () const
 Get the active units system.
void GetStringFormat (const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, TCollection_AsciiString &)
 Get format for the string.
void GetIntegerFormat (const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const Standard_Character, TCollection_AsciiString &)
 Get format for the integer.
void GetFloatFormat (const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const TCollection_AsciiString &, const Standard_Character, TCollection_AsciiString &)
 Returns format for the float.
void Split (const TCollection_AsciiString &, Handle(TColStd_HArray1OfExtendedString)&)
 Split the string theStr separated by spaces.
UnitDataGetUnitData (const UnitSystem &) const
 Get units structure for specified units system sys.
 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

Member Typedef Documentation

typedef NCollection_DataMap<TCollection_AsciiString, TCollection_ExtendedString> DDS_DicItem.OptionsMap [private]

Member Enumeration Documentation

Enum describes type of datum value

Enumerator:
String 

String type of value.

Float 

Real (double) numeric type of value.

Integer 

Integer (int) numeric type of value.

List 

List type of enumerable value.

Unknown 

Unknown or undefined type of value.

Enum describes the flags for existance of domain data

Enumerator:
MinValue 

Flag of minimum value definition existence.

MaxValue 

Flag of maximum value definition existence.

DefaultValue 

Flag of default value definition existence.


Constructor & Destructor Documentation

DDS_DicItem::DDS_DicItem ( )

Creates the instance of empty dictionary item.

DDS_DicItem::DDS_DicItem ( const DDS_DicItem ) [private]

Member Function Documentation

TCollection_AsciiString DDS_DicItem::GetId ( ) const
Returns:
parameter ID

References myId.

DDS_DicItem::Type DDS_DicItem::GetType ( ) const
Returns:
parameter type

References myType.

TCollection_ExtendedString DDS_DicItem::GetLabel ( ) const
Returns:
parameter label

References myLabel.

TCollection_ExtendedString DDS_DicItem::GetFilter ( ) const
Returns:
parameter filter

References myFilter.

TCollection_ExtendedString DDS_DicItem::GetRequired ( ) const
Returns:
Required attribute

References myRequired.

DDS_MsgType DDS_DicItem::GetWarningLevel ( ) const
Returns:
warning level

References myWarnLevel.

TCollection_ExtendedString DDS_DicItem::GetLongDescription ( ) const
Returns:
long description

References myLongDescr.

TCollection_ExtendedString DDS_DicItem::GetShortDescription ( ) const
Returns:
short description

References myShortDescr.

TCollection_AsciiString DDS_DicItem::GetComponent ( ) const
Returns:
component name

References Handle(), test_big_table.myComponent, and TCollection_AsciiString.

TCollection_AsciiString DDS_DicItem::GetUnits ( ) const
Returns:
parameter units

References GetActiveUnitSystem().

TCollection_AsciiString DDS_DicItem::GetUnits ( const UnitSystem theSystem) const

If specified units system doesn't exist, empty string is returned.

Parameters:
theSystemunits system
Returns:
parameter units

References GetUnitData(), DDS_DicItem.UnitData.myUnits, and TCollection_AsciiString.

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.

Returns:
default value

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.

Parameters:
theSystemunits system
Returns:
default value

References Float, FromSI(), Integer, List, myDefString, myDefValue, myType, and String.

Standard_Real DDS_DicItem::GetMinValue ( ) const

Returned value is converted to SI.

Returns:
minimum value

References GetActiveUnitSystem().

Standard_Real DDS_DicItem::GetMinValue ( const UnitSystem theUnitsSystem) const

Returned value is converted to SI.

Parameters:
theUnitsSystemunits system
Returns:
minimum value

References FromSI(), and myMin.

Standard_Real DDS_DicItem::GetMaxValue ( ) const

Returned value converted to SI.

Returns:
maximum value

References GetActiveUnitSystem().

Standard_Real DDS_DicItem::GetMaxValue ( const UnitSystem theUnitsSystem) const

Returned value converted to SI.

Parameters:
theUnitsSystemunits system
Returns:
maximum value

References FromSI(), and myMax.

Standard_Integer DDS_DicItem::GetPrecision ( ) const
Returns:
parameter precision

References GetActiveUnitSystem().

Standard_Integer DDS_DicItem::GetPrecision ( const UnitSystem theSystem) const

If specified units system doesn't exist, zero is returned.

Parameters:
theSystemunits system
Returns:
parameter precision

References GetUnitData(), and DDS_DicItem.UnitData.myPrecision.

TCollection_AsciiString DDS_DicItem::GetFormat ( const Standard_Boolean  theCanonical = Standard_True) const

If argument theCanonical is true, format string is reduced according to the sprintf() specification (without extra non standard qualifiers).

Parameters:
theCanonical'canonical form' flag
Returns:
format string

References GetActiveUnitSystem().

TCollection_AsciiString DDS_DicItem::GetFormat ( const UnitSystem theSystem,
const Standard_Boolean  theCanonical = Standard_True 
) const

If argument theCanonical is true, format string is reduced according to the sprintf() specification (without extra non standard qualifiers).

Parameters:
theSystemunits system
theCanonical'canonical form' flag
Returns:
format string

References GetUnitData(), DDS_DicItem.UnitData.myFormat, and TCollection_AsciiString.

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.

Returns:
referenced list name
See also:
GetListOfValues()

References myListName.

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.

Parameters:
theStringsreturning items names
theIntegersreturning items identifiers
Returns:
true if returning lists are not empty
See also:
GetNameOfValues()
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.

Parameters:
theStringsreturning items names
theIntegersreturning items identifiers
theIconsreturning items icons
Returns:
true if returning lists are not empty
See also:
GetNameOfValues()
Standard_Boolean DDS_DicItem::GetSpecialValues ( TColStd_MapOfReal &  theMap) const
Parameters:
theMapreturning map of the special values
Returns:
true if returning map is not empty

References TCollection_AsciiString.

Standard_Real DDS_DicItem::GetMinZoom ( ) const
Returns:
lateral zooming minimum value

References myMinZoom.

Standard_Real DDS_DicItem::GetMaxZoom ( ) const
Returns:
lateral zooming maximum value

References myMaxZoom.

Standard_Real DDS_DicItem::GetZoomOrder ( ) const
Returns:
lateral zooming order

References myZoomOrder.

Standard_Real DDS_DicItem::ToSI ( const Standard_Real  theVal) const
Parameters:
theValvalue being converted
Returns:
value converted to SI

References GetActiveUnitSystem().

Standard_Real DDS_DicItem::FromSI ( const Standard_Real  theVal) const
Parameters:
theValvalue being converted
Returns:
value converted from SI

References GetActiveUnitSystem().

Standard_Real DDS_DicItem::ToSI ( const Standard_Real  theVal,
const UnitSystem theUnitsSystem 
) const
Parameters:
theValvalue being converted
theUnitsSystemunits system
Returns:
value converted to the specified units system

References GetUnitData(), DDS_DicItem.UnitData.myScale, and DDS_DicItem.UnitData.myZero.

Standard_Real DDS_DicItem::FromSI ( const Standard_Real  theVal,
const UnitSystem theUnitsSystem 
) const
Parameters:
theValvalue being converted
theUnitsSystemunits system
Returns:
value converted from the specified units system

References GetUnitData(), DDS_DicItem.UnitData.myScale, and DDS_DicItem.UnitData.myZero.

Standard_Boolean DDS_DicItem::HasData ( const Standard_Integer  flag) const
Parameters:
flagdata flag
Returns:
true if data specified by flag exists

References myData.

TCollection_ExtendedString DDS_DicItem::GetOption ( const TCollection_AsciiString name) const

If option is not found, empty string is returned.

Parameters:
nameoption name
Returns:
option value

References myOptions.

Standard_Boolean DDS_DicItem::GetOptionNames ( TColStd_SequenceOfAsciiString &  names) const
Parameters:
namesreturning list of options
Returns:
true if list is not empty

References myOptions.

void DDS_DicItem::operator= ( const DDS_DicItem ) [private]
void DDS_DicItem::FillDataMap ( TCollection_AsciiString  theID,
const LDOM_Element &  theDatum,
const LDOM_Element &  theCompElement,
const LDOM_Element &  theDocElement,
const TColStd_SequenceOfAsciiString &  theSystems 
) [private]
void DDS_DicItem::PrepareFormats ( const TCollection_AsciiString theFormat) [private]
void DDS_DicItem::GetDefaultFormat ( ) [private]
DDS_DicItem::UnitSystem DDS_DicItem::GetActiveUnitSystem ( ) const [private]
Returns:
active units system

References Handle(), and test_big_table.myComponent.

void DDS_DicItem::GetStringFormat ( const TCollection_AsciiString theFlags,
const TCollection_AsciiString theWidth,
const TCollection_AsciiString thePrecision,
const TCollection_AsciiString theTypePrefix,
TCollection_AsciiString theFormat 
) [private]
Parameters:
theFlagsformat flags
theWidthfield width
thePrecisionprecision
theTypePrefixtype prefix
theFormatreturning format string
void DDS_DicItem::GetIntegerFormat ( const TCollection_AsciiString theFlags,
const TCollection_AsciiString theWidth,
const TCollection_AsciiString thePrecision,
const TCollection_AsciiString theTypePrefix,
const Standard_Character  theType,
TCollection_AsciiString theFormat 
) [private]
Parameters:
theFlagsformat flags
theWidthfield width
thePrecisionprecision
theTypePrefixtype prefix
theTypeinteger value type
theFormatreturning format string
void DDS_DicItem::GetFloatFormat ( const TCollection_AsciiString theFlags,
const TCollection_AsciiString theWidth,
const TCollection_AsciiString thePrecision,
const TCollection_AsciiString theTypePrefix,
const Standard_Character  theType,
TCollection_AsciiString theFormat 
) [private]
Parameters:
theFlagsformat flags
theWidthfield width
thePrecisionprecision
theTypePrefixtype prefix
theTypefloating point value type
theFormatreturning format string
void DDS_DicItem::Split ( const TCollection_AsciiString theStr,
Handle(TColStd_HArray1OfExtendedString)&  aRes 
) [private]
Parameters:
theStrsource string
aResreturning substrings array

References TCollection_AsciiString.

DDS_DicItem::UnitData * DDS_DicItem::GetUnitData ( const UnitSystem sys) const [private]
Parameters:
sysunits system
Returns:
units system information structure

References myUnitData.

DDS_DicItem.Handle ( TColStd_HArray1OfExtendedString  ) [private]
DDS_DicItem.Handle ( TColStd_HArray1OfInteger  ) [private]
DDS_DicItem.Handle ( TColStd_HArray1OfExtendedString  ) [private]
DDS_DicItem.Handle ( Standard_Transient  ) [private]

Friends And Related Function Documentation

friend class DDS_DicGroup [friend]

Field Documentation

TCollection_ExtendedString DDS_DicItem.myLabel [private]
TCollection_ExtendedString DDS_DicItem.myFilter [private]
TCollection_ExtendedString DDS_DicItem.myRequired [private]
Standard_Integer DDS_DicItem.myType [private]
Standard_Integer DDS_DicItem.myWarnLevel [private]
TCollection_ExtendedString DDS_DicItem.myLongDescr [private]
TCollection_ExtendedString DDS_DicItem.myShortDescr [private]
Standard_Real DDS_DicItem.myMax [private]
Standard_Real DDS_DicItem.myMin [private]
Standard_Real DDS_DicItem.myDefValue [private]
TCollection_ExtendedString DDS_DicItem.myDefString [private]
Standard_Integer DDS_DicItem.myData [private]
TCollection_ExtendedString DDS_DicItem.myListName [private]
Standard_Real DDS_DicItem.myMinZoom [private]
Standard_Real DDS_DicItem.myMaxZoom [private]
Standard_Real DDS_DicItem.myZoomOrder [private]
NCollection_DataMap<UnitSystem, UnitData> DDS_DicItem.myUnitData [private]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS