SAMSON¶

This class is the main interface of SAMSON. It acts as a facade that centralizes and exposes other functions from the SAMSON API to make it easy for developers to interact with SAMSON, the data graph, etc. All functions in this class are static.

SAMSON API: SAMSON

samson.Facade.SAMSON.askUser(dialogTitle: str, dialogText: str) → bool¶

Asks a question to the user with a message in a modal pop-up dialog

samson.Facade.SAMSON.beginHolding(name: str) → None¶

Begins holding

samson.Facade.SAMSON.captureViewport(width: int, height: int, transparentBackground: bool=False) → QImage¶

Captures the viewport

samson.Facade.SAMSON.captureViewportToFile(filename: str, width: int, height: int, transparentBackground: bool=False) → None¶

Captures the viewport into file

samson.Facade.SAMSON.disableHolding() → None¶

Pauses holding

samson.Facade.SAMSON.enableHolding() → None¶

Resumes holding

samson.Facade.SAMSON.endHolding() → None¶

Ends holding

samson.Facade.SAMSON.exit() → None¶

Exits SAMSON with a dialog

samson.Facade.SAMSON.exportToFile(*args, **kwargs)¶

Overloaded function.

  1. exportToFile(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, fileName: str) -> None

Export a selection of nodes to a file

  1. exportToFile(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, fileName: str, parameters: List[str]=0) -> None

Export a selection of nodes to a file with parameters specific to each exporter

samson.Facade.SAMSON.getAction(*args, **kwargs)¶

Overloaded function.

  1. getAction(actionUUID: samson.Core.Container.UUID) -> SBGAction

Returns the action with the given actionUUID

  1. getAction(actionUUID: str) -> SBGAction

Returns the action with the given actionUUID

samson.Facade.SAMSON.getActiveCamera() → samson.DataModel.Document.Camera¶

Returns the Active Camera

samson.Facade.SAMSON.getActiveDocument() → samson.DataModel.Document.Document¶

Returns the Active Document

samson.Facade.SAMSON.getActiveLayer() → samson.DataModel.Document.Layer¶

Returns the Active Layer

samson.Facade.SAMSON.getActiveModel() → SBMModel¶

Returns the Active Model

samson.Facade.SAMSON.getAtomRadius() → samson.DataModel.Quantity.unitsSI¶

Get the radius of atoms in the default representation of structural models

