## class OSGSIM_EXPORT osgSim::SphereSegment

> A SphereSegment is a Geode to represent an portion of a sphere (potentially the whole sphere).

## Inheritance:

### Public Fields

osg::Vec3 _centre
float _radius
float _azMin
float _azMax
float _elevMin
float _elevMax
int _density
DrawMask _drawMask
osg::Vec4 _surfaceColor
osg::Vec4 _spokeColor
osg::Vec4 _edgeLineColor
osg::Vec4 _planeColor

### Public Methods

SphereSegment()
  Default constructor.
SphereSegment(const osg::Vec3& centre, float radius, float azMin, float azMax, float elevMin, float elevMax, int density)
  Construct by angle ranges.
SphereSegment(const osg::Vec3& centre, float radius, const osg::Vec3& vec, float azRange, float elevRange, int density)
  Construct by vector.
SphereSegment(const SphereSegment& rhs, const osg::CopyOp& co)
  Copy constructor
void setCentre(const osg::Vec3& c)
  Set the centre point of the SphereSegment
const osg::Vec3& getCentre() const
  Get the centre point of the SphereSegment
void setRadius(float r)
  Set the radius of the SphereSegment
float getRadius() const
  Get the radius of the SphereSegment
void setArea(const osg::Vec3& v, float azRange, float elevRange)
  Set the area of the sphere segment
void getArea(osg::Vec3& v, float& azRange, float& elevRange) const
  Get the area of the sphere segment
void setDensity(int d)
  Set the density of the sphere segment
int getDensity() const
  Get the density of the sphere segment
void setDrawMask(DrawMask dm)
  Specify the DrawMask.
void setSurfaceColor(const osg::Vec4& c)
  Set the color of the surface.
void setSpokeColor(const osg::Vec4& c)
  Set the color of the spokes.
void setEdgeLineColor(const osg::Vec4& c)
  Set the color of the edge line.
void setSideColor(const osg::Vec4& c)
  Set the color of the planes.
void setAllColors(const osg::Vec4& c)
  Set color of all components.
META_Node(osgSim, SphereSegment)
void dirtyAllDrawableDisplayLists()
void dirtyAllDrawableBounds()
bool Surface_computeBound(osg::BoundingBox&) const
void Surface_drawImplementation(osg::State&) const
bool EdgeLine_computeBound(osg::BoundingBox&) const
void EdgeLine_drawImplementation(osg::State&) const
bool Side_computeBound(osg::BoundingBox&, SideOrientation, BoundaryAngle) const
void Side_drawImplementation(osg::State&, SideOrientation, BoundaryAngle) const
bool Spoke_computeBound(osg::BoundingBox&, BoundaryAngle, BoundaryAngle) const
void Spoke_drawImplementation(osg::State&, BoundaryAngle, BoundaryAngle) const

### Public Members

enum DrawMask
  DrawMask represents a bit field, the values of which may be OR'ed together to specify which parts of the sphere segment should be drawn.
enum BoundaryAngle
enum SideOrientation

## Documentation

> A SphereSegment is a Geode to represent an portion of a sphere (potentially the whole sphere). The sphere is aligned such that the line through the sphere's poles is parallel to the z axis. The sphere segment may be rendered various components switched on or off:

> - The specified area of the sphere surface.

> - An edge line around the boundary of the specified area of the sphere surface.

> - Four spokes, where a spoke is the line from the sphere's centre to a corner of the rendered area.

> - Four planar areas, where the planar areas are formed between the spokes.

> Caveats:

> - It's worth noting that the line through the sphere's poles is parallel to the z axis. This has implications when specifying the area to be rendered, and specifying areas where the centre of the rendered area is the Z axis may lead to unexpected geometry.

> - It's possible to render the whole sphere by specifying elevation and azimuth ranges round the full 360 degrees. When doing so you may consider switching the planes, spokes, and edge lines off, to avoid rendering artefacts, e.g. the upper and lower planes will be coincident.

`enum DrawMask`
  DrawMask represents a bit field, the values of which may be OR'ed together to specify which parts of the sphere segment should be drawn. E.g. \code sphereSegment->setDrawMask(SphereSegment::DrawMask(SphereSegment::SURFACE|SphereSegment::SPOKES)); \endcode

  `SURFACE`

  `SPOKES`
    < Draw the specified area on the sphere's surface

  `EDGELINE`
    < Draw the spokes from the sphere's centre to the surface's corners

  `SIDES`
    < Draw the line round the edge of the area on the sphere's surface

  `ALL`
    < Draw the planes from the sphere's centre to the edge of the sphere's surface

