API (v3.0.0-dev) - Giro3D
    Preparing search index...

    A tool that allows interactive creation and edition of Shapes.

    To create shapes, you can either use one of the preset methods (createSegment, createPolygon...), or start creating a free shape with createShape.

    This method allows fine control over the constraints to apply to the shape (how many vertices, styling options, what component to display...).

    The enterEditMode method allows the user to edit any shape that the mouse interacts with. Depending on the constraints put on the shape during the creation (assuming of course that the shape was created with this tool), some operations might not be permitted.

    To exit edition mode, call exitEditMode.

    • If a shape was created with the createSegment method, it is not possible to insert or remove points, because the constraint forces the shape to have exactly 2 points.

    • If a shape was created with the createPolygon method, then any time the user moves the first or last vertex, the other one is automatically moved at the same position, to ensure the shape remains closed.

    Hierarchy

    Implements

    Index

    Constructors

    • Parameters

      • options: { domElement?: HTMLElement; instance: Instance }
        • OptionaldomElement?: HTMLElement

          The DOM element to listen to. If unspecified, this will use Instance.domElement.

        • instance: Instance

          The Giro3D instance.

      Returns DrawTool

    Methods

    • Interactively draws a segment, calling the provided callback every time the second point of the segment is moved. This method returns when the user clicks to confirm the position of the last point.

      Note: the segment itself is not visible, it is the responsibility of the caller to create the appropriate visual representation depending on the desired effect.

      Parameters

      Returns Promise<void>

    • Creates a vertical measure Shape that displays the vertical distance between the start and end point, as well as the angle between the segment formed by those points and the horizontal plane. The shape looks like a right triangle.

      Parameters

      Returns Promise<Shape<EntityUserData> | null>

      A promise that eventually returns the Shape or null if creation was cancelled.

    • Disposes unmanaged resources created by this instance.

      Returns void

    • Exits edition mode.

      Returns void