primitiveHandlers¶
PrimitiveHandler¶
- class ORSServiceClass.primitiveHandlers.primitivehandler.PrimitiveHandler(instance)¶
Bases:
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:
- 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: View)¶
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
- 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() Annotation¶
Gets the annotation manipulated by the handler
- Return:
the annotation of the handler, or None if the annotation is not yet created
- Rtype:
- 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.InputEventData) – event data
- Return:
list of selected annotations
- Rtype:
list of ORSModel.ors.Annotation
- getViewAtActivation() View¶
Gets the view under cursor when the activation is started
- Return:
view under cursor at activation
- Rtype:
- 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()¶
Method called at the beginning of
ORSServiceClass.ORSControllerAndHandler.ORSHandlerAbstract.ORSHandlerAbstract.process()to know if the methodORSServiceClass.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:
Trueif the preparation has been done with success;Falseotherwise.
- needReset()¶
Gets if the method
resetshould be called at the exitAction stage.- Return:
Trueif the methodresetshould be called;Falseotherwise.- Rtype:
bool
- 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:
Trueif the preparation is complete and the handler is ready to process.
- 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.InputEventData) – 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.InputEventData) – 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
- processMouseMove2D(eventData, constraintVectorForControlPoint=None, constraintVectorForPrimitive=None)¶
Moves the selected annotation or some of his control points
- Parameters:
eventData (OrsEvent.eventdata.InputEventData) – 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
- processMouseMove3D(eventData, constraintVectorForControlPoint=None, constraintVectorForPrimitive=None)¶
Moves the selected annotation or some of his control points
- Parameters:
eventData (OrsEvent.eventdata.InputEventData) – 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(logging=True)¶
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.
- 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
- setPositionOfFloatingCaptionForView(aView, anAnnotation, position)¶
Sets the position of of the floating caption This method (unless overloaded) calls on the plugin implementation method
setPositionOfFloatingCaptionForView.- Parameters:
aView (ORSModel.ors.View) – the view where the manipulation took place
anAnnotation (ORSModel.ors.Annotation) – the annotation object to modify
position (ORSModel.ors.Vector3) – (X, Y, Z) coordinate of the new position
- Returns:
success (bool) – True if successful, False otherwise
- setPrimitive(primitive)¶
Sets the annotation manipulated by the handler
- Parameters:
primitive (ORSModel.ors.Annotation) – the annotation of the handler, or
None.
AngleHandler¶
- class ORSServiceClass.primitiveHandlers.angleHandler.AngleHandler(instance)¶
Bases:
PrimitiveHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- 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
- 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
- needReset()¶
Gets if the method
resetshould be called at the exitAction stage.- Return:
Trueif the methodresetshould be called;Falseotherwise.- Rtype:
bool
- 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.InputEventData) – event data
- Return:
Trueif the task has been completed with success;Falseotherwise.- Rtype:
bool
- 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.
CircleHandler¶
- class ORSServiceClass.primitiveHandlers.circleHandler.CircleHandler(instance)¶
Bases:
RectangleHandler- 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
- 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
EllipseHandler¶
- class ORSServiceClass.primitiveHandlers.ellipseHandler.EllipseHandler(instance)¶
Bases:
RectangleHandler- 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
- 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
FreeHandHandler¶
- class ORSServiceClass.primitiveHandlers.freeHandHandler.FreeHandHandler(instance)¶
Bases:
RegionHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- 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
- 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
- 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.InputEventData) – event data
- Return:
Trueif the task has been completed with success;Falseotherwise.- Rtype:
bool
PathHandler¶
- class ORSServiceClass.primitiveHandlers.pathHandler.PathHandler(instance)¶
Bases:
PrimitiveHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- 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
- 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
- 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.InputEventData) – 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.InputEventData) – 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()¶
The “publish” method is overloaded to add extra logging commands.
PointHandler¶
- class ORSServiceClass.primitiveHandlers.pointHandler.PointHandler(instance)¶
Bases:
PrimitiveHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- getIsRepresentableAtCreation()¶
Gets if the annotation should be set as representable after being instantiated
- Return:
Trueif it should be set as representable;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
- 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
- needReset()¶
Gets if the method
resetshould be called at the exitAction stage.- Return:
Trueif the methodresetshould be called;Falseotherwise.- Rtype:
bool
- 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.InputEventData) – event data
- Return:
Trueif the task has been completed with success;Falseotherwise.- Rtype:
bool
- 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.
PolyHandler¶
- class ORSServiceClass.primitiveHandlers.polyHandler.PolyHandler(instance)¶
Bases:
RegionHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- getIsRepresentableAtCreation()¶
Gets if the annotation should be set as representable after being instantiated
- Return:
Trueif it should be set as representable;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
- 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
- needReset()¶
Gets if the method
resetshould be called at the exitAction stage.- Return:
Trueif the methodresetshould be called;Falseotherwise.- Rtype:
bool
- 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.InputEventData) – event data
- Return:
Trueif the task has been completed with success;Falseotherwise.- Rtype:
bool
RectangleHandler¶
- class ORSServiceClass.primitiveHandlers.rectangularHandler.RectangleHandler(instance)¶
Bases:
RegionHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- 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
- 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
- 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.InputEventData) – event data
- Return:
Trueif the task has been completed with success;Falseotherwise.- Rtype:
bool
- processMouseMove(eventData)¶
Moves the selected annotation or some of his control points
- Parameters:
eventData (OrsEvent.eventdata.InputEventData) – 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
RulerConstraintHandler¶
- class ORSServiceClass.primitiveHandlers.rulerConstraintHandler.RulerConstraintHandler(instance)¶
Bases:
RulerHandler- processMouseMove(eventData, constraintVectorForControlPoint=None, constraintVectorForPrimitive=None)¶
Moves the selected annotation or some of his control points
- Parameters:
eventData (OrsEvent.eventdata.InputEventData) – 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
RulerHandler¶
- class ORSServiceClass.primitiveHandlers.rulerhandler.RulerHandler(instance)¶
Bases:
PrimitiveHandler- getAssociatedPrimitive()¶
Gets the class of the annotation manipulated by the handler
- Return:
an Annotation subclass
- Rtype:
ORSModel.ors.Annotation class
- 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
- 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
- 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.InputEventData) – event data
- Return:
Trueif the task has been completed with success;Falseotherwise.- Rtype:
bool
RulerHorizontalHandler¶
- class ORSServiceClass.primitiveHandlers.rulerHorizontalHandler.RulerHorizontalHandler(instance)¶
Bases:
RulerConstraintHandler- 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
RulerVerticalHandler¶
- class ORSServiceClass.primitiveHandlers.rulerVerticalHandler.RulerVerticalHandler(instance)¶
Bases:
RulerConstraintHandler- 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
SplitAngleHandler¶
- class ORSServiceClass.primitiveHandlers.splitAngleHandler.SplitAngleHandler(instance)¶
Bases:
AngleHandler- 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
SquareHandler¶
- class ORSServiceClass.primitiveHandlers.squareHandler.SquareHandler(instance)¶
Bases:
RectangleHandler- 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