OrsObjectPropertiesList

Manages the object properties panel on the right-hand side of the application

author:

Dragonfly Team

contact:

https://dragonfly.comet.tech

email:

support.dragonfly@comet.tech

organization:

Comet Technologies Canada Inc.

address:

460 Ste-Catherine Ouest, suite 600, Montréal, Québec, Canada, H3B 1A7

copyright:

Comet Technologies Canada Inc. All rights reserved 2023.

date:

Oct 01 2015 16:56

dragonflyVersion:

3.0

UUID:

d6f287f4761811e78bbd448a5b5d70c0

Class Code

class OrsPythonPlugins.OrsObjectPropertiesList.OrsObjectPropertiesList.OrsObjectPropertiesList(*args, **kwargs)
addPropertyWidgetToIgnore(className)

In certain contexts, properties of an object should not be displayed. Add the class object representing the OrsProperties to ignore

Parameters:

className – str

Return:

cleanup()

Deletes the variables managed by the plugin. It is the place to remove callbacks and other references to Python objects that would prevent them to be garbage collected. This method is called during the process of deletion of the plugin. It calls for the cleanup and deletion of the forms.

classmethod exportItemsAsMultipleORSObject(selectedItems)

Queries the user for an export folder, and exports the objects to the file :return: Nothing

classmethod exportItemsToCSV(selectedItems: List[Managed], exportData3d: bool = True) → None

Queries the user for an export file, and exports the objects to the file

This method queries the user, so it is not an interface method: it cannot be recorded in a macro. The export itself is delegated to interface methods (CSVExporter.exportObjectsToCSVFile and, through OrsScalarInformationWidget.exportScalarSlot, exportScalarValueSlotsToCSV of the scalar value helper), which are the ones recorded in the macro.

Deprecated since version 2027.1: This used to be an interface method, but it could not be replayed since it queries the user. Macros recorded before that change that call it directly still run, but they prompt for a file instead of replaying the recorded one.

Parameters:
  • selectedItems (ORSModel.ors.Managed) [count=[1, None]] – a list of objects

  • exportData3d (bool) – allow or not export of selected items data in 3d

classmethod exportItemsToCSVFromGUIDs(selectedGUIDs, exportData3d)

Queries the user for an export file, and exports the objects to the file

Parameters:
  • selectedGUIDs (str) – a list of selected guid

  • exportData3d (bool) – allow or not export of selected items data in 3d

interfacemethod exportORSObjectsInFile(objectsToExport: Annotated[List[Managed], MinLen(min_length=0)], filename: str, compressionEngine: CompressionEngine = CompressionEngine.NONE, fileFormat: FileFormat = FileFormat.LATEST) → None

Saves a list of objects in a single .ORSObject file

Parameters:
  • objectsToExport (ORSModel.ors.Managed) [count=[0, None]] – list of objects

  • filename (file saving) – file name with .ORSObject extension

  • compressionEngine (IntEnum CompressionEngine) – compressionEngine for export file

  • fileFormat (IntEnum FileFormat) – file format for export file

Anonymize filename:

True

interfacemethod exportObjectsAsMultipleORSObject(objectsToExport, folder, progress)

Export a list of ORSObjects as multiple ORSObject files

Parameters:
Anonymize folder:

True

Returns:

not_written (tuple) [count=[0, None]] – list of non written objects, as (title, filename, error code) tuples

classmethod getClassNamesCanExportData(class_names)

Ensures that all class names given can be exported to CSV

Parameters:

class_names – list of class names

Returns:

output – Bool

getClassname(anObjectGUID)

Gets the class name of an object

Parameters:

anObjectGUID (str) – an object GUID

Return:

class name

Rtype:

str

classmethod getMainFormClass()

Gets the class of the main form

Returns:

output –

getPluginExtendedInfrastructureClassInstance(pluginExtendedInfrastructureClass)

Gets the instance associated to the plugin extended infrastructure class.

Parameters:

pluginExtendedInfrastructureClass (plugin extended infrastructure class) – a plugin extended infrastructure class supported by the plugin

Return:

an instance of the plugin extended infrastructure class

Rtype:

instance of plugin extended infrastructure class

classmethod getPluginExtendedInfrastructureClasses()

Gets the list of the supported plugin extended infrastructure classes of the plugin.

Returns:

output (list of classes) – list of the plugin extended infrastructure classes

getState()

This method is called when saving a plugin instance in a session to obtain the information required to set up the plugin at the loading of the session.

The plugin needs to be savable (see ORSServiceClass.OrsPlugin.abstractPlugin.AbstractPlugin.savable).

Return:

a string of information that will be sent back to the setState method

Rtype:

str

Note

The usage of the character " is not permitted, unless escaped.

See also

ORSServiceClass.OrsPlugin.orsPlugin.OrsPlugin.setState()

