View

Inheritance diagram

Inheritance diagram of ORSModel.ors.View, ORSModel.ors.Node, ORSModel.ors.Managed, ORSModel.ors.ORSBaseClass

Classes

View

class ORSModel.ors.View

Bases: ORSModel.ors.Node

brief_description: Represents a host window where the renderer is displayed. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005 Represents a host window where the renderer is displayed.

compile(self) → None
decrementTimeStep(self) → None

Decrements the view’s time step counter.

Note

When looking at 4D data (3D plus a time dimension), one can cycle through the time dimension in this fashion.

draw(self) → None

Forces an immediate draw of the view.

drawOnCurrentGLContext(self, bCapture: bool) → None
Parameters:bCapture (bool) –
exportSnapshotCustomSized(self, iWidth: int, iHeight: int, pOutputImage: ORSModel.ors.Image) → Image

Exports a snapshot of the view to an image, sized to specification.

Note

This method saves a snapshot sized to specifications. The resulting image is always full resolution, no matter what size is given.

Note

If an output image is support, the resulting snapshot is written to that output image. That same output image will be the return value.

Parameters:
  • iWidth (int) – the width of the image to be saved (a uint16_t)
  • iHeight (int) – the height of the image to be saved (a uint16_t)
  • pOutputImage (ORSModel.ors.Image) – (optional) an output image (an Image)
Returns:

output (ORSModel.ors.Image) – an image (an Image)

fitBoundedPlaneInView(self, IBoundedPlane: ORSModel.ors.Rectangle) → None
Parameters:IBoundedPlane (ORSModel.ors.Rectangle) –
fitBoundedPlaneInViewLogged(rectangle, logging=True)
fitBoxInView(self, aBox: ORSModel.ors.Box) → None
Parameters:aBox (ORSModel.ors.Box) –
fitBoxInViewLogged(box, logging=True)
gatherTimeStepMaxFromAll(self) → None

Queries all visible models to know how many timesteps there are.

get2DBackgroundColor(self) → Color

Gets the view’s 3D first background color.

Returns:output (ORSModel.ors.Color) – a color (an Color)
get3DBackgroundColor1(self) → Color

Gets the view’s 3D first background color.

Returns:output (ORSModel.ors.Color) – a color (an Color)
get3DBackgroundColor2(self) → Color

Gets the view’s 3D first background color.

Returns:output (ORSModel.ors.Color) – a color (a Color)
get3DBackgroundColorMode(self) → int

Gets the view’s 3D background color mode.

Note

The color mode has 3 different meanings: -2 says the color is uniform (i.e. the second color is ignored), -1 says the color is gradient radial (the two colors are used), any value between 0 and 359 says the color is gradient linear (the two colors are used), and that value indicates the angle of the gradient.

Returns:output (int) – color mode (a short, see note below)
getAllChildrenOfClassesVisibleAndHighlightable(self, classes: ORSModel.ors.typing.List[str]) → List

Returns a flattened list of all the child nodes, of the given class, that are renderable and highlightable.

Note

The list contains only Managed objects (they will need to be typecast to the appropriate class).

Parameters:classes (typing.List[str]) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of all child nodes that can be rendered (an List)
getAllVisibleChildrenOfClass(self, pProgId: str) → List

Returns a flattened list of all the child nodes, of the given class, that are visible.

Note

The list contains only Managed objects (they will need to be typecast to the appropriate class).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of all child nodes that are visible (an List)
getAmbientLightColor(self) → Color
Returns:output (ORSModel.ors.Color) –
getAngleDimensionUnit(self) → DimensionUnit
Returns:output (ORSModel.ors.DimensionUnit) –
getAngularSpeed(self) → float
Returns:output (float) –
getAutoFocus(self) → bool
Returns:output (bool) –
getAutofocusFactor(self) → float
Returns:output (float) –
getBorderColor(self) → Color
Returns:output (ORSModel.ors.Color) –
getBorderWidth(self) → float
Returns:output (float) –
getBoundedPlaneOfFirstSliceOfBox(self, aBox: ORSModel.ors.Box) → Rectangle
Parameters:aBox (ORSModel.ors.Box) –
Returns:output (ORSModel.ors.Rectangle) –
getBoundedPlaneOfLastSliceOfBox(self, aBox: ORSModel.ors.Box) → Rectangle
Parameters:aBox (ORSModel.ors.Box) –
Returns:output (ORSModel.ors.Rectangle) –
getBoundedPlaneOfSliceOfBox(self, aBox: ORSModel.ors.Box, sliceIndex: int) → Rectangle
Parameters:
Returns:

output (ORSModel.ors.Rectangle) –

getBoxAbleToContainAllEnabledVisualReachableByRender(self, inbox: ORSModel.ors.Box) → Box
Parameters:inbox (ORSModel.ors.Box) –
Returns:output (ORSModel.ors.Box) –
getCamera(self) → Camera

Gets the picked Overlay in a view.

Returns:output (ORSModel.ors.Camera) – the GUID of the overlay if successful, should be a VisualOVerlay but this idl doesn’t allow it
getCameraSpaceLightPos(self) → Vector3
Returns:output (ORSModel.ors.Vector3) –
getCineMode(self) → int
Returns:output (int) –
getClassNameStatic() → str

getClassNameStatic

Returns:output (str) –
getContext()
getCurrentTimeStep(self) → int

Gets the view’s current time step.

Returns:output (int) –
getDiffuseFactor(self) → float
Returns:output (float) –
getDiffuseLightColor(self) → Color
Returns:output (ORSModel.ors.Color) –
getDimensionUnit(self, dimensionType: int) → DimensionUnit

Gets the view’s dimension unit.

Note

See the ORS_def.h file for enum CxvUniverse_Dimension_type values.

Parameters:dimensionType (int) – the unit type (a CxvUniverse_Dimension_type)
Returns:output (ORSModel.ors.DimensionUnit) – the current dimension unit (DimensionUnit)
getDimensionUnitID(self, dimensionType: int) → int

Gets the view’s dimension unit.

Note

To obtain the object, call DimensionUnit::getUnitFor().

Note

See the ORS_def.h file for enum CxvUniverse_Dimension and CxvUniverse_Dimension_type values.

Parameters:dimensionType (int) – the unit type (a CxvUniverse_Dimension_type)
Returns:output (int) – the current CxvUniverse_Dimension unit (a int32_t)
getDisplayedAxis(self, aBox: ORSModel.ors.Box) → int

Gets the axis direction of the view.

Note

The axis value is 0 for Sagittal, 1 for Coronal or 2 for Axial.

Parameters:aBox (ORSModel.ors.Box) –
Returns:output (int) – the axis (a uint16_t)
getDrawFocusRect(self) → bool
Returns:output (bool) –
getEnableFocus(self) → bool
Returns:output (bool) –
getExportTransparentBackground(self) → bool
Returns:output (bool) –
getFadeFactor(self) → float
Returns:output (float) –
getFitToViewBorder(self) → int

Gets the number of pixels allocated to the border around the view.

Returns:output (int) – the number of pixels (a int32_t)
getFocalDistance(self) → float
Returns:output (float) –
getFocalRange(self) → float
Returns:output (float) –
getFocusSigma(self) → float
Returns:output (float) –
getGammaCorrection(self) → float
Returns:output (float) –
getGlobalVolumeOpacity(self) → float
Returns:output (float) –
getHWND(self) → int

Gets the view handle.

Returns:output (int) – the handle of the window
getImageNumberingAscending(self) → bool
Returns:output (bool) –
getIntersliceDistance(self, box: ORSModel.ors.Box) → float
Parameters:box (ORSModel.ors.Box) –
Returns:output (float) –
getIs3DAllowed(self) → bool

Gets view 3D allowed attribute.

Note

This is used by the 3D renderer

Returns:output (bool) – true if can be in 3D
getIsBorderEnabled(self) → bool
Returns:output (bool) –
getIsChildReachableByRenderer(self, INode: ORSModel.ors.Node) → bool

