OCC.Units module

This package provides all the facilities to createand question a dictionary of units, and also tomanipulate measurements which are real values withunits.

class Handle_Units_Lexicon(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_QuantitiesSequence(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_SequenceNodeOfQtsSequence(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_SequenceNodeOfTksSequence(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_SequenceNodeOfUtsSequence(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_ShiftedToken(*args)

Bases: OCC.Units.Handle_Units_Token

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_ShiftedUnit(*args)

Bases: OCC.Units.Handle_Units_Unit

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_Token(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_TokensSequence(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_Unit(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_UnitsDictionary(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_UnitsLexicon(*args)

Bases: OCC.Units.Handle_Units_Lexicon

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_UnitsSequence(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class Handle_Units_UnitsSystem(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

static DownCast()
GetObject()
IsNull()
Nullify()
thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
thisown

The membership flag

value()
class Units_Explorer(*args)

Bases: object

  • Empty contructor of the class.
Return type:None
  • Creates a new instance of the class, initialized with the UnitsSystem <aunitssystem>.
Parameters:aunitssystem (Handle_Units_UnitsSystem &) –
Return type:None
  • Creates a new instance of the class, initialized with the UnitsDictionary <aunitsdictionary>.
Parameters:aunitsdictionary (Handle_Units_UnitsDictionary &) –
Return type:None
  • Creates a new instance of the class, initialized with the UnitsSystem <aunitssystem> and positioned at the quantity <aquantity>.
Parameters:
  • aunitssystem (Handle_Units_UnitsSystem &) –
  • aquantity (char *) –
Return type:

None

  • Creates a new instance of the class, initialized with the UnitsDictionary <aunitsdictionary> and positioned at the quantity <aquantity>.
Parameters:
  • aunitsdictionary (Handle_Units_UnitsDictionary &) –
  • aquantity (char *) –
Return type:

None

Init()
  • Initializes the instance of the class with the UnitsSystem <aunitssystem>.
Parameters:aunitssystem (Handle_Units_UnitsSystem &) –
Return type:None
  • Initializes the instance of the class with the UnitsDictionary <aunitsdictionary>.
Parameters:aunitsdictionary (Handle_Units_UnitsDictionary &) –
Return type:None
  • Initializes the instance of the class with the UnitsSystem <aunitssystem> and positioned at the quantity <aquantity>.
Parameters:
  • aunitssystem (Handle_Units_UnitsSystem &) –
  • aquantity (char *) –
Return type:

None

  • Initializes the instance of the class with the UnitsDictionary <aunitsdictionary> and positioned at the quantity <aquantity>.
Parameters:
  • aunitsdictionary (Handle_Units_UnitsDictionary &) –
  • aquantity (char *) –
Return type:

None

IsActive()
  • If the units system to explore is a user system, returns True if the current unit is active, False otherwise. //! If the units system to explore is the units dictionary, returns True if the current unit is the S.I. unit.
Return type:bool
MoreQuantity()
  • Returns True if there is another Quantity to explore, False otherwise.
Return type:bool
MoreUnit()
  • Returns True if there is another Unit to explore, False otherwise.
Return type:bool
NextQuantity()
  • Sets the next Quantity current.
Return type:None
NextUnit()
  • Sets the next Unit current.
Return type:None
Quantity()
  • Returns the name of the current Quantity.
Return type:TCollection_AsciiString
Unit()
  • Returns the name of the current unit.
Return type:TCollection_AsciiString
thisown

The membership flag

class Units_Lexicon(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Creates an empty instance of Lexicon.
Return type:None
AddToken()
  • Adds to the lexicon a new token with <aword>, <amean>, <avalue> as arguments. If there is already a token with the field <theword> equal to <aword>, the existing token is updated.
Parameters:
  • aword (char *) –
  • amean (char *) –
  • avalue (float) –
Return type:

None

Creates()
  • Reads the file <afilename> to create a sequence of tokens stored in <thesequenceoftokens>.
Parameters:afilename (char *) –
Return type:None
Dump()
  • Useful for debugging.
Return type:None
FileName()
  • Returns in a AsciiString from TCollection the name of the file.
Return type:TCollection_AsciiString
GetHandle()
Sequence()
  • Returns the first item of the sequence of tokens.
Return type:Handle_Units_TokensSequence
UpToDate()
  • Returns true if the file has not changed since the creation of the Lexicon object. Returns false otherwise.
Return type:bool
thisown

The membership flag

class Units_MathSentence(*args)

Bases: OCC.Units.Units_Sentence

  • Creates and returns a MathSentence object. The string <astring> describes an algebraic formula in natural language.
Parameters:astring (char *) –
Return type:None
thisown

The membership flag

class Units_Measurement(*args)

Bases: object

  • It is the empty constructor of the class.
Return type:None
  • Returns an instance of this class. <avalue> defines the measurement, and <atoken> the token which defines the unit used.
Parameters:
  • avalue (float) –
  • atoken (Handle_Units_Token &) –
Return type:

None

  • Returns an instance of this class. <avalue> defines the measurement, and <aunit> the unit used, described in natural language.
Parameters:
  • avalue (float) –
  • aunit (char *) –
Return type:

None

Add()
  • Returns (if it is possible) a measurement which is the addition of <self> and <ameasurement>. The chosen returned unit is the unit of <self>.
Parameters:ameasurement (Units_Measurement &) –
Return type:Units_Measurement
Convert()
  • Converts (if possible) the measurement object into another unit. <aunit> must have the same dimensionality as the unit contained in the token <thetoken>.
Parameters:aunit (char *) –
Return type:None
Divide()
  • Returns a measurement which is the division of <self> by <ameasurement>.
Parameters:ameasurement (Units_Measurement &) –
Return type:Units_Measurement
  • Returns a measurement which is the division of <self> by the constant <avalue>.
Parameters:avalue (float) –
Return type:Units_Measurement
Dump()
  • Useful for debugging.
Return type:None
Fractional()
  • Returns a Measurement object with the fractional value of the measurement contained in <self>.
Return type:Units_Measurement
HasToken()
Return type:bool
Integer()
  • Returns a Measurement object with the integer value of the measurement contained in <self>.
Return type:Units_Measurement
Measurement()
  • Returns the value of the measurement.
Return type:float
Multiply()
  • Returns a measurement which is the multiplication of <self> and <ameasurement>.
Parameters:ameasurement (Units_Measurement &) –
Return type:Units_Measurement
  • Returns a measurement which is the multiplication of <self> with the value <avalue>.
Parameters:avalue (float) –
Return type:Units_Measurement
Power()
  • Returns a measurement which is <self> powered <anexponent>.
Parameters:anexponent (float) –
Return type:Units_Measurement
Subtract()
  • Returns (if it is possible) a measurement which is the subtraction of <self> and <ameasurement>. The chosen returned unit is the unit of <self>.
Parameters:ameasurement (Units_Measurement &) –
Return type:Units_Measurement
Token()
  • Returns the token contained in <self>.
Return type:Handle_Units_Token
thisown

The membership flag

class Units_QtsSequence(*args)

Bases: OCC.TCollection.TCollection_BaseSequence

Return type:None
Parameters:Other (Units_QtsSequence &) –
Return type:None
Append()
Parameters:
  • T (Handle_Units_Quantity &) –
  • S (Units_QtsSequence &) –
Return type:

None

Return type:

None

Assign()
Parameters:Other (Units_QtsSequence &) –
Return type:Units_QtsSequence
ChangeValue()
Parameters:Index (int) –
Return type:Handle_Units_Quantity
Clear()
Return type:None
First()
Return type:Handle_Units_Quantity
InsertAfter()
Parameters:
  • Index (int) –
  • T (Handle_Units_Quantity &) –
  • Index
  • S (Units_QtsSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (int) –
  • T (Handle_Units_Quantity &) –
  • Index
  • S (Units_QtsSequence &) –
Return type:

None

Return type:

None

Last()
Return type:Handle_Units_Quantity
Prepend()
Parameters:
  • T (Handle_Units_Quantity &) –
  • S (Units_QtsSequence &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • Index (int) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

None

Return type:

None

Set()
Parameters:Other (Units_QtsSequence &) –
Return type:Units_QtsSequence
SetValue()
Parameters:
  • Index (int) –
  • I (Handle_Units_Quantity &) –
Return type:

None

Split()
Parameters:
  • Index (int) –
  • Sub (Units_QtsSequence &) –
Return type:

None

Value()
Parameters:Index (int) –
Return type:Handle_Units_Quantity
thisown

The membership flag

class Units_QuantitiesSequence(*args)

Bases: OCC.MMgt.MMgt_TShared

Return type:None
Append()
Parameters:
  • anItem (Handle_Units_Quantity &) –
  • aSequence (Handle_Units_QuantitiesSequence &) –
Return type:

None

Return type:

None

ChangeSequence()
Return type:Units_QtsSequence
ChangeValue()
Parameters:anIndex (int) –
Return type:Handle_Units_Quantity
Clear()
Return type:None
Exchange()
Parameters:
  • anIndex (int) –
  • anOtherIndex (int) –
Return type:

None

GetHandle()
InsertAfter()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Quantity &) –
  • anIndex
  • aSequence (Handle_Units_QuantitiesSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Quantity &) –
  • anIndex
  • aSequence (Handle_Units_QuantitiesSequence &) –
Return type:

None

Return type:

None

IsEmpty()
Return type:bool
Length()
Return type:int
Prepend()
Parameters:
  • anItem (Handle_Units_Quantity &) –
  • aSequence (Handle_Units_QuantitiesSequence &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • anIndex (int) –
  • fromIndex (int) –
  • toIndex (int) –
Return type:

None

Return type:

None

Reverse()
Return type:None
Sequence()
Return type:Units_QtsSequence
SetValue()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Quantity &) –
Return type:

None

Split()
Parameters:anIndex (int) –
Return type:Handle_Units_QuantitiesSequence
Value()
Parameters:anIndex (int) –
Return type:Handle_Units_Quantity
thisown

The membership flag

class Units_Sentence(*args)

Bases: object

  • Creates and returns a Sentence, by analyzing the string <astring> with the lexicon <alexicon>.
Parameters:
  • alexicon (Handle_Units_Lexicon &) –
  • astring (char *) –
Return type:

None

Dump()
  • Useful for debugging.
Return type:None
Evaluate()
  • Computes and returns in a token the result of the expression.
Return type:Handle_Units_Token
IsDone()
  • Return True if number of created tokens > 0 (i.e creation of sentence is succesfull)
Return type:bool
Sequence()
  • Returns <thesequenceoftokens>.
Return type:Handle_Units_TokensSequence
  • Sets the field <thesequenceoftokens> to <asequenceoftokens>.
Parameters:asequenceoftokens (Handle_Units_TokensSequence &) –
Return type:None
SetConstants()
  • For each constant encountered, sets the value.
Return type:None
thisown

The membership flag

class Units_SequenceNodeOfQtsSequence(*args)

Bases: OCC.TCollection.TCollection_SeqNode

Parameters:
  • I (Handle_Units_Quantity &) –
  • n (TCollection_SeqNodePtr &) –
  • p (TCollection_SeqNodePtr &) –
Return type:

None

GetHandle()
Value()
Return type:Handle_Units_Quantity
thisown

The membership flag

class Units_SequenceNodeOfTksSequence(*args)

Bases: OCC.TCollection.TCollection_SeqNode

Parameters:
  • I (Handle_Units_Token &) –
  • n (TCollection_SeqNodePtr &) –
  • p (TCollection_SeqNodePtr &) –
Return type:

None

GetHandle()
Value()
Return type:Handle_Units_Token
thisown

The membership flag

class Units_SequenceNodeOfUtsSequence(*args)

Bases: OCC.TCollection.TCollection_SeqNode

Parameters:
  • I (Handle_Units_Unit &) –
  • n (TCollection_SeqNodePtr &) –
  • p (TCollection_SeqNodePtr &) –
Return type:

None

GetHandle()
Value()
Return type:Handle_Units_Unit
thisown

The membership flag

class Units_ShiftedToken(*args)

Bases: OCC.Units.Units_Token

  • Creates and returns a shifted token. <aword> is a string containing the available word, <amean> gives the signification of the token, <avalue> is the numeric value of the dimension, <amove> is the gap, and <adimensions> is the dimension of the given word <aword>.
Parameters:
  • aword (char *) –
  • amean (char *) –
  • avalue (float) –
  • amove (float) –
  • adimensions (Handle_Units_Dimensions &) –
Return type:

None

GetHandle()
Move()
  • Returns the gap <themove>
Return type:float
thisown

The membership flag

class Units_ShiftedUnit(*args)

Bases: OCC.Units.Units_Unit

  • Creates and returns a shifted unit. <aname> is the name of the unit, <asymbol> is the usual abbreviation of the unit, <avalue> is the value in relation to the International System of Units, and <amove> is the gap in relation to another unit. //! For example Celcius dregee of temperature is an instance of ShiftedUnit with <avalue> equal to 1. and <amove> equal to 273.15.
Parameters:
  • aname (char *) –
  • asymbol (char *) –
  • avalue (float) –
  • amove (float) –
  • aquantity (Handle_Units_Quantity &) –
Return type:

None

  • Creates and returns a unit. <aname> is the name of the unit, <asymbol> is the usual abbreviation of the unit.
Parameters:
  • aname (char *) –
  • asymbol (char *) –
Return type:

None

  • Creates and returns a unit. <aname> is the name of the unit.
Parameters:aname (char *) –
Return type:None
GetHandle()
Move()
  • Sets the field <themove> to <amove>
Parameters:amove (float) –
Return type:None
  • Returns the shifted value <themove>.
Return type:float
thisown

The membership flag

class Units_TksSequence(*args)

Bases: OCC.TCollection.TCollection_BaseSequence

Return type:None
Parameters:Other (Units_TksSequence &) –
Return type:None
Append()
Parameters:
  • T (Handle_Units_Token &) –
  • S (Units_TksSequence &) –
Return type:

None

Return type:

None

Assign()
Parameters:Other (Units_TksSequence &) –
Return type:Units_TksSequence
ChangeValue()
Parameters:Index (int) –
Return type:Handle_Units_Token
Clear()
Return type:None
First()
Return type:Handle_Units_Token
InsertAfter()
Parameters:
  • Index (int) –
  • T (Handle_Units_Token &) –
  • Index
  • S (Units_TksSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (int) –
  • T (Handle_Units_Token &) –
  • Index
  • S (Units_TksSequence &) –
Return type:

None

Return type:

None

Last()
Return type:Handle_Units_Token
Prepend()
Parameters:
  • T (Handle_Units_Token &) –
  • S (Units_TksSequence &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • Index (int) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

None

Return type:

None

Set()
Parameters:Other (Units_TksSequence &) –
Return type:Units_TksSequence
SetValue()
Parameters:
  • Index (int) –
  • I (Handle_Units_Token &) –
Return type:

None

Split()
Parameters:
  • Index (int) –
  • Sub (Units_TksSequence &) –
Return type:

None

Value()
Parameters:Index (int) –
Return type:Handle_Units_Token
thisown

The membership flag

class Units_Token(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Creates and returns a empty token.
Return type:None
  • Creates and returns a token. <aword> is a string containing the available word.
Parameters:aword (char *) –
Return type:None
  • Creates and returns a token. <atoken> is copied in the returned token.
Parameters:atoken (Handle_Units_Token &) –
Return type:None
  • Creates and returns a token. <aword> is a string containing the available word and <amean> gives the signification of the token.
Parameters:
  • aword (char *) –
  • amean (char *) –
Return type:

None

  • Creates and returns a token. <aword> is a string containing the available word, <amean> gives the signification of the token and <avalue> is the numeric value of the dimension.
Parameters:
  • aword (char *) –
  • amean (char *) –
  • avalue (float) –
Return type:

None

  • Creates and returns a token. <aword> is a string containing the available word, <amean> gives the signification of the token, <avalue> is the numeric value of the dimension, and <adimensions> is the dimension of the given word <aword>.
Parameters:
  • aword (char *) –
  • amean (char *) –
  • avalue (float) –
  • adimension (Handle_Units_Dimensions &) –
Return type:

None

Add()
Parameters:aninteger (int) –
Return type:Handle_Units_Token
  • Returns a token which is the addition of <self> and another token <atoken>. The addition is possible if and only if the dimensions are the same.
Parameters:atoken (Handle_Units_Token &) –
Return type:Handle_Units_Token
Creates()
  • Creates and returns a token, which is a ShiftedToken.
Return type:Handle_Units_Token
Destroy()
  • Destroies the Token
Return type:void
Dimensions()
  • Returns the dimensions of the token <thedimensions>.
Return type:Handle_Units_Dimensions
  • Sets the field <thedimensions> to <adimensions>.
Parameters:adimensions (Handle_Units_Dimensions &) –
Return type:None
Divide()
  • Returns a token which is the division of <self> by another token <atoken>.
Parameters:atoken (Handle_Units_Token &) –
Return type:Handle_Units_Token
Divided()
  • This virtual method is called by the Measurement methods, to compute the measurement during a conversion.
Parameters:avalue (float) –
Return type:float
Dump()
  • Useful for debugging
Parameters:
  • ashift (int) –
  • alevel (int) –
Return type:

void

GetHandle()
IsEqual()
  • Returns true if the field <theword> and the string <astring> are the same, false otherwise.
Parameters:astring (char *) –
Return type:bool
  • Returns true if the field <theword> and the string <theword> contained in the token <atoken> are the same, false otherwise.
Parameters:atoken (Handle_Units_Token &) –
Return type:bool
IsGreater()
  • Returns false if the field <theword> is strictly contained at the beginning of the string <astring>, true otherwise.
Parameters:astring (char *) –
Return type:bool
  • Returns false if the field <theword> is strictly contained at the beginning of the string <astring>, true otherwise.
Parameters:atoken (Handle_Units_Token &) –
Return type:bool
IsGreaterOrEqual()
  • Returns true if the string <astring> is strictly contained at the beginning of the field <theword> false otherwise.
Parameters:atoken (Handle_Units_Token &) –
Return type:bool
IsLessOrEqual()
  • Returns true if the field <theword> is strictly contained at the beginning of the string <astring>, false otherwise.
Parameters:astring (char *) –
Return type:bool
IsNotEqual()
  • Returns false if the field <theword> and the string <astring> are the same, true otherwise.
Parameters:astring (char *) –
Return type:bool
  • Returns false if the field <theword> and the string <theword> contained in the token <atoken> are the same, true otherwise.
Parameters:atoken (Handle_Units_Token &) –
Return type:bool
Length()
  • Returns the length of the word.
Return type:int
Mean()
  • Returns the significance of the word <theword>, which is in the field <themean>.
Return type:TCollection_AsciiString
  • Sets the field <themean> to <amean>.
Parameters:amean (char *) –
Return type:None
Multiplied()
  • This virtual method is called by the Measurement methods, to compute the measurement during a conversion.
Parameters:avalue (float) –
Return type:float
Multiply()
  • Returns a token which is the product of <self> and another token <atoken>.
Parameters:atoken (Handle_Units_Token &) –
Return type:Handle_Units_Token
Power()
  • Returns a token which is <self> to the power of another token <atoken>. The computation is possible only if <atoken> is a dimensionless constant.
Parameters:atoken (Handle_Units_Token &) –
Return type:Handle_Units_Token
  • Returns a token which is <self> to the power of <anexponent>.
Parameters:anexponent (float) –
Return type:Handle_Units_Token
Subtract()
  • Returns a token which is the subtraction of <self> and another token <atoken>. The subtraction is possible if and only if the dimensions are the same.
Parameters:atoken (Handle_Units_Token &) –
Return type:Handle_Units_Token
Update()
  • Updates the token <self> with the additional signification <amean> by concatenation of the two strings <themean> and <amean>. If the two significations are the same , an information message is written in the output device.
Parameters:amean (char *) –
Return type:None
Value()
  • Returns the value stored in the field <thevalue>.
Return type:float
  • Sets the field <thevalue> to <avalue>.
Parameters:avalue (float) –
Return type:None
Word()
  • Returns the string <theword>
Return type:TCollection_AsciiString
  • Sets the field <theword> to <aword>.
Parameters:aword (char *) –
Return type:None
thisown

The membership flag

class Units_TokensSequence(*args)

Bases: OCC.MMgt.MMgt_TShared

Return type:None
Append()
Parameters:
  • anItem (Handle_Units_Token &) –
  • aSequence (Handle_Units_TokensSequence &) –
Return type:

None

Return type:

None

ChangeSequence()
Return type:Units_TksSequence
ChangeValue()
Parameters:anIndex (int) –
Return type:Handle_Units_Token
Clear()
Return type:None
Exchange()
Parameters:
  • anIndex (int) –
  • anOtherIndex (int) –
Return type:

None

GetHandle()
InsertAfter()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Token &) –
  • anIndex
  • aSequence (Handle_Units_TokensSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Token &) –
  • anIndex
  • aSequence (Handle_Units_TokensSequence &) –
Return type:

None

Return type:

None

IsEmpty()
Return type:bool
Length()
Return type:int
Prepend()
Parameters:
  • anItem (Handle_Units_Token &) –
  • aSequence (Handle_Units_TokensSequence &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • anIndex (int) –
  • fromIndex (int) –
  • toIndex (int) –
Return type:

None

Return type:

None

Reverse()
Return type:None
Sequence()
Return type:Units_TksSequence
SetValue()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Token &) –
Return type:

None

Split()
Parameters:anIndex (int) –
Return type:Handle_Units_TokensSequence
Value()
Parameters:anIndex (int) –
Return type:Handle_Units_Token
thisown

The membership flag

class Units_Unit(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Creates and returns a unit. <aname> is the name of the unit, <asymbol> is the usual abbreviation of the unit, and <avalue> is the value in relation to the International System of Units.
Parameters:
  • aname (char *) –
  • asymbol (char *) –
  • avalue (float) –
  • aquantity (Handle_Units_Quantity &) –
Return type:

None

  • Creates and returns a unit. <aname> is the name of the unit, <asymbol> is the usual abbreviation of the unit.
Parameters:
  • aname (char *) –
  • asymbol (char *) –
Return type:

None

  • Creates and returns a unit. <aname> is the name of the unit.
Parameters:aname (char *) –
Return type:None
Dump()
  • Useful for debugging
Parameters:
  • ashift (int) –
  • alevel (int) –
Return type:

void

GetHandle()
IsEqual()
  • Compares all the symbols linked within <self> with the name of <atoken>, and returns True if there is one symbol equal to the name, False otherwise.
Parameters:astring (char *) –
Return type:bool
Name()
  • Returns the name of the unit <thename>
Return type:TCollection_AsciiString
Quantity()
  • Returns <thequantity> contained in <self>.
Return type:Handle_Units_Quantity
  • Sets the physical Quantity <aquantity> to <self>.
Parameters:aquantity (Handle_Units_Quantity &) –
Return type:None
Symbol()
  • Adds a new symbol <asymbol> attached to <self>.
Parameters:asymbol (char *) –
Return type:None
SymbolsSequence()
  • Returns the sequence of symbols <thesymbolssequence>
Return type:Handle_TColStd_HSequenceOfHAsciiString
Token()
  • Starting with <self>, returns a new Token object.
Return type:Handle_Units_Token
Value()
  • Returns the value in relation with the International System of Units.
Return type:float
  • Sets the value <avalue> to <self>.
Parameters:avalue (float) –
Return type:None
thisown

The membership flag

class Units_UnitSentence(*args)

Bases: OCC.Units.Units_Sentence

  • Creates and returns a UnitSentence. The string <astring> describes in natural language the unit or the composed unit to be analysed.
Parameters:astring (char *) –
Return type:None
  • Creates and returns a UnitSentence. The string <astring> describes in natural language the unit to be analysed. The sequence of physical quantities <asequenceofquantities> describes the available dictionary of units you want to use.
Parameters:
  • astring (char *) –
  • aquantitiessequence (Handle_Units_QuantitiesSequence &) –
Return type:

None

Analyse()
  • Analyzes the sequence of tokens created by the constructor to find the true significance of each token.
Return type:None
SetUnits()
  • For each token which represents a unit, finds in the sequence of physical quantities all the characteristics of the unit found.
Parameters:aquantitiessequence (Handle_Units_QuantitiesSequence &) –
Return type:None
thisown

The membership flag

class Units_UnitsDictionary(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Returns an empty instance of UnitsDictionary.
Return type:None
ActiveUnit()
  • Returns for <aquantity> the active unit.
Parameters:aquantity (char *) –
Return type:TCollection_AsciiString
Creates()
  • Returns a UnitsDictionary object which contains the sequence of all the units you want to consider, physical quantity by physical quantity.
Parameters:afilename (char *) –
Return type:None
Dump()
  • Dumps only the sequence of quantities without the units if <alevel> is equal to zero, and for each quantity all the units stored if <alevel> is equal to one.
Parameters:alevel (int) –
Return type:None
  • Dumps for a designated physical dimensions <adimensions> all the previously stored units.
Parameters:adimensions (Handle_Units_Dimensions &) –
Return type:None
GetHandle()
Sequence()
  • Returns the head of the sequence of physical quantities.
Return type:Handle_Units_QuantitiesSequence
UpToDate()
  • Returns true if there has been no modification of the file Units.dat since the creation of the dictionary object, false otherwise.
Return type:bool
thisown

The membership flag

class Units_UnitsLexicon(*args)

Bases: OCC.Units.Units_Lexicon

  • Returns an empty instance of UnitsLexicon
Return type:None
Creates()
  • Reads the files <afilename1> and <afilename2> to create a sequence of tokens stored in <thesequenceoftokens>.
Parameters:
  • afilename1 (char *) –
  • afilename2 (char *) –
  • amode (bool) – default value is Standard_True
Return type:

None

Dump()
  • Useful for debugging.
Return type:None
FileName2()
  • Returns in a AsciiString from TCollection the name of the file.
Return type:TCollection_AsciiString
GetHandle()
thisown

The membership flag

class Units_UnitsSequence(*args)

Bases: OCC.MMgt.MMgt_TShared

Return type:None
Append()
Parameters:
  • anItem (Handle_Units_Unit &) –
  • aSequence (Handle_Units_UnitsSequence &) –
Return type:

None

Return type:

None

ChangeSequence()
Return type:Units_UtsSequence
ChangeValue()
Parameters:anIndex (int) –
Return type:Handle_Units_Unit
Clear()
Return type:None
Exchange()
Parameters:
  • anIndex (int) –
  • anOtherIndex (int) –
Return type:

None

GetHandle()
InsertAfter()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Unit &) –
  • anIndex
  • aSequence (Handle_Units_UnitsSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Unit &) –
  • anIndex
  • aSequence (Handle_Units_UnitsSequence &) –
Return type:

None

Return type:

None

IsEmpty()
Return type:bool
Length()
Return type:int
Prepend()
Parameters:
  • anItem (Handle_Units_Unit &) –
  • aSequence (Handle_Units_UnitsSequence &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • anIndex (int) –
  • fromIndex (int) –
  • toIndex (int) –
Return type:

None

Return type:

None

Reverse()
Return type:None
Sequence()
Return type:Units_UtsSequence
SetValue()
Parameters:
  • anIndex (int) –
  • anItem (Handle_Units_Unit &) –
Return type:

None

Split()
Parameters:anIndex (int) –
Return type:Handle_Units_UnitsSequence
Value()
Parameters:anIndex (int) –
Return type:Handle_Units_Unit
thisown

The membership flag

class Units_UnitsSystem(*args)

Bases: OCC.MMgt.MMgt_TShared

  • Returns an instance of UnitsSystem initialized to the S.I. units system.
Return type:None
  • Returns an instance of UnitsSystem initialized to the S.I. units system upgraded by the base system units decription file. Attempts to find the four following files: $CSF_`aName`Defaults/.aName $CSF_`aName`SiteDefaults/.aName $CSF_`aName`GroupDefaults/.aName $CSF_`aName`UserDefaults/.aName See : Resource_Manager for the description of this file.
Parameters:
  • aName (char *) –
  • Verbose (bool) – default value is Standard_False
Return type:

None

Activate()
  • Specifies for <aquantity> the unit <aunit> used.
Parameters:
  • aquantity (char *) –
  • aunit (char *) –
Return type:

None

Activates()
  • Activates the first unit of all defined system quantities
Return type:None
ActiveUnit()
  • Returns for <aquantity> the active unit.
Parameters:aquantity (char *) –
Return type:TCollection_AsciiString
ActiveUnitsSequence()
  • Returns a sequence of integer in correspondance with the sequence of quantities, which indicates, for each redefined quantity, the index into the sequence of units, of the active unit.
Return type:Handle_TColStd_HSequenceOfInteger
ConvertSIValueToUserSystem()
  • Converts the real value <avalue> from the S.I. system of units to the user system of units. <aquantity> is the physical dimensions of the measurement.
Parameters:
  • aquantity (char *) –
  • avalue (float) –
Return type:

float

ConvertUserSystemValueToSI()
  • Converts the real value <avalue> from the user system of units to the S.I. system of units. <aquantity> is the physical dimensions of the measurement.
Parameters:
  • aquantity (char *) –
  • avalue (float) –
Return type:

float

ConvertValueToUserSystem()
  • Converts a real value <avalue> from the unit <aunit> belonging to the physical dimensions <aquantity> to the corresponding unit of the user system.
Parameters:
  • aquantity (char *) –
  • avalue (float) –
  • aunit (char *) –
Return type:

float

Dump()
Return type:None
GetHandle()
IsEmpty()
  • Returns True if no units has been defined in the system.
Return type:bool
QuantitiesSequence()
  • Returns the sequence of refined quantities.
Return type:Handle_Units_QuantitiesSequence
Remove()
  • Removes for <aquantity> the unit <aunit> used.
Parameters:
  • aquantity (char *) –
  • aunit (char *) –
Return type:

None

Specify()
  • Specifies for <aquantity> the unit <aunit> used.
Parameters:
  • aquantity (char *) –
  • aunit (char *) –
Return type:

None

thisown

The membership flag

class Units_UtsSequence(*args)

Bases: OCC.TCollection.TCollection_BaseSequence

Return type:None
Parameters:Other (Units_UtsSequence &) –
Return type:None
Append()
Parameters:
  • T (Handle_Units_Unit &) –
  • S (Units_UtsSequence &) –
Return type:

None

Return type:

None

Assign()
Parameters:Other (Units_UtsSequence &) –
Return type:Units_UtsSequence
ChangeValue()
Parameters:Index (int) –
Return type:Handle_Units_Unit
Clear()
Return type:None
First()
Return type:Handle_Units_Unit
InsertAfter()
Parameters:
  • Index (int) –
  • T (Handle_Units_Unit &) –
  • Index
  • S (Units_UtsSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (int) –
  • T (Handle_Units_Unit &) –
  • Index
  • S (Units_UtsSequence &) –
Return type:

None

Return type:

None

Last()
Return type:Handle_Units_Unit
Prepend()
Parameters:
  • T (Handle_Units_Unit &) –
  • S (Units_UtsSequence &) –
Return type:

None

Return type:

None

Remove()
Parameters:
  • Index (int) –
  • FromIndex (int) –
  • ToIndex (int) –
Return type:

None

Return type:

None

Set()
Parameters:Other (Units_UtsSequence &) –
Return type:Units_UtsSequence
SetValue()
Parameters:
  • Index (int) –
  • I (Handle_Units_Unit &) –
Return type:

None

Split()
Parameters:
  • Index (int) –
  • Sub (Units_UtsSequence &) –
Return type:

None

Value()
Parameters:Index (int) –
Return type:Handle_Units_Unit
thisown

The membership flag

new_instancemethod(func, inst, cls)
register_handle(handle, base_object)

Inserts the handle into the base object to prevent memory corruption in certain cases

class units

Bases: object

static Convert()
  • Converts <avalue> expressed in <afirstunit> into the <asecondunit>.
Parameters:
  • avalue (float) –
  • afirstunit (char *) –
  • asecondunit (char *) –
Return type:

float

static DictionaryOfUnits(*args) → OCC.Units.Handle_Units_UnitsDictionary
  • Returns a unique instance of the dictionary of units. If <amode> is True, then it forces the recomputation of the dictionary of units.
Parameters:amode (bool) – default value is Standard_False
Return type:Handle_Units_UnitsDictionary
static Dimensions()
  • return the dimension associated to the Type
Parameters:aType (char *) –
Return type:Handle_Units_Dimensions
static FirstQuantity()
  • Returns the first quantity string founded from the unit <aUnit>.
Parameters:aunit (char *) –
Return type:char *
static FromSI()
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

static LexiconFile()
  • Defines the location of the file containing the lexicon useful in manipulating composite units.
Parameters:afile (char *) –
Return type:void
static LexiconFormula(*args) → OCC.Units.Handle_Units_Lexicon
  • Return a unique instance of LexiconFormula.
Return type:Handle_Units_Lexicon
static LexiconUnits(*args) → OCC.Units.Handle_Units_Lexicon
  • Returns a unique instance of the Units_Lexicon. If <amode> is True, it forces the recomputation of the dictionary of units, and by consequence the completion of the Units_Lexicon.
Parameters:amode (bool) – default value is Standard_True
Return type:Handle_Units_Lexicon
static NullDimensions()
  • Returns always the same instance of Dimensions.
Return type:Handle_Units_Dimensions
static Quantity()
  • Returns a unique quantity instance corresponding to <aquantity>.
Parameters:aquantity (char *) –
Return type:Handle_Units_Quantity
static ToSI()
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

static UnitsFile()
  • Defines the location of the file containing all the information useful in creating the dictionary of all the units known to the system.
Parameters:afile (char *) –
Return type:void
thisown

The membership flag

units_Convert()
  • Converts <avalue> expressed in <afirstunit> into the <asecondunit>.
Parameters:
  • avalue (float) –
  • afirstunit (char *) –
  • asecondunit (char *) –
Return type:

float

units_DictionaryOfUnits(*args) → OCC.Units.Handle_Units_UnitsDictionary
  • Returns a unique instance of the dictionary of units. If <amode> is True, then it forces the recomputation of the dictionary of units.
Parameters:amode (bool) – default value is Standard_False
Return type:Handle_Units_UnitsDictionary
units_Dimensions()
  • return the dimension associated to the Type
Parameters:aType (char *) –
Return type:Handle_Units_Dimensions
units_FirstQuantity()
  • Returns the first quantity string founded from the unit <aUnit>.
Parameters:aunit (char *) –
Return type:char *
units_FromSI()
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

units_LexiconFile()
  • Defines the location of the file containing the lexicon useful in manipulating composite units.
Parameters:afile (char *) –
Return type:void
units_LexiconFormula(*args) → OCC.Units.Handle_Units_Lexicon
  • Return a unique instance of LexiconFormula.
Return type:Handle_Units_Lexicon
units_LexiconUnits(*args) → OCC.Units.Handle_Units_Lexicon
  • Returns a unique instance of the Units_Lexicon. If <amode> is True, it forces the recomputation of the dictionary of units, and by consequence the completion of the Units_Lexicon.
Parameters:amode (bool) – default value is Standard_True
Return type:Handle_Units_Lexicon
units_NullDimensions()
  • Returns always the same instance of Dimensions.
Return type:Handle_Units_Dimensions
units_Quantity()
  • Returns a unique quantity instance corresponding to <aquantity>.
Parameters:aquantity (char *) –
Return type:Handle_Units_Quantity
units_ToSI()
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

units_UnitsFile()
  • Defines the location of the file containing all the information useful in creating the dictionary of all the units known to the system.
Parameters:afile (char *) –
Return type:void