handleChanged(oldState, newState)

This method is called when the state of the application is changed.

Parameters:
  • oldState (str) – name of the old (previous) state

  • newState (str) – name of the new (current) state

handleTriggered(eventData)

This method is called on every user input (mouse move, mouse click, key press, …) when the current state of the application is one of those declared by the plugin. This method can be used to perform specific tasks even if no action is currently in progress.

Parameters:

eventData (OrsEvent.eventdata.InputEventData) – the event data

classmethod importAllLoggingClasses()

This method is called to make any class extension available for macro playing. It should:

  1. import all class extension;

  2. return a list of classes where logging is supported.

Returns:

output (list of classes) – list of classes where logging is supported by the current plugin

interfacemethod importORSObjectsFromFile(fname: str, progress: Progress) → Annotated[List[Managed], MinLen(min_length=0)]

Import ORS objects from file

Deprecated since version 3.5: Use importORSObjectsFromFileAndPublish.

Parameters:
Returns:

importedObjects (ORSModel.ors.Managed) [count=[0, None]] – imported objects

interfacemethod importORSObjectsFromFileAndPublish(filenames: Annotated[List[str], MinLen(min_length=1)], progress: Progress = None, useOnceSliceChannels: bool = False) → Annotated[List[Managed], MinLen(min_length=0)]

Import ORS objects from file and publish them

Parameters:
  • filenames (file) [count=[1, None]] – list of filenames

  • progress (ORSModel.ors.Progress) – a progress bar

  • useOnceSliceChannels (bool) – publish every slice as separate images

Anonymize filenames:

True

Returns:

importedObjects (ORSModel.ors.Managed) [count=[0, None]] – imported objects

interfacemethod importObjectsFromFileAndPublish(fname: str, guids: Annotated[List[str], MinLen(min_length=1)], progress: Progress = None, generate2DImages: bool = False) → Annotated[List[Managed], MinLen(min_length=0)]

Import specific objects from file and publish them

Parameters:
  • fname (file) – filename

  • guids (str) [count=[1, None]] – list of strings of the objects GUIDs to import

  • progress (ORSModel.ors.Progress) – a progress bar

  • generate2DImages (bool) – publish every slice as separate images

Anonymize fname:

True

Returns:
  • importedObjects (ORSModel.ors.Managed) [count=[0, None]] – imported objects

  • errors (str) [count=[0, None]] – errors for objects that could not be imported

importSelectedObjects()

Queries the user for an import file, opens a GUI to let the user select which objects to import, and then imports the objects selected from the file :return: results: imported objects :rtype results: Optional[List[str]]

interfacemethod importSpecificObjectsFromFileAndPublish(fname: str, guids: Annotated[List[str], MinLen(min_length=1)], progress: Progress = None, useOnceSliceChannels: bool = False) → Annotated[List[Managed], MinLen(min_length=0)]

Import specific objects from file and publish them

Deprecated since version 2026.1: Use importObjectsFromFileAndPublish instead

Parameters:
  • fname (file) – filename

  • guids (str) [count=[1, None]] – list of strings of the objects GUIDs to import

  • progress (ORSModel.ors.Progress) – a progress bar

  • useOnceSliceChannels (bool) – publish every slice as separate images

Anonymize fname:

True

Returns:

importedObjects (ORSModel.ors.Managed) [count=[0, None]] – imported objects

moveObjects(listObjectsToMove, listObjectsDisplayed, insertionIndex)

Reorders the list of objects at the specified insertion index.

Parameters:
Count listOrsObjectsToMove:

[0, None]

Count listObjectsDisplayed:

[0, None]

postLoadSession()

Placeholder for code that needs to get executed when a session is loaded. Note that this method is called at the very end of the process, when the model has been restored, plugins have been instantiated and the workspace has been restored.

postOrsObjectPropertiesListTriggeringChanges(anObject)

Informs the object ordering model that changes caused by the current plugin are done

Parameters:

anObject (ORSModel.ors.Managed) – object subject to changes

preOrsObjectPropertiesListTriggeringChanges(anObject)

Informs the object ordering model that changes caused by the current plugin are expected

Parameters:

anObject (ORSModel.ors.Managed) – object subject to changes

prePublishInSession()

Placeholder for code that needs to get executed when a session is loaded, before the object model gets published. Note that this method is called after all plugins have been created.

refreshUIFromModel()

Calls the UI to be updated based on the implementation

removePropertyWidgetFromIgnore(className)

Remove the widget class from the ignore list :param className: str :return:

setState(state)

This method is called to set up the plugin when loading a session.

Note

This method is called only if the string returned by ORSServiceClass.OrsPlugin.orsPlugin.OrsPlugin.getState() at the saving of the session was not empty.

Parameters:

state (str) – string of information as provided by the getState during the saving of the session