Verifies if a child node is renderable.

Parameters:INode (ORSModel.ors.Node) – a node in the child hierarchy of the view (a Node)
Returns:output (bool) – true if the node is renderable, false otherwise
getIsEnabled(self) → bool

Queries the view to know if it is enabled.

Note

Disabled views are “inert”, they react to very few events and display nothing.

Returns:output (bool) – true if the view is enabled, false otherwise
getIsIn2DViewMode(self) → bool
Returns:output (bool) –
getIsIn3DViewMode(self) → bool
Returns:output (bool) –
getIsInAcquisitionPlaneOf(self, aStructuredGrid: ORSModel.ors.StructuredGrid) → bool
Parameters:aStructuredGrid (ORSModel.ors.StructuredGrid) –
Returns:output (bool) –
getIsInNoViewMode(self) → bool
Returns:output (bool) –
getIsInThinMIPViewMode(self) → bool
Returns:output (bool) –
getIsOrientationAndPositionLocked(self) → bool

Gets the view’s position and orientation lock status.

Note

When a view position is locked, one cannot set its oblique info.

Returns:output (bool) – true if the view position and orientation is locked, false otherwise
getIsOrientationLocked(self) → bool

Gets the view’s orientation lock status.

Note

When a view orientation is locked, one cannot set its oblique info.

Returns:output (bool) – true if the view orientation is locked, false otherwise
getIsOrthoProjection(self) → bool
Returns:output (bool) –
getIsPositionLocked(self) → bool

Gets the view’s position lock status.

Note

When a view position is locked, one cannot set its oblique info.

Returns:output (bool) – true if the view position is locked, false otherwise
getIsRenderingTiled(self) → bool
Returns:output (bool) –
getIsShadowEnabled(self) → bool
Returns:output (bool) –
getIsSpinning(self) → bool
Returns:output (bool) –
getIsTrackingLight(self) → bool

Queries if the view is in tracking light mode or not.

Returns:output (bool) – true if the view is in tracking light mode, false otherwise
getLODEnabled(self) → bool
Returns:output (bool) –
getLODFactor(self) → float
Returns:output (float) –
getLODMode(self) → int

Gets the view LOD mode.

Note

LOD stands for Level Of Detail. It defines how much detail is displayed when moving the visual artifacts in the view. The lower the level, the faster the visual will move.

Note

See the ORS_def.h file, it contains defines (in the form CXV_DISPLAY_LOD_XXX) for valid values.

Returns:output (int) – an LOD mode (a int32_t)
getLODSamplingFactor(self) → float
Returns:output (float) –
getLayoutGenealogicalName()

Gets the genealogical name of the view

Returns:aName (str) – the genealogical name of the view
getLengthAsPixelCount(self, aLength: float) → float

Gets the number of pixels on the screen that represent a world length.

Parameters:aLength (float) – the world length (a double)
Returns:output (float) – the number of pixels that match the length (a double)
getLengthDimensionUnit(self) → DimensionUnit
Returns:output (ORSModel.ors.DimensionUnit) –
getLightFollowCamera(self) → bool
Returns:output (bool) –
getLightMaxDistance(self) → float
Returns:output (float) –
getLightPosition(self) → Vector3
Returns:output (ORSModel.ors.Vector3) –
getLocalPositionArrayTransformedToXY(self, pVisual: ORSModel.ors.Visual, pLocalPositions: ORSModel.ors.SequenceableCollection, nPtsCount: int, pTimeStep: int, pOutputXYPositions: ORSModel.ors.SequenceableCollection) → SequenceableCollection
Parameters:
Returns:

output (ORSModel.ors.SequenceableCollection) –

getLocalPositionFromVisualLocalPosition(self, pVisual: ORSModel.ors.Visual, anotherVisual: ORSModel.ors.Visual, pAlocalPositionInAnotherVisual: ORSModel.ors.Vector3, pTimeStep: int) → Vector3
Parameters:
Returns:

output (ORSModel.ors.Vector3) –

getLocalPositionFromWorldPosition(self, pVisual: ORSModel.ors.Visual, pWorldPosition: ORSModel.ors.Vector3, pTimeStep: int) → Vector3
Parameters:
Returns:

output (ORSModel.ors.Vector3) –

getLocalPositionTransformedToXY(self, IVisual: ORSModel.ors.Visual, pCoord: ORSModel.ors.Vector3, pTimeStep: int, oX: float, oY: float) → bool

Transforms a local coordinate in 2D coordinates.

Note

The values are returned in the last two parameters supplied.

Parameters:
Returns:
  • output (bool) – true if the local Z coordinate is currently visible, false otherwise
  • pTimeStep (int) – the X 2D coordinate (a double*)
  • oX (float) – the Y 2D coordinate (a double*)
getMaxTimeStep(self) → int
Returns:output (int) –
getMillisecondsElapsedSinceLastDraw(self) → int

Returns the time elapsed since the last draw, in milliseconds.

Returns:output (int) – the elapsed time, in milliseconds (a uint32_t)
getNeedRefresh(self) → bool
Returns:output (bool) –
getNextSliceDirectionOfBox(self, aBox: ORSModel.ors.Box) → Vector3
Parameters:aBox (ORSModel.ors.Box) –
Returns:output (ORSModel.ors.Vector3) –
getOcclusionLODFactor(self) → int
Returns:output (int) –
getOrthoZoomFactor(self) → float
Returns:output (float) –
getPickData(self, pixelXPositionInDisplay: int, pixelYPositionInDisplay: int) → Intersection

Gets the object being picked in the view.

Note

Returns an intersection describing what is currently under the mouse cursor in the view.

Parameters:
  • pixelXPositionInDisplay (int) –
  • pixelYPositionInDisplay (int) –
Returns:

output (ORSModel.ors.Intersection) – an intersection (an Intersection)

getPickVisualData(self, aIVisual: ORSModel.ors.Visual, pixelXPositionInDisplay: int, pixelYPositionInDisplay: int) → Intersection

Gets the pick region from a visual in the view.

Note

Returns an intersection describing what is currently being picked in the visual supplied. If the given visual is not being picked, getHit() on the intersection will return FALSE.

Parameters:
  • aIVisual (ORSModel.ors.Visual) – a visual (an Visual)
  • pixelXPositionInDisplay (int) –
  • pixelYPositionInDisplay (int) –
Returns:

output (ORSModel.ors.Intersection) – an intersection (an Intersection)

getProjectionMatrix(self) → Matrix4x4
Returns:output (ORSModel.ors.Matrix4x4) –
getProjectionMode2D(self) → int

Gets the 2D projection mode of the view.

Note

See CxvVolumeProjection_Mode in ORS_def.h for supported volume projection modes.

Returns:output (int) – the current 2D projection mode (an int)
getRectangle()

Get the rectangle in the space defined by the View

Returns:rectangle (ORSModel.ors.Rectangle) – a Rectangle
getRenderCount(self) → int

Returns the number of times theView was rendered (draw)

Returns:output (int) – the rendereing count (unint32)
getRenderMode(self) → int

Gets the view render mode.

Returns:output (int) – a render mode (a uint16_t, see ors_def.h)
getRestTime(self) → int

Gets the rendering idle time.

Note

The rendering idle time is the period of time between cycles. Increasing this value makes the renderer less responsive.

Note

Default value is 22 ms.

Returns:output (int) – a number of milliseconds (a LONG)
getRotationAxis(self) → Vector3
Returns:output (ORSModel.ors.Vector3) –
getSceneLayoutGenealogicalName()

Gets the genealogical name of the scene layout of the view