`SphereSegment()`
  Default constructor.

`SphereSegment(const osg::Vec3& centre, float radius, float azMin, float azMax, float elevMin, float elevMax, int density)`
  Construct by angle ranges. Note that the azimuth 'zero' is the Y axis; specifying an azimuth range from azMin -osg::PI/2.0f to azMax osg::PI/2.0f will cover the 'top half' of the circle in the XY plane. The elev angles are 'out' of the 'zero' XY plane with +ve angles above the plane, and -ve angles below.
  Parameters:
    centre - sphere centre
    radius - radius of sphere
    azMin - azimuth minimum
    azMin - azimuth maximum
    elevMin - elevation minimum
    elevMax - elevation maximum
    density - number of units to divide the azimuth and elevation ranges into

`SphereSegment(const osg::Vec3& centre, float radius, const osg::Vec3& vec, float azRange, float elevRange, int density)`
  Construct by vector.
  Parameters:
    centre - sphere centre
    radius - radius of sphere
    vec - vector pointing from sphere centre to centre point of rendered area on sphere surface
    azRange - azimuth range in radians (with centre along vec)
    elevRange - elevation range in radians (with centre along vec)
    density - number of units to divide the azimuth and elevation ranges into

`SphereSegment(const SphereSegment& rhs, const osg::CopyOp& co)`
  Copy constructor

`void setCentre(const osg::Vec3& c)`
  Set the centre point of the SphereSegment

`const osg::Vec3& getCentre() const`
  Get the centre point of the SphereSegment

`void setRadius(float r)`
  Set the radius of the SphereSegment

`float getRadius() const`
  Get the radius of the SphereSegment

`void setArea(const osg::Vec3& v, float azRange, float elevRange)`
  Set the area of the sphere segment

  Parameters:
    vec - vector pointing from sphere centre to centre point of rendered area on sphere surface
    azRange - azimuth range in radians (with centre along vec)
    elevRange - elevation range in radians (with centre along vec)

`void getArea(osg::Vec3& v, float& azRange, float& elevRange) const`
  Get the area of the sphere segment

  Parameters:
    vec - vector pointing from sphere centre to centre point of rendered area on sphere surface (normalized)
    azRange - azimuth range in radians (with centre along vec)
    elevRange - elevation range in radians (with centre along vec)

`void setDensity(int d)`
  Set the density of the sphere segment

`int getDensity() const`
  Get the density of the sphere segment

`void setDrawMask(DrawMask dm)`
  Specify the DrawMask.
  Parameters:
    dm - Bitmask specifying which parts of the sphere segment should be drawn.
  See Also:
    DrawMask

`void setSurfaceColor(const osg::Vec4& c)`
  Set the color of the surface.

`void setSpokeColor(const osg::Vec4& c)`
  Set the color of the spokes.

`void setEdgeLineColor(const osg::Vec4& c)`
  Set the color of the edge line.

`void setSideColor(const osg::Vec4& c)`
  Set the color of the planes.

`void setAllColors(const osg::Vec4& c)`
  Set color of all components.

`META_Node(osgSim, SphereSegment)`

`void dirtyAllDrawableDisplayLists()`

`void dirtyAllDrawableBounds()`

`bool Surface_computeBound(osg::BoundingBox&) const`

`void Surface_drawImplementation(osg::State&) const`

`bool EdgeLine_computeBound(osg::BoundingBox&) const`

`void EdgeLine_drawImplementation(osg::State&) const`

`enum BoundaryAngle`

`MIN`

`MAX`

`enum SideOrientation`

`AZIM`

`ELEV`

`bool Side_computeBound(osg::BoundingBox&, SideOrientation, BoundaryAngle) const`

`void Side_drawImplementation(osg::State&, SideOrientation, BoundaryAngle) const`

`bool Spoke_computeBound(osg::BoundingBox&, BoundaryAngle, BoundaryAngle) const`

`void Spoke_drawImplementation(osg::State&, BoundaryAngle, BoundaryAngle) const`

`osg::Vec3 _centre`

`float _radius`

`float _azMin`

`float _azMax`

`float _elevMin`

`float _elevMax`

`int _density`

`DrawMask _drawMask`

`osg::Vec4 _surfaceColor`

`osg::Vec4 _spokeColor`

`osg::Vec4 _edgeLineColor`

`osg::Vec4 _planeColor`

This class has no child classes.

Friends:
  class Surface
  class EdgeLine
  class Side
  class Spoke

Alphabetic index HTML hierarchy of classes or Java

This page was generated with the help of DOC++.