NASA World Wind

gov.nasa.worldwind.render
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 Summary
 void drawInterior(DrawContext dc, Object shape)
          Draws the shape's filled faces.
 void drawOutline(DrawContext dc, Object shape)
          Draws the shape's outline.
 Double getDepthOffsetFactor(DrawContext dc, Object shape)
          Returns the depth-offset factor.
 Double getDepthOffsetUnits(DrawContext dc, Object shape)
          Returns the depth-offset units.
 boolean isDrawInterior(DrawContext dc, Object shape)
          Indicates whether the shape's faces are drawn.
 boolean isDrawOutline(DrawContext dc, Object shape)
          Indicates whether the shape's outline is drawn.
 boolean isEnableDepthOffset(DrawContext dc, Object shape)
          Indicates whether the shape's depth should be adjusted to give its filled faces priority over coincident items previously drawn.
 

Method Detail

drawInterior

void drawInterior(DrawContext dc,
                  Object shape)
Draws the shape's filled faces.

Parameters:
dc - the current draw context.
shape - the shape being drawn.

drawOutline

void drawOutline(DrawContext dc,
                 Object shape)
Draws the shape's outline.

Parameters:
dc - the current draw context.
shape - the shape being drawn.

getDepthOffsetFactor

Double getDepthOffsetFactor(DrawContext dc,
                            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

Double getDepthOffsetUnits(DrawContext dc,
                           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.

isDrawInterior

boolean isDrawInterior(DrawContext dc,
                       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.

isDrawOutline

boolean isDrawOutline(DrawContext dc,
                      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.

isEnableDepthOffset

boolean isEnableDepthOffset(DrawContext dc,
                            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.

NASA World Wind