Returns:aName (str) – the genealogical name of the scene layout of the view
getScreenLengthTransformedToWorldLength(self, inLength: float) → float
Parameters:inLength (float) –
Returns:output (float) –
getShadowMapSize(self) → int
Returns:output (int) –
getShadowOpacity(self) → float
Returns:output (float) –
getShadowPrecision(self) → float
Returns:output (float) –
getShadowStrength(self) → float
Returns:output (float) –
getShininess(self) → float
Returns:output (float) –
getShowOrientationIndicators(self) → bool

Gets the visibility of the orientation indicators.

Returns:output (bool) – true if the orientation indicators are visible, false otherwise
getShowViewFPS(self) → bool
Returns:output (bool) –
getSlabThickness(self) → float

Gets the view’s slab thickness.

Note

Note that this value represents the half slab thickness, in microns.

Returns:output (float) – the slab thickness, in microns (a double)
getSliceCountOfBox(self, aBox: ORSModel.ors.Box) → int

Gets the number of slices of a given box.

Parameters:aBox (ORSModel.ors.Box) – the visual box (a Box)
Returns:output (int) – the number of slices in the box, in the current camera direction (a uint32_t)
getSliceIndexOfBox(self, aBox: ORSModel.ors.Box) → float

Gets the current slice position of a given box.

Parameters:aBox (ORSModel.ors.Box) – the visual box (an Box)
Returns:output (float) – the current slice position in the box
getSpecularFactor(self) → float
Returns:output (float) –
getSpecularLightColor(self) → Color
Returns:output (ORSModel.ors.Color) –
getSpotlightFactor(self) → float
Returns:output (float) –
getSurfaceDimensionUnit(self) → DimensionUnit

Gets the view’s surface dimension unit.

Returns:output (ORSModel.ors.DimensionUnit) –
getTopFrame()

Gets the top frame of the view

getUseSuperSampling(self) → bool
Returns:output (bool) –
getValueInCurrentUnitConvertedToMeter(self, pValue: float) → float

Converts a value expressed in the view’s current dimension unit to meters.

Note

This method is the reverse of getValueInMeterConvertedToCurrentUnit().

Note

The value to be converted is assumed to be expressed in the view’s current dimension unit. For example, if the view’s current unit is cm, getValueInCurrentUnitConvertedToMeter(1.0) will return 0.01 (1 meter -> 100 cm).

Parameters:pValue (float) – the value to be converted (a double)
Returns:output (float) – the value converted to meters (a double)
getValueInMeterConvertedToCurrentUnit(self, pValue: float) → float

Converts a value against the view’s current dimension unit.

Note

The value to be converted is always assumed to be expressed in meters, the reference internal unit. For example, if the view’s current unit is cm, getValueInMeterConvertedToCurrentUnit(1.0) will return 100 (1 meter -> 100 cm).

Note

This method is the reverse of getValueInCurrentUnitConvertedToMeter().

Parameters:pValue (float) – the value (in meters) to be converted (a double)
Returns:output (float) – the value converted (a double)
getViewAlignedBoxThatContainsAllEnabledVisualsReachableByRenderer(self) → Box
Returns:output (ORSModel.ors.Box) –
getViewBoundedPlaneInWorldCoordinates(self) → Rectangle

Returns a plane bounded to the view, in world coordinates.

Returns:output (ORSModel.ors.Rectangle) – a plane (an Rectangle)
getViewCenter(self) → Vector3
Returns:output (ORSModel.ors.Vector3) –
getViewMatrix(self) → Matrix4x4
Returns:output (ORSModel.ors.Matrix4x4) –
getViewMode(self) → int

Gets the view’s volume mode.

Note

See the ORS_def.h file for valid values.

Returns:output (int) – a CxvView_Mode (a int32_t)
getViewNormal(self) → Vector3
Returns:output (ORSModel.ors.Vector3) –
getViewOrientedBoxThatContainsBox(self, aBox: ORSModel.ors.Box) → Box
Parameters:aBox (ORSModel.ors.Box) –
Returns:output (ORSModel.ors.Box) –
getViewOrientedPlane(self) → OrientedPlane
Returns:output (ORSModel.ors.OrientedPlane) –
getViewPlane(self) → Plane
Returns:output (ORSModel.ors.Plane) –
getViewRepresentationColor(self) → Color

Gets the view’s representation color.

Note

This call is used to query the color that represents the view.

Returns:output (ORSModel.ors.Color) – a color (a Color)
getVolumeDimensionUnit(self) → DimensionUnit
Returns:output (ORSModel.ors.DimensionUnit) –
getWorldLengthTransformedToScreenLength(self, inLength: float) → float
Parameters:inLength (float) –
Returns:output (float) –
getWorldPositionArrayTransformedToXY(self, pWorldPositions: ORSModel.ors.SequenceableCollection, nPtsCount: int, pOutputXYPositions: ORSModel.ors.SequenceableCollection) → SequenceableCollection
Parameters:
Returns:

output (ORSModel.ors.SequenceableCollection) –

getWorldPositionFromLocalPosition(self, pVisual: ORSModel.ors.Visual, pLocalPosition: ORSModel.ors.Vector3, pTimeStep: int) → Vector3
Parameters:
Returns:

output (ORSModel.ors.Vector3) –

getWorldPositionTransformedToXY(self, pPosition: ORSModel.ors.Vector3, oX: float, oY: float) → bool

Transforms a world coordinate in 2D coordinates.

Note

The values are returned in the last two parameters supplied.

Parameters:

pPosition (ORSModel.ors.Vector3) – a position (an Vector3)

Returns:
  • output (bool) – true if the world Z coordinate is currently visible, false otherwise
  • oX (float) – the X 2D coordinate (a double*)
  • oY (float) – the Y 2D coordinate (a double*)
getXSize(self) → int

Gets the view X size.

Returns:output (int) – the X size, in pixels (a uint16_t)
getXYArrayTransformedToLocalPosition(self, pVisual: ORSModel.ors.Visual, pXYPositions: ORSModel.ors.SequenceableCollection, nPtsCount: int, pTimeStep: int, pOutputLocalPositions: ORSModel.ors.SequenceableCollection) → SequenceableCollection
Parameters:
Returns:

output (ORSModel.ors.SequenceableCollection) –

getXYArrayTransformedToWorldPosition(self, pXYPositions: ORSModel.ors.SequenceableCollection, nPtsCount: int, pOutputWorldPositions: ORSModel.ors.SequenceableCollection) → SequenceableCollection
Parameters:
Returns:

output (ORSModel.ors.SequenceableCollection) –

getXYTransformedToWorldPosition(self, x: float, y: float) → Vector3

Transforms a 2D coordinates to world coordinate.

Note

The world coordinate is projected on the current view bounded plane.

Parameters:
  • x (float) – the X 2D coordinate (a double)
  • y (float) – the Y 2D coordinate (a double)
Returns:

output (ORSModel.ors.Vector3) – a position in world coordinate(an Vector3)

getYSize(self) → int

Gets the view Y size.

Returns:output (int) – the Y size, in pixels (a uint16_t)
getZoomFactor(self) → float

Gets the current zoom factor.

Returns:output (float) – zoom factor (a double)
getdepthMapFarValue(self) → float
Returns:output (float) –
getdepthMapNearValue(self) → float
Returns:output (float) –
imhide(node)

With a view, hide the node (such as a Channel, ROI, Mesh) in this view

Parameters:node (ORSModel.ors.Node) –
imshow(node, lut=None)

With a view, show the node (such as a Channel, ROI, Mesh) in this view with an optional Lookup Table

Parameters:
incrementTimeStep(self) → None

Increments the view’s time step counter.

Note

When looking at 4D data (3D plus a time dimension), one can cycle through the time dimension in this fashion.

none()

View.__init__() -> View

refresh(self) → None

Refreshes the view.

Note

The view is not immediately refreshed, it will be so when the next timer fires up.

refreshAndWait()

Forces a refresh of the view and wait for the refresh to be finished before return

resetNeedRefresh(self) → None
saveScreenshot(filename, scale=1.0)

Save a screenshot

