From Geoff Michel, typo and spelling fixes

This commit is contained in:
Robert Osfield 2004-09-02 19:10:33 +00:00
parent 13f43ec836
commit 21691f2d56
26 changed files with 167 additions and 163 deletions

View File

@ -20,7 +20,7 @@
namespace osg { namespace osg {
/** MatrixTransform - is a subclass of Transform which has an osg::Matrix /** MatrixTransform - is a subclass of Transform which has an osg::Matrix
* which represent a 4x4 transformation of its children from local cordinates * which represents a 4x4 transformation of its children from local coordinates
* into the Transform's parent coordinates. * into the Transform's parent coordinates.
*/ */
class SG_EXPORT MatrixTransform : public Transform class SG_EXPORT MatrixTransform : public Transform
@ -47,10 +47,10 @@ class SG_EXPORT MatrixTransform : public Transform
/** Get the matrix. */ /** Get the matrix. */
inline const Matrix& getMatrix() const { return _matrix; } inline const Matrix& getMatrix() const { return _matrix; }
/** pre multiply the transforms matrix.*/ /** pre multiply the transform's matrix.*/
void preMult(const Matrix& mat) { _matrix.preMult(mat); _inverseDirty=true; dirtyBound(); } void preMult(const Matrix& mat) { _matrix.preMult(mat); _inverseDirty=true; dirtyBound(); }
/** post multiply the transforms matrix.*/ /** post multiply the transform's matrix.*/
void postMult(const Matrix& mat) { _matrix.postMult(mat); _inverseDirty=true; dirtyBound(); } void postMult(const Matrix& mat) { _matrix.postMult(mat); _inverseDirty=true; dirtyBound(); }
/** Get the inverse matrix. */ /** Get the inverse matrix. */

View File

@ -65,7 +65,7 @@ class SG_EXPORT Multisample : public StateAttribute
virtual int compare(const StateAttribute& sa) const virtual int compare(const StateAttribute& sa) const
{ {
// check the types are equal and then create the rhs variable // check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below. // used by the COMPARE_StateAttribute_Parameter macro's below.
COMPARE_StateAttribute_Types(Multisample,sa) COMPARE_StateAttribute_Types(Multisample,sa)
// compare each paramter in turn against the rhs. // compare each paramter in turn against the rhs.
@ -73,7 +73,7 @@ class SG_EXPORT Multisample : public StateAttribute
COMPARE_StateAttribute_Parameter(_invert) COMPARE_StateAttribute_Parameter(_invert)
COMPARE_StateAttribute_Parameter(_mode) COMPARE_StateAttribute_Parameter(_mode)
return 0; // passed all the above comparison macro's, must be equal. return 0; // passed all the above comparison macros, must be equal.
} }
void setSampleCoverage(float coverage, bool invert) void setSampleCoverage(float coverage, bool invert)
@ -89,8 +89,8 @@ class SG_EXPORT Multisample : public StateAttribute
virtual void apply(State& state) const; virtual void apply(State& state) const;
/** Extensions class which encapsulates the querring of extensions and /** Extensions class which encapsulates the querying of extensions and
* associated function pointers, and provide convinience wrappers to * associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.*/ * check for the extensions or use the associated functions.*/
class SG_EXPORT Extensions : public osg::Referenced class SG_EXPORT Extensions : public osg::Referenced
{ {
@ -122,15 +122,15 @@ class SG_EXPORT Multisample : public StateAttribute
}; };
/** Function to call to get the extension of a specified context. /** Function to call to get the extension of a specified context.
* If the Exentsion object for that context has not yet been created then * If the Exentsion object for that context has not yet been created
* and the 'createIfNotInitalized' flag been set to false then returns NULL. * and the 'createIfNotInitalized' flag been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is * If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object * automatically created. However, in this case the extension object will
* only be created with the graphics context associated with ContextID..*/ * only be created with the graphics context associated with ContextID..*/
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized); static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
/** setExtensions allows users to override the extensions across graphics contexts. /** setExtensions allows users to override the extensions across graphics contexts.
* typically used when you have different extensions supported across graphics pipes * Typically used when you have different extensions supported across graphics pipes
* but need to ensure that they all use the same low common denominator extensions.*/ * but need to ensure that they all use the same low common denominator extensions.*/
static void setExtensions(unsigned int contextID,Extensions* extensions); static void setExtensions(unsigned int contextID,Extensions* extensions);

View File

@ -31,7 +31,7 @@ class Transform;
/** META_Node macro define the standard clone, isSameKindAs, className /** META_Node macro define the standard clone, isSameKindAs, className
* and accept methods. Use when subclassing from Node to make it * and accept methods. Use when subclassing from Node to make it
* more convinient to define the required pure virtual methods.*/ * more convenient to define the required pure virtual methods.*/
#define META_Node(library,name) \ #define META_Node(library,name) \
virtual osg::Object* cloneType() const { return new name (); } \ virtual osg::Object* cloneType() const { return new name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \ virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
@ -56,7 +56,7 @@ class SG_EXPORT Node : public Object
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/ /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Node(const Node&,const CopyOp& copyop=CopyOp::SHALLOW_COPY); Node(const Node&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
/** clone the an object of the same type as the node.*/ /** clone an object of the same type as the node.*/
virtual Object* cloneType() const { return new Node(); } virtual Object* cloneType() const { return new Node(); }
/** return a clone of a node, with Object* return type.*/ /** return a clone of a node, with Object* return type.*/
@ -78,7 +78,7 @@ class SG_EXPORT Node : public Object
* Equivalent to dynamic_cast<const Group*>(this).*/ * Equivalent to dynamic_cast<const Group*>(this).*/
virtual const Group* asGroup() const { return 0; } virtual const Group* asGroup() const { return 0; }
/** convert 'this' into a Transform pointer if Node is a Transform, otherwise return 0. /** Convert 'this' into a Transform pointer if Node is a Transform, otherwise return 0.
* Equivalent to dynamic_cast<Transform*>(this).*/ * Equivalent to dynamic_cast<Transform*>(this).*/
virtual Transform* asTransform() { return 0; } virtual Transform* asTransform() { return 0; }
/** convert 'const this' into a const Transform pointer if Node is a Transform, otherwise return 0. /** convert 'const this' into a const Transform pointer if Node is a Transform, otherwise return 0.
@ -150,11 +150,11 @@ class SG_EXPORT Node : public Object
inline const NodeCallback* getCullCallback() const { return _cullCallback.get(); } inline const NodeCallback* getCullCallback() const { return _cullCallback.get(); }
/** Set the view frustum/small feature culling of this node to be active or inactive. /** Set the view frustum/small feature culling of this node to be active or inactive.
* The default value to true for _cullingActive. Used a guide * The default value is true for _cullingActive. Used as a guide
* to the cull traversal.*/ * to the cull traversal.*/
void setCullingActive(bool active); void setCullingActive(bool active);
/** Get the view frustum/small feature _cullingActive flag for this node. Used a guide /** Get the view frustum/small feature _cullingActive flag for this node. Used as a guide
* to the cull traversal.*/ * to the cull traversal.*/
inline bool getCullingActive() const { return _cullingActive; } inline bool getCullingActive() const { return _cullingActive; }
@ -162,7 +162,7 @@ class SG_EXPORT Node : public Object
inline unsigned int getNumChildrenWithCullingDisabled() const { return _numChildrenWithCullingDisabled; } inline unsigned int getNumChildrenWithCullingDisabled() const { return _numChildrenWithCullingDisabled; }
/** Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal. /** Return true if this node can be culled by view frustum, occlusion or small feature culling during the cull traversal.
* note, return true only if no children have culling disabled, and the local _cullingActive flag is true.*/ * Note, returns true only if no children have culling disabled, and the local _cullingActive flag is true.*/
inline bool isCullingActive() const { return _numChildrenWithCullingDisabled==0 && _cullingActive && getBound().valid(); } inline bool isCullingActive() const { return _numChildrenWithCullingDisabled==0 && _cullingActive && getBound().valid(); }
/** Get the number of Children of this node which are or have OccluderNode's.*/ /** Get the number of Children of this node which are or have OccluderNode's.*/
@ -198,7 +198,7 @@ class SG_EXPORT Node : public Object
void addDescription(const std::string& desc) { _descriptions.push_back(desc); } void addDescription(const std::string& desc) { _descriptions.push_back(desc); }
/** set the node's StateSet.*/ /** Set the node's StateSet.*/
inline void setStateSet(osg::StateSet* dstate) { _stateset = dstate; } inline void setStateSet(osg::StateSet* dstate) { _stateset = dstate; }
/** return the node's StateSet, if one does not already exist create it /** return the node's StateSet, if one does not already exist create it
@ -206,10 +206,10 @@ class SG_EXPORT Node : public Object
* that a valid StateSet is always returned and can be used directly.*/ * that a valid StateSet is always returned and can be used directly.*/
osg::StateSet* getOrCreateStateSet(); osg::StateSet* getOrCreateStateSet();
/** return the node's StateSet. returns NULL if a stateset is not attached.*/ /** Return the node's StateSet. returns NULL if a stateset is not attached.*/
inline osg::StateSet* getStateSet() { return _stateset.get(); } inline osg::StateSet* getStateSet() { return _stateset.get(); }
/** return the node's const StateSet. returns NULL if a stateset is not attached.*/ /** return the node's const StateSet. Returns NULL if a stateset is not attached.*/
inline const osg::StateSet* getStateSet() const { return _stateset.get(); } inline const osg::StateSet* getStateSet() const { return _stateset.get(); }
/** get the bounding sphere of node. /** get the bounding sphere of node.
@ -232,7 +232,7 @@ class SG_EXPORT Node : public Object
be deleted other than by being dereferenced and the reference be deleted other than by being dereferenced and the reference
count being zero (see osg::Referenced), preventing the deletion count being zero (see osg::Referenced), preventing the deletion
of nodes which are still in use. This also means that of nodes which are still in use. This also means that
Node's cannot be created on stack i.e Node node will not compile, Nodes cannot be created on stack i.e Node node will not compile,
forcing all nodes to be created on the heap i.e Node* node forcing all nodes to be created on the heap i.e Node* node
= new Node().*/ = new Node().*/
virtual ~Node(); virtual ~Node();

View File

@ -36,11 +36,11 @@ class SG_EXPORT NodeCallback : public virtual Object {
META_Object(osg,NodeCallback) META_Object(osg,NodeCallback)
/** Callback method call by the NodeVisitor when visiting a node.*/ /** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(Node* node, NodeVisitor* nv) virtual void operator()(Node* node, NodeVisitor* nv)
{ {
// note, callback is repsonsible for scenegraph traversal so // note, callback is responsible for scenegraph traversal so
// should always include call the traverse(node,nv) to ensure // should always include call traverse(node,nv) to ensure
// that the rest of cullbacks and the scene graph are traversed. // that the rest of cullbacks and the scene graph are traversed.
traverse(node,nv); traverse(node,nv);
} }

View File

@ -39,14 +39,14 @@ class OccluderNode;
class Sequence; class Sequence;
class CoordinateSystemNode; class CoordinateSystemNode;
/** Visitor for type safe operations on osg::Node's. /** Visitor for type safe operations on osg::Nodes.
Based on GOF's Visitor pattern. The NodeVisitor Based on GOF's Visitor pattern. The NodeVisitor
is useful for developing type safe operations to nodes is useful for developing type safe operations to nodes
in the scene graph (as per Visitor pattern), and adds to this in the scene graph (as per Visitor pattern), and adds to this
support for optional scene graph traversal to allow support for optional scene graph traversal to allow
operations to be applied to whole scenes at once. The Visitor operations to be applied to whole scenes at once. The Visitor
pattern uses a technique of double dispatch as a mechanism to pattern uses a technique of double dispatch as a mechanism to
called the appropriate apply(..) method of the NodeVisitor. To call the appropriate apply(..) method of the NodeVisitor. To
use this feature one must use the Node::accept(NodeVisitor) which use this feature one must use the Node::accept(NodeVisitor) which
is extended in each Node subclass, rather than the NodeVisitor is extended in each Node subclass, rather than the NodeVisitor
apply directly. So use root->accept(myVisitor); instead of apply directly. So use root->accept(myVisitor); instead of
@ -79,14 +79,14 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
virtual ~NodeVisitor(); virtual ~NodeVisitor();
/** Method to call to reset visitor. Useful for your visitor accumulates /** Method to call to reset visitor. Useful if your visitor accumulates
state during a traversal, and you plan to reuse the visitor. state during a traversal, and you plan to reuse the visitor.
To flush that state for the next traversal than call reset() prior To flush that state for the next traversal: call reset() prior
to each traversal.*/ to each traversal.*/
virtual void reset() {} virtual void reset() {}
/** Set the VisitorType, used to distingush different visitors during /** Set the VisitorType, used to distinguish different visitors during
* traversal of the scene, typically used in the Node::traverse() method * traversal of the scene, typically used in the Node::traverse() method
* to select which behaviour to use for different types of traversal/visitors.*/ * to select which behaviour to use for different types of traversal/visitors.*/
inline void setVisitorType(VisitorType type) { _visitorType = type; } inline void setVisitorType(VisitorType type) { _visitorType = type; }
@ -100,20 +100,20 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
/** Get the traversal number. Typically used to denote the frame count.*/ /** Get the traversal number. Typically used to denote the frame count.*/
inline int getTraversalNumber() const { return _traversalNumber; } inline int getTraversalNumber() const { return _traversalNumber; }
/** Set the FrameStamp that this traversal is assoicated with.*/ /** Set the FrameStamp that this traversal is associated with.*/
inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; } inline void setFrameStamp(FrameStamp* fs) { _frameStamp = fs; }
/** Get the FrameStamp that this traversal is assoicated with.*/ /** Get the FrameStamp that this traversal is associated with.*/
inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); } inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); }
/** Set the TraversalMask of this NodeVisitor. /** Set the TraversalMask of this NodeVisitor.
* The TraversalMask is used by the NodeVisitor::validNodeMask() method * The TraversalMask is used by the NodeVisitor::validNodeMask() method
* to determine whether to operate on a node and its subgraph. * to determine whether to operate on a node and its subgraph.
* validNodeMask() is called automaticaly in the Node::accept() method before * validNodeMask() is called automatically in the Node::accept() method before
* any call to NodeVisitor::apply(), apply() is only ever called if validNodeMask * any call to NodeVisitor::apply(), apply() is only ever called if validNodeMask
* returns true. Note, if NodeVisitor::_traversalMask is 0 then all operations * returns true. Note, if NodeVisitor::_traversalMask is 0 then all operations
* will be swithced off for all nodes. Whereas setting both _traversalMask and * will be switched off for all nodes. Whereas setting both _traversalMask and
* _nodeMaskOverride to 0xffffffff will allow a visitor to work on all nodes * _nodeMaskOverride to 0xffffffff will allow a visitor to work on all nodes
* regardless of their own Node::_nodeMask state.*/ * regardless of their own Node::_nodeMask state.*/
inline void setTraversalMask(Node::NodeMask mask) { _traversalMask = mask; } inline void setTraversalMask(Node::NodeMask mask) { _traversalMask = mask; }
@ -132,7 +132,7 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
inline Node::NodeMask getNodeMaskOverride() const { return _nodeMaskOverride; } inline Node::NodeMask getNodeMaskOverride() const { return _nodeMaskOverride; }
/** Method to called by Node and its subclass' Node::accept() method, if the result is true /** Method to called by Node and its subclass' Node::accept() method, if the result is true
* to be used to cull operations of nodes and their subgraphs. * it is used to cull operations of nodes and their subgraphs.
* Return true if the result of a bit wise and of the NodeVisitor::_traversalMask * Return true if the result of a bit wise and of the NodeVisitor::_traversalMask
* with the bit or between NodeVistor::_nodeMaskOverride and the Node::_nodeMask. * with the bit or between NodeVistor::_nodeMaskOverride and the Node::_nodeMask.
* default values for _traversalMask is 0xffffffff, _nodeMaskOverride is 0x0, * default values for _traversalMask is 0xffffffff, _nodeMaskOverride is 0x0,
@ -154,8 +154,8 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
/** /**
* Set user data, data must be subclased from Referenced to allow * Set user data, data must be subclased from Referenced to allow
* automatic memory handling. If you own data isn't directly * automatic memory handling. If your own data isn't directly
* subclassed from Referenced then create and adapter object * subclassed from Referenced then create an adapter object
* which points to your own objects and handles the memory addressing. * which points to your own objects and handles the memory addressing.
*/ */
inline void setUserData(Referenced* obj) { _userData = obj; } inline void setUserData(Referenced* obj) { _userData = obj; }
@ -178,7 +178,7 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
} }
/** Method called by osg::Node::accept() method before /** Method called by osg::Node::accept() method before
* a call the NodeVisitor::apply(..). The back of the list will, * a call to the NodeVisitor::apply(..). The back of the list will,
* therefore, be the current node being visited inside the apply(..), * therefore, be the current node being visited inside the apply(..),
* and the rest of the list will be the parental sequence of nodes * and the rest of the list will be the parental sequence of nodes
* from the top most node applied down the graph to the current node. * from the top most node applied down the graph to the current node.
@ -186,8 +186,8 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
* will be called automatically by the Node::accept() method.*/ * will be called automatically by the Node::accept() method.*/
inline void pushOntoNodePath(Node* node) { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.push_back(node); else _nodePath.insert(_nodePath.begin(),node); } inline void pushOntoNodePath(Node* node) { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.push_back(node); else _nodePath.insert(_nodePath.begin(),node); }
/** Method callby osg::Node::accept() method after /** Method called by osg::Node::accept() method after
* a call the NodeVisitor::apply(..). * a call to NodeVisitor::apply(..).
* Note, the user does not typically call pushNodeOnPath() as it * Note, the user does not typically call pushNodeOnPath() as it
* will be called automatically by the Node::accept() method.*/ * will be called automatically by the Node::accept() method.*/
inline void popFromNodePath() { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.pop_back(); else _nodePath.erase(_nodePath.begin()); } inline void popFromNodePath() { if (_traversalMode!=TRAVERSE_PARENTS) _nodePath.pop_back(); else _nodePath.erase(_nodePath.begin()); }
@ -206,12 +206,12 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
/** Get the distance from a point to the eye point, distance value in local coordinate system. /** Get the distance from a point to the eye point, distance value in local coordinate system.
* Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement. * Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.
* If the getDistianceFromEyePoint(pos) is not implmented than a default value of 0.0 is returned.*/ * If the getDistanceFromEyePoint(pos) is not implemented then a default value of 0.0 is returned.*/
virtual float getDistanceToEyePoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; } virtual float getDistanceToEyePoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; }
/** Get the distance of a point from the eye point, distance value in the eye coordinate system. /** Get the distance of a point from the eye point, distance value in the eye coordinate system.
* Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement. * Note, not all NodeVisitor implement this method, it is mainly cull visitors which will implement.
* If the getDistianceFromEyePoint(pos) is not implmented than a default value of 0.0 is returned.*/ * If the getDistanceFromEyePoint(pos) is not implemented than a default value of 0.0 is returned.*/
virtual float getDistanceFromEyePoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; } virtual float getDistanceFromEyePoint(const Vec3& /*pos*/, bool /*useLODScale*/) const { return 0.0f; }
virtual void apply(Node& node) { traverse(node);} virtual void apply(Node& node) { traverse(node);}
@ -242,7 +242,7 @@ class SG_EXPORT NodeVisitor : public virtual Referenced
virtual void apply(OccluderNode& node) { apply((Group&)node); } virtual void apply(OccluderNode& node) { apply((Group&)node); }
/** callback for managing database paging, such as generated by PagedLOD nodes.*/ /** Callback for managing database paging, such as generated by PagedLOD nodes.*/
class DatabaseRequestHandler : public osg::Referenced class DatabaseRequestHandler : public osg::Referenced
{ {
public: public:

View File

@ -36,7 +36,7 @@ enum NotifySeverity {
DEBUG_FP=6 DEBUG_FP=6
}; };
/** set the notify level, overriding the default or value set by /** set the notify level, overriding the default or the value set by
* the environmental variable OSGNOTIFYLEVEL. * the environmental variable OSGNOTIFYLEVEL.
*/ */
extern SG_EXPORT void setNotifyLevel(NotifySeverity severity); extern SG_EXPORT void setNotifyLevel(NotifySeverity severity);
@ -53,7 +53,7 @@ extern SG_EXPORT bool initNotifyLevel();
* application or via the an environmental variable. For instance * application or via the an environmental variable. For instance
* setenv OSGNOTIFYLEVEL DEBUG (for tsh), export OSGNOTIFYLEVEL=DEBUG * setenv OSGNOTIFYLEVEL DEBUG (for tsh), export OSGNOTIFYLEVEL=DEBUG
* (for bourne shell) or set OSGNOTIFYLEVEL=DEBUG (for Windows) all * (for bourne shell) or set OSGNOTIFYLEVEL=DEBUG (for Windows) all
* set tell the osg to redirect all debugging and more important messages * tell the osg to redirect all debugging and more important messages
* to the console (useful for debugging :-) setting ALWAYS will force * to the console (useful for debugging :-) setting ALWAYS will force
* all messages to be absorbed, which might be appropriate for final * all messages to be absorbed, which might be appropriate for final
* applications. Default NotifyLevel is NOTICE. Check the enum * applications. Default NotifyLevel is NOTICE. Check the enum

View File

@ -21,7 +21,7 @@
namespace osg { namespace osg {
/** META_Object macro define the standard clone, isSameKindAs and className methods. /** META_Object macro define the standard clone, isSameKindAs and className methods.
* Use when subclassing from Object to make it more convinient to define * Use when subclassing from Object to make it more convenient to define
* the standard pure virtual clone, isSameKindAs and className methods * the standard pure virtual clone, isSameKindAs and className methods
* which are required for all Object subclasses.*/ * which are required for all Object subclasses.*/
#define META_Object(library,name) \ #define META_Object(library,name) \
@ -55,15 +55,15 @@ class SG_EXPORT Object : public Referenced
Must be defined by derived classes.*/ Must be defined by derived classes.*/
virtual Object* cloneType() const = 0; virtual Object* cloneType() const = 0;
/** Clone the an object, with Object* return type. /** Clone an object, with Object* return type.
Must be defined by derived classes.*/ Must be defined by derived classes.*/
virtual Object* clone(const CopyOp&) const = 0; virtual Object* clone(const CopyOp&) const = 0;
virtual bool isSameKindAs(const Object*) const { return true; } virtual bool isSameKindAs(const Object*) const { return true; }
/** return the name of the object's library. Must be defined /** return the name of the object's library. Must be defined
by derived classes. The OpenSceneGraph convention the is by derived classes. The OpenSceneGraph convention is that the
that the namspace of a library is the same as the library name.*/ namespace of a library is the same as the library name.*/
virtual const char* libraryName() const = 0; virtual const char* libraryName() const = 0;
/** return the name of the object's class type. Must be defined /** return the name of the object's class type. Must be defined
@ -80,7 +80,7 @@ class SG_EXPORT Object : public Referenced
/** Set the data variance of this object. /** Set the data variance of this object.
* Can be set to either STATIC for values that do not change over the lifetime of the object, * Can be set to either STATIC for values that do not change over the lifetime of the object,
* or DYNAMIC for values that vary over the lifetime of the object. The DataVariance value * or DYNAMIC for values that vary over the lifetime of the object. The DataVariance value
* can be used be routines such as optimzation codes that wish to share static data.*/ * can be used by routines such as optimzation codes that wish to share static data.*/
inline void setDataVariance(DataVariance dv) { _dataVariance = dv; } inline void setDataVariance(DataVariance dv) { _dataVariance = dv; }
/** Get the data variance of this object.*/ /** Get the data variance of this object.*/
@ -88,10 +88,10 @@ class SG_EXPORT Object : public Referenced
/** /**
* Set user data, data must be subclased from Referenced to allow * Set user data, data must be subclassed from Referenced to allow
* automatic memory handling. If you own data isn't directly * automatic memory handling. If your own data isn't directly
* subclassed from Referenced then create and adapter object * subclassed from Referenced then create an adapter object
* which points to your own objects and handles the memory addressing. * which points to your own object and handles the memory addressing.
*/ */
inline void setUserData(Referenced* obj) { _userData = obj; } inline void setUserData(Referenced* obj) { _userData = obj; }
@ -108,7 +108,7 @@ class SG_EXPORT Object : public Referenced
be deleted other than by being dereferenced and the reference be deleted other than by being dereferenced and the reference
count being zero (see osg::Referenced), preventing the deletion count being zero (see osg::Referenced), preventing the deletion
of nodes which are still in use. This also means that of nodes which are still in use. This also means that
Node's cannot be created on stack i.e Node node will not compile, Nodes cannot be created on stack i.e Node node will not compile,
forcing all nodes to be created on the heap i.e Node* node forcing all nodes to be created on the heap i.e Node* node
= new Node().*/ = new Node().*/
virtual ~Object() {} virtual ~Object() {}

View File

@ -50,7 +50,7 @@ class SG_EXPORT OccluderNode : public Group
virtual ~OccluderNode() {} virtual ~OccluderNode() {}
/** Override's Group's computeBound.*/ /** Overrides Group's computeBound.*/
virtual bool computeBound() const; virtual bool computeBound() const;
ref_ptr<ConvexPlanarOccluder> _occluder; ref_ptr<ConvexPlanarOccluder> _occluder;

View File

@ -77,15 +77,15 @@ class SG_EXPORT PagedLOD : public LOD
unsigned int getNumTimeStamps() const { return _perRangeDataList.size(); } unsigned int getNumTimeStamps() const { return _perRangeDataList.size(); }
/** Set the number of children that the PagedLOD must keep around, even if thay are older than their expiry time.*/ /** Set the number of children that the PagedLOD must keep around, even if they are older than their expiry time.*/
inline void setNumChildrenThatCannotBeExpired(unsigned int num) { _numChildrenThatCannotBeExpired = num; } inline void setNumChildrenThatCannotBeExpired(unsigned int num) { _numChildrenThatCannotBeExpired = num; }
/** Get the number of children that the PagedLOD must keep around, even if thay are older than their expiry time.*/ /** Get the number of children that the PagedLOD must keep around, even if they are older than their expiry time.*/
unsigned int getNumChildrenThatCannotBeExpired() const { return _numChildrenThatCannotBeExpired; } unsigned int getNumChildrenThatCannotBeExpired() const { return _numChildrenThatCannotBeExpired; }
/** Remove the children from the PagedLOD which haven't be visited since specified expiry time. /** Remove the children from the PagedLOD which haven't been visited since specified expiry time.
The removed children are added the removeChildren list passed into the method, The removed children are added to the removeChildren list passed into the method,
this allows the children to be deleted later at the callers discression.*/ this allows the children to be deleted later at the caller's discretion.*/
virtual void removeExpiredChildren(double expiryTime,NodeList& removedChildren); virtual void removeExpiredChildren(double expiryTime,NodeList& removedChildren);
protected : protected :

View File

@ -183,9 +183,9 @@ class SG_EXPORT Plane
} }
/** Transform the plane by matrix. Note, this operations carries out /** Transform the plane by matrix. Note, this operation carries out
* the calculation of the inverse of the matrix since to transforms * the calculation of the inverse of the matrix since a plane
* planes must be multiplied my the inverse transposed. This * must be multiplied by the inverse transposed to transform it. This
* make this operation expensive. If the inverse has been already * make this operation expensive. If the inverse has been already
* calculated elsewhere then use transformProvidingInverse() instead. * calculated elsewhere then use transformProvidingInverse() instead.
* See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf*/ * See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf*/
@ -196,7 +196,7 @@ class SG_EXPORT Plane
transformProvidingInverse(inverse); transformProvidingInverse(inverse);
} }
/** Transform the plane by provide a pre inverted matrix. /** Transform the plane by providing a pre inverted matrix.
* see transform for details. */ * see transform for details. */
inline void transformProvidingInverse(const osg::Matrix& matrix) inline void transformProvidingInverse(const osg::Matrix& matrix)
{ {

View File

@ -41,10 +41,10 @@ class SG_EXPORT Point : public StateAttribute
virtual int compare(const StateAttribute& sa) const virtual int compare(const StateAttribute& sa) const
{ {
// check the types are equal and then create the rhs variable // check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below. // used by the COMPARE_StateAttribute_Parameter macros below.
COMPARE_StateAttribute_Types(Point,sa) COMPARE_StateAttribute_Types(Point,sa)
// compare each paramter in turn against the rhs. // compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_size) COMPARE_StateAttribute_Parameter(_size)
COMPARE_StateAttribute_Parameter(_fadeThresholdSize) COMPARE_StateAttribute_Parameter(_fadeThresholdSize)
COMPARE_StateAttribute_Parameter(_distanceAttenuation) COMPARE_StateAttribute_Parameter(_distanceAttenuation)

View File

@ -19,7 +19,7 @@
namespace osg { namespace osg {
/** Class to for setting OpenGL's polygon culling mode. /** State Class for setting OpenGL's polygon culling mode.
*/ */
class SG_EXPORT PolygonMode : public StateAttribute class SG_EXPORT PolygonMode : public StateAttribute
{ {
@ -40,7 +40,7 @@ class SG_EXPORT PolygonMode : public StateAttribute
virtual int compare(const StateAttribute& sa) const virtual int compare(const StateAttribute& sa) const
{ {
// check the types are equal and then create the rhs variable // check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below. // used by the COMPARE_StateAttribute_Parameter macros below.
COMPARE_StateAttribute_Types(PolygonMode,sa) COMPARE_StateAttribute_Types(PolygonMode,sa)
// compare each paramter in turn against the rhs. // compare each paramter in turn against the rhs.
@ -48,7 +48,7 @@ class SG_EXPORT PolygonMode : public StateAttribute
COMPARE_StateAttribute_Parameter(_modeFront) COMPARE_StateAttribute_Parameter(_modeFront)
COMPARE_StateAttribute_Parameter(_modeBack) COMPARE_StateAttribute_Parameter(_modeBack)
return 0; // passed all the above comparison macro's, must be equal. return 0; // passed all the above comparison macros, must be equal.
} }
enum Face { enum Face {

View File

@ -39,14 +39,14 @@ class SG_EXPORT PolygonOffset : public StateAttribute
virtual int compare(const StateAttribute& sa) const virtual int compare(const StateAttribute& sa) const
{ {
// check the types are equal and then create the rhs variable // check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below. // used by the COMPARE_StateAttribute_Parameter macros below.
COMPARE_StateAttribute_Types(PolygonOffset,sa) COMPARE_StateAttribute_Types(PolygonOffset,sa)
// compare each paramter in turn against the rhs. // compare each paramter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_factor) COMPARE_StateAttribute_Parameter(_factor)
COMPARE_StateAttribute_Parameter(_units) COMPARE_StateAttribute_Parameter(_units)
return 0; // passed all the above comparison macro's, must be equal. return 0; // passed all the above comparison macros, must be equal.
} }
virtual bool getModeUsage(ModeUsage& usage) const virtual bool getModeUsage(ModeUsage& usage) const

View File

@ -20,7 +20,7 @@
namespace osg { namespace osg {
/** A Polytope class for representing convex clipping volumes made up. /** A Polytope class for representing convex clipping volumes made up of a set of planes.
* When adding planes, their normals should point inwards (into the volume) */ * When adding planes, their normals should point inwards (into the volume) */
class SG_EXPORT Polytope class SG_EXPORT Polytope
{ {
@ -56,7 +56,7 @@ class SG_EXPORT Polytope
return *this; return *this;
} }
/** Create a Polytope with is cube, centered at 0,0,0, with sides of 2 units.*/ /** Create a Polytope which is a cube, centered at 0,0,0, with sides of 2 units.*/
void setToUnitFrustum(bool withNear=true, bool withFar=true) void setToUnitFrustum(bool withNear=true, bool withFar=true)
{ {
_planeList.erase(_planeList.begin(),_planeList.end()); _planeList.erase(_planeList.begin(),_planeList.end());
@ -86,7 +86,7 @@ class SG_EXPORT Polytope
unsigned int numActivePlanes = 0; unsigned int numActivePlanes = 0;
// count number active planes. // count number of active planes.
PlaneList::const_iterator itr; PlaneList::const_iterator itr;
for(itr=pt._planeList.begin(); for(itr=pt._planeList.begin();
itr!=pt._planeList.end(); itr!=pt._planeList.end();
@ -178,7 +178,7 @@ class SG_EXPORT Polytope
_maskStack.pop_back(); _maskStack.pop_back();
} }
/** Check whether a vertex is contained with clipping set.*/ /** Check whether a vertex is contained within clipping set.*/
inline bool contains(const osg::Vec3& v) const inline bool contains(const osg::Vec3& v) const
{ {
if (!_maskStack.back()) return true; if (!_maskStack.back()) return true;
@ -194,7 +194,7 @@ class SG_EXPORT Polytope
return true; return true;
} }
/** Check whether any part of vertex list is contained with clipping set.*/ /** Check whether any part of vertex list is contained within clipping set.*/
inline bool contains(const std::vector<Vec3>& vertices) inline bool contains(const std::vector<Vec3>& vertices)
{ {
if (!_maskStack.back()) return true; if (!_maskStack.back()) return true;
@ -342,9 +342,9 @@ class SG_EXPORT Polytope
/** Transform the clipping set by matrix. Note, this operations carries out /** Transform the clipping set by matrix. Note, this operations carries out
* the calculation of the inverse of the matrix since to transforms * the calculation of the inverse of the matrix since a plane must
* planes must be multiplied my the inverse transposed. This * be multiplied by the inverse transposed to transform it. This
* make this operation expensive. If the inverse has been already * makes this operation expensive. If the inverse has been already
* calculated elsewhere then use transformProvidingInverse() instead. * calculated elsewhere then use transformProvidingInverse() instead.
* See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf*/ * See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf*/
inline void transform(const osg::Matrix& matrix) inline void transform(const osg::Matrix& matrix)

View File

@ -22,8 +22,8 @@
namespace osg { namespace osg {
/** PositionAttitideTransform - is Transform the set the coordinates transform /** PositionAttitudeTransform - is a Transform. Sets the coordinate transform
up via a Vec3 position and Quat attitude. via a Vec3 position and Quat attitude.
*/ */
class SG_EXPORT PositionAttitudeTransform : public Transform class SG_EXPORT PositionAttitudeTransform : public Transform
{ {

View File

@ -19,7 +19,7 @@
namespace osg { namespace osg {
/** Projection nodes set up the frustum/orthographic projection used when rendering the scene . /** Projection nodes set up the frustum/orthographic projection used when rendering the scene.
*/ */
class SG_EXPORT Projection : public Group class SG_EXPORT Projection : public Group
{ {

View File

@ -331,13 +331,13 @@ class SG_EXPORT Quat
value_type angle3, const Vec3d& axis3); value_type angle3, const Vec3d& axis3);
/** Make a rotation Quat which will rotate vec1 to vec2. /** Make a rotation Quat which will rotate vec1 to vec2.
Generally take adot product to get the angle between these Generally take a dot product to get the angle between these
and then use a cross product to get the rotation axis and then use a cross product to get the rotation axis
Watch out for the two special cases of when the vectors Watch out for the two special cases when the vectors
are co-incident or opposite in direction.*/ are co-incident or opposite in direction.*/
void makeRotate( const Vec3f& vec1, const Vec3f& vec2 ); void makeRotate( const Vec3f& vec1, const Vec3f& vec2 );
/** Make a rotation Quat which will rotate vec1 to vec2. /** Make a rotation Quat which will rotate vec1 to vec2.
Generally take adot product to get the angle between these Generally take a dot product to get the angle between these
and then use a cross product to get the rotation axis and then use a cross product to get the rotation axis
Watch out for the two special cases of when the vectors Watch out for the two special cases of when the vectors
are co-incident or opposite in direction.*/ are co-incident or opposite in direction.*/

View File

@ -39,13 +39,13 @@ class SG_EXPORT ShadeModel : public StateAttribute
virtual int compare(const StateAttribute& sa) const virtual int compare(const StateAttribute& sa) const
{ {
// check the types are equal and then create the rhs variable // check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below. // used by the COMPARE_StateAttribute_Parameter macros below.
COMPARE_StateAttribute_Types(ShadeModel,sa) COMPARE_StateAttribute_Types(ShadeModel,sa)
// compare each paramter in turn against the rhs. // compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_mode) COMPARE_StateAttribute_Parameter(_mode)
return 0; // passed all the above comparison macro's, must be equal. return 0; // passed all the above comparison macros, must be equal.
} }
enum Mode { enum Mode {

View File

@ -54,7 +54,7 @@ class SG_EXPORT ShadowVolumeOccluder
inline void popCurrentMask(); inline void popCurrentMask();
/** return true if the matrix passed in matches the projection matrix that this ShaowVolumeOccluder is /** return true if the matrix passed in matches the projection matrix that this ShadowVolumeOccluder is
* associated with.*/ * associated with.*/
bool matchProjectionMatrix(const osg::Matrix& matrix) const bool matchProjectionMatrix(const osg::Matrix& matrix) const
{ {
@ -63,8 +63,8 @@ class SG_EXPORT ShadowVolumeOccluder
} }
/** Set the NodePath which describes the which node in the scene graph /** Set the NodePath which describes which node in the scene graph
* that this occluder was attached to.*/ * that this occluder is attached to. */
inline void setNodePath(NodePath& nodePath) { _nodePath = nodePath; } inline void setNodePath(NodePath& nodePath) { _nodePath = nodePath; }
inline NodePath& getNodePath() { return _nodePath; } inline NodePath& getNodePath() { return _nodePath; }
inline const NodePath& getNodePath() const { return _nodePath; } inline const NodePath& getNodePath() const { return _nodePath; }
@ -87,11 +87,11 @@ class SG_EXPORT ShadowVolumeOccluder
const HoleList& getHoleList() const { return _holeList; } const HoleList& getHoleList() const { return _holeList; }
/** return true if the specified vertex list is contaned entirely /** return true if the specified vertex list is contained entirely
* within this shadow occluder volume.*/ * within this shadow occluder volume.*/
bool contains(const std::vector<Vec3>& vertices); bool contains(const std::vector<Vec3>& vertices);
/** return true if the specified bounding sphere is contaned entirely /** return true if the specified bounding sphere is contained entirely
* within this shadow occluder volume.*/ * within this shadow occluder volume.*/
bool contains(const BoundingSphere& bound); bool contains(const BoundingSphere& bound);

View File

@ -29,7 +29,7 @@ class ConstShapeVisitor;
/** META_StateAttribute macro define the standard clone, isSameKindAs, /** META_StateAttribute macro define the standard clone, isSameKindAs,
* className and getType methods. * className and getType methods.
* Use when subclassing from Object to make it more convinient to define * Use when subclassing from Object to make it more convenient to define
* the standard pure virtual methods which are required for all Object * the standard pure virtual methods which are required for all Object
* subclasses.*/ * subclasses.*/
#define META_Shape(library,name) \ #define META_Shape(library,name) \
@ -85,7 +85,7 @@ class SG_EXPORT Shape : public Object
virtual ~Shape(); virtual ~Shape();
}; };
// forward declartions of Shape types. // forward declarations of Shape types.
class Sphere; class Sphere;
class Box; class Box;
class Cone; class Cone;
@ -521,8 +521,8 @@ class SG_EXPORT HeightField : public Shape
/** Set the height of the skirt to render around the edge of HeightField. /** Set the height of the skirt to render around the edge of HeightField.
* The skirt is used as a means of disguising edge boundaries between adjacent HeightField, particular * The skirt is used as a means of disguising edge boundaries between adjacent HeightField,
* of ones with different resolutions.*/ * particularly of ones with different resolutions.*/
void setSkirtHeight(float skirtHeight) { _skirtHeight = skirtHeight; } void setSkirtHeight(float skirtHeight) { _skirtHeight = skirtHeight; }
/** Get the height of the skirt to render around the edge of HeightField.*/ /** Get the height of the skirt to render around the edge of HeightField.*/
@ -541,17 +541,19 @@ class SG_EXPORT HeightField : public Shape
inline Matrix getRotationMatrix() const { return Matrix(_rotation); } inline Matrix getRotationMatrix() const { return Matrix(_rotation); }
inline bool zeroRotation() const { return _rotation.zeroRotation(); } inline bool zeroRotation() const { return _rotation.zeroRotation(); }
/* set a single height point in the height field */
inline void setHeight(unsigned int c,unsigned int r,float value) inline void setHeight(unsigned int c,unsigned int r,float value)
{ {
_heights[c+r*_columns] = value; _heights[c+r*_columns] = value;
} }
/* Get address of single height point in the height field, allows user to change. */
inline float& getHeight(unsigned int c,unsigned int r) inline float& getHeight(unsigned int c,unsigned int r)
{ {
return _heights[c+r*_columns]; return _heights[c+r*_columns];
} }
/* Get value of single height point in the height field, not editable. */
inline float getHeight(unsigned int c,unsigned int r) const inline float getHeight(unsigned int c,unsigned int r) const
{ {
return _heights[c+r*_columns]; return _heights[c+r*_columns];
@ -631,7 +633,7 @@ class CompositeShape : public Shape
void removeChild(unsigned int i) { _children.erase(_children.begin()+i); } void removeChild(unsigned int i) { _children.erase(_children.begin()+i); }
/** find the index number of child, if child is not found then it returns getNumChildren(), /** find the index number of child, if child is not found then it returns getNumChildren(),
* so should be used in similar sytle of STL's result!=end().*/ * so should be used in similar style to STL's result!=end().*/
unsigned int findChildNo(Shape* shape) const unsigned int findChildNo(Shape* shape) const
{ {
for (unsigned int childNo=0;childNo<_children.size();++childNo) for (unsigned int childNo=0;childNo<_children.size();++childNo)

View File

@ -155,13 +155,13 @@ class SG_EXPORT ShapeDrawable : public Drawable
/** return true, osg::ShapeDrawable does support accept(ConstAttributeFunctor&).*/ /** return true, osg::ShapeDrawable does support accept(ConstAttributeFunctor&).*/
virtual bool supports(ConstAttributeFunctor&) const { return true; } virtual bool supports(ConstAttributeFunctor&) const { return true; }
/** accept an ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.*/ /** accept a ConstAttributeFunctor and call its methods to tell it about the interal attributes that this Drawable has.*/
virtual void accept(ConstAttributeFunctor& af) const; virtual void accept(ConstAttributeFunctor& af) const;
/** return true, osg::ShapeDrawable does support accept(PrimitiveFunctor&) .*/ /** return true, osg::ShapeDrawable does support accept(PrimitiveFunctor&) .*/
virtual bool supports(PrimitiveFunctor&) const { return true; } virtual bool supports(PrimitiveFunctor&) const { return true; }
/** accept a PrimtiveFunctor and call its methods to tell it about the interal primtives that this Drawable has.*/ /** accept a PrimtiveFunctor and call its methods to tell it about the internal primitives that this Drawable has.*/
virtual void accept(PrimitiveFunctor& pf) const; virtual void accept(PrimitiveFunctor& pf) const;
protected: protected:

View File

@ -48,7 +48,7 @@ namespace osg {
#endif #endif
#endif #endif
/** macro for use with osg::StateAttrbiute::apply methods for detected and /** macro for use with osg::StateAttrbiute::apply methods for detecting and
* reporting OpenGL error messages.*/ * reporting OpenGL error messages.*/
#define OSG_GL_DEBUG(message) \ #define OSG_GL_DEBUG(message) \
if (state.getFineGrainedErrorDetection()) \ if (state.getFineGrainedErrorDetection()) \
@ -75,7 +75,7 @@ class SG_EXPORT State : public Referenced
/** pop stateset off state stack.*/ /** pop stateset off state stack.*/
void popStateSet(); void popStateSet();
/** pop all stateset's off state stack, ensuring its empty ready for the next frame. /** pop all statesets off state stack, ensuring it is empty ready for the next frame.
* note, to return OpenGL to default state, one should do any state.popAllStatSets(); state.apply().*/ * note, to return OpenGL to default state, one should do any state.popAllStatSets(); state.apply().*/
void popAllStateSets(); void popAllStateSets();
@ -260,17 +260,17 @@ class SG_EXPORT State : public Referenced
/** Attribute has been applied externally, /** Attribute has been applied externally,
* and therefore this attribute type has been dirtied * and therefore this attribute type has been dirtied
* and will need to be re-appplied on next osg::State.apply(..). * and will need to be re-applied on next osg::State.apply(..).
* note, if you have an osg::StateAttribute which you have applied externally * note, if you have an osg::StateAttribute which you have applied externally
* then use the have_applied(attribute) method as this will the osg::State to * then use the have_applied(attribute) method as this will cause the osg::State to
* track the current state more accuratly and enable lazy state updating such * track the current state more accurately and enable lazy state updating such
* that only changed state will be applied.*/ * that only changed state will be applied.*/
void haveAppliedAttribute(StateAttribute::Type type); void haveAppliedAttribute(StateAttribute::Type type);
/** Get whether the current specified mode is enabled (true) or disabled (false).*/ /** Get whether the current specified mode is enabled (true) or disabled (false).*/
bool getLastAppliedMode(StateAttribute::GLMode mode) const; bool getLastAppliedMode(StateAttribute::GLMode mode) const;
/** Get the current specified attribute, return NULL is one has not yet been applied.*/ /** Get the current specified attribute, return NULL if one has not yet been applied.*/
const StateAttribute* getLastAppliedAttribute(StateAttribute::Type type) const; const StateAttribute* getLastAppliedAttribute(StateAttribute::Type type) const;
@ -290,14 +290,14 @@ class SG_EXPORT State : public Referenced
* and will need to be re-appplied on next osg::State.apply(..). * and will need to be re-appplied on next osg::State.apply(..).
* note, if you have an osg::StateAttribute which you have applied externally * note, if you have an osg::StateAttribute which you have applied externally
* then use the have_applied(attribute) method as this will the osg::State to * then use the have_applied(attribute) method as this will the osg::State to
* track the current state more accuratly and enable lazy state updating such * track the current state more accurately and enable lazy state updating such
* that only changed state will be applied.*/ * that only changed state will be applied.*/
void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type); void haveAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type);
/** Get whether the current specified texture mode is enabled (true) or disabled (false).*/ /** Get whether the current specified texture mode is enabled (true) or disabled (false).*/
bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const; bool getLastAppliedTextureMode(unsigned int unit, StateAttribute::GLMode mode) const;
/** Get the current specified texture attribute, return NULL is one has not yet been applied.*/ /** Get the current specified texture attribute, return NULL if one has not yet been applied.*/
const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type) const; const StateAttribute* getLastAppliedTextureAttribute(unsigned int unit, StateAttribute::Type type) const;
@ -310,7 +310,7 @@ class SG_EXPORT State : public Referenced
/** disable the vertex, normal, color, tex coords, secenday color, fog coord and index arrays.*/ /** disable the vertex, normal, color, tex coords, secenday color, fog coord and index arrays.*/
void disableAllVertexArrays(); void disableAllVertexArrays();
/** dirty the vertex, normal, color, tex coords, secenday color, fog coord and index arrays.*/ /** dirty the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.*/
void dirtyAllVertexArrays(); void dirtyAllVertexArrays();
@ -338,7 +338,7 @@ class SG_EXPORT State : public Referenced
_vertexArray._dirty = false; _vertexArray._dirty = false;
} }
/** wrapper glDisableClientState(GL_VERTEX_ARRAY). /** wrapper around glDisableClientState(GL_VERTEX_ARRAY).
* note, only updates values that change.*/ * note, only updates values that change.*/
inline void disableVertexPointer() inline void disableVertexPointer()
{ {
@ -596,12 +596,14 @@ class SG_EXPORT State : public Referenced
} }
} }
/** set the current tex coord array texture unit, return true if selected, false if selection failed such as when multitexturing is not supported. /** set the current tex coord array texture unit, return true if selected,
* false if selection failed such as when multitexturing is not supported.
* note, only updates values that change.*/ * note, only updates values that change.*/
bool setClientActiveTextureUnit( unsigned int unit ); bool setClientActiveTextureUnit( unsigned int unit );
/** set the current texture unit, return true if selected, false if selection failed such as when multitexturing is not supported. /** set the current texture unit, return true if selected,
* false if selection failed such as when multitexturing is not supported.
* note, only updates values that change.*/ * note, only updates values that change.*/
bool setActiveTextureUnit( unsigned int unit ); bool setActiveTextureUnit( unsigned int unit );
@ -634,9 +636,9 @@ class SG_EXPORT State : public Referenced
/** Set the current OpenGL context uniqueID. /** Set the current OpenGL context uniqueID.
Note, it is the application developers responsibility to Note, it is the application developers responsibility to
set up unique ID for each OpenGL context. This value is set up unique ID for each OpenGL context. This value is
then used by osg::StateAttribure's and osg::Drawable's to then used by osg::StateAttribute's and osg::Drawable's to
help manage OpenGL display list and texture binds appropriate help manage OpenGL display list and texture binds appropriate
for each context, the contextID simply acts as an index local for each context, the contextID simply acts as an index in local
arrays that they maintain for the purpose. arrays that they maintain for the purpose.
Typical settings for contextID are 0,1,2,3... up to the maximum Typical settings for contextID are 0,1,2,3... up to the maximum
number of graphics contexts you have setup. number of graphics contexts you have setup.
@ -654,7 +656,7 @@ class SG_EXPORT State : public Referenced
inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); } inline const FrameStamp* getFrameStamp() const { return _frameStamp.get(); }
/** Set the DisplaySettings. Note, nothing is applied, the visual settings are just used /** Set the DisplaySettings. Note, nothing is applied, the visual settings are just
* used in the State object to pass the current visual settings to Drawables * used in the State object to pass the current visual settings to Drawables
* during rendering. */ * during rendering. */
inline void setDisplaySettings(DisplaySettings* vs) { _displaySettings = vs; } inline void setDisplaySettings(DisplaySettings* vs) { _displaySettings = vs; }
@ -885,21 +887,21 @@ inline void State::pushModeList(ModeMap& modeMap,const StateSet::ModeList& modeL
mitr!=modeList.end(); mitr!=modeList.end();
++mitr) ++mitr)
{ {
// get the mode stack for incomming GLmode {mitr->first}. // get the mode stack for incoming GLmode {mitr->first}.
ModeStack& ms = modeMap[mitr->first]; ModeStack& ms = modeMap[mitr->first];
if (ms.valueVec.empty()) if (ms.valueVec.empty())
{ {
// first pair so simply push incomming pair to back. // first pair so simply push incoming pair to back.
ms.valueVec.push_back(mitr->second); ms.valueVec.push_back(mitr->second);
} }
else if ((ms.valueVec.back() & StateAttribute::OVERRIDE) && !(mitr->second & StateAttribute::PROTECTED)) // check the existing override flag else if ((ms.valueVec.back() & StateAttribute::OVERRIDE) && !(mitr->second & StateAttribute::PROTECTED)) // check the existing override flag
{ {
// push existing back since override keeps the previoius value. // push existing back since override keeps the previous value.
ms.valueVec.push_back(ms.valueVec.back()); ms.valueVec.push_back(ms.valueVec.back());
} }
else else
{ {
// no override on so simply push incomming pair to back. // no override on so simply push incoming pair to back.
ms.valueVec.push_back(mitr->second); ms.valueVec.push_back(mitr->second);
} }
ms.changed = true; ms.changed = true;
@ -912,22 +914,22 @@ inline void State::pushAttributeList(AttributeMap& attributeMap,const StateSet::
aitr!=attributeList.end(); aitr!=attributeList.end();
++aitr) ++aitr)
{ {
// get the attribute stack for incomming type {aitr->first}. // get the attribute stack for incoming type {aitr->first}.
AttributeStack& as = attributeMap[aitr->first]; AttributeStack& as = attributeMap[aitr->first];
if (as.attributeVec.empty()) if (as.attributeVec.empty())
{ {
// first pair so simply push incomming pair to back. // first pair so simply push incoming pair to back.
as.attributeVec.push_back( as.attributeVec.push_back(
AttributePair(aitr->second.first.get(),aitr->second.second)); AttributePair(aitr->second.first.get(),aitr->second.second));
} }
else if ((as.attributeVec.back().second & StateAttribute::OVERRIDE) && !(aitr->second.second & StateAttribute::PROTECTED)) // check the existing override flag else if ((as.attributeVec.back().second & StateAttribute::OVERRIDE) && !(aitr->second.second & StateAttribute::PROTECTED)) // check the existing override flag
{ {
// push existing back since override keeps the previoius value. // push existing back since override keeps the previous value.
as.attributeVec.push_back(as.attributeVec.back()); as.attributeVec.push_back(as.attributeVec.back());
} }
else else
{ {
// no override on so simply push incomming pair to back. // no override on so simply push incoming pair to back.
as.attributeVec.push_back( as.attributeVec.push_back(
AttributePair(aitr->second.first.get(),aitr->second.second)); AttributePair(aitr->second.first.get(),aitr->second.second));
} }
@ -941,7 +943,7 @@ inline void State::popModeList(ModeMap& modeMap,const StateSet::ModeList& modeLi
mitr!=modeList.end(); mitr!=modeList.end();
++mitr) ++mitr)
{ {
// get the mode stack for incomming GLmode {mitr->first}. // get the mode stack for incoming GLmode {mitr->first}.
ModeStack& ms = modeMap[mitr->first]; ModeStack& ms = modeMap[mitr->first];
if (!ms.valueVec.empty()) if (!ms.valueVec.empty())
{ {
@ -957,7 +959,7 @@ inline void State::popAttributeList(AttributeMap& attributeMap,const StateSet::A
aitr!=attributeList.end(); aitr!=attributeList.end();
++aitr) ++aitr)
{ {
// get the attribute stack for incomming type {aitr->first}. // get the attribute stack for incoming type {aitr->first}.
AttributeStack& as = attributeMap[aitr->first]; AttributeStack& as = attributeMap[aitr->first];
if (!as.attributeVec.empty()) if (!as.attributeVec.empty())
{ {
@ -1017,8 +1019,8 @@ inline void State::applyModeList(ModeMap& modeMap,const StateSet::ModeList& mode
} }
else else
{ {
// this_mitr & ds_mitr refer to the same mode, check the overide // this_mitr & ds_mitr refer to the same mode, check the override
// if any otherwise just apply the incomming mode. // if any otherwise just apply the incoming mode.
ModeStack& ms = this_mitr->second; ModeStack& ms = this_mitr->second;
@ -1036,7 +1038,7 @@ inline void State::applyModeList(ModeMap& modeMap,const StateSet::ModeList& mode
} }
else else
{ {
// no override on or no previous entry, therefore consider incomming mode. // no override on or no previous entry, therefore consider incoming mode.
bool new_value = ds_mitr->second & StateAttribute::ON; bool new_value = ds_mitr->second & StateAttribute::ON;
if (applyMode(ds_mitr->first,new_value,ms)) if (applyMode(ds_mitr->first,new_value,ms))
{ {
@ -1074,7 +1076,7 @@ inline void State::applyModeList(ModeMap& modeMap,const StateSet::ModeList& mode
} }
} }
// iterator over the remaining incomming modes to apply any new mode. // iterator over the remaining incoming modes to apply any new mode.
for(; for(;
ds_mitr!=modeList.end(); ds_mitr!=modeList.end();
++ds_mitr) ++ds_mitr)
@ -1137,8 +1139,8 @@ inline void State::applyAttributeList(AttributeMap& attributeMap,const StateSet:
} }
else else
{ {
// this_mitr & ds_mitr refer to the same attribute, check the overide // this_mitr & ds_mitr refer to the same attribute, check the override
// if any otherwise just apply the incomming attribute // if any otherwise just apply the incoming attribute
AttributeStack& as = this_aitr->second; AttributeStack& as = this_aitr->second;
@ -1155,7 +1157,7 @@ inline void State::applyAttributeList(AttributeMap& attributeMap,const StateSet:
} }
else else
{ {
// no override on or no previous entry, therefore consider incomming mode. // no override on or no previous entry, therefore consider incoming mode.
const StateAttribute* new_attr = ds_aitr->second.first.get(); const StateAttribute* new_attr = ds_aitr->second.first.get();
if (applyAttribute(new_attr,as)) if (applyAttribute(new_attr,as))
{ {
@ -1190,7 +1192,7 @@ inline void State::applyAttributeList(AttributeMap& attributeMap,const StateSet:
} }
} }
// iterator over the remaining incomming modes to apply any new mode. // iterator over the remaining incoming modes to apply any new mode.
for(; for(;
ds_aitr!=attributeList.end(); ds_aitr!=attributeList.end();
++ds_aitr) ++ds_aitr)

View File

@ -31,7 +31,7 @@ class StateSet;
/** META_StateAttribute macro define the standard clone, isSameKindAs, /** META_StateAttribute macro define the standard clone, isSameKindAs,
* className and getType methods. * className and getType methods.
* Use when subclassing from Object to make it more convinient to define * Use when subclassing from Object to make it more convenient to define
* the standard pure virtual methods which are required for all Object * the standard pure virtual methods which are required for all Object
* subclasses.*/ * subclasses.*/
#define META_StateAttribute(library,name,type) \ #define META_StateAttribute(library,name,type) \
@ -42,7 +42,7 @@ class StateSet;
virtual const char* className() const { return #name; } \ virtual const char* className() const { return #name; } \
virtual Type getType() const { return type; } virtual Type getType() const { return type; }
/** COMPARE_StateAttribute_Types macro is a helper for implementing the StatateAtribute::compare(..) method.*/ /** COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(..) method.*/
#define COMPARE_StateAttribute_Types(TYPE,rhs_attribute) \ #define COMPARE_StateAttribute_Types(TYPE,rhs_attribute) \
if (this==&rhs_attribute) return 0;\ if (this==&rhs_attribute) return 0;\
const std::type_info* type_lhs = &typeid(*this);\ const std::type_info* type_lhs = &typeid(*this);\
@ -53,7 +53,7 @@ class StateSet;
/** COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(..) method. /** COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(..) method.
* Macro assumes that variable rhs has been corrected defined by code preceesing * Macro assumes that variable rhs has been correctly defined by preceding code
* macro.*/ * macro.*/
#define COMPARE_StateAttribute_Parameter(parameter) \ #define COMPARE_StateAttribute_Parameter(parameter) \
if (parameter<rhs.parameter) return -1; \ if (parameter<rhs.parameter) return -1; \
@ -61,12 +61,12 @@ class StateSet;
// define for the GL_EXT_secondary_color extension, GL_COLOR_SUM is OpenGL // define for the GL_EXT_secondary_color extension, GL_COLOR_SUM is OpenGL
// mode to be used to enable and disable the off the second color. // mode to be used to enable and disable the second color.
#ifndef GL_COLOR_SUM #ifndef GL_COLOR_SUM
#define GL_COLOR_SUM 0x8458 #define GL_COLOR_SUM 0x8458
#endif #endif
/** Base class for state attribuets. /** Base class for state attributes.
*/ */
class SG_EXPORT StateAttribute : public Object class SG_EXPORT StateAttribute : public Object
{ {
@ -74,20 +74,20 @@ class SG_EXPORT StateAttribute : public Object
/** GLMode is the value used in glEnable/glDisable(mode) */ /** GLMode is the value used in glEnable/glDisable(mode) */
typedef GLenum GLMode; typedef GLenum GLMode;
/** GLModeValue is used to specified whether an mode is enabled (ON) or disabled (OFF). /** GLModeValue is used to specify whether a mode is enabled (ON) or disabled (OFF).
* GLMoveValue is also used to specify the override behavior of modes from parent to children. * GLMoveValue is also used to specify the override behavior of modes from parent to children.
* See enum Value description for more details.*/ * See enum Value description for more details.*/
typedef unsigned int GLModeValue; typedef unsigned int GLModeValue;
/** Override is used to specified the override behavior of StateAttributes /** Override is used to specify the override behavior of StateAttributes
* from from parent to children. * from parent to children.
* See enum Value description for more details.*/ * See enum Value description for more details.*/
typedef unsigned int OverrideValue; typedef unsigned int OverrideValue;
/** list values which can be used in to set either GLModeValues /** list values which can be used to set either GLModeValues or OverrideValues.
* or OverrideValues. When using in conjunction with GLModeValues * When using in conjunction with GLModeValues, all Values have meaning.
* all Values have meaning. When using in conjection with * When using in conjection with StateAttribute OverrideValue only
* StateAttribute OverrideValue only OFF,OVERRIDE and INHERIT * OFF,OVERRIDE and INHERIT are meaningful.
* are meaningful. However, they are useful when using GLModeValue * However, they are useful when using GLModeValue
* and OverrideValue in conjunction with each other as when using * and OverrideValue in conjunction with each other as when using
* StateSet::setAttributeAndModes(..).*/ * StateSet::setAttributeAndModes(..).*/
enum Values enum Values
@ -96,11 +96,11 @@ class SG_EXPORT StateAttribute : public Object
OFF = 0x0, OFF = 0x0,
/** means that associated GLMode is enabled and Override is disabled.*/ /** means that associated GLMode is enabled and Override is disabled.*/
ON = 0x1, ON = 0x1,
/** Overriding of GLMode's or StateAttributes is enabled, so that state below it is overriden.*/ /** Overriding of GLMode's or StateAttributes is enabled, so that state below it is overridden.*/
OVERRIDE = 0x2, OVERRIDE = 0x2,
/** Protecting of GLMode's os StateAttributes is enabled, so that state from above connot override this and below state.*/ /** Protecting of GLMode's or StateAttributes is enabled, so that state from above cannot override this and below state.*/
PROTECTED = 0x4, PROTECTED = 0x4,
/** means that GLMode or StateAttribute should in inherited from above.*/ /** means that GLMode or StateAttribute should be inherited from above.*/
INHERIT = 0x8 INHERIT = 0x8
}; };
@ -109,12 +109,12 @@ class SG_EXPORT StateAttribute : public Object
/** Values of StateAttribute::Type used to aid identification /** Values of StateAttribute::Type used to aid identification
* of different StateAttribute subclasses. Each subclass defines * of different StateAttribute subclasses. Each subclass defines
* it own value in the virtual Type getType() method. When * its own value in the virtual Type getType() method. When
* extending the osg's StateAttribute's simply define your * extending the osg's StateAttribute's simply define your
* own Type value which is unique, using the StateAttribute::Type * own Type value which is unique, using the StateAttribute::Type
* enum as a guide of what values to use. If your new subclass * enum as a guide of what values to use. If your new subclass
* needs to override a standard StateAttriubte then simple use * needs to override a standard StateAttriubte then simply use
* that types value. */ * that type's value. */
enum Types enum Types
{ {
TEXTURE, TEXTURE,
@ -234,7 +234,7 @@ class SG_EXPORT StateAttribute : public Object
/** default to nothing to compile - all state is applied immediately. */ /** default to nothing to compile - all state is applied immediately. */
virtual void compileGLObjects(State&) const {} virtual void compileGLObjects(State&) const {}
/** release an OpenGL objects in specified graphics context if State /** release OpenGL objects in specified graphics context if State
object is passed, otherwise release OpenGL objexts for all graphics context if object is passed, otherwise release OpenGL objexts for all graphics context if
State object pointer NULL.*/ State object pointer NULL.*/
virtual void releaseGLObjects(State* =0) const {} virtual void releaseGLObjects(State* =0) const {}

View File

@ -33,7 +33,7 @@ namespace osg {
Encapsulates OpenGL state modes and attributes. Encapsulates OpenGL state modes and attributes.
Used to specific textures etc of osg::Drawable's which hold references Used to specific textures etc of osg::Drawable's which hold references
to a single osg::StateSet. StateSet can be shared between Drawable's to a single osg::StateSet. StateSet can be shared between Drawable's
and is recommend if possible as it minimize expensive state changes and is recommend if possible as it minimizes expensive state changes
in the graphics pipeline. in the graphics pipeline.
*/ */
class SG_EXPORT StateSet : public Object class SG_EXPORT StateSet : public Object
@ -76,7 +76,7 @@ class SG_EXPORT StateSet : public Object
void setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value); void setMode(StateAttribute::GLMode mode, StateAttribute::GLModeValue value);
/** set this StateSet to inherit specified GLMode type from parents. /** set this StateSet to inherit specified GLMode type from parents.
* has the effect of deleting any GlMode of specified type from StateSet.*/ * Has the effect of deleting any GlMode of specified type from StateSet.*/
void setModeToInherit(StateAttribute::GLMode mode); void setModeToInherit(StateAttribute::GLMode mode);
/** get specified GLModeValue for specified GLMode. /** get specified GLModeValue for specified GLMode.
@ -150,15 +150,15 @@ class SG_EXPORT StateSet : public Object
/** set this StateSet to contain specified attribute and set the associated GLMode's to specified value.*/ /** set this StateSet to contain specified attribute and set the associated GLMode's to specified value.*/
void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON); void setTextureAttributeAndModes(unsigned int unit,StateAttribute *attribute, StateAttribute::GLModeValue value=StateAttribute::ON);
/** set this StateSet to inherit specified attribute type from parents. /** set this StateSet to inherit specified attribute type from parents.
* has the effect of deleting any state attributes of specified type from StateSet.*/ * Has the effect of deleting any state attributes of specified type from StateSet.*/
void setTextureAttributeToInherit(unsigned int unit,StateAttribute::Type type); void setTextureAttributeToInherit(unsigned int unit,StateAttribute::Type type);
/** get specified Texture related StateAttribute for specified type. /** get specified Texture related StateAttribute for specified type.
* returns NULL if no type is contained within StateSet.*/ * Returns NULL if no type is contained within StateSet.*/
StateAttribute* getTextureAttribute(unsigned int unit,StateAttribute::Type type); StateAttribute* getTextureAttribute(unsigned int unit,StateAttribute::Type type);
/** get specified Texture related const StateAttribute for specified type. /** get specified Texture related const StateAttribute for specified type.
* returns NULL if no type is contained within const StateSet.*/ * Returns NULL if no type is contained within const StateSet.*/
const StateAttribute* getTextureAttribute(unsigned int unit,StateAttribute::Type type) const; const StateAttribute* getTextureAttribute(unsigned int unit,StateAttribute::Type type) const;
/** get specified Texture related RefAttributePair for specified type. /** get specified Texture related RefAttributePair for specified type.

View File

@ -45,10 +45,10 @@ class SG_EXPORT Stencil : public StateAttribute
virtual int compare(const StateAttribute& sa) const virtual int compare(const StateAttribute& sa) const
{ {
// check the types are equal and then create the rhs variable // check the types are equal and then create the rhs variable
// used by the COMPARE_StateAttribute_Paramter macro's below. // used by the COMPARE_StateAttribute_Parameter macro's below.
COMPARE_StateAttribute_Types(Stencil,sa) COMPARE_StateAttribute_Types(Stencil,sa)
// compare each paramter in turn against the rhs. // compare each parameter in turn against the rhs.
COMPARE_StateAttribute_Parameter(_func) COMPARE_StateAttribute_Parameter(_func)
COMPARE_StateAttribute_Parameter(_funcRef) COMPARE_StateAttribute_Parameter(_funcRef)
COMPARE_StateAttribute_Parameter(_funcMask) COMPARE_StateAttribute_Parameter(_funcMask)
@ -119,10 +119,10 @@ class SG_EXPORT Stencil : public StateAttribute
/** get the operation when the stencil test fails.*/ /** get the operation when the stencil test fails.*/
inline Operation getStencilFailOperation() const { return _sfail; } inline Operation getStencilFailOperation() const { return _sfail; }
/** get the operation when the stencil test passes but the depth test fails*/ /** get the operation when the stencil test passes but the depth test fails.*/
inline Operation getStencilPassAndDepthFailOperation() const { return _zfail; } inline Operation getStencilPassAndDepthFailOperation() const { return _zfail; }
/** get the operation when both the stencil test and the depth test pass*/ /** get the operation when both the stencil test and the depth test pass.*/
inline Operation getStencilPassAndDepthPassOperation() const { return _zpass; } inline Operation getStencilPassAndDepthPassOperation() const { return _zpass; }

View File

@ -61,7 +61,7 @@ class ref_ptr
inline bool operator < (const ref_ptr& rp) const { return (_ptr<rp._ptr); } inline bool operator < (const ref_ptr& rp) const { return (_ptr<rp._ptr); }
inline bool operator > (const ref_ptr& rp) const { return (_ptr>rp._ptr); } inline bool operator > (const ref_ptr& rp) const { return (_ptr>rp._ptr); }
// comparion operator for const T*. // comparison operator for const T*.
inline bool operator == (const T* ptr) const { return (_ptr==ptr); } inline bool operator == (const T* ptr) const { return (_ptr==ptr); }
inline bool operator != (const T* ptr) const { return (_ptr!=ptr); } inline bool operator != (const T* ptr) const { return (_ptr!=ptr); }
inline bool operator < (const T* ptr) const { return (_ptr<ptr); } inline bool operator < (const T* ptr) const { return (_ptr<ptr); }