Interface OutlinedShape


  • public interface OutlinedShape
    Defines the interface for the multi-pass rendering technique implemented by DrawContext.drawOutlinedShape(OutlinedShape, Object) that renders outlines around filled shapes correctly and resolves depth-buffer fighting between the shape being drawn and those previously drawn. The methods of this interface are called by the draw context during the multi-pass rendering.
    • Method Detail

      • isDrawOutline

        boolean isDrawOutline​(DrawContext dc,
                              java.lang.Object shape)
        Indicates whether the shape's outline is drawn.
        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
        Returns:
        true if the shape's outline should be drawn, otherwise false.
      • isDrawInterior

        boolean isDrawInterior​(DrawContext dc,
                               java.lang.Object shape)
        Indicates whether the shape's faces are drawn.
        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
        Returns:
        true if the shape's faces should be drawn, otherwise false.
      • isEnableDepthOffset

        boolean isEnableDepthOffset​(DrawContext dc,
                                    java.lang.Object shape)
        Indicates whether the shape's depth should be adjusted to give its filled faces priority over coincident items previously drawn.
        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
        Returns:
        true if the shape should have priority, otherwise false.
      • drawOutline

        void drawOutline​(DrawContext dc,
                         java.lang.Object shape)
        Draws the shape's outline.
        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
      • drawInterior

        void drawInterior​(DrawContext dc,
                          java.lang.Object shape)
        Draws the shape's filled faces.
        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
      • getDepthOffsetFactor

        java.lang.Double getDepthOffsetFactor​(DrawContext dc,
                                              java.lang.Object shape)
        Returns the depth-offset factor.

        The amount of depth offset when depth offset is enabled is computed by the formula factor * DZ + r * units, where DZ is a measurement of the change in depth relative to the screen area of the shape, and r is the smallest value guaranteed to produce a resolvable offset. units is the value return by getDepthOffsetUnits(DrawContext, Object).

        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
        Returns:
        the depth offset factor to use for the shape.
      • getDepthOffsetUnits

        java.lang.Double getDepthOffsetUnits​(DrawContext dc,
                                             java.lang.Object shape)
        Returns the depth-offset units.

        The amount of depth offset when depth offset is enabled is computed by the formula factor * DZ + r * units, where DZ is a measurement of the change in depth relative to the screen area of the shape, and r is the smallest value guaranteed to produce a resolvable offset. factor is the value return by getDepthOffsetFactor(DrawContext, Object).

        Parameters:
        dc - the current draw context.
        shape - the shape being drawn.
        Returns:
        the depth units to use for the shape.