Parameters:
  • filename (file saving) – path to save
  • scale (float) – scaling factor
set2DBackgroundColor(self, IColor: ORSModel.ors.Color) → None

Sets the view’s 2D background color.

Note

The color should be expressed as RGB (the alpha is not used here).

Parameters:IColor (ORSModel.ors.Color) – a color (an Color)
set3DBackgroundColor(self, iMode: int, IColor1: ORSModel.ors.Color, IColor2: ORSModel.ors.Color) → None

Sets the view’s 3D background color.

Note

The colors should be expressed as RGB (the alpha is not used here).

Parameters:
setAmbientLightColor(self, IColor: ORSModel.ors.Color) → None
Parameters:IColor (ORSModel.ors.Color) –
setAngularSpeed(self, value: float) → None
Parameters:value (float) –
setAutoFocus(self, aValue: bool) → None
Parameters:aValue (bool) –
setAutofocusFactor(self, value: float) → None
Parameters:value (float) –
setBorderColor(self, IColor: ORSModel.ors.Color) → None
Parameters:IColor (ORSModel.ors.Color) –
setBorderWidth(self, aValue: float) → None
Parameters:aValue (float) –
setCamera(self, aCamera: ORSModel.ors.Camera) → None
Parameters:aCamera (ORSModel.ors.Camera) –
setCameraLogged(camera, logging=True)
setCameraSpaceLightPos(self, pPosition: ORSModel.ors.Vector3) → None
Parameters:pPosition (ORSModel.ors.Vector3) –
setCaptionTextFontName(self, sFontName: str) → None
Parameters:sFontName (str) –
setCineMode(self, mode: int) → None
Parameters:mode (int) –
setCurrentTimeStep(self, value: int) → None
Parameters:value (int) –
setDiffuseFactor(self, aValue: float) → None
Parameters:aValue (float) –
setDiffuseLightColor(self, IColor: ORSModel.ors.Color) → None
Parameters:IColor (ORSModel.ors.Color) –
setDimensionUnitID(self, dimensionType: int, pUnit: int) → None

Sets the view’s dimension unit.

Note

See the ORS_def.h file for enum CxvUniverse_Dimension and CxvUniverse_Dimension_type values.

Parameters:
  • dimensionType (int) – the unit type (a CxvUniverse_Dimension_type)
  • pUnit (int) – a CxvUniverse_Dimension unit (a int32_t*)
setDrawFocusRect(self, value: bool) → None
Parameters:value (bool) –
setEnableFocus(self, aValue: bool) → None
Parameters:aValue (bool) –
setExportTransparentBackground(self, aValue: bool) → None
Parameters:aValue (bool) –
setFadeFactor(self, value: float) → None
Parameters:value (float) –
setFitToViewBorder(self, value: int) → None

Sets the number of pixels allocated to the border around the view.

Parameters:value (int) – the number of pixels (a int32_t*)
setFocalDistance(self, aValue: float) → None
Parameters:aValue (float) –
setFocalRange(self, value: float) → None
Parameters:value (float) –
setFocusSigma(self, aValue: float) → None
Parameters:aValue (float) –
setGammaCorrection(self, value: float) → None
Parameters:value (float) –
setGlobalVolumeOpacity(self, aValue: float) → None
Parameters:aValue (float) –
setImageNumberingAscending(self, value: bool) → None
Parameters:value (bool) –
setInImagePlaneOfBox(box)

Sets the view in the image plane of the given box

Parameters:box (ORSModel.ors.Box) – box to align the view with
setIs3DAllowed(self, isAllowed: bool) → None

Set if the view is allowed to be in 3D viewmode.

Note

This is used by the 3D renderer

Parameters:isAllowed (bool) –
setIsBorderEnabled(self, aValue: bool) → None

Enables or disables the view border.

Parameters:aValue (bool) – true to enable the border, false to disable it.
setIsEnabled(self, pEnabled: bool) → None

Enables or disables the view.

Note

Disabled views are “inert”, they react to very few events and display nothing.

Parameters:pEnabled (bool) – true to enable the view, false to disable it
setIsOrientationAndPositionLocked(self, value: bool) → None

Sets the view’s position lock status.

Note

When a view position is locked, one cannot set its oblique info.

Parameters:value (bool) – true to lock the view position, false otherwise
setIsOrientationLocked(self, value: bool) → None

Sets the view’s orientation lock status.

Note

When a view orientation is locked, one cannot set its oblique info.

Parameters:value (bool) – true to lock the view orientation, false otherwise
setIsOrthoProjection(self, value: bool) → None
Parameters:value (bool) –
setIsPositionLocked(self, value: bool) → None

Sets the view’s position lock status.

Note

When a view position is locked, one cannot set its oblique info.

Parameters:value (bool) – true to lock the view position, false otherwise
setIsShadowEnabled(self, aValue: bool) → None
Parameters:aValue (bool) –
setIsSpinning(self, value: bool) → None
Parameters:value (bool) –
setIsTrackingLight(self, value: bool) → None

Sets the view to be in tracking light mode or not.

Parameters:value (bool) – true to be in tracking light mode, false otherwise
setLODEnabled(self, aValue: bool) → None
Parameters:aValue (bool) –
setLODFactor(self, aValue: float) → None
Parameters:aValue (float) –
setLODMode(self, dwMode: int) → None

Sets the view LOD mode.

Note

LOD stands for Level Of Detail. It defines how much detail is displayed when moving the visual artifacts in the view. The lower the level, the faster the visual will move.

Note

See the ORS_def.h file, it contains defines (in the form CXV_DISPLAY_LOD_XXX) for valid values.

Parameters:dwMode (int) – an LOD mode (a int32_t*)
setLODSamplingFactor(self, aValue: float) → None
Parameters:aValue (float) –
setLightFollowCamera(self, aValue: bool) → None
Parameters:aValue (bool) –
setLightMaxDistance(self, aValue: float) → None
Parameters:aValue (float) –
setLightPosition(self, aLightPosition: ORSModel.ors.Vector3) → None
Parameters:aLightPosition (ORSModel.ors.Vector3) –
setOcclusionLODFactor(self, aValue: int) → None
Parameters:aValue (int) –
setOrientationIndicators(self, left: str, right: str, up: str, down: str, top: str, bottom: str) → None

Sets the orientation indicators.

Parameters:
  • left (str) – 6 string, one for each orientation indicator
  • right (str) –
  • up (str) –
  • down (str) –
  • top (str) –
  • bottom (str) –
setOrientedPlaneWithBox(self, anOrientedPlane: ORSModel.ors.OrientedPlane, aBox: ORSModel.ors.Box) → None
Parameters:
setOrientedPlaneWithBoxLogged(orientedPlane, box, logging=True)
setOrthoZoomFactor(self, value: float) → None
Parameters:value (float) –
setOrthoZoomFactorLogged(zoomFactor, logging=True)
setProjectionMode2D(self, iMode: int) → None

Sets the 2D projection mode of the view.

Note

See CxvVolumeProjection_Mode in ORS_def.h for supported volume projection modes.

Parameters:iMode (int) – a 2D projection mode (an int)
setProjectionMode2DLogged(projectionMode, logging=True)
setRenderMode(self, mode: int) → None

Sets the view render mode.

Parameters:mode (int) – an OrsRenderMode (a uint16_t, see ors_def.h)
setRestTime(self, value: int) → None
Parameters:value (int) –
setRotationAxis(self, value: ORSModel.ors.Vector3) → None
Parameters:value (ORSModel.ors.Vector3) –
setShadowMapSize(self, value: int) → None
Parameters:value (int) –
setShadowOpacity(self, aValue: float) → None
Parameters:aValue (float) –
setShadowPrecision(self, aValue: float) → None
Parameters:aValue (float) –
setShadowStrength(self, aValue: float) → None
Parameters:aValue (float) –
setShininess(self, aValue: float) → None
Parameters:aValue (float) –
setShowOrientationIndicators(self, pFlag: bool) → None

