Addd libraryName() method to osg::Object in preperation for the osgDB support

for node kits plugins.
This commit is contained in:
Robert Osfield
2002-06-06 13:25:36 +00:00
parent 21a8149aa5
commit 99580f2212
78 changed files with 115 additions and 71 deletions

10
NEWS
View File

@@ -3,6 +3,16 @@ OSG News (most significant items from ChangeLog)
================================================
Occlusion culling adding to the core OSG.
osgParticle developed by Marco Jez adds support for a range of particle
effects.
osgSim a seperate add-on library adds support for navigational light points.
Support for NodeKits.
26th April 2002 - osg-0.8.45.tar.gz
>>> Support added for Solaris, texture cube mapping & muliple projections.

View File

@@ -25,7 +25,7 @@ class SG_EXPORT AlphaFunc : public StateAttribute
_comparisonFunc(af._comparisonFunc),
_referenceValue(af._referenceValue) {}
META_StateAttribute(AlphaFunc,ALPHAFUNC);
META_StateAttribute(osg, AlphaFunc,ALPHAFUNC);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -28,7 +28,7 @@ class SG_EXPORT Billboard : public Geode
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Billboard(const Billboard&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(Billboard);
META_Node(osg, Billboard);
/** Set the billboard rotation mode. */
void setMode(const Mode mode);

View File

@@ -23,7 +23,7 @@ class SG_EXPORT ClipNode : public Group
ClipNode(const ClipNode& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(ClipNode);
META_Node(osg, ClipNode);
/** Create a 6 clip planes to create a clip box.*/
void createClipBox(const BoundingBox& bb,unsigned int clipPlaneNumberBase=0);

View File

@@ -32,7 +32,7 @@ class SG_EXPORT ClipPlane : public StateAttribute
_clipPlaneNum=cp._clipPlaneNum;
}
META_StateAttribute(ClipPlane, (Type)(CLIPPLANE+_clipPlaneNum));
META_StateAttribute(osg, ClipPlane, (Type)(CLIPPLANE+_clipPlaneNum));
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -29,7 +29,7 @@ class SG_EXPORT ColorMask : public StateAttribute
_blue(cm._blue),
_alpha(cm._alpha) {}
META_StateAttribute(ColorMask, COLORMASK);
META_StateAttribute(osg, ColorMask, COLORMASK);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -22,7 +22,7 @@ class SG_EXPORT ColorMatrix : public StateAttribute
StateAttribute(cm,copyop),
_matrix(cm._matrix) {}
META_StateAttribute(ColorMatrix, COLORMATRIX);
META_StateAttribute(osg, ColorMatrix, COLORMATRIX);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -24,7 +24,7 @@ class SG_EXPORT CullFace : public StateAttribute
StateAttribute(cf,copyop),
_mode(cf._mode) {}
META_StateAttribute(CullFace, CULLFACE);
META_StateAttribute(osg, CullFace, CULLFACE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -29,7 +29,7 @@ class SG_EXPORT Depth : public StateAttribute
_zFar(dp._zFar) {}
META_StateAttribute(Depth, DEPTH);
META_StateAttribute(osg, Depth, DEPTH);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -28,6 +28,7 @@ class SG_EXPORT DrawPixels : public Drawable
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawPixels*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawPixels"; }

View File

@@ -61,6 +61,7 @@ class SG_EXPORT Drawable : public Object
Drawable(const Drawable& drawable,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Drawable*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Drawable"; }

View File

@@ -32,7 +32,7 @@ class SG_EXPORT EarthSky : public Group
_clearColor(es._clearColor) {}
META_Node(EarthSky);
META_Node(osg, EarthSky);
/** Sets the flag which control whether a glClear is required at the beginning of each frame. */
inline void setRequiresClear(const bool requiresClear) { _requiresClear = requiresClear; }

View File

@@ -29,7 +29,7 @@ class SG_EXPORT Fog : public StateAttribute
_end(fog._end),
_color(fog._color) {}
META_StateAttribute(Fog,FOG);
META_StateAttribute(osg, Fog,FOG);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -23,7 +23,7 @@ class SG_EXPORT FrontFace : public StateAttribute
StateAttribute(ff,copyop),
_mode(ff._mode) {}
META_StateAttribute(FrontFace, FRONTFACE);
META_StateAttribute(osg, FrontFace, FRONTFACE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -156,6 +156,7 @@ class SG_EXPORT GeoSet : public Drawable
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const GeoSet*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "GeoSet"; }

View File

@@ -23,7 +23,7 @@ class SG_EXPORT Geode : public Node
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Geode(const Geode&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(Geode);
META_Node(osg, Geode);
/** Add Drawable to Geode.
* If gset is not NULL and is not contained in Geode then increment its

View File

@@ -25,7 +25,7 @@ class SG_EXPORT Group : public Node
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Group(const Group&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(Group);
META_Node(osg, Group);
virtual void traverse(NodeVisitor& nv);

View File

@@ -29,6 +29,7 @@ class SG_EXPORT Image : public Object
virtual Object* cloneType() const { return osgNew Image(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew Image(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Image*>(obj)!=0; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Image"; }

View File

@@ -58,7 +58,7 @@ class SG_EXPORT Impostor : public LOD
_impostorSpriteList(),
_impostorThreshold(es._impostorThreshold) {}
META_Node(Impostor);
META_Node(osg, Impostor);
typedef std::vector< ref_ptr<ImpostorSprite> > ImpostorSpriteList;

View File

@@ -37,6 +37,7 @@ class SG_EXPORT ImpostorSprite : public Drawable
* since it is not appropriate to share data of an ImpostorSprite.*/
virtual Object* clone(const CopyOp&) const { return osgNew ImpostorSprite(); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ImpostorSprite*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "ImpostorSprite"; }
/** Set the parent, which must be an Impostor.

View File

@@ -32,7 +32,7 @@ class SG_EXPORT LOD : public Group
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
LOD(const LOD&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(LOD);
META_Node(osg, LOD);
virtual void traverse(NodeVisitor& nv);

View File

@@ -34,7 +34,7 @@ class SG_EXPORT Light : public StateAttribute
_spot_exponent(light._spot_exponent),
_spot_cutoff(light._spot_cutoff) {}
META_StateAttribute(Light, (Type)(LIGHT_0+_lightnum));
META_StateAttribute(osg, Light, (Type)(LIGHT_0+_lightnum));
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -26,7 +26,7 @@ class SG_EXPORT LightModel : public StateAttribute
_twoSided(lw._twoSided) {}
META_StateAttribute(LightModel, LIGHTMODEL);
META_StateAttribute(osg, LightModel, LIGHTMODEL);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -23,7 +23,7 @@ class SG_EXPORT LightSource : public Group
_value(ls._value),
_light(dynamic_cast<osg::Light*>(copyop(ls._light.get()))) {}
META_Node(LightSource);
META_Node(osg, LightSource);
/** Set the attached light.*/
void setLight(Light* light);

View File

@@ -22,7 +22,7 @@ class SG_EXPORT LineStipple : public StateAttribute
_factor(lw._factor),
_pattern(lw._pattern) {}
META_StateAttribute(LineStipple, LINESTIPPLE);
META_StateAttribute(osg, LineStipple, LINESTIPPLE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -22,7 +22,7 @@ class SG_EXPORT LineWidth : public StateAttribute
StateAttribute(lw,copyop),
_width(lw._width) {}
META_StateAttribute(LineWidth, LINEWIDTH);
META_StateAttribute(osg, LineWidth, LINEWIDTH);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -39,7 +39,7 @@ class SG_EXPORT Material : public StateAttribute
_shininessFront(mat._shininessFront),
_shininessBack(mat._shininessBack) {}
META_StateAttribute(Material, MATERIAL);
META_StateAttribute(osg, Material, MATERIAL);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -34,6 +34,7 @@ class SG_EXPORT Matrix : public Object
virtual Object* cloneType() const { return osgNew Matrix(); } \
virtual Object* clone(const CopyOp&) const { return osgNew Matrix(*this); } \
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Matrix*>(obj)!=NULL; } \
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Matrix"; }
virtual ~Matrix() {}

View File

@@ -22,11 +22,12 @@ class Group;
/** META_Node macro define the standard clone, isSameKindAs, className
* and accept methods. Use when subclassing from Node to make it
* more convinient to define the required pure virtual methods.*/
#define META_Node(name) \
#define META_Node(library,name) \
virtual osg::Object* cloneType() const { return osgNew name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* className() const { return #name; } \
virtual const char* libraryName() const { return #library; } \
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } \
@@ -54,6 +55,9 @@ class SG_EXPORT Node : public Object
/** return true if this and obj are of the same kind of object.*/
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Node*>(obj)!=NULL; }
/** return the name of the node's library.*/
virtual const char* libraryName() const { return "osg"; }
/** return the name of the node's class type.*/
virtual const char* className() const { return "Node"; }

View File

@@ -14,11 +14,12 @@ namespace osg {
* Use when subclassing from Object to make it more convinient to define
* the standard pure virtual clone, isSameKindAs and className methods
* which are required for all Object subclasses.*/
#define META_Object(T) \
virtual osg::Object* cloneType() const { return osgNew T (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew T (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const T *>(obj)!=NULL; } \
virtual const char* className() const { return #T; }
#define META_Object(library,name) \
virtual osg::Object* cloneType() const { return osgNew name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; }\
virtual const char* className() const { return #name; }
/** Base class/standard interface for objects which require IO support,
@@ -50,6 +51,11 @@ class SG_EXPORT Object : public Referenced
virtual bool isSameKindAs(const Object*) const { return true; }
/** return the name of the object's library. Must be defined
by derived classes. The OpenSceneGraph convention the is
that the namspace of a library is the same as the library name.*/
virtual const char* libraryName() const = 0;
/** return the name of the object's class type. Must be defined
by derived classes.*/
virtual const char* className() const = 0;

View File

@@ -24,7 +24,7 @@ class SG_EXPORT OccluderNode : public Group
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
OccluderNode(const OccluderNode&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(OccluderNode);
META_Node(osg, OccluderNode);
/** Attach a ConvexPlanerOccluder to an OccluderNode.*/

View File

@@ -25,7 +25,7 @@ class SG_EXPORT Point : public StateAttribute
_fadeThresholdSize(point._fadeThresholdSize),
_distanceAttenuation(point._distanceAttenuation) {}
META_StateAttribute(Point, POINT);
META_StateAttribute(osg, Point, POINT);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -25,7 +25,7 @@ class SG_EXPORT PolygonMode : public StateAttribute
_modeFront(pm._modeFront),
_modeBack(pm._modeBack) {}
META_StateAttribute(PolygonMode, POLYGONMODE);
META_StateAttribute(osg, PolygonMode, POLYGONMODE);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -23,7 +23,7 @@ class SG_EXPORT PolygonOffset : public StateAttribute
_factor(po._factor),
_units(po._units) {}
META_StateAttribute(PolygonOffset, POLYGONOFFSET);
META_StateAttribute(osg, PolygonOffset, POLYGONOFFSET);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -25,7 +25,7 @@ class SG_EXPORT PositionAttitudeTransform : public Transform
_attitude(pat._attitude) {}
META_Node(PositionAttitudeTransform);
META_Node(osg, PositionAttitudeTransform);
void setPosition(const Vec3& pos) { _position = pos; }

View File

@@ -24,7 +24,7 @@ class SG_EXPORT Projection : public Group
Projection(const Matrix& matix);
META_Node(Projection);
META_Node(osg, Projection);
/** Set the transform's matrix.*/
void setMatrix(const Matrix& mat) { (*_matrix) = mat; }

View File

@@ -25,7 +25,7 @@ class SG_EXPORT ShadeModel : public StateAttribute
_mode(sm._mode) {}
META_StateAttribute(ShadeModel, SHADEMODEL);
META_StateAttribute(osg, ShadeModel, SHADEMODEL);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -22,10 +22,11 @@ class StateSet;
* Use when subclassing from Object to make it more convinient to define
* the standard pure virtual methods which are required for all Object
* subclasses.*/
#define META_StateAttribute(name,type) \
#define META_StateAttribute(library,name,type) \
virtual osg::Object* cloneType() const { return osgNew name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; } \
virtual const char* className() const { return #name; } \
virtual const Type getType() const { return type; }
@@ -168,6 +169,9 @@ class SG_EXPORT StateAttribute : public Object
/** return true if this and obj are of the same kind of object.*/
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const StateAttribute*>(obj)!=NULL; }
/** return the name of the attribute's library.*/
virtual const char* libraryName() const { return "osg"; }
/** return the name of the attribute's class type.*/
virtual const char* className() const { return "StateAttribute"; }

View File

@@ -33,6 +33,7 @@ class SG_EXPORT StateSet : public Object
virtual Object* cloneType() const { return osgNew StateSet(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew StateSet(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const StateSet*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "StateSet"; }
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/

View File

@@ -32,7 +32,7 @@ class SG_EXPORT Stencil : public StateAttribute
_writeMask(stencil._writeMask) {}
META_StateAttribute(Stencil, STENCIL);
META_StateAttribute(osg, Stencil, STENCIL);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -34,7 +34,7 @@ class SG_EXPORT Switch : public Group
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Switch(const Switch&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
META_Node(Switch);
META_Node(osg, Switch);
virtual void traverse(NodeVisitor& nv);

View File

@@ -23,7 +23,7 @@ class SG_EXPORT TexEnv : public StateAttribute
_mode(texenv._mode) {}
META_StateAttribute(TexEnv, TEXENV);
META_StateAttribute(osg, TexEnv, TEXENV);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -35,7 +35,7 @@ class SG_EXPORT TexGen : public StateAttribute
_plane_r(texgen._plane_r),
_plane_q(texgen._plane_q) {}
META_StateAttribute(TexGen, TEXGEN);
META_StateAttribute(osg, TexGen, TEXGEN);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -22,7 +22,7 @@ class SG_EXPORT TexMat : public StateAttribute
StateAttribute(texmat,copyop),
_matrix(texmat._matrix) {}
META_StateAttribute(TexMat, TEXMAT);
META_StateAttribute(osg, TexMat, TEXMAT);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -102,7 +102,7 @@ class SG_EXPORT Texture : public StateAttribute
_subloadWidth(text._subloadWidth),
_subloadHeight(text._subloadHeight) {}
META_StateAttribute(Texture,(Type)(TEXTURE_0+_textureUnit));
META_StateAttribute(osg, Texture,(Type)(TEXTURE_0+_textureUnit));
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& rhs) const;

View File

@@ -27,7 +27,7 @@ class SG_EXPORT TextureCubeMap : public Texture
TextureCubeMap(const TextureCubeMap& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Texture(cm,copyop) {}
META_StateAttribute(TextureCubeMap,(Type)(TEXTURE_0+_textureUnit));
META_StateAttribute(osg, TextureCubeMap,(Type)(TEXTURE_0+_textureUnit));
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& rhs) const;

View File

@@ -38,7 +38,7 @@ class SG_EXPORT Transform : public Group
Transform(const Matrix& matix);
META_Node(Transform);
META_Node(osg, Transform);
enum ReferenceFrame
{

View File

@@ -23,7 +23,7 @@ class SG_EXPORT Transparency : public StateAttribute
_source_factor(trans._source_factor),
_destination_factor(trans._destination_factor) {}
META_StateAttribute(Transparency,TRANSPARENCY);
META_StateAttribute(osg, Transparency,TRANSPARENCY);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -29,7 +29,7 @@ class SG_EXPORT Viewport : public StateAttribute
_width(vp._width),
_height(vp._height) {}
META_StateAttribute(Viewport,VIEWPORT);
META_StateAttribute(osg, Viewport,VIEWPORT);
/** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/
virtual int compare(const StateAttribute& sa) const

View File

@@ -24,7 +24,7 @@ namespace osgParticle
inline AccelOperator();
inline AccelOperator(const AccelOperator &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(AccelOperator);
META_Object(osgParticle, AccelOperator);
/// Get the acceleration vector.
inline const osg::Vec3 &getAcceleration() const;

View File

@@ -22,6 +22,7 @@ namespace osgParticle
inline CenteredPlacer();
inline CenteredPlacer(const CenteredPlacer &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "CenteredPlacer"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const Placer *>(obj) != 0; }

View File

@@ -17,6 +17,7 @@ namespace osgParticle
inline Counter();
inline Counter(const Counter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Counter"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const Counter *>(obj) != 0; }

View File

@@ -28,6 +28,7 @@ namespace osgParticle
Emitter();
Emitter(const Emitter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Emitter"; }
virtual bool isSameKindAs(const osg::Object *obj) { return dynamic_cast<const Emitter*>(obj) != 0; }
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } }

View File

@@ -30,7 +30,7 @@ namespace osgParticle
FluidFrictionOperator();
FluidFrictionOperator(const FluidFrictionOperator &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(FluidFrictionOperator);
META_Object(osgParticle, FluidFrictionOperator);
/// Get the density of the fluid.
inline float getFluidDensity() const;

View File

@@ -26,7 +26,7 @@ namespace osgParticle
inline ForceOperator();
inline ForceOperator(const ForceOperator &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(ForceOperator);
META_Object(osgParticle, ForceOperator);
/// Get the force vector.
inline const osg::Vec3 &getForce() const;

View File

@@ -26,6 +26,7 @@ namespace osgParticle
Interpolator(const Interpolator &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY)
: osg::Object(copy, copyop) {}
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Interpolator"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const Interpolator *>(obj) != 0; }

View File

@@ -25,7 +25,7 @@ namespace osgParticle
LinearInterpolator(const LinearInterpolator &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY)
: Interpolator(copy, copyop) {}
META_Object(LinearInterpolator);
META_Object(osgParticle, LinearInterpolator);
virtual float interpolate(float t, float y1, float y2) const
{

View File

@@ -37,7 +37,7 @@ namespace osgParticle
ModularEmitter();
ModularEmitter(const ModularEmitter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Node(ModularEmitter);
META_Node(osgParticle,ModularEmitter);
/// Get the counter object.
inline Counter *getCounter();

View File

@@ -28,7 +28,7 @@ namespace osgParticle
ModularProgram();
ModularProgram(const ModularProgram &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Node(ModularProgram);
META_Node(osgParticle,ModularProgram);
/// Get the number of operators.
inline int numOperators() const;

View File

@@ -29,7 +29,7 @@ namespace osgParticle {
MultiSegmentPlacer();
MultiSegmentPlacer(const MultiSegmentPlacer &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(MultiSegmentPlacer);
META_Object(osgParticle, MultiSegmentPlacer);
/// Get the number of vertices which define the segments.
inline int numVertices() const;

View File

@@ -28,6 +28,7 @@ namespace osgParticle
inline Operator();
inline Operator(const Operator &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Operator"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const Operator *>(obj) != 0; }

View File

@@ -37,7 +37,7 @@ namespace osgParticle
ParticleSystem();
ParticleSystem(const ParticleSystem &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(ParticleSystem);
META_Object(osgParticle, ParticleSystem);
/// Get the default bounding box
inline const osg::BoundingBox &getDefaultBoundingBox() const;

View File

@@ -32,7 +32,7 @@ namespace osgParticle
ParticleSystemUpdater();
ParticleSystemUpdater(const ParticleSystemUpdater &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Node(ParticleSystemUpdater);
META_Node(osgParticle,ParticleSystemUpdater);
/// Return the number of particle systems on the list.
inline int numParticleSystems() const;

View File

@@ -23,6 +23,7 @@ namespace osgParticle
inline Placer();
inline Placer(const Placer &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Placer"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const Placer *>(obj) != 0; }

View File

@@ -24,7 +24,7 @@ namespace osgParticle
inline PointPlacer();
inline PointPlacer(const PointPlacer &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(PointPlacer);
META_Object(osgParticle, PointPlacer);
/** Place a particle.
This method is called automatically by <CODE>ModularEmitter</CODE> and should not be called

View File

@@ -28,6 +28,7 @@ namespace osgParticle
Program();
Program(const Program &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Program"; }
virtual bool isSameKindAs(const osg::Object *obj) { return dynamic_cast<const Program*>(obj) != 0; }
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } }

View File

@@ -29,7 +29,7 @@ namespace osgParticle
inline RadialShooter();
inline RadialShooter(const RadialShooter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(RadialShooter);
META_Object(osgParticle, RadialShooter);
/// Get the range of possible values for <B>theta</B> angle.
inline const rangef &getThetaRange() const;

View File

@@ -19,7 +19,7 @@ namespace osgParticle
inline RandomRateCounter();
inline RandomRateCounter(const RandomRateCounter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(RandomRateCounter);
META_Object(osgParticle, RandomRateCounter);
/// Return the number of particles to be created in this frame
inline int numParticlesToCreate(double dt) const;

View File

@@ -47,7 +47,7 @@ namespace osgParticle
/// Set the range of possible values for the central angle.
inline void setPhiRange(float r1, float r2);
META_Object(SectorPlacer);
META_Object(osgParticle, SectorPlacer);
/// Place a particle. Do not call it manually.
inline void place(Particle *P) const;

View File

@@ -25,7 +25,7 @@ namespace osgParticle {
inline SegmentPlacer();
inline SegmentPlacer(const SegmentPlacer &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
META_Object(SegmentPlacer);
META_Object(osgParticle, SegmentPlacer);
/// get vertex <B>A</B>.
inline const osg::Vec3 &getVertexA() const;

View File

@@ -22,6 +22,7 @@ namespace osgParticle
inline Shooter();
inline Shooter(const Shooter &copy, const osg::CopyOp &copyop = osg::CopyOp::SHALLOW_COPY);
virtual const char *libraryName() const { return "osgParticle"; }
virtual const char *className() const { return "Shooter"; }
virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast<const Shooter *>(obj) != 0; }

View File

@@ -38,10 +38,11 @@ namespace osgText {
* Use when subclassing from Object to make it more convinient to define
* the standard pure virtual methods which are required for all Object
* subclasses.*/
#define META_Font(name) \
#define META_Font(library,name) \
virtual osg::Object* cloneType() const { return new name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; } \
virtual const char* className() const { return #name; } \
@@ -62,7 +63,9 @@ class OSGTEXT_EXPORT Font : public osg::Object
_textureSize(font._textureSize)
{}
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Font *>(obj)!=NULL; }
virtual const char* libraryName() const { return "osgText"; }
virtual const char* className() const { return "Font"; }
bool open(const char* font);
@@ -118,6 +121,7 @@ class OSGTEXT_EXPORT RasterFont:public Font
RasterFont(const std::string& /*font*/):Font() {}
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RasterFont *>(obj)!=NULL; }
virtual const char* libraryName() const { return "osgText"; }
virtual const char* className() const { return "RasterFont"; }
protected:
@@ -135,6 +139,7 @@ class OSGTEXT_EXPORT VectorFont:public Font
VectorFont(const std::string& /*font*/):Font(){}
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const VectorFont *>(obj)!=NULL; }
virtual const char* libraryName() const { return "osgText"; }
virtual const char* className() const { return "VectorFont"; }
protected:
@@ -154,7 +159,7 @@ class OSGTEXT_EXPORT BitmapFont:public RasterFont
BitmapFont(const std::string& font,
int point_size);
META_Font(BitmapFont);
META_Font(osgText,BitmapFont);
protected:
@@ -174,7 +179,7 @@ class OSGTEXT_EXPORT PixmapFont:public RasterFont
PixmapFont(const std::string& font,
int point_size);
META_Font(PixmapFont);
META_Font(osgText,PixmapFont);
protected:
@@ -198,7 +203,7 @@ class OSGTEXT_EXPORT TextureFont:public RasterFont
int point_size,
int textureSize );
META_Font(TextureFont);
META_Font(osgText,TextureFont);
protected:
@@ -218,7 +223,7 @@ class OSGTEXT_EXPORT OutlineFont:public VectorFont
int point_size,
double precision);
META_Font(OutlineFont);
META_Font(osgText,OutlineFont);
protected:
@@ -243,7 +248,7 @@ public:
int point_size,
double precision);
META_Font(PolygonFont);
META_Font(osgText,PolygonFont);
protected:

View File

@@ -18,7 +18,7 @@ class OSGTEXT_EXPORT Paragraph : public osg::Geode
Paragraph(const Paragraph& paragraph,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
Paragraph(const osg::Vec3& position,const std::string& text,osgText::Font* font);
META_Node(Paragraph)
META_Node(osgText,Paragraph)
void setFont(osgText::Font* font);

View File

@@ -19,6 +19,7 @@ class OSGUTIL_EXPORT DepthSortedBin : public RenderBin
virtual osg::Object* cloneType() const { return new DepthSortedBin(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new DepthSortedBin(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const DepthSortedBin*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "DepthSortedBin"; }
virtual void reset();

View File

@@ -38,6 +38,7 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
virtual osg::Object* cloneType() const { return new RenderBin(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderBin(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderBin*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderBin"; }
virtual void reset();

View File

@@ -26,6 +26,7 @@ class OSGUTIL_EXPORT RenderStageLighting : public osg::Object
virtual osg::Object* cloneType() const { return new RenderStageLighting(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStageLighting*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderStageLighting"; }
virtual void reset();

View File

@@ -25,6 +25,7 @@ class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage
virtual osg::Object* cloneType() const { return new RenderToTextureStage(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderToTextureStage(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderToTextureStage*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderToTextureStage"; }
virtual void reset();

View File

@@ -93,12 +93,8 @@
#endif
// lifted from glext.h, to remove dependancy on glext.h
#ifndef GL_EXT_texture_object
#define GL_TEXTURE_PRIORITY_EXT 0x8066
#define GL_TEXTURE_RESIDENT_EXT 0x8067
#define GL_TEXTURE_1D_BINDING_EXT 0x8068
#ifndef GL_TEXTURE_2D_BINDING_EXT
#define GL_TEXTURE_2D_BINDING_EXT 0x8069
#define GL_TEXTURE_3D_BINDING_EXT 0x806A
#endif
#if defined(_MSC_VER)