From David Fries, add init() call to SphereSegment constructor, and
new get methods for draw mask and color.
This commit is contained in:
parent
d73824f0a1
commit
316c646a8f
@ -82,7 +82,9 @@ public:
|
|||||||
_elevMin(0.0f), _elevMax(osg::PI/2.0f),
|
_elevMin(0.0f), _elevMax(osg::PI/2.0f),
|
||||||
_density(10),
|
_density(10),
|
||||||
_drawMask(DrawMask(ALL))
|
_drawMask(DrawMask(ALL))
|
||||||
{}
|
{
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Construct by angle ranges. Note that the azimuth 'zero' is the Y axis; specifying
|
Construct by angle ranges. Note that the azimuth 'zero' is the Y axis; specifying
|
||||||
@ -164,6 +166,22 @@ public:
|
|||||||
*/
|
*/
|
||||||
void getArea(osg::Vec3& v, float& azRange, float& elevRange) const;
|
void getArea(osg::Vec3& v, float& azRange, float& elevRange) const;
|
||||||
|
|
||||||
|
/** Set the area of the sphere segment
|
||||||
|
@param azMin azimuth minimum
|
||||||
|
@param azMin azimuth maximum
|
||||||
|
@param elevMin elevation minimum
|
||||||
|
@param elevMax elevation maximum
|
||||||
|
*/
|
||||||
|
void setArea(float azMin, float azMax, float elevMin, float elevMax);
|
||||||
|
|
||||||
|
/** Get the area of the sphere segment
|
||||||
|
@param azMin azimuth minimum
|
||||||
|
@param azMin azimuth maximum
|
||||||
|
@param elevMin elevation minimum
|
||||||
|
@param elevMax elevation maximum
|
||||||
|
*/
|
||||||
|
void getArea(float &azMin, float &azMax, float &elevMin, float &elevMax) const;
|
||||||
|
|
||||||
/** Set the density of the sphere segment */
|
/** Set the density of the sphere segment */
|
||||||
void setDensity(int d);
|
void setDensity(int d);
|
||||||
|
|
||||||
@ -177,18 +195,33 @@ public:
|
|||||||
*/
|
*/
|
||||||
void setDrawMask(DrawMask dm);
|
void setDrawMask(DrawMask dm);
|
||||||
|
|
||||||
|
/** Get the DrawMask */
|
||||||
|
DrawMask getDrawMask() const { return _drawMask; }
|
||||||
|
|
||||||
/** Set the color of the surface. */
|
/** Set the color of the surface. */
|
||||||
void setSurfaceColor(const osg::Vec4& c);
|
void setSurfaceColor(const osg::Vec4& c);
|
||||||
|
|
||||||
|
/** Get the color of the surface. */
|
||||||
|
osg::Vec4 getSurfaceColor() const { return _surfaceColor; }
|
||||||
|
|
||||||
/** Set the color of the spokes. */
|
/** Set the color of the spokes. */
|
||||||
void setSpokeColor(const osg::Vec4& c);
|
void setSpokeColor(const osg::Vec4& c);
|
||||||
|
|
||||||
|
/** Get the color of the spokes. */
|
||||||
|
osg::Vec4 getSpokeColor() const { return _spokeColor; }
|
||||||
|
|
||||||
/** Set the color of the edge line. */
|
/** Set the color of the edge line. */
|
||||||
void setEdgeLineColor(const osg::Vec4& c);
|
void setEdgeLineColor(const osg::Vec4& c);
|
||||||
|
|
||||||
|
/** Get the color of the edge line. */
|
||||||
|
osg::Vec4 getEdgeLineColor() const { return _edgeLineColor; }
|
||||||
|
|
||||||
/** Set the color of the planes. */
|
/** Set the color of the planes. */
|
||||||
void setSideColor(const osg::Vec4& c);
|
void setSideColor(const osg::Vec4& c);
|
||||||
|
|
||||||
|
/** Get the color of the planes. */
|
||||||
|
osg::Vec4 getSideColor() const { return _planeColor; }
|
||||||
|
|
||||||
/** Set color of all components. */
|
/** Set color of all components. */
|
||||||
void setAllColors(const osg::Vec4& c);
|
void setAllColors(const osg::Vec4& c);
|
||||||
|
|
||||||
|
@ -293,6 +293,28 @@ void SphereSegment::getArea(osg::Vec3& vec, float& azRange, float& elevRange) co
|
|||||||
vec.set(cos(elev)*sin(az), cos(elev)*cos(az), sin(elev));
|
vec.set(cos(elev)*sin(az), cos(elev)*cos(az), sin(elev));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SphereSegment::setArea(float azMin, float azMax,
|
||||||
|
float elevMin, float elevMax)
|
||||||
|
{
|
||||||
|
_azMin=azMin;
|
||||||
|
_azMax=azMax;
|
||||||
|
_elevMin=elevMin;
|
||||||
|
_elevMax=elevMax;
|
||||||
|
|
||||||
|
dirtyAllDrawableDisplayLists();
|
||||||
|
dirtyAllDrawableBounds();
|
||||||
|
dirtyBound();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SphereSegment::getArea(float &azMin, float &azMax,
|
||||||
|
float &elevMin, float &elevMax) const
|
||||||
|
{
|
||||||
|
azMin=_azMin;
|
||||||
|
azMax=_azMax;
|
||||||
|
elevMin=_elevMin;
|
||||||
|
elevMax=_elevMax;
|
||||||
|
}
|
||||||
|
|
||||||
void SphereSegment::setDensity(int density)
|
void SphereSegment::setDensity(int density)
|
||||||
{
|
{
|
||||||
_density = density;
|
_density = density;
|
||||||
|
Loading…
Reference in New Issue
Block a user