Sets the visibility of the orientation indicators.

Parameters:pFlag (bool) – true to show the orientation indicators, false to hide them
setShowViewFPS(self, bShow: bool) → None
Parameters:bShow (bool) –
setSize(self, xSize: int, ySize: int) → None

Sets the view size.

Parameters:
  • xSize (int) – the X size, in pixels (a uint16_t)
  • ySize (int) – the Y size, in pixels (a uint16_t)
setSlabThickness(self, value: float) → None

Sets the view’s slab thickness.

Note

Note that this value should represent the half slab thickness, in microns.

Parameters:value (float) – the slab thickness, in microns (a double)
setSlabThicknessLogged(thickness, logging=True)
setSliceIndexOfBox(self, aBox: ORSModel.ors.Box, sliceIndex: float) → None

Sets the current slice position for a given box.

Parameters:
  • aBox (ORSModel.ors.Box) – the visual box (an Box)
  • sliceIndex (float) – the slice position in the box to set
setSliceIndexOfBoxLogged(box, sliceIndex, logging=True)
setSpecularFactor(self, aValue: float) → None
Parameters:aValue (float) –
setSpecularLightColor(self, IColor: ORSModel.ors.Color) → None
Parameters:IColor (ORSModel.ors.Color) –
setSpotlightFactor(self, aValue: float) → None
Parameters:aValue (float) –
setUseOrthographicProjectionIn3D(ortho)

Use or not orthographic projection in 3D

Parameters:ortho (bool) – use orthographic projection
setUseSuperSampling(self, aValue: bool) → None
Parameters:aValue (bool) –
setViewMode(self, viewMode: int) → None

Sets the view’s volume mode.

Note

See the ORS_def.h file for valid values.

Parameters:viewMode (int) – a CxvView_Mode (a int32_t*)
setViewModeLogged(viewMode, logging=True)
setViewOrientedPlane(self, anOrientedPlane: ORSModel.ors.OrientedPlane, aSlabThickness: float) → None
Parameters:
setViewOrientedPlaneLogged(orientedPlane, thickness, logging=True)
setViewPlanePosition(self, worldPosition: ORSModel.ors.Vector3, centerView: bool) → None
Parameters:
setViewPlanePositionLogged(point, center, logging=True)
setViewRepresentationColor(self, IColor: ORSModel.ors.Color) → None

Sets the view’s representation color.

Note

This call is used to specify the color that represents the view

Parameters:IColor (ORSModel.ors.Color) – a color (an Color)
setXSize(self, xSize: int) → None

Sets the view X size.

Parameters:xSize (int) – the X size, in pixels (a uint16_t)
setYSize(self, ySize: int) → None

Sets the view Y size.

Parameters:ySize (int) – the Y size, in pixels (a uint16_t)
setZoomFactor(self, value: float) → None
Parameters:value (float) –
setdepthMapFarValue(self, aValue: float) → None
Parameters:aValue (float) –
setdepthMapNearValue(self, aValue: float) → None
Parameters:aValue (float) –

Node

class ORSModel.ors.Node

Bases: ORSModel.ors.Managed

brief_description: An abstract class for any object that can be a node in the visualization flow. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005

attachChild(self, anINode: ORSModel.ors.Node) → bool

Attaches a child node.

Note

Certain parent-child relationships are forbidden, hence the need to verify the result.

Note

Calling this method several times will still result in the child node only appearing once in its parent.

Parameters:anINode (ORSModel.ors.Node) – the node to attach (a Node)
Returns:output (bool) – true if child was attached, false otherwise
attachChildAtIndex(self, anINode: ORSModel.ors.Node, index: int) → bool

Attaches a child node at a given index.

Note

Certain parent-child relationships are forbidden, hence the need to verify the result.

Note

Calling this method several times will still result in the child node only appearing once in its parent.

Parameters:
  • anINode (ORSModel.ors.Node) – the node to attach (a Node)
  • index (int) – the index (a uint32_t)
Returns:

output (bool) – true if child was attached, false otherwise

copyGraph(self) → Node

Returns a copy of the node, including its graph.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Returns:output (ORSModel.ors.Node) – a new node (a Node)
detachChild(self, anINode: ORSModel.ors.Node) → bool

Detaches a child node.

Parameters:anINode (ORSModel.ors.Node) – the node to detach (a Node)
Returns:output (bool) – true if child was detached, false otherwise
getAllChildrenNodes(self) → List

Returns a flattened list of the child hierarchy of the node.

Note

The child hierarchy is flattened.

Note

Expect no particular ordering of the nodes.

Returns:output (ORSModel.ors.List) – a list of all nodes below the node (a List)
getAllChildrenOfClass(self, pProgId: str) → List

Returns all the nodes of the specified class found in the child hierarchy.

Note

Result will be an empty list if no match is found.

Note

The search is done breadth-first.

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of nodes (a List)
getAllChildrenOfClassReachableByRenderer(self, pProgId: str) → List

Returns a flattened list of all the child nodes, of the given class, that are renderable.

Note

The list contains only Managed objects (they will need to be typecast to the appropriate class).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of all child nodes that can be rendered (an List)
getAllParentNodes(self) → List

Returns a flattened list of the parent hierarchy of the node.

Note

The parent hierarchy is flattened.

Note

Expect no particular ordering of the nodes.

Returns:output (ORSModel.ors.List) – a list of all nodes above the node (an List)
getAllParentsOfClass(self, pProgId: str) → List

Returns all the nodes of the specified class found in the parent hierarchy.

Note

Result will be an empty list if no match is found.

Note

The search is done breadth-first.

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of nodes (an List)
getChildWithGUID(self, aGUID: str) → Node

Gets an immediate child node with the given GUID.

Note

Only immediate children are searched.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Parameters:aGUID (str) – a GUID (a string)
Returns:output (ORSModel.ors.Node) – a child node if found (a Node), none() otherwise
getChildWithTitle(self, aTitle: str) → Node

Gets an immediate child node with the given title.

Note

Only immediate children are searched.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Parameters:aTitle (str) – a string (a string)
Returns:output (ORSModel.ors.Node) – a child node if found (a Node), none() otherwise
getChildrenNodes(self) → List

Returns the list of immediate child nodes.

Returns:output (ORSModel.ors.List) – a list of nodes (an List)
getChildrenOfClass(self, pProgId: str) → List

Returns the nodes of the specified class found in the immediate children.

Note

Result will be an empty list if no match is found.

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of nodes (an List)
getClassNameStatic() → str

getClassNameStatic

Returns:output (str) –
getFirstChildOfClass(self, pProgId: str) → Node

Returns the first object of the specified class found in the child hierarchy.

Note

The search is done breadth-first.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.Node) – a node if one exists (a Node), none() otherwise
getFirstChildOfClassAndPrivateTitle(self, pProgId: str, privateTitle: str) → Node

Searches the hierarchy for a child node with the specified class and private title.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:
  • pProgId (str) – the ProgId of the class to test against (a string)
  • privateTitle (str) – some text (a string)
Returns:

output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise

getFirstFrameTowardsNode(self, anINode: ORSModel.ors.Node) → ReferenceFrame

Gets the first frame found going up the hierarchy towards a given object.

Parameters:anINode (ORSModel.ors.Node) – the target node (an Node)
Returns:output (ORSModel.ors.ReferenceFrame) – a frame (an ReferenceFrame) or NULL if no frame is found
getFirstNodeWithClassNameTowardsNode(self, pProgId: str, anINode: ORSModel.ors.Node) → Node

Searches the hierarchy for a parent node with the specified class toward a specific parent nopde.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:
  • pProgId (str) – the ProgId of the class to test against (a string)
  • anINode (ORSModel.ors.Node) – a target node
Returns:

output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise

getFirstParentOfClass(self, pProgId: str) → Node

Returns the first object of the specified class found in the parent hierarchy.

Note

