14#ifndef OSGSIM_SPHERESEGMENT
15#define OSGSIM_SPHERESEGMENT 1
82 _centre(0.0f,0.0f,0.0f), _radius(1.0f),
83 _azMin(0.0f), _azMax(
osg::PI/2.0f),
84 _elevMin(0.0f), _elevMax(
osg::PI/2.0f),
104 SphereSegment(
const osg::Vec3& centre,
float radius,
float azMin,
float azMax,
float elevMin,
float elevMax,
int density);
159 void setArea(
float azMin,
float azMax,
float elevMin,
float elevMax);
167 void getArea(
float &azMin,
float &azMax,
float &elevMin,
float &elevMax)
const;
215 typedef std::vector< osg::ref_ptr<osg::Vec3Array> >
LineList;
258 float _azMin, _azMax, _elevMin, _elevMax;
281 osg::StateSet* getLitStateSet(
const osg::Vec4& color) {
return (color.
a()<1.0) ? _litTransparentState.get() : _litOpaqueState.get(); }
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
BoundingSphered BoundingSphere
Definition BoundingSphere:308
Vec4f Vec4
Definition Vec4:21
The osgSim library is a NodeKit that extends the core scene graph to support nodes and drawables that...
Definition BlinkSequence:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
Pure virtual base class for drawable geometry.
Definition Drawable:89
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
value_type & a()
Definition Vec4f:100
const osg::Vec4 & getSideColor() const
Get the color of the planes.
Definition SphereSegment:207
void getArea(float &azMin, float &azMax, float &elevMin, float &elevMax) const
Get the area of the sphere segment.
void getArea(osg::Vec3 &vec, float &azRange, float &elevRange) const
Get the area of the sphere segment.
META_Node(osgSim, SphereSegment)
void setCentre(const osg::Vec3 &c)
Set the centre point of the SphereSegment.
DrawMask
DrawMask represents a bit field, the values of which may be OR'ed together to specify which parts of ...
Definition SphereSegment:71
@ ALL
Draw every part of the sphere segment.
Definition SphereSegment:76
@ EDGELINE
Draw the line round the edge of the area on the sphere's surface.
Definition SphereSegment:74
@ SIDES
Draw the planes from the sphere's centre to the edge of the sphere's surface.
Definition SphereSegment:75
@ SPOKES
Draw the spokes from the sphere's centre to the surface's corners.
Definition SphereSegment:73
@ SURFACE
Draw the specified area on the sphere's surface.
Definition SphereSegment:72
void updatePositions()
recompute the vertex positions of the rendering meshes/lines that represent the sphere segment.
void setArea(const osg::Vec3 &vec, float azRange, float elevRange)
Set the area of the sphere segment.
void setDensity(int d)
Set the density of the sphere segment.
virtual void releaseGLObjects(osg::State *state=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
void setSurfaceColor(const osg::Vec4 &c)
Set the color of the surface.
void setDrawMask(int dm)
Specify the DrawMask.
void setArea(float azMin, float azMax, float elevMin, float elevMax)
Set the area of the sphere segment.
int getDensity() const
Get the density of the sphere segment.
void setSpokeColor(const osg::Vec4 &c)
Set the color of the spokes.
void setAllColors(const osg::Vec4 &c)
Set color of all components.
osg::Node * computeIntersectionSubgraph(const osg::Matrixd &matrix, osg::Node *subgraph)
Compute the intersection lines between subgraph and this sphere segment.
SphereSegment()
Default constructor.
Definition SphereSegment:81
void setSideColor(const osg::Vec4 &c)
Set the color of the planes.
LineList computeIntersection(const osg::Matrixd &matrix, osg::Node *subgraph)
Compute the intersection lines between subgraph and this sphere segment.
const osg::Vec4 & getSurfaceColor() const
Get the color of the surface.
Definition SphereSegment:189
float getRadius() const
Get the radius of the SphereSegment.
SphereSegment(const SphereSegment &rhs, const osg::CopyOp &co)
Copy constructor.
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
int getDrawMask() const
Get the DrawMask.
Definition SphereSegment:183
std::vector< osg::ref_ptr< osg::Vec3Array > > LineList
A list of vertex arrays representing a list of lines.
Definition SphereSegment:215
void updatePrimitives()
recompute the primitives rendering meshes/lines thtat represent the sphere segment.
const osg::Vec4 & getEdgeLineColor() const
Get the color of the edge line.
Definition SphereSegment:201
void setEdgeLineColor(const osg::Vec4 &c)
Set the color of the edge line.
osg::Node * computeIntersectionSubgraph(const osg::Matrixd &matrix, osg::Drawable *drawable)
Compute the intersection lines between specified drawable and this sphere segment.
SphereSegment(const osg::Vec3 ¢re, float radius, const osg::Vec3 &vec, float azRange, float elevRange, int density)
Construct by vector.
const osg::Vec3 & getCentre() const
Get the centre point of the SphereSegment.
LineList computeIntersection(const osg::Matrixd &matrix, osg::Drawable *drawable)
Compute the intersection lines between specified drawable and this sphere segment.
void setRadius(float r)
Set the radius of the SphereSegment.
void traverse(osg::NodeVisitor &nv)
Traverse downwards : calls children's accept method with NodeVisitor.
SphereSegment(const osg::Vec3 ¢re, float radius, float azMin, float azMax, float elevMin, float elevMax, int density)
Construct by angle ranges.
virtual osg::BoundingSphere computeBound() const
Compute the bounding sphere around Node's geometry or children.
const osg::Vec4 & getSpokeColor() const
Get the color of the spokes.
Definition SphereSegment:195
#define OSGSIM_EXPORT
Definition Export:38