KnowledgeInterfaces Interface CATICkeMKSUnit
Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.
interface CATICkeMKSUnit
Interface dedicated to MKS equivalent management.
Role: Magnitudes are equivalent to a combination of primitive magnitudes
(for example : a speed is equivalent to Length divided by time).
This class gives the list of exponent (positive or negative) for each primitive magnitude
The primitives are :
M : Length
K : Mass
S : Time
A : Ampere
T : Temperature
C : Candela
O : Mole
P : Price
R : Angle
E : Solid angle
Scalar : scalar
Usage :
#include "CATICkeParmFactory.h"
#include "CATICkeMKSUnit.h"
//------------------------------------------------
// MKS Units
//------------------------------------------------
// you can create mks unit equivalent to a scalar
CATICkeMKSUnit_var mk1 = fact->CreateMKSUnit ();
Assume (mk1->Get(MKSUnitM) == 0);
// you can create mks unit equivalent to a simple standard unit
CATICkeMKSUnit_var area = fact->CreateMKSUnit (MKSUnitM,2);
Assume (area->Get(MKSUnitM) == 2);
// you can create mks unit equivalent to a combination of units
CATICkeMKSUnit_var density = fact->CreateMKSUnit (-3,1,0,0,0,0,0,0,0,0);
Assume (density->Get(MKSUnitM) == -3);
This interface is mono implemented by a C++ object. This object is created by the volatile factory CATICkeParmFactory.
- See also:
- ,
Method Index
- o
Compare(CATICkeMKSUnit_var&)
- Compares one mks with another.
- o
Divide(CATICkeMKSUnit_var&,CATICkeMKSUnit_var&)
- Divides 2 mks unit (example a Length divided by a Length produces a scalar).
- o
Get(CATICkeMKSUnit::Basic)
- Reads the exponent of a basic primitive.
- o
Multiply(CATICkeMKSUnit_var&,CATICkeMKSUnit_var&)
- Multiply 2 MKSunit (example a Length multiplied with a Length produces an area).
- o
Power(int,CATICkeMKSUnit_var&)
- Power (example a Length power 3 produces a volume).
- o
Set(CATICkeMKSUnit::Basic,int)
- Sets a basic primitive exponent.
- o
Show()
- Shows a view of the MKS equivalent in NLS.
Enumerated Type Index
- o
Basic
- List of existing MKS primitive magnitudes.
Methods
o Compare
public virtual Compare( | const | iMKSToCompare) |
-
Compares one mks with another.
- Parameters:
-
- iMKSToCompare
- MKS to compare
- Returns:
-
Legal values: CATCke::True if same MKS
CATCke::False if not
o Divide
public virtual Divide( | const | iMKSDividedBy, |
| | oResult) |
-
Divides 2 mks unit (example a Length divided by a Length produces a scalar).
- Parameters:
-
- iMKSDividedBy
- the unit that must divide the current unit
- oResult
- the resulting unit
- Returns:
-
Legal values: CATCke::True if division Ok
CATCke::False if error in MKS division
o Get
public virtual Get( | const | iPrimitiveMagnitude) |
-
Reads the exponent of a basic primitive.
- Parameters:
-
- iPrimitiveMagnitude
- primitive magnitude
- Returns:
- the exponent for a basic primitive
o Multiply
public virtual Multiply( | const | iMKSMultipliedWith, |
| | oResult) |
-
Multiply 2 MKSunit (example a Length multiplied with a Length produces an area).
- Parameters:
-
- iMKSMultipliedWith
- the parameter with which the multiplication occurs.
- oResult
- The resulting unit.
- Returns:
-
Legal values: CATCke::True if multiplication Ok
CATCke::False if error in MKS multiplication
o Power
public virtual Power( | const | iCoeff, |
| | oResult) |
-
Power (example a Length power 3 produces a volume).
- Parameters:
-
- iCoeff
- exponent (positive or negative)
- oResult
- the resulting unit
- Returns:
-
Legal values: CATCke::True if operation Ok
CATCke::False if error in MKS operation
o Set
public virtual Set( | const | iPrimitiveMagnitude, |
| const | iCoeff) |
-
Sets a basic primitive exponent.
- Parameters:
-
- iPrimitiveMagnitude
- primitive magnitude
- iCoeff
- exponent This method is supposed to be used only at definition stage of a magnitude.
o Show
-
Shows a view of the MKS equivalent in NLS.
- Returns:
- a view of the MKS equivalent in NLS.
Enumerated Types
o Basic
-
enum Basic {
M,
K,
S,
A,
T,
C,
O,
P,
R,
E,
Scalar
}
List of existing MKS primitive magnitudes.
Legal values:
M for meter
K for kilogram
S for second
A for amper
T for temperature
C for candela
O for number of mole
P for price
R for radian
E for steradian
This object is included in the file: CATICkeMKSUnit.h
If needed, your Imakefile.mk should include the module: KnowledgeItf
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.