The search is done breadth-first.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.Node) – a node if one exists (a Node), none() otherwise
getFirstParentOfClassAndPrivateTitle(self, pProgId: str, privateTitle: str) → Node

Searches the hierarchy for a parent node with the specified class and private title.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:
  • pProgId (str) – the ProgId of the class to test against (a string)
  • privateTitle (str) – some text (a string)
Returns:

output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise

getFrameTransformationFromNode(self, towardNode: ORSModel.ors.Node, pTimeStep: int) → Matrix4x4
Parameters:
Returns:

output (ORSModel.ors.Matrix4x4) –

getImmediateChildOfClass(self, pProgId: str) → Node

Searches for a child node with the specified class.

Note

Only the immediate children are searched, not the hierarchy.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
getImmediateParentOfClass(self, pProgId: str) → Node

Searches for a parent node with the specified class.

Note

Only the immediate parents are searched, not the hierarchy.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
getImmediateParentWithGUID(self, pGUID: str) → Node

Gets a parent node with the given GUID.

Note

Only immediate parents are searched.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Parameters:pGUID (str) – a GUID (a string)
Returns:output (ORSModel.ors.Node) – a parent node if found (a Node), none() otherwise
getIsNodeOneOfMyAscendants(self, anINode: ORSModel.ors.Node) → bool

Checks to see if a specified node is in the parent hierarchy of the node.

Note

The parent hierarchy is searched in its entirety for the specified node.

Note

The search is conducted depth-first.

Parameters:anINode (ORSModel.ors.Node) –
Returns:output (bool) – true if the specified node in the parent hierarchy, false otherwise
getIsNodeOneOfMyDescendants(self, anINode: ORSModel.ors.Node) → bool

Checks to see if a specified node is in the child hierarchy of the node.

Note

The child hierarchy is searched in its entirety for the specified node.

Note

The search is conducted depth-first.

Parameters:anINode (ORSModel.ors.Node) –
Returns:output (bool) – true if the specified node in the child hierarchy, false otherwise
getMaxTSizeOfChilden(self) → int

Get Maximum T Size of all children node of this node.

Returns:output (int) –
getParentNodes(self) → List

Gets the immediate parent nodes.

Returns:output (ORSModel.ors.List) – a list of nodes (a List)
getParentWithGUID(self, pGUID: str) → Node

Gets a parent node (from the hierarchy) with the given GUID.

Note

The whole parent hierarchy is searched.

Note

The search is done breadth-first.

Note

You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().

Parameters:pGUID (str) – a GUID (a string)
Returns:output (ORSModel.ors.Node) – a parent node if found (a Node), none() otherwise
getParentsOfClass(self, pProgId: str) → List

Returns the nodes of the specified class found in the immediate parents.

Note

Result will be an empty list if no match is found.

Note

Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).

Parameters:pProgId (str) – the ProgId of the class to test against (a string)
Returns:output (ORSModel.ors.List) – a list of nodes (a List)
none()

Node.__init__() -> Node

propagateChildrenNodesOrganizationDirty(includeSelf=False)

Calls for a propagateDirty with the flag OrsChildrenNodesOrganizationDirty

Parameters:includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
propagateDataDirty(includeSelf=False)

Calls for a propagateDirty with the flag OrsDataDirty

Parameters:includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
propagateDirty(self, dirtyFlag: str, includeSelf: bool) → None

Causes a dirty message to be sent to all children nodes.

Note

See ORS_def.h for default dirty flag (ex: ORSDataDirty).

Note

A dirty message has different results for different objects, but generally causes a refresh on the data.

Note

Message propagation is done depth-first.

Parameters:
  • dirtyFlag (str) – a string dirty flag (a string)
  • includeSelf (bool) – should set this dirty (a bool)
propagateGeometryDirty(includeSelf=False)

Calls for a propagateDirty with the flag OrsGeometryDirty

Parameters:includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
propagateHighlightDirty(includeSelf=False)

Calls for a propagateDirty with the flag OrsHighlightDirty

Parameters:includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
propagatePropertyDirty(includeSelf=False)

Calls for a propagateDirty with the flag OrsPropertyDirty

Parameters:includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
propagateVisibilityDirty(includeSelf=False)

Calls for a propagateDirty with the flag OrsVisibilityDirty

Parameters:includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
refresh()

Refreshes the views related to the current object

refreshAll2DParentViews(self) → None

Causes all 3D views in the parent hierarchy of the node to be refreshed.

refreshAll3DParentViews(self) → None

Causes all 3D views in the parent hierarchy of the node to be refreshed.

refreshAllParentViews(self) → None

Causes all views in the parent hierarchy of the node to be refreshed.

setAllowRenderingInAllParentViews(self, bValue: bool) → None

Allows or prevents rendering in the views affected by a node.

Parameters:bValue (bool) – true to allow rendering, false to disallow it.
switchOrderOfPrecedenceOfChildrenNodes(self, anINode1: ORSModel.ors.Node, anINode2: ORSModel.ors.Node) → bool

Rearranges the order of child nodes.

Note

When child nodes are not in the desired order, they can be switched with this method (for example, the order in which they are rendered can be undesired).

Note

Both nodes are swapped in the list of nodes. For example, if nodes are A B C D and this call is made switchOrderOfPrecedenceOfChildrenNodes(A, C), the nodes are then in this order: C B A D.

Note

This method dives down in the child hierarchy until it finds a node where both arguments appear, then performs the switch at that level.

Parameters:
Returns:

output (bool) – true if successful, false otherwise

switchOrderOfPrecedenceOfParentNodes(self, anINode1: ORSModel.ors.Node, anINode2: ORSModel.ors.Node) → bool

Rearranges the ordering of immediate parent nodes.

Note

When parent nodes are not in the desired order, they can be switched with this method.

Note

Both nodes are swapped in the list of nodes. For example, if nodes are A B C D and this call is made switchOrderOfPrecedenceOfParentNodes(A, C), the nodes are then in this order: C B A D.

Note

This method acts only on immediate parent nodes, not the entire parent hierarchy.

Parameters:
Returns:

output (bool) – true if successful, false otherwise

Managed

class ORSModel.ors.Managed

Bases: ORSModel.ors.ORSBaseClass

brief_description: The “mother” of all author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005

addCallbackToEvent(self, anEventName: str, sCallbackName: str, callbackData: int) → bool

Adds a callback subscription to an event.

Note

The callback name for a given event needs to be unique for that event, i.e. no two callbacks for a given event can have the same name.

Parameters:
  • anEventName (str) – name of the event to subscribe to (a string)
  • sCallbackName (str) – callback name (a string)
  • callbackData (int) – a pointer to a ORS_EVENT_CALLBACK_INFO structure
Returns:

output (bool) – true if subscription succeeded, false otherwise

addToDeleteSet(self, anIObject: ORSModel.ors.Managed) → None

Add an object to the delete set.

Note

All objects have a delete set, which designates those objects that should also be deleted when the receiver gets deleted.

Parameters:anIObject (ORSModel.ors.Managed) – an object (a Managed)
addToSelection(contextInstance)

Adds the instance to the selection of a context

Parameters:contextInstance (plugin instance) – context instance

Note

Only representable object can be selected

applyPreferences()

Helper for setting the attribute of the object following the preferences

atomicLoad(sFilename: str, bPreserveIdentity: bool) → Managed

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

Parameters:
  • sFilename (str) – path of the file to load
  • bPreserveIdentity (bool) – if true, preserves the identity of the object, false otherwise
Returns:

output (Managed) – a managed object, or none() if the load fails

atomicLoadFrom(self, anXML: str) → None

Loads an object from an XML string.

Parameters:anXML (str) –

Managed.atomicLoadFrom(self, buffer: int, nBytes: int) -> None

Loads an object from a buffer. Used for python pickling.

Parameters:
  • buffer (bytes) – the buffer
  • nBytes (int) – the number of bytes in the buffer (a 64 bit unsigned int)
