Model

Inheritance diagram

Inheritance diagram of ORSModel.ors.Model

Classes

Model

class ORSModel.ors.Model

brief_description: Main gateway into the author: Normand Mongeau. All other members of ORS participated. version: 1.2 date: September 2006 Main gateway into the ORS Core library. Used for general functionality of the ORS Core library.

static addAListOfObjectsToSelection(aListOfObjects, contextInstance)

Adds a list of objects to selection for a given context.

Parameters:
  • aListOfObjects (ORSModel.ors.Managed) – list of objects to add (list)
  • contextInstance (plugin instance) – context instance
Count aListOfObjects:
 

[0, None]

Note

Only representable object can be un selected

addCallbackToClassEvent(aClassName: str, anEventName: str, sCallbackName: str, callbackInfo: int, permanent: bool) → bool

Adds a callback subscription to a class event.

Parameters:
  • aClassName (str) – the class name (a string)
  • anEventName (str) – the event name (a string)
  • sCallbackName (str) – the callback name (a string)
  • callbackInfo (bytes) – a pointer to a ORS_EVENT_CALLBACK_INFO struct
  • permanent (bool) – true to make the callback permanent (will survive a new session), false for a normal callback
Returns:

output (bool) – true if operation was successful, false otherwise (the callback already existed)

addCallbackToGlobalEvent(anEventName: str, sCallbackName: str, callbackInfo: int, permanent: bool) → bool

Adds a callback subscription to a global event.

Parameters:
  • anEventName (str) – the event name (a string)
  • sCallbackName (str) – the callback name (a string)
  • callbackInfo (bytes) – a pointer to a ORS_EVENT_CALLBACK_INFO struct
  • permanent (bool) – true to make the callback permanent (will survive a new session), false for a normal callback
Returns:

output (bool) – true if operation was successful, false otherwise (the callback already existed)

deleteAllObjects(pFinalExit: bool) → None

Deletes every core object.

Parameters:pFinalExit (bool) –
downgrade() → None
getActiveWorkerThreadsCount() → int

Returns the number of active worker threads.

Returns:output (int) – a count of active worker threads (a uint32_t)
static getAllSelectedObjectsOfClass(pProgId, contextInstance)

Returns a flattened list of all representable selected object of the given class and context.

Parameters:
  • pProgId (str) – the ProgId of the class to test against
  • contextInstance (plugin instance) – context instance
Return:

a list of all selected objects

Rtype:

ORSModel.ors.Managed

Rcount:

[0, None]

getAvailableCPUCount() → int

Returns how many CPUs are available.

Note

In order to prepare some computations to be multi-threaded, this method returns how many CPUs are available.

Returns:output (int) – a CPU count (a uint16_t)
getBuildNumber() → str

Returns the Core library internal build number.

Returns:output (str) – a build number text (a string)
getClassEventCallbackEnabled(aClassName: str, sEventName: str, sCallbackName: str) → bool

Gets the enabled state of a callback subscription to a class event.

Parameters:
  • aClassName (str) – the event name (a string)
  • sEventName (str) – the callback name (a string)
  • sCallbackName (str) –
Returns:

output (bool) – true if the callback is enabled, false if the callback is disabled or if the callback was not found

getCredentialsFilePath() → str
Returns:output (str) –
getCurrentActivationFor(product: int) → str
Parameters:product (int) –
Returns:output (str) –
classmethod getCurrentAvailableGPUMemoryNVIDIADisplay()

Returns available GPU memory (in kb) on current NVIDIA display.

Note

This function should not be called in a run in back ground function. Also application should be running so that the OpenGL context is started.

getCurrentLicenseInformationFor(product: int) → str
Parameters:product (int) –
Returns:output (str) –
getDLLFilename() → str

Returns the Core library file name.

Returns:output (str) – a fully qualified file path (a string)
getDLLVersion() → str

Returns the Core library internal version.

Returns:output (str) – a version text (a string)
getDebugMode() → bool

Checks if the Core library is in debug mode.

Returns:output (bool) – true if in debug mode, false otherwise
getEpsilon() → float
Returns:output (float) –
getFontNames() → str

Gets the available font names.

Returns:output (str) –
getGlobalEventCallbackEnabled(sEventName: str, sCallbackName: str) → bool

Gets the enabled state of a callback subscription to a global event.

Parameters:
  • sEventName (str) – the event name (a string)
  • sCallbackName (str) – the callback name (a string)
Returns:

output (bool) – true if the callback is enabled, false if the callback is disabled or if the callback was not found

getIsRunningInReleaseMode() → bool

Checks if the Core library is running in release mode.

Returns:output (bool) – true if in release mode, false otherwise
getLicenseExpiry() → int
Returns:output (int) –
getMajorVersion() → str

Returns the Core library internal major version.

Returns:output (str) – a version text (a string)
getMaximumViewportHeight() → int
Returns:output (int) –
getMaximumViewportWidth() → int
Returns:output (int) –
getModelObjectsCount() → int

Returns the count of currently live objects.

Returns:output (int) –
getPresetFileExtension() → str

Gets the extension of preset files.

Returns:output (str) –
getStartupResultCode() → int
Returns:output (int) –
classmethod getTotalGPUMemoryNVIDIADisplay()