samson.Facade.SAMSON.getAtomicWeight(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSI¶

Returns the atomic weight of periodic table element element

samson.Facade.SAMSON.getBlock(element: SBMElement::Type) → str¶

Returns the block of periodic table element element

samson.Facade.SAMSON.getBondRadius() → samson.DataModel.Quantity.unitsSI¶

Get the radius of bonds in the default representation of structural models

samson.Facade.SAMSON.getColorFromUser(dialogTitle: str='Choose a color') → tuple¶

Gets a color from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getCovalentRadius(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSI¶

Returns the covalent radius of periodic table element element

samson.Facade.SAMSON.getDoubleFromUser(dialogTitle: str, minimum: float, maximum: float, singleStep: float=1.0, prefix: str='', suffix: str='', decimals: int=2) → tuple¶

Gets a number from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getElectronegativity(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSI¶

Returns the electronegativity of periodic table element element

samson.Facade.SAMSON.getElementName(element: SBMElement::Type) → str¶

Returns the name of the periodic table element corresponding to a given type

samson.Facade.SAMSON.getElementSymbol(element: SBMElement::Type) → str¶

Returns the symbol of the periodic table element corresponding to a given type

samson.Facade.SAMSON.getElementTypeByName(elementName: str) → SBMElement::Type¶

Returns the periodic table element type corresponding to a given name

samson.Facade.SAMSON.getElementTypeBySymbol(elementSymbol: str) → SBMElement::Type¶

Returns the periodic table element type corresponding to a given symbol

samson.Facade.SAMSON.getFileNameFromUser(dialogTitle: str='Choose a filename', dir: str='', filter: str='') → tuple¶

Gets a filename from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getGroup(element: SBMElement::Type) → int¶

Returns the group of periodic table element element

samson.Facade.SAMSON.getIntegerFromUser(dialogTitle: str, minimum: int, maximum: int, singleStep: int=1, prefix: str='', suffix: str='') → tuple¶

Gets a number from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getMousePositionInViewport() → QPoint¶

Returns the current mouse position in viewport coordinates

samson.Facade.SAMSON.getNodes(selectionString: str='*') → samson.DataModel.DataGraph.NodeIndexer¶
Returns nodes (in a node indexer), based on a selectionString.
For selectionString use Node Specification Language (SAMSON API: Node Specification Language
samson.Facade.SAMSON.getNumberOfElements() → int¶

Returns the number of defined periodic table elements

samson.Facade.SAMSON.getPathFromUser(dialogTitle: str='Choose a path') → tuple¶

Gets a path from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getPeriod(element: SBMElement::Type) → str¶

Returns the period of periodic table element element

samson.Facade.SAMSON.getProxy(className: str, elementUUID: samson.Core.Container.UUID=) → samson.Core.Class.ClassProxy¶

Returns the proxy of a class

samson.Facade.SAMSON.getSAMSONElementsPath() → str¶

Returns the path where SAMSON Elements are installed

samson.Facade.SAMSON.getSAMSONPath() → str¶

Returns the path where SAMSON is installed

samson.Facade.SAMSON.getScratchPath() → str¶

Returns the path to scratch data

samson.Facade.SAMSON.getSimulationFlag() → bool¶

Returns true when interactive simulation is on

samson.Facade.SAMSON.getStringFromUser(dialogTitle: str='Set a string') → tuple¶

Gets a string from the user in a modal pop-up dialog. Returns a tuple: True/False (False in case if Cancel button was clicked) and the resulting value if Ok button was clicked

samson.Facade.SAMSON.getTime() → int¶

Returns SAMSON’s internal time

samson.Facade.SAMSON.getUserDataPath() → str¶

Returns the path where user data is installed

samson.Facade.SAMSON.getVanDerWaalsRadius(element: SBMElement::Type) → samson.DataModel.Quantity.unitsSI¶

Returns the van der Waals radius of periodic table element element

samson.Facade.SAMSON.getVersionNumber() → samson.Core.Container.VersionNumber¶

Returns the version number of SAMSON

samson.Facade.SAMSON.getViewportHeight() → int¶

Returns the viewport height

samson.Facade.SAMSON.getViewportPositionFromWorldPosition(position: samson.DataModel.Type.vector3) → samson.DataModel.Type.vector3¶

Returns the projection in the viewport of a given world position

samson.Facade.SAMSON.getViewportWidth() → int¶

Returns the viewport width

samson.Facade.SAMSON.hideProgressBar() → None¶

Hides the progress bar

samson.Facade.SAMSON.hold(node: samson.DataModel.DataGraph.Node) → None¶

Holds a node and its descendants

samson.Facade.SAMSON.importFromFile(*args, **kwargs)¶

Overloaded function.

  1. importFromFile(fileName: str, preferredLayer: samson.DataModel.Document.Layer=None) -> None

Import a file from the disk

  1. importFromFile(fileName: str, parameters: List[str]=0, preferredLayer: samson.DataModel.Document.Layer=None) -> None

Import a file from the disk with parameters specific to each importer

samson.Facade.SAMSON.informUser(dialogTitle: str, dialogText: str) → None¶

Informs the user with a message in a modal pop-up dialog

samson.Facade.SAMSON.isHolding() → bool¶

Returns true when SAMSON is holding

samson.Facade.SAMSON.isProgressBarStopped() → bool¶

Returns true when the progress bar is stopped

samson.Facade.SAMSON.isRedoing() → bool¶

Returns true while redoing

samson.Facade.SAMSON.isUndoing() → bool¶

Returns true while undoing

samson.Facade.SAMSON.makeInteractionModel(dynamicalModel: SBMDynamicalModelParticleSystem, interactionModelClassName: str, interactionModelElementUUID: samson.Core.Container.UUID=) → SBMInteractionModelParticleSystem¶

Make an interaction model

samson.Facade.SAMSON.makeNeigborSearch(dynamicalModel: SBMDynamicalModelParticleSystem, cutoffDistance: samson.DataModel.Quantity.unitsSI, neighborSearchClassName: str, ineighborSearchElementUUID: samson.Core.Container.UUID=) → SBSNeighborSearchParticleSystem¶

Make a neighbor search algorithm

samson.Facade.SAMSON.makePropertyModel(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, propertyModelClassName: str, propertyModelElementUUID: samson.Core.Container.UUID=) → SBMPropertyModel¶

Make a property model

samson.Facade.SAMSON.makeSimulator(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, interactionModelClassName: str, interactionModelElementUUID: samson.Core.Container.UUID, stateUpdaterClassName: str, stateUpdaterElementUUID: samson.Core.Container.UUID=) → SBSSimulatorParticleSystem¶

Make a simulator

samson.Facade.SAMSON.makeStateUpdater(dynamicalModel: SBMDynamicalModelParticleSystem, interactionModel: SBMInteractionModelParticleSystem, stateUpdaterClassName: str, stateUpdaterElementUUID: samson.Core.Container.UUID=) → SBSStateUpdaterParticleSystem¶

Make a state updater

samson.Facade.SAMSON.makeVisualModel(nodeIndexer: samson.DataModel.DataGraph.NodeIndexer, visualModelClassName: str, visualModelElementUUID: samson.Core.Container.UUID=) → SBMVisualModel¶

Make a visual model

samson.Facade.SAMSON.printDataGraphState() → None¶

Prints in the terminal the data graph state

samson.Facade.SAMSON.printFullMemoryUsage() → None¶

Prints in the terminal full memory usage

samson.Facade.SAMSON.printMemoryUsage() → None¶

Prints in the terminal memory usage

samson.Facade.SAMSON.printRendererState() → None¶

Prints in the terminal the renderer state

samson.Facade.SAMSON.printUndoStack() → None¶

Prints in the terminal the undo stack

samson.Facade.SAMSON.processEvents() → None¶

Requests an update

samson.Facade.SAMSON.redo() → None¶

Redo one command

samson.Facade.SAMSON.requestViewportUpdate() → None¶

Requests a viewport update

samson.Facade.SAMSON.setBusy(isBusy: bool) → None¶

Notifies the user that SAMSON is busy

samson.Facade.SAMSON.setProgressBarValue(value: int) → None¶

Sets the value of the progress bar

samson.Facade.SAMSON.setSimulationFlag(simulationFlag: bool) → None¶

Sets the interactive simulation flag

samson.Facade.SAMSON.setStatusMessage(message: str, time: int=0) → None¶

Shows a message in the status bar

samson.Facade.SAMSON.showProgressBar(name: str='', minimum: int=0, maximum: int=0, minimumDurationInSeconds: float=2.0, isCancellable: bool=True, cancelButtonText: str='Cancel') → None¶

Shows the progress bar

samson.Facade.SAMSON.showProperties(node: samson.DataModel.DataGraph.Node) → bool¶

Shows the properties widget of a node

samson.Facade.SAMSON.startSimulation() → None¶

Starts interactive simulation

samson.Facade.SAMSON.startTimer() → None¶

Starts a new performance timer

samson.Facade.SAMSON.stopSimulation() → None¶

Stops interactive simulation

samson.Facade.SAMSON.stopTimer() → List[samson.DataModel.Quantity.unitsSI]¶

Stops the top performance timer. Returns elapsed time and total time [in seconds]

samson.Facade.SAMSON.toggleSimulation() → None¶

Toggles interactive simulation on and off

samson.Facade.SAMSON.undo() → None¶

Undo one command