Skip to content

Updates to graphics module

What has changed

  • Added a new line method to SimpleLineAnnotation that allows for specification of the length of the of the line (in pixels) a priori. This way, if you have a known line of a given length (e.g. a cross-section of known stationing), you can digitize that line based on the converted number of pixels and get a consistent length.

    • This works by sending the Instructions.Line_With_Supplied_Length_Instruction along with the length in pixels to the AnnotationView.
    viewer.scene.set_current_instruction(
     Instructions.Line_With_Supplied_Length_Instruction,
     length=1750,
    )
    • When a user clicks the 1st point, the line is started. Then the current mouse position is then used to set the line direction, updated live. Clicking another point sets the line. All the while, the length of the line will not change.
    • The Instructions.Simple_Line_Instruction works the same way, but the line will end at the point where the second mouse click occurs.
    • The Instructions.Add_Line_By_Points method remains unchanged.
  • I removed unnecessary digitization of GripItems (the grip-able points, currently symbolized as yellow circles) for the Line and Polygon annotations.

  • Fleshed out documentation throughout the graphics module.

Closes #41 (closed)

Merge request reports

Loading