atomicLoadSpecificNode(self, aFilename: str, aXPathOfTheNodeToLoad: str) → bool

Loads an object from a file containing several objects.

Parameters:
  • aFilename (str) –
  • aXPathOfTheNodeToLoad (str) –
Returns:

output (bool) –

atomicSave(self, aFilename: str, isTemporary: bool) → int

Saves the object to a file.

Parameters:
  • aFilename (str) – path of the file to save
  • isTemporary (bool) – if true, try to keep file in memory
Returns:

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

copy(self) → Managed

Returns a copy of the managed.

Note

Only the immediate attributes of the managed are copied. The graph surrounding the new managed is the same one as the source managed.

Note

You can type the return value of this method to any subclass of Managed, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be NULL.

Returns:output (ORSModel.ors.Managed) – a new managed (a Managed)
deleteObject(self) → None

Explicitly deletes the core object wrapped by this Interface object.

deleteObjectAndAllItsChildren(self) → None

Explicitly deletes the core object wrapped by this Interface object, along with all its children.

getAllGroupsContaining(self, anIObject: ORSModel.ors.Managed) → List

Gets all the groups that contain the given object.

Parameters:anIObject (ORSModel.ors.Managed) –
Returns:output (ORSModel.ors.List) –
classmethod getAllInstances()
getAllInstancesOf(pProgId: str) → List

Gathers all existing objects of the specified class.

Parameters:pProgId (str) –
Returns:output (ORSModel.ors.List) –
classmethod getAllObjectsOfClass(cls_name)
getAllObjectsOfClassAndPrivateTitle(pProgId: str, pPrivateTitle: str) → List

Gathers all existing objects of the specified class, that have a matching private title.

Parameters:
  • pProgId (str) – name of the class (a string)
  • pPrivateTitle (str) – private title to search for (a string)
Returns:

output (ORSModel.ors.List) – all the objects that match the search criteria (a List)

getAllObjectsOfClassAndUserData(pProgId: str, userDataKey: str, userDataValue: str) → List

Gathers all existing objects of the specified class, that have a matching user data.

Parameters:
  • pProgId (str) – name of the class (a string)
  • userDataKey (str) – key of the user data (a string)
  • userDataValue (str) – value to look for (a string)
Returns:

output (ORSModel.ors.List) – all the objects that match the search criteria (a List)

getAllRepresentableObjects(self) → List

Gets all the representable objects of the world.

Returns:output (ORSModel.ors.List) – a list containing all the representable objects
classmethod getAllSubclasses(outputCollection=None)
getAtomicTextRepresentation(self, bSelfContained: bool) → str

Retrieves the object’s atomic text representation.

Parameters:bSelfContained (bool) –
Returns:output (str) –
getBinaryUserInfo(self, pTag: str) → None

Retrieves a user defined binary value. Typed as void* for sip, but it’s in reality an unsigned char*.

Note

If the key doesn’t exist, nullptr is returned

Parameters:pTag (str) – key of the data (a string)
getBinaryUserInfoAsBytes(name)
getBinaryUserInfoSize(self, pTag: str) → int

Retrieves the size of a user defined binary value.

Note

If the key doesn’t exist, 0 is returned

Parameters:pTag (str) – key of the data (a string)
Returns:output (int) – the size of the data (a uint32_t)
getCallbacksEnabled(self) → bool

Queries the object to know if its callbacks are enabled or disabled.

Returns:output (bool) – true if callbacks are enabled, false otherwise
getChildrenNodesOrganizationDirtySignature()

Gets the current dirty signature for the flag OrsChildrenNodesOrganizationDirty

Returns:childrenNodesOrganizationDirtySignature (int) – the dirty signature
classmethod getClassDenomination()
static getClassFromProgId(progId)
getClassName(self) → str

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

Returns:output (str) – the class name (a string)
getClassNameStatic() → str

getClassNameStatic

Returns:output (str) –
getCreationTime(self) → int

Returns the time Number of seconds since Jan 1 2000 of creation of this object.

Returns:output (int) – a uint32_t
getDataDirtySignature()

Gets the current dirty signature for the flag OrsDataDirty

Returns:dataDirtySignature (int) – the dirty signature
getDirtySignature(self, dirtyFlag: str) → int

Gets the current dirty signature.

Note

Objects can be dirty for several aspects, see the ors_def.h file for the different dirty aspects.

Parameters:dirtyFlag (str) – dirty flag name (a string, see note below)
Returns:output (int) – dirty signature (a uint64_t)
getEventCallbackEnabled(self, sEventName: str, sCallbackName: str) → bool

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

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

output (bool) – true if callback is enabled, false if disabled or if the callback subscription did not exist

getGUID(self) → str

Retrieves the GUID of the core object.

Note

The GUID is the unique identifier of the object. No two objects can have the same GUID. Once you have an object’s GUID, at any time you can obtain a reference to that object via its GUID, given that the object is still alive.

Returns:output (str) –
getGeometryDirtySignature()

Gets the current dirty signature for the flag OrsGeometryDirty

Returns:geometryDirtySignature (int) – the dirty signature
getHasCallbacksForEvent(self, anEventName: str) → bool

Checks if the receiver has any callbacks for an event.

Parameters:anEventName (str) – name of the event (a string)
Returns:output (bool) –
getHighlightDirtySignature()

Gets the current dirty signature for the flag OrsHighlightDirty

Returns:highlightDirtySignature (int) – the dirty signature
getIsAvailableInContext(pluginInstance=None)
getIsDirty(self, dirtyFlag: str) → bool

Gets if the object is dirty for a specific dirty flag.

Parameters:dirtyFlag (str) – dirty flag name (a string, see note below)
Returns:output (bool) – true if object is dirty, false otherwise
getIsDirtyAnyDirtyFlag(self) → bool

Gets if the object is dirty for any of the dirty flags.

Returns:output (bool) – true if object is dirty, false otherwise
getIsEqualTo(self, aManaged: ORSModel.ors.Managed) → bool

Checks if the two objects are equal.

Parameters:aManaged (ORSModel.ors.Managed) – an object to compare with (a Managed)
Returns:output (bool) – true if the receiver and the argument are equal (class dependent), false otherwise
getIsExclusiveToContext(pluginInstance=None)
getIsIdentityPreservedForPickling(self) → bool

Returns True if the GUID is preserved when pickling and unpickling an object.

Returns:output (bool) – Returns True if the GUID is preserved when pickling and unpickling an object
getIsInDeleteSet(self, anIObject: ORSModel.ors.Managed) → bool

Gets if an object is included in the receiver delete set.

Note

The delete set is a list of objects that are to be deleted when the receiver is deleted.

Parameters:anIObject (ORSModel.ors.Managed) – object to look for in the receiver delete set (a Managed)
Returns:output (bool) – true if the object is in the delete set of the receiver, false otherwise
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) –
getIsInstanceOfAtLeastOneClasses(progIdList)
getIsPrivateInContext(pluginInstance=None)
getIsPublicInAllContexts()
getIsRepresentable(self) → bool

Queries the object to know if it is representable.

Returns:output (bool) –
getIsSameObjectAs(self, anObject: ORSModel.ors.Managed) → bool

Checks to see if the receiver wraps the same underlying object as the supplied argument.

Parameters:anObject (ORSModel.ors.Managed) – an object to compare with (a Managed)
Returns:output (bool) – true if underlying object is the same for both the receiver and the argument, false otherwise
classmethod getIsSubclassOf(parentClass)
getIsToBeKeptAliveUntilExit(self) → bool

Queries the object to know if it is permanent for the life of the application.

Note

Permanent objects survive a new session, i.e. they live until the application is terminated.

Returns:output (bool) – true if object is permanent, false otherwise
getIsToBeSaved(self) → bool

Queries the object to know if it should be saved in a session file.

