mxcubecore.HardwareObjects.mockup.ShapeHistoryMockup#
Contains the classes
ShapeHistory
Shape
Point
Line
CanvasGrid
ShapeHistory keeps track of the current shapes the user has created. The shapes handled are any that inherits the Shape base class. There are currently two shapes implemented Point and Line.
Point is the graphical representation of a centred position. A point can be stored and managed by the ShapeHistory. the Line object represents a line between two Point objects.
Classes
|
|
|
|
|
Base class for shapes. |
|
Keeps track of the current shapes the user has created. |
- class mxcubecore.HardwareObjects.mockup.ShapeHistoryMockup.Line(drawing, start_qub_p, end_qub_p, start_cpos, end_cpos)[source]#
Bases:
Shape
- class mxcubecore.HardwareObjects.mockup.ShapeHistoryMockup.Point(drawing, centred_position, screen_pos)[source]#
Bases:
Shape
- class mxcubecore.HardwareObjects.mockup.ShapeHistoryMockup.Shape[source]#
Bases:
object
Base class for shapes.
- class mxcubecore.HardwareObjects.mockup.ShapeHistoryMockup.ShapeHistoryMockup(name)[source]#
Bases:
HardwareObject
Keeps track of the current shapes the user has created. The shapes handled are any that inherits the Shape base class.
- add_shape(shape)[source]#
Adds the shape <shape> to the list of handled objects.
- Parameters:
shape (Shape object.) – Shape to add.
- delete_shape(shape)[source]#
Removes the shape <shape> from the list of handled shapes.
- Parameters:
shape (Shape object.) – The shape to remove
- get_qimage(image, canvas, zoom=1)[source]#
Gets the QImage from a parent widget.
- Parameters:
image (QWidget) – The QWidget that contains the image to extract
canvas (QCanvas) – The QCanvas obejct to add as overlay
zoom (int.) – Zoom level
- Returns:
The QImage contained in the parent widget.
- Return type:
QImage
- get_snapshot(qub_objects)[source]#
Get a snapshot of the video stream and overlay the objects in qub_objects.
- Parameters:
qub_objects (QCanvas) – The QCanvas object to add on top of the video.
- Returns:
The snapshot
- Return type:
QImage