From 99580f2212070502eeea3469719c3510d3674397 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 6 Jun 2002 13:25:36 +0000 Subject: [PATCH] Addd libraryName() method to osg::Object in preperation for the osgDB support for node kits plugins. --- NEWS | 10 ++++++++++ include/osg/AlphaFunc | 2 +- include/osg/Billboard | 2 +- include/osg/ClipNode | 2 +- include/osg/ClipPlane | 2 +- include/osg/ColorMask | 2 +- include/osg/ColorMatrix | 2 +- include/osg/CullFace | 2 +- include/osg/Depth | 2 +- include/osg/DrawPixels | 1 + include/osg/Drawable | 1 + include/osg/EarthSky | 2 +- include/osg/Fog | 2 +- include/osg/FrontFace | 2 +- include/osg/GeoSet | 1 + include/osg/Geode | 2 +- include/osg/Group | 2 +- include/osg/Image | 1 + include/osg/Impostor | 2 +- include/osg/ImpostorSprite | 1 + include/osg/LOD | 2 +- include/osg/Light | 2 +- include/osg/LightModel | 2 +- include/osg/LightSource | 2 +- include/osg/LineStipple | 2 +- include/osg/LineWidth | 2 +- include/osg/Material | 2 +- include/osg/Matrix | 1 + include/osg/Node | 6 +++++- include/osg/Object | 16 +++++++++++----- include/osg/OccluderNode | 2 +- include/osg/Point | 2 +- include/osg/PolygonMode | 2 +- include/osg/PolygonOffset | 2 +- include/osg/PositionAttitudeTransform | 2 +- include/osg/Projection | 2 +- include/osg/ShadeModel | 2 +- include/osg/StateAttribute | 6 +++++- include/osg/StateSet | 1 + include/osg/Stencil | 2 +- include/osg/Switch | 2 +- include/osg/TexEnv | 2 +- include/osg/TexGen | 2 +- include/osg/TexMat | 2 +- include/osg/Texture | 2 +- include/osg/TextureCubeMap | 2 +- include/osg/Transform | 2 +- include/osg/Transparency | 2 +- include/osg/Viewport | 2 +- include/osgParticle/AccelOperator | 2 +- include/osgParticle/CenteredPlacer | 1 + include/osgParticle/Counter | 1 + include/osgParticle/Emitter | 1 + include/osgParticle/FluidFrictionOperator | 2 +- include/osgParticle/ForceOperator | 2 +- include/osgParticle/Interpolator | 1 + include/osgParticle/LinearInterpolator | 2 +- include/osgParticle/ModularEmitter | 2 +- include/osgParticle/ModularProgram | 2 +- include/osgParticle/MultiSegmentPlacer | 2 +- include/osgParticle/Operator | 1 + include/osgParticle/ParticleSystem | 2 +- include/osgParticle/ParticleSystemUpdater | 2 +- include/osgParticle/Placer | 1 + include/osgParticle/PointPlacer | 2 +- include/osgParticle/Program | 1 + include/osgParticle/RadialShooter | 2 +- include/osgParticle/RandomRateCounter | 2 +- include/osgParticle/SectorPlacer | 2 +- include/osgParticle/SegmentPlacer | 2 +- include/osgParticle/Shooter | 1 + include/osgText/Font | 17 +++++++++++------ include/osgText/Paragraph | 2 +- include/osgUtil/DepthSortedBin | 1 + include/osgUtil/RenderBin | 1 + include/osgUtil/RenderStageLighting | 1 + include/osgUtil/RenderToTextureStage | 1 + src/osgText/FTGL.h | 6 +----- 78 files changed, 115 insertions(+), 71 deletions(-) diff --git a/NEWS b/NEWS index 5ef44a8be..65e2ac359 100644 --- a/NEWS +++ b/NEWS @@ -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. diff --git a/include/osg/AlphaFunc b/include/osg/AlphaFunc index 0920a3981..0fbf72e4c 100644 --- a/include/osg/AlphaFunc +++ b/include/osg/AlphaFunc @@ -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 diff --git a/include/osg/Billboard b/include/osg/Billboard index 9c0a01ac1..359c8e7b8 100644 --- a/include/osg/Billboard +++ b/include/osg/Billboard @@ -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); diff --git a/include/osg/ClipNode b/include/osg/ClipNode index cd8c03897..98c8d6a04 100644 --- a/include/osg/ClipNode +++ b/include/osg/ClipNode @@ -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); diff --git a/include/osg/ClipPlane b/include/osg/ClipPlane index bf83fb9b3..47eaa8547 100644 --- a/include/osg/ClipPlane +++ b/include/osg/ClipPlane @@ -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 diff --git a/include/osg/ColorMask b/include/osg/ColorMask index f508983c0..062c1208a 100644 --- a/include/osg/ColorMask +++ b/include/osg/ColorMask @@ -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 diff --git a/include/osg/ColorMatrix b/include/osg/ColorMatrix index 79be0cc28..8d29d2a8b 100644 --- a/include/osg/ColorMatrix +++ b/include/osg/ColorMatrix @@ -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 diff --git a/include/osg/CullFace b/include/osg/CullFace index 9d27b17be..ee14bcce7 100644 --- a/include/osg/CullFace +++ b/include/osg/CullFace @@ -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 diff --git a/include/osg/Depth b/include/osg/Depth index 92a76f1c1..bcd858d94 100644 --- a/include/osg/Depth +++ b/include/osg/Depth @@ -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 diff --git a/include/osg/DrawPixels b/include/osg/DrawPixels index 106906fdb..d85235bc7 100644 --- a/include/osg/DrawPixels +++ b/include/osg/DrawPixels @@ -28,6 +28,7 @@ class SG_EXPORT DrawPixels : public Drawable virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "DrawPixels"; } diff --git a/include/osg/Drawable b/include/osg/Drawable index e9046e641..5daa3c3f7 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -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(obj)!=NULL; } + virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "Drawable"; } diff --git a/include/osg/EarthSky b/include/osg/EarthSky index ce83f305e..fd06c39b5 100644 --- a/include/osg/EarthSky +++ b/include/osg/EarthSky @@ -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; } diff --git a/include/osg/Fog b/include/osg/Fog index df74da01e..a00ffdf98 100644 --- a/include/osg/Fog +++ b/include/osg/Fog @@ -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 diff --git a/include/osg/FrontFace b/include/osg/FrontFace index 133741768..bcc49c280 100644 --- a/include/osg/FrontFace +++ b/include/osg/FrontFace @@ -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 diff --git a/include/osg/GeoSet b/include/osg/GeoSet index abd45b3ff..5a21a9258 100644 --- a/include/osg/GeoSet +++ b/include/osg/GeoSet @@ -156,6 +156,7 @@ class SG_EXPORT GeoSet : public Drawable virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast(obj)!=NULL; } + virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "GeoSet"; } diff --git a/include/osg/Geode b/include/osg/Geode index b62aaa8dc..03287ac21 100644 --- a/include/osg/Geode +++ b/include/osg/Geode @@ -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 diff --git a/include/osg/Group b/include/osg/Group index 1cbb03c5a..79a104c57 100644 --- a/include/osg/Group +++ b/include/osg/Group @@ -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); diff --git a/include/osg/Image b/include/osg/Image index 2e9b70ed5..817a9afed 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -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(obj)!=0; } + virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "Image"; } diff --git a/include/osg/Impostor b/include/osg/Impostor index 223d2b601..ff9f44a6b 100644 --- a/include/osg/Impostor +++ b/include/osg/Impostor @@ -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 > ImpostorSpriteList; diff --git a/include/osg/ImpostorSprite b/include/osg/ImpostorSprite index 10c3f8f86..3d49a7df8 100644 --- a/include/osg/ImpostorSprite +++ b/include/osg/ImpostorSprite @@ -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(obj)!=NULL; } + virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "ImpostorSprite"; } /** Set the parent, which must be an Impostor. diff --git a/include/osg/LOD b/include/osg/LOD index 754e0aa65..e67448c4d 100644 --- a/include/osg/LOD +++ b/include/osg/LOD @@ -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); diff --git a/include/osg/Light b/include/osg/Light index 05cd41ffa..9b8495f68 100644 --- a/include/osg/Light +++ b/include/osg/Light @@ -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 diff --git a/include/osg/LightModel b/include/osg/LightModel index e5dcfb26e..8c40ae923 100644 --- a/include/osg/LightModel +++ b/include/osg/LightModel @@ -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 diff --git a/include/osg/LightSource b/include/osg/LightSource index 7e2062767..ea930a950 100644 --- a/include/osg/LightSource +++ b/include/osg/LightSource @@ -23,7 +23,7 @@ class SG_EXPORT LightSource : public Group _value(ls._value), _light(dynamic_cast(copyop(ls._light.get()))) {} - META_Node(LightSource); + META_Node(osg, LightSource); /** Set the attached light.*/ void setLight(Light* light); diff --git a/include/osg/LineStipple b/include/osg/LineStipple index 818cf99ad..6381161d5 100644 --- a/include/osg/LineStipple +++ b/include/osg/LineStipple @@ -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 diff --git a/include/osg/LineWidth b/include/osg/LineWidth index 4d6742fa2..e49fc2523 100644 --- a/include/osg/LineWidth +++ b/include/osg/LineWidth @@ -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 diff --git a/include/osg/Material b/include/osg/Material index 04ebf39b4..94d00f361 100644 --- a/include/osg/Material +++ b/include/osg/Material @@ -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 diff --git a/include/osg/Matrix b/include/osg/Matrix index b0fc0111b..052937564 100644 --- a/include/osg/Matrix +++ b/include/osg/Matrix @@ -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(obj)!=NULL; } \ + virtual const char* libraryName() const { return "osg"; } virtual const char* className() const { return "Matrix"; } virtual ~Matrix() {} diff --git a/include/osg/Node b/include/osg/Node index 4f734cf29..099f9cfeb 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -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(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(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"; } diff --git a/include/osg/Object b/include/osg/Object index 98ba117ad..efe779247 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -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(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(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; diff --git a/include/osg/OccluderNode b/include/osg/OccluderNode index 280ae258e..7f9d5580b 100644 --- a/include/osg/OccluderNode +++ b/include/osg/OccluderNode @@ -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.*/ diff --git a/include/osg/Point b/include/osg/Point index cc8d80e88..5e59189ef 100644 --- a/include/osg/Point +++ b/include/osg/Point @@ -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 diff --git a/include/osg/PolygonMode b/include/osg/PolygonMode index 55b976b50..69d67b375 100644 --- a/include/osg/PolygonMode +++ b/include/osg/PolygonMode @@ -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 diff --git a/include/osg/PolygonOffset b/include/osg/PolygonOffset index 935c6c3ba..441e938fa 100644 --- a/include/osg/PolygonOffset +++ b/include/osg/PolygonOffset @@ -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 diff --git a/include/osg/PositionAttitudeTransform b/include/osg/PositionAttitudeTransform index b0ffc9db0..ee4c03f16 100644 --- a/include/osg/PositionAttitudeTransform +++ b/include/osg/PositionAttitudeTransform @@ -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; } diff --git a/include/osg/Projection b/include/osg/Projection index 042168709..fb4aa72a2 100644 --- a/include/osg/Projection +++ b/include/osg/Projection @@ -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; } diff --git a/include/osg/ShadeModel b/include/osg/ShadeModel index 6db6ad555..7729200a9 100644 --- a/include/osg/ShadeModel +++ b/include/osg/ShadeModel @@ -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 diff --git a/include/osg/StateAttribute b/include/osg/StateAttribute index 0bf45560b..d14923a33 100644 --- a/include/osg/StateAttribute +++ b/include/osg/StateAttribute @@ -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(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(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"; } diff --git a/include/osg/StateSet b/include/osg/StateSet index 43b87bb6d..eb2084f8f 100644 --- a/include/osg/StateSet +++ b/include/osg/StateSet @@ -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(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.*/ diff --git a/include/osg/Stencil b/include/osg/Stencil index 8b7c57ef8..31ad36630 100644 --- a/include/osg/Stencil +++ b/include/osg/Stencil @@ -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 diff --git a/include/osg/Switch b/include/osg/Switch index e6a8618c5..efd439380 100644 --- a/include/osg/Switch +++ b/include/osg/Switch @@ -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); diff --git a/include/osg/TexEnv b/include/osg/TexEnv index 259091170..b45dcea3a 100644 --- a/include/osg/TexEnv +++ b/include/osg/TexEnv @@ -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 diff --git a/include/osg/TexGen b/include/osg/TexGen index 9f4c4b74a..53dda2db8 100644 --- a/include/osg/TexGen +++ b/include/osg/TexGen @@ -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 diff --git a/include/osg/TexMat b/include/osg/TexMat index a274d1e45..b804692f8 100644 --- a/include/osg/TexMat +++ b/include/osg/TexMat @@ -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 diff --git a/include/osg/Texture b/include/osg/Texture index 39d0eb51d..3377ae131 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -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; diff --git a/include/osg/TextureCubeMap b/include/osg/TextureCubeMap index 7ba125488..adb9fd112 100644 --- a/include/osg/TextureCubeMap +++ b/include/osg/TextureCubeMap @@ -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; diff --git a/include/osg/Transform b/include/osg/Transform index c86376702..c7ccf7b6c 100644 --- a/include/osg/Transform +++ b/include/osg/Transform @@ -38,7 +38,7 @@ class SG_EXPORT Transform : public Group Transform(const Matrix& matix); - META_Node(Transform); + META_Node(osg, Transform); enum ReferenceFrame { diff --git a/include/osg/Transparency b/include/osg/Transparency index afde287c9..2ccb7bda5 100644 --- a/include/osg/Transparency +++ b/include/osg/Transparency @@ -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 diff --git a/include/osg/Viewport b/include/osg/Viewport index b91b3471e..e481d9a3b 100644 --- a/include/osg/Viewport +++ b/include/osg/Viewport @@ -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 diff --git a/include/osgParticle/AccelOperator b/include/osgParticle/AccelOperator index da70dbb4b..4abd9d55f 100644 --- a/include/osgParticle/AccelOperator +++ b/include/osgParticle/AccelOperator @@ -24,7 +24,7 @@ namespace osgParticle inline AccelOperator(); inline AccelOperator(const AccelOperator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(AccelOperator); + META_Object(osgParticle, AccelOperator); /// Get the acceleration vector. inline const osg::Vec3 &getAcceleration() const; diff --git a/include/osgParticle/CenteredPlacer b/include/osgParticle/CenteredPlacer index b950f44e8..877826a5c 100644 --- a/include/osgParticle/CenteredPlacer +++ b/include/osgParticle/CenteredPlacer @@ -22,6 +22,7 @@ namespace osgParticle inline CenteredPlacer(); inline CenteredPlacer(const CenteredPlacer ©, const osg::CopyOp ©op = 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(obj) != 0; } diff --git a/include/osgParticle/Counter b/include/osgParticle/Counter index c75db1823..d6059e9b7 100644 --- a/include/osgParticle/Counter +++ b/include/osgParticle/Counter @@ -17,6 +17,7 @@ namespace osgParticle inline Counter(); inline Counter(const Counter ©, const osg::CopyOp ©op = 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(obj) != 0; } diff --git a/include/osgParticle/Emitter b/include/osgParticle/Emitter index 2754985f8..935f14cea 100644 --- a/include/osgParticle/Emitter +++ b/include/osgParticle/Emitter @@ -28,6 +28,7 @@ namespace osgParticle Emitter(); Emitter(const Emitter ©, const osg::CopyOp ©op = 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(obj) != 0; } virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } diff --git a/include/osgParticle/FluidFrictionOperator b/include/osgParticle/FluidFrictionOperator index fb2a681d9..4989016b6 100644 --- a/include/osgParticle/FluidFrictionOperator +++ b/include/osgParticle/FluidFrictionOperator @@ -30,7 +30,7 @@ namespace osgParticle FluidFrictionOperator(); FluidFrictionOperator(const FluidFrictionOperator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(FluidFrictionOperator); + META_Object(osgParticle, FluidFrictionOperator); /// Get the density of the fluid. inline float getFluidDensity() const; diff --git a/include/osgParticle/ForceOperator b/include/osgParticle/ForceOperator index 6da553c38..76bade9f2 100644 --- a/include/osgParticle/ForceOperator +++ b/include/osgParticle/ForceOperator @@ -26,7 +26,7 @@ namespace osgParticle inline ForceOperator(); inline ForceOperator(const ForceOperator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(ForceOperator); + META_Object(osgParticle, ForceOperator); /// Get the force vector. inline const osg::Vec3 &getForce() const; diff --git a/include/osgParticle/Interpolator b/include/osgParticle/Interpolator index a3bc28b31..5bed9ec7f 100644 --- a/include/osgParticle/Interpolator +++ b/include/osgParticle/Interpolator @@ -26,6 +26,7 @@ namespace osgParticle Interpolator(const Interpolator ©, const osg::CopyOp ©op = 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(obj) != 0; } diff --git a/include/osgParticle/LinearInterpolator b/include/osgParticle/LinearInterpolator index a31ff5c03..a0811ab50 100644 --- a/include/osgParticle/LinearInterpolator +++ b/include/osgParticle/LinearInterpolator @@ -25,7 +25,7 @@ namespace osgParticle LinearInterpolator(const LinearInterpolator ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY) : Interpolator(copy, copyop) {} - META_Object(LinearInterpolator); + META_Object(osgParticle, LinearInterpolator); virtual float interpolate(float t, float y1, float y2) const { diff --git a/include/osgParticle/ModularEmitter b/include/osgParticle/ModularEmitter index 1c254ca87..3ffeb7b34 100644 --- a/include/osgParticle/ModularEmitter +++ b/include/osgParticle/ModularEmitter @@ -37,7 +37,7 @@ namespace osgParticle ModularEmitter(); ModularEmitter(const ModularEmitter ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Node(ModularEmitter); + META_Node(osgParticle,ModularEmitter); /// Get the counter object. inline Counter *getCounter(); diff --git a/include/osgParticle/ModularProgram b/include/osgParticle/ModularProgram index f4da376c7..c13494c60 100644 --- a/include/osgParticle/ModularProgram +++ b/include/osgParticle/ModularProgram @@ -28,7 +28,7 @@ namespace osgParticle ModularProgram(); ModularProgram(const ModularProgram ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Node(ModularProgram); + META_Node(osgParticle,ModularProgram); /// Get the number of operators. inline int numOperators() const; diff --git a/include/osgParticle/MultiSegmentPlacer b/include/osgParticle/MultiSegmentPlacer index 8ecbca9cb..8bd1f6e6f 100644 --- a/include/osgParticle/MultiSegmentPlacer +++ b/include/osgParticle/MultiSegmentPlacer @@ -29,7 +29,7 @@ namespace osgParticle { MultiSegmentPlacer(); MultiSegmentPlacer(const MultiSegmentPlacer ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(MultiSegmentPlacer); + META_Object(osgParticle, MultiSegmentPlacer); /// Get the number of vertices which define the segments. inline int numVertices() const; diff --git a/include/osgParticle/Operator b/include/osgParticle/Operator index 09bc364cb..0f9aa19fc 100644 --- a/include/osgParticle/Operator +++ b/include/osgParticle/Operator @@ -28,6 +28,7 @@ namespace osgParticle inline Operator(); inline Operator(const Operator ©, const osg::CopyOp ©op = 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(obj) != 0; } diff --git a/include/osgParticle/ParticleSystem b/include/osgParticle/ParticleSystem index a06d3a7c7..510f31892 100644 --- a/include/osgParticle/ParticleSystem +++ b/include/osgParticle/ParticleSystem @@ -37,7 +37,7 @@ namespace osgParticle ParticleSystem(); ParticleSystem(const ParticleSystem ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(ParticleSystem); + META_Object(osgParticle, ParticleSystem); /// Get the default bounding box inline const osg::BoundingBox &getDefaultBoundingBox() const; diff --git a/include/osgParticle/ParticleSystemUpdater b/include/osgParticle/ParticleSystemUpdater index 2f23341b1..c82725602 100644 --- a/include/osgParticle/ParticleSystemUpdater +++ b/include/osgParticle/ParticleSystemUpdater @@ -32,7 +32,7 @@ namespace osgParticle ParticleSystemUpdater(); ParticleSystemUpdater(const ParticleSystemUpdater ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Node(ParticleSystemUpdater); + META_Node(osgParticle,ParticleSystemUpdater); /// Return the number of particle systems on the list. inline int numParticleSystems() const; diff --git a/include/osgParticle/Placer b/include/osgParticle/Placer index d96dbf90e..767b372d9 100644 --- a/include/osgParticle/Placer +++ b/include/osgParticle/Placer @@ -23,6 +23,7 @@ namespace osgParticle inline Placer(); inline Placer(const Placer ©, const osg::CopyOp ©op = 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(obj) != 0; } diff --git a/include/osgParticle/PointPlacer b/include/osgParticle/PointPlacer index 1143712c3..41f806cc9 100644 --- a/include/osgParticle/PointPlacer +++ b/include/osgParticle/PointPlacer @@ -24,7 +24,7 @@ namespace osgParticle inline PointPlacer(); inline PointPlacer(const PointPlacer ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(PointPlacer); + META_Object(osgParticle, PointPlacer); /** Place a particle. This method is called automatically by ModularEmitter and should not be called diff --git a/include/osgParticle/Program b/include/osgParticle/Program index cfce7ff8b..8eeabc449 100644 --- a/include/osgParticle/Program +++ b/include/osgParticle/Program @@ -28,6 +28,7 @@ namespace osgParticle Program(); Program(const Program ©, const osg::CopyOp ©op = 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(obj) != 0; } virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } diff --git a/include/osgParticle/RadialShooter b/include/osgParticle/RadialShooter index 4bb851f40..d851eabf2 100644 --- a/include/osgParticle/RadialShooter +++ b/include/osgParticle/RadialShooter @@ -29,7 +29,7 @@ namespace osgParticle inline RadialShooter(); inline RadialShooter(const RadialShooter ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(RadialShooter); + META_Object(osgParticle, RadialShooter); /// Get the range of possible values for theta angle. inline const rangef &getThetaRange() const; diff --git a/include/osgParticle/RandomRateCounter b/include/osgParticle/RandomRateCounter index 937017420..98917714e 100644 --- a/include/osgParticle/RandomRateCounter +++ b/include/osgParticle/RandomRateCounter @@ -19,7 +19,7 @@ namespace osgParticle inline RandomRateCounter(); inline RandomRateCounter(const RandomRateCounter ©, const osg::CopyOp ©op = 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; diff --git a/include/osgParticle/SectorPlacer b/include/osgParticle/SectorPlacer index 225f09dac..5f7e57383 100644 --- a/include/osgParticle/SectorPlacer +++ b/include/osgParticle/SectorPlacer @@ -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; diff --git a/include/osgParticle/SegmentPlacer b/include/osgParticle/SegmentPlacer index 381bcd1c8..1d7775a8d 100644 --- a/include/osgParticle/SegmentPlacer +++ b/include/osgParticle/SegmentPlacer @@ -25,7 +25,7 @@ namespace osgParticle { inline SegmentPlacer(); inline SegmentPlacer(const SegmentPlacer ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); - META_Object(SegmentPlacer); + META_Object(osgParticle, SegmentPlacer); /// get vertex A. inline const osg::Vec3 &getVertexA() const; diff --git a/include/osgParticle/Shooter b/include/osgParticle/Shooter index b1ee010e2..bc924975d 100644 --- a/include/osgParticle/Shooter +++ b/include/osgParticle/Shooter @@ -22,6 +22,7 @@ namespace osgParticle inline Shooter(); inline Shooter(const Shooter ©, const osg::CopyOp ©op = 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(obj) != 0; } diff --git a/include/osgText/Font b/include/osgText/Font index c7425de3a..05aa4b52f 100644 --- a/include/osgText/Font +++ b/include/osgText/Font @@ -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(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(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(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(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: diff --git a/include/osgText/Paragraph b/include/osgText/Paragraph index 91dbce3a2..56c18b3be 100644 --- a/include/osgText/Paragraph +++ b/include/osgText/Paragraph @@ -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); diff --git a/include/osgUtil/DepthSortedBin b/include/osgUtil/DepthSortedBin index fe1e93633..287499e25 100644 --- a/include/osgUtil/DepthSortedBin +++ b/include/osgUtil/DepthSortedBin @@ -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(obj)!=0L; } + virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "DepthSortedBin"; } virtual void reset(); diff --git a/include/osgUtil/RenderBin b/include/osgUtil/RenderBin index 0d698756e..c0f824fe2 100644 --- a/include/osgUtil/RenderBin +++ b/include/osgUtil/RenderBin @@ -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(obj)!=0L; } + virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "RenderBin"; } virtual void reset(); diff --git a/include/osgUtil/RenderStageLighting b/include/osgUtil/RenderStageLighting index 92aa44745..f19209906 100644 --- a/include/osgUtil/RenderStageLighting +++ b/include/osgUtil/RenderStageLighting @@ -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(obj)!=0L; } + virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "RenderStageLighting"; } virtual void reset(); diff --git a/include/osgUtil/RenderToTextureStage b/include/osgUtil/RenderToTextureStage index 9082bccad..d2c9edad9 100644 --- a/include/osgUtil/RenderToTextureStage +++ b/include/osgUtil/RenderToTextureStage @@ -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(obj)!=0L; } + virtual const char* libraryName() const { return "osgUtil"; } virtual const char* className() const { return "RenderToTextureStage"; } virtual void reset(); diff --git a/src/osgText/FTGL.h b/src/osgText/FTGL.h index 6ef504537..24ee3db65 100644 --- a/src/osgText/FTGL.h +++ b/src/osgText/FTGL.h @@ -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)