OCC.Units module

class OCC.Units.Handle_Units_Lexicon(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_QuantitiesSequence(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_SequenceNodeOfQtsSequence(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

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

The membership flag

class OCC.Units.Handle_Units_SequenceNodeOfTksSequence(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

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

The membership flag

class OCC.Units.Handle_Units_SequenceNodeOfUtsSequence(*args)

Bases: OCC.TCollection.Handle_TCollection_SeqNode

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

The membership flag

class OCC.Units.Handle_Units_ShiftedToken(*args)

Bases: OCC.Units.Handle_Units_Token

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

The membership flag

class OCC.Units.Handle_Units_ShiftedUnit(*args)

Bases: OCC.Units.Handle_Units_Unit

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

The membership flag

class OCC.Units.Handle_Units_Token(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_TokensSequence(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_Unit(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_UnitsDictionary(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_UnitsLexicon(*args)

Bases: OCC.Units.Handle_Units_Lexicon

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

The membership flag

class OCC.Units.Handle_Units_UnitsSequence(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.Handle_Units_UnitsSystem(*args)

Bases: OCC.MMgt.Handle_MMgt_TShared

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

The membership flag

class OCC.Units.SwigPyIterator(*args, **kwargs)

Bases: object

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

The membership flag

value()
class OCC.Units.Units_Explorer(*args)

Bases: object

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 OCC.Units.Units_Lexicon

Bases: OCC.MMgt.MMgt_TShared

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()

Units_Lexicon_GetHandle(Units_Lexicon self) -> Handle_Units_Lexicon

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 OCC.Units.Units_MathSentence(*args)

Bases: OCC.Units.Units_Sentence

thisown

The membership flag

class OCC.Units.Units_Measurement(*args)

Bases: object

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 OCC.Units.Units_QtsSequence

Bases: OCC.TCollection.TCollection_BaseSequence

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 (Standard_Integer) –
Return type:Handle_Units_Quantity
Clear()
Return type:None
First()
Return type:Handle_Units_Quantity
InsertAfter()
Parameters:
  • Index (Standard_Integer) –
  • T (Handle_Units_Quantity &) –
  • Index
  • S (Units_QtsSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (Standard_Integer) –
  • 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 (Standard_Integer) –
  • FromIndex (Standard_Integer) –
  • ToIndex (Standard_Integer) –
Return type:

None

Return type:

None

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

None

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

None

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

The membership flag

class OCC.Units.Units_QuantitiesSequence

Bases: OCC.MMgt.MMgt_TShared

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

None

Return type:

None

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

None

GetHandle()

Units_QuantitiesSequence_GetHandle(Units_QuantitiesSequence self) -> Handle_Units_QuantitiesSequence

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

None

Return type:

None

InsertBefore()
Parameters:
  • anIndex (Standard_Integer) –
  • 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 (Standard_Integer) –
  • fromIndex (Standard_Integer) –
  • toIndex (Standard_Integer) –
Return type:

None

Return type:

None

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

None

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

The membership flag

class OCC.Units.Units_Sentence(*args)

Bases: object

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 OCC.Units.Units_SequenceNodeOfQtsSequence(*args)

Bases: OCC.TCollection.TCollection_SeqNode

GetHandle()

Units_SequenceNodeOfQtsSequence_GetHandle(Units_SequenceNodeOfQtsSequence self) -> Handle_Units_SequenceNodeOfQtsSequence

Value()
Return type:Handle_Units_Quantity
thisown

The membership flag

class OCC.Units.Units_SequenceNodeOfTksSequence(*args)

Bases: OCC.TCollection.TCollection_SeqNode

GetHandle()

Units_SequenceNodeOfTksSequence_GetHandle(Units_SequenceNodeOfTksSequence self) -> Handle_Units_SequenceNodeOfTksSequence

Value()
Return type:Handle_Units_Token
thisown

The membership flag

class OCC.Units.Units_SequenceNodeOfUtsSequence(*args)

Bases: OCC.TCollection.TCollection_SeqNode

GetHandle()

Units_SequenceNodeOfUtsSequence_GetHandle(Units_SequenceNodeOfUtsSequence self) -> Handle_Units_SequenceNodeOfUtsSequence

Value()
Return type:Handle_Units_Unit
thisown

The membership flag

class OCC.Units.Units_ShiftedToken(*args)

Bases: OCC.Units.Units_Token

GetHandle()

Units_ShiftedToken_GetHandle(Units_ShiftedToken self) -> Handle_Units_ShiftedToken

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

The membership flag

class OCC.Units.Units_ShiftedUnit(*args)

Bases: OCC.Units.Units_Unit

GetHandle()

Units_ShiftedUnit_GetHandle(Units_ShiftedUnit self) -> Handle_Units_ShiftedUnit

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 OCC.Units.Units_TksSequence

Bases: OCC.TCollection.TCollection_BaseSequence

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 (Standard_Integer) –
Return type:Handle_Units_Token
Clear()
Return type:None
First()
Return type:Handle_Units_Token
InsertAfter()
Parameters:
  • Index (Standard_Integer) –
  • T (Handle_Units_Token &) –
  • Index
  • S (Units_TksSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (Standard_Integer) –
  • 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 (Standard_Integer) –
  • FromIndex (Standard_Integer) –
  • ToIndex (Standard_Integer) –
Return type:

None

Return type:

None

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

None

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

None

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

The membership flag

class OCC.Units.Units_Token(*args)

Bases: OCC.MMgt.MMgt_TShared

Add()
Parameters:aninteger (Standard_Integer) –
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 (Standard_Integer) –
  • alevel (Standard_Integer) –
Return type:

void

GetHandle()

Units_Token_GetHandle(Units_Token self) -> Handle_Units_Token

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 OCC.Units.Units_TokensSequence

Bases: OCC.MMgt.MMgt_TShared

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

None

Return type:

None

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

None

GetHandle()

Units_TokensSequence_GetHandle(Units_TokensSequence self) -> Handle_Units_TokensSequence

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

None

Return type:

None

InsertBefore()
Parameters:
  • anIndex (Standard_Integer) –
  • 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 (Standard_Integer) –
  • fromIndex (Standard_Integer) –
  • toIndex (Standard_Integer) –
Return type:

None

Return type:

None

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

None

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

The membership flag

class OCC.Units.Units_Unit(*args)

Bases: OCC.MMgt.MMgt_TShared

Dump()
  • Useful for debugging
Parameters:
  • ashift (Standard_Integer) –
  • alevel (Standard_Integer) –
Return type:

void

GetHandle()

Units_Unit_GetHandle(Units_Unit self) -> Handle_Units_Unit

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 OCC.Units.Units_UnitSentence(*args)

Bases: OCC.Units.Units_Sentence

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 OCC.Units.Units_UnitsDictionary

Bases: OCC.MMgt.MMgt_TShared

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 (Standard_Integer) –
Return type:None
  • Dumps for a designated physical dimensions <adimensions> all the previously stored units.
Parameters:adimensions (Handle_Units_Dimensions &) –
Return type:None
GetHandle()

Units_UnitsDictionary_GetHandle(Units_UnitsDictionary self) -> Handle_Units_UnitsDictionary

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 OCC.Units.Units_UnitsLexicon

Bases: OCC.Units.Units_Lexicon

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

  • 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()

Units_UnitsLexicon_GetHandle(Units_UnitsLexicon self) -> Handle_Units_UnitsLexicon

thisown

The membership flag

class OCC.Units.Units_UnitsSequence

Bases: OCC.MMgt.MMgt_TShared

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

None

Return type:

None

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

None

GetHandle()

Units_UnitsSequence_GetHandle(Units_UnitsSequence self) -> Handle_Units_UnitsSequence

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

None

Return type:

None

InsertBefore()
Parameters:
  • anIndex (Standard_Integer) –
  • 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 (Standard_Integer) –
  • fromIndex (Standard_Integer) –
  • toIndex (Standard_Integer) –
Return type:

None

Return type:

None

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

None

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

The membership flag

class OCC.Units.Units_UnitsSystem(*args)

Bases: OCC.MMgt.MMgt_TShared

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()

Units_UnitsSystem_GetHandle(Units_UnitsSystem self) -> Handle_Units_UnitsSystem

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 OCC.Units.Units_UtsSequence

Bases: OCC.TCollection.TCollection_BaseSequence

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 (Standard_Integer) –
Return type:Handle_Units_Unit
Clear()
Return type:None
First()
Return type:Handle_Units_Unit
InsertAfter()
Parameters:
  • Index (Standard_Integer) –
  • T (Handle_Units_Unit &) –
  • Index
  • S (Units_UtsSequence &) –
Return type:

None

Return type:

None

InsertBefore()
Parameters:
  • Index (Standard_Integer) –
  • 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 (Standard_Integer) –
  • FromIndex (Standard_Integer) –
  • ToIndex (Standard_Integer) –
Return type:

None

Return type:

None

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

None

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

None

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

The membership flag

class OCC.Units.units(*args, **kwargs)

Bases: object

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

float

static DictionaryOfUnits(*args)
  • 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
  • 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(*args)
  • return the dimension associated to the Type
Parameters:aType (char *) –
Return type:Handle_Units_Dimensions
static FirstQuantity(*args)
  • Returns the first quantity string founded from the unit <aUnit>.
Parameters:aunit (char *) –
Return type:char *
static FromSI(*args)
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

static LexiconFile(*args)
  • Defines the location of the file containing the lexicon useful in manipulating composite units.
Parameters:afile (char *) –
Return type:void
static LexiconFormula()
  • Return a unique instance of LexiconFormula.
Return type:Handle_Units_Lexicon
static LexiconUnits(*args)
  • 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
  • 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(*args)
  • Returns a unique quantity instance corresponding to <aquantity>.
Parameters:aquantity (char *) –
Return type:Handle_Units_Quantity
static ToSI(*args)
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

static UnitsFile(*args)
  • 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

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

float

OCC.Units.units_DictionaryOfUnits(*args)
  • 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
  • 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
OCC.Units.units_Dimensions(*args)
  • return the dimension associated to the Type
Parameters:aType (char *) –
Return type:Handle_Units_Dimensions
OCC.Units.units_FirstQuantity(*args)
  • Returns the first quantity string founded from the unit <aUnit>.
Parameters:aunit (char *) –
Return type:char *
OCC.Units.units_FromSI(*args)
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

OCC.Units.units_LexiconFile(*args)
  • Defines the location of the file containing the lexicon useful in manipulating composite units.
Parameters:afile (char *) –
Return type:void
OCC.Units.units_LexiconFormula()
  • Return a unique instance of LexiconFormula.
Return type:Handle_Units_Lexicon
OCC.Units.units_LexiconUnits(*args)
  • 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
  • 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
OCC.Units.units_NullDimensions()
  • Returns always the same instance of Dimensions.
Return type:Handle_Units_Dimensions
OCC.Units.units_Quantity(*args)
  • Returns a unique quantity instance corresponding to <aquantity>.
Parameters:aquantity (char *) –
Return type:Handle_Units_Quantity
OCC.Units.units_ToSI(*args)
Parameters:
  • aData (float) –
  • aUnit (char *) –
  • aData
  • aUnit
  • aDim (Handle_Units_Dimensions &) –
Return type:

float

Return type:

float

OCC.Units.units_UnitsFile(*args)
  • 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