Color

Inheritance diagram

Inheritance diagram of ORSModel.ors.Color, ORSModel.ors.Unmanaged, ORSModel.ors.ORSBaseClass

Classes

Color

class ORSModel.ors.Color

Bases: Unmanaged

Wraps and defines colors.

class OPACITY_FLAG(*values)

Bases: IntEnum

createFromPythonRepresentation(aPythonRepresentation: str) → ORSModel.ors.Color

Create aColor from a python representation a static method.

Parameters:

aPythonRepresentation (str) – a string

Returns:

output (ORSModel.ors.Color) – a color (a Color)

getAlpha(self) → float

Gets the alpha component of the color.

Note

Color components are expressed as values between 0 and 1.

Returns:

output (float) – the alpha value (a double)

getBlue(self) → float

Gets the blue component of the color.

Note

Color components are expressed as values between 0 and 1.

Returns:

output (float) – the blue value (a double)

getClassNameStatic() → str

getClassNameStatic

Returns:

output (str)

getComponentAtIndex(self, index: int) → float

Gets a component of the color.

Note

Color components are expressed as values between 0 and 1.

Note

Color components indexes are zero-based.

Parameters:

index (int) – the component index (a uint16_t)

Returns:

output (float) – a double value

getComponentCount(self) → int

Gets the number of component of the color.

Returns:

output (int) – the component count (a uint16_t)

getComponents(self) → ORSModel.ors.ArrayDouble

Gets all the components of the color.

Note

Color components are expressed as values between 0 and 1.

Returns:

output (ORSModel.ors.ArrayDouble) – a double array (an ArrayDouble)

getGreen(self) → float

Gets the green component of the color.

Note

Color components are expressed as values between 0 and 1.

Returns:

output (float) – the green value (a double)

getIsEqualTo(self, aColor: ORSModel.ors.Color) → bool

Checks for equality to another color.

Parameters:

aColor (ORSModel.ors.Color) – a color (a Color)

Returns:

output (bool) – true if the colors are equal, false otherwise

getRed(self) → float

Gets the red component of the color.

Note

Color components are expressed as values between 0 and 1.

Returns:

output (float) – the red value (a double)

none() → Color
Returns:

output (Color)

setAlpha(self, alpha: float)

Sets the alpha component of the color.

Note

Color components are expressed as values between 0 and 1.

Parameters:

alpha (float) – the alpha value (a double)

setBlue(self, blue: float)

Sets the blue component of the color.

Note

Color components are expressed as values between 0 and 1.

Parameters:

blue (float) – the blue value (a double)

setComponentAtIndex(self, index: int, component: float)

Sets a component of the color.

Note

Color components are expressed as values between 0 and 1.

Note

Color components indexes are zero-based.

Parameters:
  • index (int) – the component index (a uint16_t)

  • component (float) – a double value

setComponents(self, components: ORSModel.ors.ArrayDouble)

Sets all the components of the color.

Note

Color components are expressed as values between 0 and 1.

Parameters:

components (ORSModel.ors.ArrayDouble) – a double array (an ArrayDouble)

setGreen(self, green: float)

Sets the green component of the color.

Note

Color components are expressed as values between 0 and 1.

Parameters:

green (float) – the green value (a double)

setRed(self, red: float)

Sets the red component of the color.

Note

Color components are expressed as values between 0 and 1.

Parameters:

red (float) – the red value (a double)

Unmanaged

class ORSModel.ors.Unmanaged

Bases: ORSBaseClass

Abstract class for objects that are not managed by the core library. Unmanaged objects are transient objects.

atomicLoad(sFilename: str) → Unmanaged

Creates an object from a file where an object was saved.

Parameters:

sFilename (str) – path of the file to load

Returns:

output (Unmanaged) – an unmanaged object, or none() if the load fails

atomicSave(self, aFilename: str) → int

Saves the object to a file.

Parameters:

aFilename (str) – path of the file to save

Returns:

output (int) – 0 if successful, otherwise an error code

createFromPythonRepresentation(aPythonRepresentation: str) → ORSModel.ors.Unmanaged

Create aUnmanaged Object from a python representation a static method.

Parameters:

aPythonRepresentation (str)

Returns:

output (ORSModel.ors.Unmanaged)

fromPythonRepresentation(self, aPythonRepresentation: str) → bool

Create aUnmanaged object from a Python string representation.

Parameters:

aPythonRepresentation (str) – a Python evaluable string representation (a string)

Returns:

output (bool) – true if parsing worked, false otherwise (a bool)

getClassName(self) → str

Retrieves the class name of the core object wrapped by this Interface object.

Returns:

output (str)

getClassNameStatic() → str

getClassNameStatic

Returns:

output (str)

getDataChecksum(self) → str
Returns:

output (str)

getIsInstanceOf(self, pProgId: str) → bool

Queries the object to know if it is an instance of a certain class.

Parameters:

pProgId (str)

Returns:

output (bool)

getPythonRepresentation(self) → str

Gets a Python evaluable string representation.

Returns:

output (str)

isNone(self) → bool

Checks if the receiver is none.

Returns:

output (bool)

isNotNone(self) → bool

Checks if the receiver is not none.

Returns:

output (bool)

none() → Unmanaged
Returns:

output (Unmanaged)

ORSBaseClass

class ORSModel.ors.ORSBaseClass

An abstract class from which all objects issued from the ORS Core Library inherit.

isManaged(self) → bool
Returns:

output (bool)

isNone(self) → bool
Returns:

output (bool)