class OSGSIM_EXPORT osgSim::SphereSegment

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

Inheritance:


Public Fields

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

Public Methods

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

Public Members

[more]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.
[more]enum BoundaryAngle
[more]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.

oenum 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

o SURFACE

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

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

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

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

o SphereSegment()
Default constructor.

o 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

o 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

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

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

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

ovoid setRadius(float r)
Set the radius of the SphereSegment

ofloat getRadius() const
Get the radius of the SphereSegment

ovoid 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)

ovoid 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)

ovoid setDensity(int d)
Set the density of the sphere segment

oint getDensity() const
Get the density of the sphere segment

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

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

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

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

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

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

o META_Node(osgSim, SphereSegment)

ovoid dirtyAllDrawableDisplayLists()

ovoid dirtyAllDrawableBounds()

obool Surface_computeBound(osg::BoundingBox&) const

ovoid Surface_drawImplementation(osg::State&) const

obool EdgeLine_computeBound(osg::BoundingBox&) const

ovoid EdgeLine_drawImplementation(osg::State&) const

oenum BoundaryAngle

o MIN

o MAX

oenum SideOrientation

o AZIM

o ELEV

obool Side_computeBound(osg::BoundingBox&, SideOrientation, BoundaryAngle) const

ovoid Side_drawImplementation(osg::State&, SideOrientation, BoundaryAngle) const

obool Spoke_computeBound(osg::BoundingBox&, BoundaryAngle, BoundaryAngle) const

ovoid Spoke_drawImplementation(osg::State&, BoundaryAngle, BoundaryAngle) const

oosg::Vec3 _centre

ofloat _radius

ofloat _azMin

ofloat _azMax

ofloat _elevMin

ofloat _elevMax

oint _density

oDrawMask _drawMask

oosg::Vec4 _surfaceColor

oosg::Vec4 _spokeColor

oosg::Vec4 _edgeLineColor

oosg::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++.