primitiveHandlers¶
PrimitiveHandler¶
-
class
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler(instance)¶ Bases:
ORSServiceClass.ORSControllerAndHandler.ORSMouseHandlerAbstract.ORSMouseHandlerAbstract-
_createPrimitive(aLayoutName, display)¶ Instantiates the annotation.
This method (unless overloaded) calls on the plugin implementation method
createPrimitive.Parameters: - aLayoutName (str) – a layout genealogical name
- display (ORSModel.ors.View) – the view in which the annotation is created
Return: the created annotation
Rtype: ORSModel.ors.Annotation
-
addControlPoint(timestep, position, orientedPlane=None)¶ Adds a control point of the annotation manipulated by the handler.
This method (unless overloaded) calls on the plugin implementation method
addControlPoint.Parameters: - timestep (int) – time index
- position (ORSModel.ors.Vector3) – position vector of the control point
- orientedPlane –
-
createPrimitive(display)¶ Creates the annotation manipulated by the handler.
The actual instantiation of the annotation is made by the call to
_createPrimitive.Parameters: display (ORSModel.ors.View) – the view in which the annotation is created Return: None
-
getAssociatedPrimitive()¶ Gets the class of the annotation manipulated by the handler
Return: an Annotation subclass Rtype: ORSModel.ors.Annotation class
-
getIsInPrimitiveCreateHandler()¶ Gets if the current application state is a creation state of the annotation for the handler
Return: Trueif the current state is one of those declared as a creation state;Falseotherwise.Rtype: bool
-
getIsRepresentableAtCreation()¶ Gets if the annotation should be set as representable after being instantiated
Return: Trueif it should be set as representable;Falseotherwise.Rtype: bool
-
getIsRepresentableAtReset()¶ Gets if the annotation should be set as representable before the call to publish
Return: Trueif it should be set as representable;Falseotherwise.Rtype: bool
-
getIsToBeAddedToSelectedObjectsAtReset()¶ Gets if the annotation should be added to the selected objects before the call to publish
Return: Trueif it should be added to the selection;Falseotherwise.Rtype: bool
-
getMinimumControlPointCount()¶ Gets the minimal count of control points for the annotation manipulated by the handler to be valid
Return: minimal count of control points Rtype: int
-
getPrimitive() → ORSModel.ors.Annotation¶ Gets the annotation manipulated by the handler
Return: the annotation of the handler, or None if the annotation is not yet created Rtype: ORSModel.ors.Annotation
-
getPrimitiveCreateHandler()¶ Gets all the states in which the annotation is created by the handler
Return: list of states Rtype: list of str
-
getPrimitiveEditHandler()¶ Gets the edition state of the annotation manipulated by the handler
Return: name of the state in which the edition occurs Rtype: str
-
getSelectedOrHighlightedAnnotationUnderCursor(view, eventData)¶ Gets the selected annotations and/or highlighted annotation under the cursor in the specified view
Parameters: - view (ORSModel.ors.View) – the view in which the cursor is found
- eventData (OrsEvent.eventdata.EventData) – event data
Return: list of selected annotations
Rtype: list of ORSModel.ors.Annotation
-
getViewAtActivation() → ORSModel.ors.View¶ Gets the view under cursor when the activation is started
Return: view under cursor at activation Rtype: ORSModel.ors.View
-
handleNames= []¶
-
insertControlPoint(index, timestep, position, orientedPlane=None)¶ Inserts a control point in the annotation manipulated by the handler.
This method (unless overloaded) calls on the plugin implementation method
insertControlPoint.Parameters: - index (int) – index of the control point to insert in the annotation
- timestep (int) – time index of the annotation
- position (ORSModel.ors.Vector3) – position vector of the control point
- orientedPlane –
-
isPrepared()¶
-
needReset()¶
-
prepare(eventData)¶
-
process(eventData)¶ Gets to know if the current state is set to edit the annotation.
In the overload of this method, the annotation should be instantiated if it was not done yet. A call to the method
processMouseMovecould be done when editing the annotation.Parameters: eventData (OrsEvent.eventdata.EventData) – event data Return: Trueif the task has been completed with success;Falseotherwise.Rtype: bool
-
processMouseMove(eventData, constraintVectorForControlPoint=None, constraintVectorForPrimitive=None)¶ Moves the selected annotation or some of his control points
Parameters: - eventData (OrsEvent.eventdata.EventData) – event data
- constraintVectorForControlPoint (ORSModel.ors.Vector3) – direction in which the control points can be moved.
If
None, all directions are available. - constraintVectorForPrimitive (ORSModel.ors.Vector3) – direction in which the annotation can be moved.
If
None, all directions are available.
Return: Trueif the task has been completed with success;Falseotherwise.Rtype: bool
-
publish()¶ Publishes the annotation manipulated by the handler
-
reset()¶ Ends the manipulation of the annotation manipulated by the handler and cleans the handler data.
If the annotation object is valid (the count of control points is sufficient):
- calls on
setControlPointPositionInImplementation; - sets the annotation representable value obtained from
getIsRepresentableAtReset; - calls on the handler
publish; - raises the data dirty flag of the annotation;
If the annotation object is not valid, the annotation object is deleted.
- calls on
-
setControlPointPositionInImplementation(primitiveGuid, index, position)¶ Sets a control point position of an annotation.
This method (unless overloaded) calls on the plugin implementation method
setControlPointPosition.Parameters: - primitiveGuid (str) – GUID of the annotation
- index (int) – index of the control point of the annotation
- position (ORSModel.ors.Vector3) – position vector of the control point
-
setPrimitive(primitive)¶ Sets the annotation manipulated by the handler
Parameters: primitive (ORSModel.ors.Annotation) – the annotation of the handler, or None.
-
unselectAllPrimitive()¶ Unselects all annotations
-
AngleHandler¶
-
class
ORSServiceClass.primitiveHandlers.angleHandler.AngleHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
createMode(eventData)¶
-
getAssociatedPrimitive()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStateAngle', 'OrsStateAngleEdit']¶
-
incrementPointSet()¶
-
needReset()¶
-
otherPoint(eventData)¶
-
process(eventData)¶
-
reset()¶
-
CircleHandler¶
-
class
ORSServiceClass.primitiveHandlers.circleHandler.CircleHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.rectangularHandler.RectangleHandler-
dotFromConstraint(dir0, dir1, direction)¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
getRegionShape()¶
-
handleNames= ['OrsStateCircle', 'OrsStateCircleEdit']¶
-
EllipseHandler¶
-
class
ORSServiceClass.primitiveHandlers.ellipseHandler.EllipseHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.rectangularHandler.RectangleHandler-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
getRegionShape()¶
-
handleNames= ['OrsStateRegionEllipse', 'OrsStateRegionEllipseEdit']¶
-
FreeHandHandler¶
-
class
ORSServiceClass.primitiveHandlers.freeHandHandler.FreeHandHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
createMode(eventData)¶
-
getAssociatedPrimitive()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
getRegionShape()¶
-
handleNames= ['OrsStateRegionFreehand', 'OrsStateRegionFreehandEdit']¶
-
process(eventData)¶
-
secondPointMove(eventData)¶
-
PathHandler¶
-
class
ORSServiceClass.primitiveHandlers.pathHandler.PathHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
createMode(eventData)¶
-
getAssociatedPrimitive()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditAddHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStatePath', 'OrsStatePathEdit', 'OrsStatePathEditAdd']¶
-
nthPoint(eventData)¶
-
process(eventData)¶
-
processMouseMove(eventData, constraintVectorForControlPoint=None, constraintVectorForPrimitive=None)¶
-
secondPointMove(eventData)¶
-
PointHandler¶
-
class
ORSServiceClass.primitiveHandlers.pointHandler.PointHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
createMode(eventData)¶
-
getAssociatedPrimitive()¶
-
getIsRepresentableAtCreation()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStatePointsEdit', 'OrsStatePoints']¶
-
needReset()¶
-
otherPoint(eventData)¶
-
process(eventData)¶
-
PolyHandler¶
-
class
ORSServiceClass.primitiveHandlers.polyHandler.PolyHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
addOtherPoint(eventData)¶
-
createMode(eventData)¶
-
getAssociatedPrimitive()¶
-
getIsRepresentableAtCreation()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
getRegionShape()¶
-
handleNames= ['OrsStateRegionPolygonal', 'OrsStateRegionPolygonalEdit']¶
-
needReset()¶
-
process(eventData)¶
-
RectangleHandler¶
-
class
ORSServiceClass.primitiveHandlers.rectangularHandler.RectangleHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
createMode(eventData)¶
-
dotFromConstraint(dir0, dir1, direction)¶
-
getAssociatedPrimitive()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
getRegionShape()¶
-
handleNames= ['OrsStateRegionRectangle', 'OrsStateRegionRectangleEdit']¶
-
process(eventData)¶
-
processMouseMove(eventData)¶
-
secondPointMove(eventData)¶
-
RulerConstraintHandler¶
-
class
ORSServiceClass.primitiveHandlers.rulerConstraintHandler.RulerConstraintHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.rulerhandler.RulerHandler-
handleNames= []¶
-
processMouseMove(eventData, constraintVectorForControlPoint=None, constraintVectorForPrimitive=None)¶
-
secondPointMove(eventData)¶
-
RulerHandler¶
-
class
ORSServiceClass.primitiveHandlers.rulerhandler.RulerHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler-
createMode(eventData)¶
-
getAssociatedPrimitive()¶
-
getMinimumControlPointCount()¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStateRulerEdit', 'OrsStateRuler']¶
-
process(eventData)¶
-
secondPointMove(eventData)¶
-
RulerHorizontalHandler¶
-
class
ORSServiceClass.primitiveHandlers.rulerHorizontalHandler.RulerHorizontalHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.rulerConstraintHandler.RulerConstraintHandler-
getConstraintFromDisplay(display)¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStateRulerHorizontalEdit', 'OrsStateRulerHorizontal']¶
-
RulerVerticalHandler¶
-
class
ORSServiceClass.primitiveHandlers.rulerVerticalHandler.RulerVerticalHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.rulerConstraintHandler.RulerConstraintHandler-
getConstraintFromDisplay(display)¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStateRulerVerticalEdit', 'OrsStateRulerVertical']¶
-
SplitAngleHandler¶
-
class
ORSServiceClass.primitiveHandlers.splitAngleHandler.SplitAngleHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.angleHandler.AngleHandler-
createMode(eventData)¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStateAngleSplit', 'OrsStateAngleSplitEdit']¶
-
otherPoint(eventData)¶
-
SquareHandler¶
-
class
ORSServiceClass.primitiveHandlers.squareHandler.SquareHandler(instance)¶ Bases:
ORSServiceClass.primitiveHandlers.rectangularHandler.RectangleHandler-
dotFromConstraint(dir0, dir1, direction)¶
-
getPrimitiveCreateHandler()¶
-
getPrimitiveEditHandler()¶
-
handleNames= ['OrsStateSquare', 'OrsStateSquareEdit']¶
-