Returns:output (bool) – true if object should be saved, false otherwise
getObjectWithGUID(guid: str) → Managed

Retrieves an object from its GUID.

Parameters:guid (str) – a GUID (a string)
Returns:output (ORSModel.ors.Managed) – An object or none if object is not found
getPrivateTitle(self) → str

Gets the private title of the object.

Note

The private title is never shown in the application, but is a means by which an object can be found (getAllObjectsOfClassAndPrivateTitle for example).

Returns:output (str) – private title of the object (a string)
getPropertyDirtySignature()

Gets the current dirty signature for the flag OrsPropertyDirty

Returns:propertyDirtySignature (int) – the dirty signature
getPythonRepresentation(self) → str

Gets a Python evaluable string representation.

Returns:output (str) – The object’s representation (a string)
getReferenceCount(self) → int

Returns the count of references to the object.

Returns:output (int) – the count of references (an int)
getTitle(self) → str

Gets the title of the object.

Returns:output (str) – the title (a string)
getUserInfo(self, pTag: str) → str

Retrieves a user defined value.

Note

If the key doesn’t exist an empty string is returned.

Parameters:pTag (str) – key of the data (a string)
Returns:output (str) – the data (a string)
getUserInfoAsArray(self) → ArrayString

Retrieves the user info as a string array.

Note

The user info data is flattened into an array of string pairs, for the key and the value.

Returns:output (ORSModel.ors.ArrayString) – the data (an ArrayString, see note below)
getUserInfoPickledObject(name)
getVisibilityDirtySignature()

Gets the current dirty signature for the flag OrsVisibilityDirty

Returns:visibilityDirtySignature (int) – the dirty signature
isManaged(self) → bool
Returns:output (bool) –
isNone(self) → bool

check if the object is none

Returns:output (bool) –
isNotNone(self) → bool

check if the object is Not none

Returns:output (bool) –
none()

Managed.__init__() -> Managed

publish()

Sets an object as representable and notifies the Dragonfly UI of a new available object

removeBinaryUserInfo(self, pTag: str) → None

Removes a user defined binary value.

Parameters:pTag (str) – key name of the binary value (a string)
removeCallbackFromEvent(self, sEventName: str, sCallbackName: str) → bool

Removes a callback subscription to an event.

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

output (bool) – true callback existed, false otherwise

removeFromDeleteSet(self, anIObject: ORSModel.ors.Managed) → None

Remove an object from the delete set.

Note

The delete set is a list of objects that are to be deleted when the receiver is deleted.

Parameters:anIObject (ORSModel.ors.Managed) – object to be removed from the delete set (a Managed)
removeUserInfo(self, pTag: str) → None

Removes a user defined value.

Parameters:pTag (str) – key of the data (a string)
selectExclusively(contextInstance)

Selects only the current instance for a context

Parameters:contextInstance (plugin instance) – context instance

Note

Only representable object can be selected

setAsTemporaryObject(isTemporaryObject=True)

Helper for setting useful properties when marking an object as a (non-)temporary object.

Parameters:isTemporaryObject (bool) – if True, the object will be set as temporary (not representable, not to be saved, callbacks disabled). Otherwise, these properties are set as the opposite.
setBinaryUserInfo(self, pTag: str, pValue: int, iDataSize: int) → None

Sets a user defined binary value.

Note

Objects can carry user defined data in the form of strings or binary data.

Parameters:
  • pTag (str) – key of the data (a string)
  • pValue (bytes) – the data (an unsigned char* buffer)
  • iDataSize (int) – the size of the data (a uint32_t)
setCallbacksEnabled(self, enabled: bool) → None

Sets the object’s callbacks to be enabled or not.

Note

When an object’s callbacks are disabled, absolutely no callbacks are triggered from the receiver.

Parameters:enabled (bool) – true to enable callbacks, false otherwise
setChildrenNodesOrganizationDirty()

Calls for a setDirty with the flag OrsChildrenNodesOrganizationDirty

setDataDirty()

Calls for a setDirty with the flag OrsDataDirty

setDirty(self, dirtyFlag: str) → None

Sets the object as being dirty for a given aspect.

Note

A dirty object is an object that has changed, giving its observers a chance to refresh their view on the object. Several aspects of an object can be dirty, see ORS_def.h for dirty signature flags.

Parameters:dirtyFlag (str) – dirty flag name (a string)
setEventCallbackEnabled(self, sEventName: str, sCallbackName: str, bValue: bool) → bool

Enables/disables a callback subscription to an event.

Note

Works for all callback types (object, class and global)

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

output (bool) – true if callback subscription existed, false otherwise

setExclusiveToContext(pluginInstance=None)
setGeometryDirty()

Calls for a setDirty with the flag OrsGeometryDirty

setHighlightDirty()

Calls for a setDirty with the flag OrsHighlightDirty

setIdentityIsPreservedForPickling(self, value: bool) → None

Set to True if the GUID is to be preserved when pickling and unpickling an object.

Parameters:value (bool) –
setIsNotDirty(self) → None

Sets the object as not being dirty for all dirty flags.

setIsRepresentable(self, isRepresentable: bool) → None

Sets the object to be representable or not.

Note

Non representable objects don’t appear in lists and such, the implicit meaning is that these objects are transient and temporary.

Parameters:isRepresentable (bool) – true to make the object representable, false otherwise
setIsToBeKeptAliveUntilExit(self, pFlag: bool) → None

Sets the object to be permanent for the life of the application.

Note

Permanent objects survive a new session, i.e. they live until the application is terminated.

Parameters:pFlag (bool) – true to make the object permanent, false otherwise
setIsToBeSaved(self, pIsToBeSaved: bool) → None

Sets the object to be saved to session files or not.

Parameters:pIsToBeSaved (bool) – true to cause the object to be saved to session files, false otherwise
setPrivateTitle(self, newPrivateTitle: str) → None

Sets the private title of the object.

Note

The private title can later be used to find a reference to that object, given that it’s still alive.

Parameters:newPrivateTitle (str) – a title (a string)
setPropertyDirty()

Calls for a setDirty with the flag OrsPropertyDirty

setPublicInAllContexts()
setTitle(self, newVal: str) → None

Sets the title of the object.

Parameters:newVal (str) –
setUserInfo(self, pTag: str, pValue: str) → None

Sets a user defined value.

Note

Stores the key/value pair in an internal dictionary. If the key already exists its previous value is overwritten.

Parameters:
  • pTag (str) – a key name (a string)
  • pValue (str) – a value (a string)
setUserInfoPickledObject(name: str, picklable_object)
setVisibilityDirty()

Calls for a setDirty with the flag OrsVisibilityDirty

switchAvailabilityToContext(oldContextID, newContextID)

Switches the availability of the object from an old context to a new context. This will be done only if the old context ID is found in the set of available contexts and the new context ID is not already in the set of available contexts. The availability for all other contexts remains unchanged.

The arguments oldContextID and newContextID are used as strings instead of plugin instances to support the situation where the old or new context is not existing (for example, to perform a copy of the objects).

Parameters:
  • oldContextID (str) – old context ID
  • newContextID (str) – new context ID
triggerClassEvent(self, sEventName: str) → bool

Triggers a class event.

Parameters:sEventName (str) –
Returns:output (bool) –
unpublish()

Sets an object as non-representable and notifies the Dragonfly UI of a loss of the availability of the object.

unselect(contextInstance)

Unselects the instance for a context

Parameters:contextInstance (plugin instance) – context instance

ORSBaseClass

class ORSModel.ors.ORSBaseClass
getPythonTraceBack() → typing.List[str]

Set the python traceback for a call from python.

Returns:output (typing.List[str]) –
isManaged(self) → bool
Returns:output (bool) –
isNone(self) → bool
Returns:output (bool) –
setPythonTraceBack(tb: ORSModel.ors.typing.List[str]) → None

Set the python traceback for a call from python.

Parameters:tb (typing.List[str]) –