ORSControllerAndHandler

Controllers

ORSMouseControler

class ORSServiceClass.ORSControllerAndHandler.ORSMouseControler.ORSMouseControler(instance)

Class managing mouse handlers

processEventData(eventData)

Process an event data by setting an appropriate handler accordingly to the current state and activating this handler if the conditions are respected.

Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the current handler completed his process; False otherwise.
setHandler(handleName)

Sets the current handler for a given state

Parameters:handleName (str) – name of the state

OrsMovementControler

class ORSServiceClass.ORSControllerAndHandler.ORSMovementControler.OrsMovementControler(instance, translationRotationWidget)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseControler.ORSMouseControler

setHandler(handleName)

Sets the current handler for a given state

Parameters:handleName (str) – name of the state
setWidget(widget)

Handlers

ORSHandlerAbstract

class ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract(instance)

Basic class to define a handler.

classmethod addHandleName(handleName)
classmethod getAllSubclasses(parentClass, outputCollection=None)
classmethod getCreateHandler(handleName, instance=None)
getImplementation()

Gets the plugin instance (implementation) associated with this handler

Return:plugin instance
handleNames = []
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
classmethod managedHandleInclude(handleName)
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
preprocess(eventData)

Method called before ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process()

Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
reset()

Method called when the handler should complete his processing (for example, at mouse button release) and clean his data.

Overloading the subclass requires to call first the super class method, as:

super().reset()
resetOnExit()

Method called by ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() at the ExitAction stage.

ORSMouseHandlerAbstract

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract(instance=None)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract

Class to define a handler based on the cursor (mouse) information

getCurrentHandlerName()
getInfinityRange()
getLocalPositionVectorAtActivation()
getWorldPositionVectorAtActivation()
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
needReset()
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
reset()

Method called when the handler should complete his processing (for example, at mouse button release) and clean his data.

Overloading the subclass requires to call first the super class method, as:

super().reset()
resetCursor(eventData)
resetOnExit()

Method called by ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() at the ExitAction stage.

setCurrentHandlerName(name)
setInfinityRange(infinityRange)
setMaximumInfinityRange(eventData)
setMaximumInfinityX(eventData)
setMaximumInfinityY(eventData)
setMinimumInfinityRange(eventData)
setMinimumInfinityX(eventData)
setMinimumInfinityY(eventData)

ORSMovementHandler

