Overview | Package | Class | Use | Tree | Index | Help
| NASA World Wind
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## gov.nasa.worldwind.geom
Class Cylinder

    java.lang.Object
      gov.nasa.worldwind.geom.Cylinder

All Implemented Interfaces:
  Extent, Renderable

    public class Cylinder

extends Object
implements Extent, Renderable

Represents a geometric cylinder. `Cylinder`s are immutable.

Constructor Summary
`Cylinder(Point bottomCenter, Point topCenter, double cylinderRadius)` Create a `Cylinder` from two points and a radius.

Method Summary
`Point` | `getCenter()`
`double` | `getDiameter()`
`double` | `getHeight()` Obtain the height of this `Cylinder`.
`double` | `getRadius()`
`Intersection[]` | `intersect(Line line)` Obtain the intersections of this extent with `line`.
`boolean` | `intersects(Frustum frustum)` Tests whether or not this `Extent` intersects `frustum`.
`boolean` | `intersects(Line line)` Calculate whether or not `line` intersects this `Extent`.
`boolean` | `intersects(Plane plane)` Calculate whether or not this `Extent` is intersected by `plane`.
`void` | `render(DrawContext dc)` Causes this `Renderable` to render itself using the `DrawContext` provided.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Cylinder

    public Cylinder(Point bottomCenter,
                    Point topCenter,
                    double cylinderRadius)

  Create a `Cylinder` from two points and a radius. Does not accept null arguments.

  Parameters:
    `bottomCenter` - represents the centrepoint of the base disc of the `Cylinder`
    `topCenter` - represents the centrepoint of the top disc of the `Cylinder`
    `cylinderRadius` - the radius of the `Cylinder`
  Throws:
    `IllegalArgumentException` - if either the top or bottom point is null

Method Detail

### getCenter

    public Point getCenter()

  Specified by:
    `getCenter` in interface `Extent`

### getDiameter

    public double getDiameter()

  Specified by:
    `getDiameter` in interface `Extent`

### getHeight

    public final double getHeight()

  Obtain the height of this `Cylinder`.

  Returns:
    the distance between the bottom and top of this `Cylinder`

### getRadius

    public double getRadius()

  Specified by:
    `getRadius` in interface `Extent`

### intersect

    public Intersection[] intersect(Line line)

  Description copied from interface: `Extent`
  Obtain the intersections of this extent with `line`. The returned array may be either null or of zero length if no intersections are discovered. It does not contain null elements. Tangential intersections are marked as such. `line` is considered to have infinite length in both directions.

  Specified by:
    `intersect` in interface `Extent`
  Parameters:
    `line` - the `Line` with which to intersect this `Extent`
  Returns:
    an array of intersections representing all the points where `line` enters or leave this `Extent`

### intersects

    public boolean intersects(Frustum frustum)

  Description copied from interface: `Extent`
  Tests whether or not this `Extent` intersects `frustum`. Returns true if any part of these two objects intersect, including the case where either object wholly contains the other, false otherwise.

  Specified by:
    `intersects` in interface `Extent`
  Parameters:
    `frustum` - the `Frustum` with which to test for intersection
  Returns:
    true if there is an intersection, false otherwise

### intersects

    public boolean intersects(Line line)

  Description copied from interface: `Extent`
  Calculate whether or not `line` intersects this `Extent`. This method may be faster than checking the size of the arary returned by `intersect(Line)`. Implementing methods must ensure that this method returns true if and only if `intersect(Line)` returns a non-null array containing at least one element.

  Specified by:
    `intersects` in interface `Extent`
  Parameters:
    `line` - the `Line` with which to test for intersection
  Returns:
    true if an intersection is found, false otherwise

### intersects

    public boolean intersects(Plane plane)

  Description copied from interface: `Extent`
  Calculate whether or not this `Extent` is intersected by `plane`.

  Specified by:
    `intersects` in interface `Extent`
  Parameters:
    `plane` - the `Plane` with which to test for intersection
  Returns:
    true if `plane` is found to intersect this `Extent`

### render

    public void render(DrawContext dc)

  Description copied from interface: `Renderable`
  Causes this `Renderable` to render itself using the `DrawContext` provided. The `DrawContext` provides the elevation model, openGl instance, globe and other information required for drawing. It is recommended that the `DrawContext` is non-null as most implementations do not support null `DrawContext`s.

  Specified by:
    `render` in interface `Renderable`
  Parameters:
    `dc` - the `DrawContext` to be used
  See Also:
    `DrawContext`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Index | Help
| NASA World Wind
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD