typerig.proxy.fl.gui.drawing · declarations 001
Back to typerig.proxy.fl.gui.drawing
BASE_PADDING
module-attribute
BASE_PADDING
MIN_NODE_SIZE
module-attribute
MIN_NODE_SIZE
NODE_SIZE_RATIO
module-attribute
NODE_SIZE_RATIO
SELECTION_LINE_WIDTH
module-attribute
SELECTION_LINE_WIDTH
TRDrawIcon
TRDrawIcon(contours, selection=None, foreground='black', background='gray')
Draw icon for gallery showing contours and optionally selected nodes.
Args: contours (list): List of fl6.flContour objects to draw selection (list, optional): List of selected nodes. If None or empty, draws full contours only foreground (str): Color name for selection lines and node markers background (str): Color name for full contour background in selection mode
Returns: QtGui.QIcon: Icon with the rendered shape
build_selection_contour
build_selection_contour(selection, bbox, padding)
Create contour from selected nodes, adjusted for canvas coordinates.
Args: selection (list): List of selected nodes bbox (fl6.flBoundingBox): Bounding box of the shape padding (float): Padding amount in pixels
Returns: fl6.flContour: Contour containing adjusted nodes
create_selection_pen
create_selection_pen(color)
Create pen for drawing selection path.
Args: color (str): Color name for the pen
Returns: QtGui.QPen: Configured pen for selection drawing
draw_contour_mode
draw_contour_mode(painter, shape, color)
Draw full closed contours in solid color.
Args: painter (QtGui.QPainter): QPainter instance shape (fl6.flShape): Shape to draw color (str): Color name for the fill
draw_node_markers
draw_node_markers(painter, selection, bbox, dimension, color, padding)
Draw circular markers at each selected node.
Args: painter (QtGui.QPainter): QPainter instance selection (list): List of selected nodes bbox (fl6.flBoundingBox): Bounding box of the shape dimension (float): Maximum dimension of the shape color (str): Color name for the markers padding (float): Padding amount in pixels
draw_selection_mode
draw_selection_mode(painter, shape, selection, bbox, foreground, background, dimension, padding)
Draw selection mode with: 1. Full contour as gray background 2. Selected nodes path as colored line 3. Node markers as circles
Args: painter (QtGui.QPainter): QPainter instance shape (fl6.flShape): Shape to draw selection (list): List of selected nodes bbox (fl6.flBoundingBox): Bounding box of the shape foreground (str): Color for selection lines and markers background (str): Color for background contour dimension (float): Maximum dimension of the shape padding (float): Padding amount in pixels
prepare_shape
prepare_shape(contours)
Clone contours and create a new shape.
Args: contours (list): List of fl6.flContour objects
Returns: fl6.flShape: Shape containing cloned contours
transform_shape_to_canvas
transform_shape_to_canvas(shape, bbox, padding)
Center shape on canvas by removing bbox offset and adding padding.
Args: shape (fl6.flShape): Shape to transform bbox (fl6.flBoundingBox): Bounding box of the shape padding (float): Padding amount in pixels