Returns the total GPU memory (in kb) on current NVIDIA display.

Note

This function should not be called in a run in back ground function. Also application should be running so that the OpenGL context is started.

getWasLicenseDowngraded() → bool
Returns:output (bool) –
hasFeature(iFeature: int, iMode: int) → bool
Parameters:
  • iFeature (int) –
  • iMode (int) –
Returns:

output (bool) –

initializeUIDeleteFramework() → None

Starts the UI delete framework. The UI is then responsible for periodically invokingprocessUIDelete() from the UI thread.

isAMD() → bool

Checks if an AMD dedicated GPU is present.

Returns:output (bool) – true if an AMD GPU was detected, false otherwise
isAWS() → bool
Returns:output (bool) –
isNVidia() → bool

Checks if an Nvidia dedicated GPU is present.

Returns:output (bool) – true if an Nvidia GPU was detected, false otherwise
isNotNone(self) → bool
Returns:output (bool) –
loadSessionFromFile(aFilename: str) → bool

Loads a session file.

Parameters:aFilename (str) – a fully qualified file path (a string)
Returns:output (bool) – true if operation was successful, false otherwise
processUIDelete() → None

Gives the UI delete sub-system some processing time. Must be invoked from the UI thread.

removeCallbackFromClassEvent(aClassName: str, sEventName: str, sCallbackName: str) → bool

Removes a callback subscription to a class event.

Parameters:
  • aClassName (str) – the class name (a string)
  • sEventName (str) – the event name (a string)
  • sCallbackName (str) – the callback name (a string)
Returns:

output (bool) – true if operation was successful, false otherwise (the callback was not found)

removeCallbackFromGlobalEvent(sEventName: str, sCallbackName: str) → bool

Removes a callback subscription to a global event.

Parameters:
  • sEventName (str) – the event name (a string)
  • sCallbackName (str) – the callback name (a string)
Returns:

output (bool) – true if removal was successful, false otherwise (the callback did not exist)

saveSessionToFile(pSessionName: str, aFilename: str, progress: ORSModel.ors.Progress) → int

Saves the current session to a file.

Parameters:
  • pSessionName (str) – a session name (a string)
  • aFilename (str) – a fully qualified file path (a string)
  • progress (ORSModel.ors.Progress) – a progress object or none (a Progress)
Returns:

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

static selectExclusivelyAListOfObjects(aListOfObjects, contextInstance)

Selects only the given objects for the context.

Parameters:
  • aListOfObjects (ORSModel.ors.Managed) – list of objects to be selected exclusively (list)
  • contextInstance (plugin instance) – context instance
Count aListOfObjects:
 

[0, None]

Note

Only representable object can be un selected

setAvailableCPUCount(pNbCPUs: int) → None

Tells the Core library to limit the number of CPUs it should use.

Note

Many algorithms are multi-threaded, use this method if you want to limit the number of CPUs used internally, to allow other applications to be responsive for example.

Note

Setting this value to 0 means to use all CPUs.

Parameters:pNbCPUs (int) – a count (a uint16_t)
setClassEventCallbackEnabled(aClassName: str, sEventName: str, sCallbackName: str, bValue: bool) → bool

Enables/disables a callback subscription to a class event.

Parameters:
  • aClassName (str) – the event name (a string)
  • sEventName (str) – the callback name (a string)
  • sCallbackName (str) – true to enable the callback, false to disable it
  • bValue (bool) –
Returns:

output (bool) – true if operation was successful, false otherwise (the callback was not found)

setDebugMode(pState: bool) → None

Sets the COM’s debug mode on or off.

Parameters:pState (bool) –
setEpsilon(anEpsilon: float) → None
Parameters:anEpsilon (float) –
setGlobalEventCallbackEnabled(sEventName: str, sCallbackName: str, bValue: bool) → bool

Enables/disables a callback subscription to a global event.

Parameters:
  • sEventName (str) – the event name (a string)
  • sCallbackName (str) – the callback name (a string)
  • bValue (bool) – true to enable the callback, false to disable it
Returns:

output (bool) – true if operation was successful, false otherwise (the callback was not found)

setPrecision(iPrecision: int) → None

Sets the precision of computations when displayed.

Parameters:iPrecision (int) –
startWorkersFor(pWorkData: int) → None
Parameters:pWorkData (bytes) –
stopWorkersWithID(id: int) → None
Parameters:id (int) –
triggerGlobalEvent(anEventName: str, sData: str) → bool

Triggers a global event.

Parameters:
  • anEventName (str) – the event name (a string)
  • sData (str) – an event specific string
Returns:

output (bool) – true if event was triggered, false otherwise

static unselectAListOfObjects(aListOfObjects, contextInstance)

Removes a list of objects to selection for a given context.

Parameters:
  • aListOfObjects (ORSModel.ors.Managed) – list of objects to remove (list)
  • contextInstance (plugin instance) – context instance
Count aListOfObjects:
 

[0, None]

static unselectAllObjects(contextInstance)

Removes all selected object of selection for the given context.

Parameters:contextInstance (plugin instance) – context instance
yieldUIWorker() → None

Gives the UI worker control to process any pending tasks that it holds.