class ORSServiceClass.ORSControllerAndHandler.ORSMovementHandler.ORSMovementHandler(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

addRotation(angle)
addScale(pivot, scaleVector)
addTranslation(translation)
applyTranformationViaTheImplementaion(refresh=True)
applyTransformation(interactive=False, refresh=True, currentView=None, logged=False)
classmethod applyTransformationToPrimitive(orsObject, transformationMatrix, dicOfControlPoint, dicOfDensePoint, interactive=False)
classmethod applyTransformationToStructuredGrid(orsObject, transformationMatrix, originalBox, originalClipBox, logged)
classmethod applyTransformationToVisualShape(orsObject, transformationMatrix, view, shape)
classmethod computeTransformationMatrixRotation(pivot, axis, angle)
classmethod computeTransformationMatrixWithScale(pivot, scaleVector)
classmethod computeTransformationMatrixWithTranslation(displacement)
getAllSelectedObjectsOfInterest()
getAngle()
getManipuletedClasses()
getRotationHandleOverlay()
getRotationHandleOverlayGUID()
getRotationPivotOverlay()
getRotationPivotOverlayGUID()
getWidgetDisplay() → ORSModel.ors.View
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
refreshViews()
reset()

Method called when the handler should complete his processing (for example, at mouse button release) and clean his data.

Overloading the subclass requires to call first the super class method, as:

super().reset()
updateTransformationMatrixRotation(pivot, axis, angle)
updateTransformationMatrixWithScale(pivot, scaleVector)
updateTransformationMatrixWithTranslation(displacement)

ORSTranslateHandler

class ORSServiceClass.ORSControllerAndHandler.ORSTranslateHandler.ORSTranslateHandler(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMovementHandler.ORSMovementHandler

classmethod applyTransformationToUnstructuredGrid(orsObject, transformationMatrix, view, position, translation, meshFrame)
handleNames = ['OrsStateMoveTranslate']
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.

ORSRotationHandler

class ORSServiceClass.ORSControllerAndHandler.ORSRotationHandler.ORSRotationHandler(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMovementHandler.ORSMovementHandler

classmethod applyTransformationToUnstructuredGrid(orsObject, view, transformationMatrix, meshFrame, initialMatrix)
getAngleDisplay()
handleNames = ['OrsStateMoveRotateHandle', 'OrsStateMoveRotatePivot']
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
needReset()
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
processRotationHandleMouvement(eventData)
processRotationPivotMovement(eventData)
rotateHandleIdx = 0
rotatePivotIdx = 1

ORSMouseHandlerCine

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerCine.ORSMouseHandlerCine(instance=None)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

classmethod goToFirstLastSlice(firstSlice, impl, eventData)
classmethod goToNextPreviousSlice(previous, impl, display)
handleNames = ['OrsStateCine']
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
classmethod setDisplayToSlice(display, box, sliceIndex, logging)

ORSMouseHandlerCineInfinite

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerCineInfinite.ORSMouseHandlerCineInfinite(instance=None)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerCine.ORSMouseHandlerCine

handleNames = ['OrsStateCineInfinite']
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.

ORSMouseHandlerMoveCameraPivot

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerMoveCameraPivot.ORSMouseHandlerMoveCameraPivot(instance=None)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

handleNames = ['OrsStateMoveCameraPivot']
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.

ORSMouseHandlerPan

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerPan.ORSMouseHandlerPan(instance=None)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

handleNames = ['OrsStatePan']
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
reset()

Method called when the handler should complete his processing (for example, at mouse button release) and clean his data.

Overloading the subclass requires to call first the super class method, as:

super().reset()

ORSMouseHandlerRotate2DXY

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerRotate2DXY.ORSMouseHandlerRotate2DXY(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

OBLIQUE_ROT_FACTOR = 0.005
fitViews(view)
getDeltaX(eventData, current_state)
getDeltaY(eventData, current_state)
getPivot()
handleNames = ['OrsStateObliqueXY', 'OrsStateObliqueX', 'OrsStateObliqueY']
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.

ORSMouseHandlerRotate2DXYInfinite

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerRotate2DXYInfinite.ORSMouseHandlerRotate2DXYInfinite(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerRotate2DXY.ORSMouseHandlerRotate2DXY

fitViews(view)
getDeltaX(eventData, current_state)
getDeltaY(eventData, current_state)
getPivot()
handleNames = ['OrsStateObliqueXAtCenter', 'OrsStateObliqueYAtCenter']

ORSMouseHandlerTrack

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerTrack.ORSMouseHandlerTrack(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

arcBallRatio = 0.9
getArcballVector(mouseScreenCoordinate, dboundedPlane)

Get a normalized vector from the center of the virtual ball O to a point P on the virtual ball surface, such that P is aligned on screen’s (X,Y) coordinates. If (X,Y) is too far away from the sphere, return the nearest point on the virtual ball surface.

getMeanSpin3DAngularSpeed()
getMeanSpin3DAxis()
handleNames = ['OrsStateTrack', 'OrsStateTrackCenter', 'OrsState3DCursor', 'OrsStateTrackSpin3D', 'OrsStateTrackConstraintHorizontally', 'OrsStateTrackConstraintVertically', 'OrsStateTrackConstraintRotation']
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.
processFor2DDisplay(eventData)
processFor3DDisplay(eventData)

ORSMouseHandlerWL

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerWL.ORSMouseHandlerWL(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

handleNames = ['OrsStateLeveling']
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.

ORSMouseHandlerWLInfinite

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerWLInfinite.ORSMouseHandlerWLInfinite(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerWL.ORSMouseHandlerWL

handleNames = ['OrsStateLevelingInfinite']

ORSMouseHandlerZoom

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerZoom.ORSMouseHandlerZoom(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract

getZoomAtCursorPosition()
handleNames = ['OrsStateZoom', 'OrsStateZoomTrackCenter']
isPrepared()

Method called at the beginning of ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process() to know if the method ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() should be called.

Overloading the subclass requires to call first the super class method, as:

if not super().isPrepared():
    return False
Return:True if the preparation has been done with success; False otherwise.
prepare(eventData)

Method called when the handler should gather the initial information required for his processing (for example, at mouse button press).

Overloading the subclass requires to call first the super class method, as:

if not super().prepare(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the preparation is complete and the handler is ready to process.
process(eventData)

Method called to perform the main task of the handler (while activated).

This method calls on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.prepare() if the call on ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.isPrepared() returns False.

Overloading the subclass requires to call first the super class method, as:

if not super().process(eventData):
    return False
Parameters:eventData (OrsEvent.eventdata.InputEventData) – event data
Return:True if the task has been completed with success; False otherwise.

ORSMouseHandlerZoomInfinite

class ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerZoomInfinite.ORSMouseHandlerZoomInfinite(instance)

Bases: ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerZoom.ORSMouseHandlerZoom

getZoomAtCursorPosition()
handleNames = ['OrsStateZoomAtCenter']

See also

primitiveHandlers.