Moved all references to osg::Cloner to osg::CopyOp.
This commit is contained in:
@@ -19,9 +19,9 @@ class SG_EXPORT AlphaFunc : public StateAttribute
|
||||
|
||||
AlphaFunc();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
AlphaFunc(const AlphaFunc& af,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(af,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
AlphaFunc(const AlphaFunc& af,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(af,copyop),
|
||||
_comparisonFunc(af._comparisonFunc),
|
||||
_referenceValue(af._referenceValue) {}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ class SG_EXPORT Billboard : public Geode
|
||||
|
||||
Billboard();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Billboard(const Billboard&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Billboard(const Billboard&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(Billboard);
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ class SG_EXPORT ClipPlane : public StateAttribute
|
||||
|
||||
ClipPlane();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
ClipPlane(const ClipPlane& cp,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(cp,cloner)
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
ClipPlane(const ClipPlane& cp,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(cp,copyop)
|
||||
{
|
||||
_clipPlane[0]=cp._clipPlane[0];
|
||||
_clipPlane[1]=cp._clipPlane[1];
|
||||
|
||||
@@ -20,9 +20,9 @@ class SG_EXPORT ColorMask : public StateAttribute
|
||||
|
||||
ColorMask();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
ColorMask(const ColorMask& cm,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(cm,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
ColorMask(const ColorMask& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(cm,copyop),
|
||||
_red(cm._red),
|
||||
_green(cm._green),
|
||||
_blue(cm._blue),
|
||||
|
||||
@@ -17,9 +17,9 @@ class SG_EXPORT ColorMatrix : public StateAttribute
|
||||
|
||||
ColorMatrix();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
ColorMatrix(const ColorMatrix& cm,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(cm,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
ColorMatrix(const ColorMatrix& cm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(cm,copyop),
|
||||
_matrix(cm._matrix) {}
|
||||
|
||||
META_StateAttribute(ColorMatrix, COLORMATRIX);
|
||||
|
||||
@@ -19,9 +19,9 @@ class SG_EXPORT CullFace : public StateAttribute
|
||||
|
||||
CullFace();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
CullFace(const CullFace& cf,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(cf,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
CullFace(const CullFace& cf,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(cf,copyop),
|
||||
_mode(cf._mode) {}
|
||||
|
||||
META_StateAttribute(CullFace, CULLFACE);
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
namespace osg {
|
||||
|
||||
|
||||
/** Cloner Functor used to control the whether shallow or deep copy is used
|
||||
* during copy construction and clone operation. The base Cloner acts as
|
||||
/** CopyOp Functor used to control the whether shallow or deep copy is used
|
||||
* during copy construction and clone operation. The base CopyOp acts as
|
||||
* a shallow copy simply passing back the same pointer as passed in.*/
|
||||
struct DeepCopy : public Cloner
|
||||
struct DeepCopy : public CopyOp
|
||||
{
|
||||
|
||||
enum CopyOptions
|
||||
|
||||
@@ -20,9 +20,9 @@ class SG_EXPORT Depth : public StateAttribute
|
||||
|
||||
Depth();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Depth(const Depth& dp,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(dp,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Depth(const Depth& dp,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(dp,copyop),
|
||||
_func(dp._func),
|
||||
_depthWriteMask(dp._depthWriteMask),
|
||||
_zNear(dp._zNear),
|
||||
|
||||
@@ -55,10 +55,10 @@ class SG_EXPORT Drawable : public Object
|
||||
|
||||
Drawable();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Drawable(const Drawable& drawable,const Cloner& cloner=ShallowCopy()):
|
||||
Object(drawable,cloner),
|
||||
_dstate(cloner(drawable._dstate.get())),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Drawable(const Drawable& drawable,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Object(drawable,copyop),
|
||||
_dstate(copyop(drawable._dstate.get())),
|
||||
_supportsDisplayList(drawable._supportsDisplayList),
|
||||
_useDisplayList(drawable._useDisplayList),
|
||||
_globjList(drawable._globjList),
|
||||
|
||||
@@ -26,8 +26,8 @@ class SG_EXPORT EarthSky : public Group
|
||||
|
||||
EarthSky();
|
||||
|
||||
EarthSky(const EarthSky& es, const Cloner& cloner=ShallowCopy()):
|
||||
Group(es,cloner),
|
||||
EarthSky(const EarthSky& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Group(es,copyop),
|
||||
_requiresClear(es._requiresClear),
|
||||
_clearColor(es._clearColor) {}
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ class SG_EXPORT Fog : public StateAttribute
|
||||
|
||||
Fog();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Fog(const Fog& fog,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(fog,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Fog(const Fog& fog,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(fog,copyop),
|
||||
_mode(fog._mode),
|
||||
_density(fog._density),
|
||||
_start(fog._start),
|
||||
|
||||
@@ -18,9 +18,9 @@ class SG_EXPORT FrontFace : public StateAttribute
|
||||
|
||||
FrontFace();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
FrontFace(const FrontFace& ff,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(ff,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
FrontFace(const FrontFace& ff,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(ff,copyop),
|
||||
_mode(ff._mode) {}
|
||||
|
||||
META_StateAttribute(FrontFace, FRONTFACE);
|
||||
|
||||
@@ -147,12 +147,12 @@ class SG_EXPORT GeoSet : public Drawable
|
||||
|
||||
GeoSet();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
GeoSet(const GeoSet& geoset,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
GeoSet(const GeoSet& geoset,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
virtual Object* cloneType() const { return new GeoSet(); }
|
||||
|
||||
virtual Object* clone(const Cloner& cloner) const { return new GeoSet(*this,cloner); }
|
||||
virtual Object* clone(const CopyOp& copyop) const { return new GeoSet(*this,copyop); }
|
||||
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const GeoSet*>(obj)!=NULL; }
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ class SG_EXPORT Geode : public Node
|
||||
|
||||
Geode();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Geode(const Geode&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Geode(const Geode&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(Geode);
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ class SG_EXPORT Group : public Node
|
||||
|
||||
Group();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Group(const Group&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Group(const Group&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(Group);
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ class SG_EXPORT Image : public Object
|
||||
|
||||
Image();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Image(const Image& image,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
virtual Object* cloneType() const { return new Image(); }
|
||||
virtual Object* clone(const Cloner& cloner) const { return new Image(*this,cloner); }
|
||||
virtual Object* clone(const CopyOp& copyop) const { return new Image(*this,copyop); }
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Image*>(obj)!=0; }
|
||||
virtual const char* className() const { return "Image"; }
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ class SG_EXPORT Impostor : public LOD
|
||||
public :
|
||||
Impostor();
|
||||
|
||||
Impostor(const Impostor& es, const Cloner& cloner=ShallowCopy()):
|
||||
LOD(es,cloner),
|
||||
Impostor(const Impostor& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
LOD(es,copyop),
|
||||
_impostorSpriteList(),
|
||||
_impostorThreshold(es._impostorThreshold) {}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class SG_EXPORT ImpostorSprite : public Drawable
|
||||
|
||||
/** Clone on ImpostorSprite just returns a clone of type,
|
||||
* since it is not appropriate to share data of an ImpostorSprite.*/
|
||||
virtual Object* clone(const Cloner&) const { return new ImpostorSprite(); }
|
||||
virtual Object* clone(const CopyOp&) const { return new ImpostorSprite(); }
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ImpostorSprite*>(obj)!=NULL; }
|
||||
virtual const char* className() const { return "ImpostorSprite"; }
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ class SG_EXPORT LOD : public Group
|
||||
|
||||
LOD() {}
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
LOD(const LOD&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
LOD(const LOD&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(LOD);
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ class SG_EXPORT Light : public StateAttribute
|
||||
|
||||
Light();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Light(const Light& light,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(light,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Light(const Light& light,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(light,copyop),
|
||||
_lightnum(light._lightnum),
|
||||
_ambient(light._ambient),
|
||||
_diffuse(light._diffuse),
|
||||
|
||||
@@ -18,9 +18,9 @@ class SG_EXPORT LightSource : public Node
|
||||
|
||||
LightSource();
|
||||
|
||||
LightSource(const LightSource& es, const Cloner& cloner=ShallowCopy()):
|
||||
Node(es,cloner),
|
||||
_light(dynamic_cast<osg::Light*>(cloner(es._light.get()))) {}
|
||||
LightSource(const LightSource& es, const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Node(es,copyop),
|
||||
_light(dynamic_cast<osg::Light*>(copyop(es._light.get()))) {}
|
||||
|
||||
META_Node(LightSource);
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ class SG_EXPORT LineWidth : public StateAttribute
|
||||
|
||||
LineWidth();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
LineWidth(const LineWidth& lw,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(lw,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
LineWidth(const LineWidth& lw,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(lw,copyop),
|
||||
_width(lw._width) {}
|
||||
|
||||
META_StateAttribute(LineWidth, LINEWIDTH);
|
||||
|
||||
@@ -19,9 +19,9 @@ class SG_EXPORT Material : public StateAttribute
|
||||
|
||||
Material();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Material(const Material& mat,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(mat,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Material(const Material& mat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(mat,copyop),
|
||||
_colorMode(mat._colorMode),
|
||||
_ambientFrontAndBack(mat._ambientFrontAndBack),
|
||||
_ambientFront(mat._ambientFront),
|
||||
|
||||
@@ -29,7 +29,7 @@ class SG_EXPORT Matrix : public Object
|
||||
float a30, float a31, float a32, float a33);
|
||||
|
||||
virtual Object* cloneType() const { return new Matrix(); } \
|
||||
virtual Object* clone(const Cloner&) const { return new Matrix(*this); } \
|
||||
virtual Object* clone(const CopyOp&) const { return new Matrix(*this); } \
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Matrix*>(obj)!=NULL; } \
|
||||
virtual const char* className() const { return "Matrix"; }
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class Group;
|
||||
* more convinient to define the required pure virtual methods.*/
|
||||
#define META_Node(name) \
|
||||
virtual osg::Object* cloneType() const { return new name (); } \
|
||||
virtual osg::Object* clone(const osg::Cloner& cloner) const { return new name (*this,cloner); } \
|
||||
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* className() const { return #name; } \
|
||||
virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) nv.apply(*this); } \
|
||||
@@ -42,14 +42,14 @@ class SG_EXPORT Node : public Object
|
||||
bounding sphere dirty flag to true.*/
|
||||
Node();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Node(const Node&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Node(const Node&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
/** clone the an object of the same type as the node.*/
|
||||
virtual Object* cloneType() const { return new Node(); }
|
||||
|
||||
/** return a clone of a node, with Object* return type.*/
|
||||
virtual Object* clone(const Cloner& cloner) const { return new Node(*this,cloner); }
|
||||
virtual Object* clone(const CopyOp& copyop) const { return new Node(*this,copyop); }
|
||||
|
||||
/** 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; }
|
||||
|
||||
@@ -10,16 +10,13 @@
|
||||
|
||||
namespace osg {
|
||||
|
||||
typedef CopyOp Cloner;
|
||||
typedef CopyOp ShallowCopy;
|
||||
|
||||
/** META_Object macro define the standard clone, isSameKindAs and className methods.
|
||||
* 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 new T (); } \
|
||||
virtual osg::Object* clone(const osg::Cloner& cloner) const { return new T (*this,cloner); } \
|
||||
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new 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; }
|
||||
|
||||
@@ -39,9 +36,9 @@ class SG_EXPORT Object : public Referenced
|
||||
concrete classes and can be constructed.*/
|
||||
Object() {}
|
||||
|
||||
/** Copy constructor, optional Cloner object can be used to control
|
||||
/** Copy constructor, optional CopyOp object can be used to control
|
||||
* shallow vs deep copying of dynamic data.*/
|
||||
Object(const Object&,const Cloner& cloner=CopyOp::SHALLOW_COPY);
|
||||
Object(const Object&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
/** Clone the type of an object, with Object* return type.
|
||||
Must be defined by derived classes.*/
|
||||
@@ -49,7 +46,7 @@ class SG_EXPORT Object : public Referenced
|
||||
|
||||
/** Clone the an object, with Object* return type.
|
||||
Must be defined by derived classes.*/
|
||||
virtual Object* clone(const Cloner&) const = 0;
|
||||
virtual Object* clone(const CopyOp&) const = 0;
|
||||
|
||||
virtual bool isSameKindAs(const Object*) const { return true; }
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ class SG_EXPORT Point : public StateAttribute
|
||||
|
||||
Point();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Point(const Point& point,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(point,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Point(const Point& point,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(point,copyop),
|
||||
_size(point._size),
|
||||
_fadeThresholdSize(point._fadeThresholdSize),
|
||||
_distanceAttenuation(point._distanceAttenuation) {}
|
||||
|
||||
@@ -18,9 +18,9 @@ class SG_EXPORT PolygonMode : public StateAttribute
|
||||
|
||||
PolygonMode();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
PolygonMode(const PolygonMode& pm,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(pm,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
PolygonMode(const PolygonMode& pm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(pm,copyop),
|
||||
_frontAndBack(pm._frontAndBack),
|
||||
_modeFront(pm._modeFront),
|
||||
_modeBack(pm._modeBack) {}
|
||||
|
||||
@@ -17,9 +17,9 @@ class SG_EXPORT PolygonOffset : public StateAttribute
|
||||
|
||||
PolygonOffset();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
PolygonOffset(const PolygonOffset& po,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(po,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
PolygonOffset(const PolygonOffset& po,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(po,copyop),
|
||||
_factor(po._factor),
|
||||
_units(po._units) {}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ class SG_EXPORT PositionAttitudeTransform : public Transform
|
||||
public :
|
||||
PositionAttitudeTransform();
|
||||
|
||||
PositionAttitudeTransform(const PositionAttitudeTransform& pat,const Cloner& cloner=ShallowCopy()):
|
||||
Transform(pat,cloner),
|
||||
PositionAttitudeTransform(const PositionAttitudeTransform& pat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Transform(pat,copyop),
|
||||
_position(pat._position),
|
||||
_attitude(pat._attitude) {}
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@ class SG_EXPORT ShadeModel : public StateAttribute
|
||||
|
||||
ShadeModel();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
ShadeModel(const ShadeModel& sm,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(sm,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
ShadeModel(const ShadeModel& sm,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(sm,copyop),
|
||||
_mode(sm._mode) {}
|
||||
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ class StateAttribute;
|
||||
class Node;
|
||||
class Drawable;
|
||||
|
||||
/** Cloner Functor used to control the whether shallow or deep copy is used
|
||||
* during copy construction and clone operation. The base Cloner acts as
|
||||
/** CopyOp Functor used to control the whether shallow or deep copy is used
|
||||
* during copy construction and clone operation. The base CopyOp acts as
|
||||
* a shallow copy simply passing back the same pointer as passed in.*/
|
||||
struct Cloner
|
||||
struct CopyOp
|
||||
{
|
||||
virtual ~Cloner() {}
|
||||
virtual ~CopyOp() {}
|
||||
|
||||
virtual Referenced* operator() (const Referenced* ref) const { return const_cast<Referenced*>(ref); }
|
||||
virtual Object* operator() (const Object* obj) const { return const_cast<Object*>(obj); }
|
||||
@@ -34,7 +34,7 @@ struct Cloner
|
||||
};
|
||||
|
||||
/** Convenience typedef so that users can use the more logical ShallowCopy in their own code.*/
|
||||
typedef Cloner ShallowCopy;
|
||||
typedef CopyOp ShallowCopy;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class StateSet;
|
||||
* subclasses.*/
|
||||
#define META_StateAttribute(name,type) \
|
||||
virtual osg::Object* cloneType() const { return new name(); } \
|
||||
virtual osg::Object* clone(const osg::Cloner& cloner) const { return new name (*this,cloner); } \
|
||||
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* className() const { return #name; } \
|
||||
virtual const Type getType() const { return type; }
|
||||
@@ -149,8 +149,8 @@ class SG_EXPORT StateAttribute : public Object
|
||||
|
||||
StateAttribute() {}
|
||||
|
||||
StateAttribute(const StateAttribute& sa,const Cloner& cloner=ShallowCopy()):
|
||||
Object(sa,cloner) {}
|
||||
StateAttribute(const StateAttribute& sa,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Object(sa,copyop) {}
|
||||
|
||||
|
||||
/** Clone the type of an attribute, with Object* return type.
|
||||
@@ -159,7 +159,7 @@ class SG_EXPORT StateAttribute : public Object
|
||||
|
||||
/** Clone an attribute, with Object* return type.
|
||||
Must be defined by derived classes.*/
|
||||
virtual Object* clone(const Cloner&) const = 0;
|
||||
virtual Object* clone(const CopyOp&) const = 0;
|
||||
|
||||
/** 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; }
|
||||
|
||||
@@ -28,10 +28,10 @@ class SG_EXPORT StateSet : public Object
|
||||
|
||||
|
||||
StateSet();
|
||||
StateSet(const StateSet&,const Cloner& cloner=ShallowCopy());
|
||||
StateSet(const StateSet&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
virtual Object* cloneType() const { return new StateSet(); }
|
||||
virtual Object* clone(const Cloner& cloner) const { return new StateSet(*this,cloner); }
|
||||
virtual Object* clone(const CopyOp& copyop) const { return new StateSet(*this,copyop); }
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const StateSet*>(obj)!=NULL; }
|
||||
virtual const char* className() const { return "StateSet"; }
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ class SG_EXPORT Stencil : public StateAttribute
|
||||
|
||||
Stencil();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Stencil(const Stencil& stencil,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(stencil,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Stencil(const Stencil& stencil,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(stencil,copyop),
|
||||
_func(stencil._func),
|
||||
_funcRef(stencil._funcRef),
|
||||
_funcMask(stencil._funcMask),
|
||||
|
||||
@@ -31,8 +31,8 @@ class SG_EXPORT Switch : public Group
|
||||
|
||||
Switch();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Switch(const Switch&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Switch(const Switch&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Node(Switch);
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ class SG_EXPORT TexEnv : public StateAttribute
|
||||
|
||||
TexEnv();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
TexEnv(const TexEnv& texenv,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(texenv,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
TexEnv(const TexEnv& texenv,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(texenv,copyop),
|
||||
_mode(texenv._mode) {}
|
||||
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ class SG_EXPORT TexGen : public StateAttribute
|
||||
|
||||
TexGen();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
TexGen(const TexGen& texgen,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(texgen,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
TexGen(const TexGen& texgen,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(texgen,copyop),
|
||||
_mode(texgen._mode),
|
||||
_plane_s(texgen._plane_s),
|
||||
_plane_t(texgen._plane_t),
|
||||
|
||||
@@ -17,9 +17,9 @@ class SG_EXPORT TexMat : public StateAttribute
|
||||
|
||||
TexMat();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
TexMat(const TexMat& texmat,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(texmat,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
TexMat(const TexMat& texmat,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(texmat,copyop),
|
||||
_matrix(texmat._matrix) {}
|
||||
|
||||
META_StateAttribute(TexMat, TEXMAT);
|
||||
|
||||
@@ -69,13 +69,13 @@ class SG_EXPORT Texture : public StateAttribute
|
||||
|
||||
Texture();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Texture(const Texture& text,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(text,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Texture(const Texture& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(text,copyop),
|
||||
_handleList(text._handleList),
|
||||
_modifiedTag(text._modifiedTag),
|
||||
_textureObjectSize(text._textureObjectSize),
|
||||
_image(cloner(text._image.get())),
|
||||
_image(copyop(text._image.get())),
|
||||
_textureUnit(text._textureUnit),
|
||||
_wrap_s(text._wrap_s),
|
||||
_wrap_t(text._wrap_t),
|
||||
|
||||
@@ -29,8 +29,8 @@ class SG_EXPORT Transform : public Group
|
||||
|
||||
Transform();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Transform(const Transform&,const Cloner& cloner=ShallowCopy());
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Transform(const Transform&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
Transform(const Matrix& matix);
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ class SG_EXPORT Transparency : public StateAttribute
|
||||
|
||||
Transparency();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Transparency(const Transparency& trans,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(trans,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Transparency(const Transparency& trans,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(trans,copyop),
|
||||
_source_factor(trans._source_factor),
|
||||
_destination_factor(trans._destination_factor) {}
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ class SG_EXPORT Viewport : public StateAttribute
|
||||
|
||||
Viewport();
|
||||
|
||||
/** Copy constructor using Cloner to manage deep vs shallow copy.*/
|
||||
Viewport(const Viewport& vp,const Cloner& cloner=ShallowCopy()):
|
||||
StateAttribute(vp,cloner),
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
Viewport(const Viewport& vp,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
StateAttribute(vp,copyop),
|
||||
_x(vp._x),
|
||||
_y(vp._y),
|
||||
_width(vp._width),
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace osgText {
|
||||
* subclasses.*/
|
||||
#define META_Font(name) \
|
||||
virtual osg::Object* cloneType() const { return new name(); } \
|
||||
virtual osg::Object* clone(const osg::Cloner& cloner) const { return new name (*this,cloner); } \
|
||||
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* className() const { return #name; } \
|
||||
|
||||
@@ -51,8 +51,8 @@ class OSGTEXT_EXPORT Font : public osg::Object
|
||||
public:
|
||||
|
||||
Font();
|
||||
Font(const Font& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
Object(font,cloner),
|
||||
Font(const Font& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
Object(font,copyop),
|
||||
_init(false),
|
||||
_created(false),
|
||||
_font(0L),
|
||||
@@ -113,8 +113,8 @@ class OSGTEXT_EXPORT RasterFont:public Font
|
||||
public:
|
||||
|
||||
RasterFont():Font(){}
|
||||
RasterFont(const RasterFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
Font(font,cloner) {}
|
||||
RasterFont(const RasterFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
Font(font,copyop) {}
|
||||
RasterFont(const std::string& font):Font() {}
|
||||
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RasterFont *>(obj)!=NULL; }
|
||||
@@ -130,8 +130,8 @@ class OSGTEXT_EXPORT VectorFont:public Font
|
||||
{
|
||||
public:
|
||||
VectorFont():Font(){}
|
||||
VectorFont(const VectorFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
Font(font,cloner) {}
|
||||
VectorFont(const VectorFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
Font(font,copyop) {}
|
||||
VectorFont(const std::string& font):Font(){}
|
||||
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const VectorFont *>(obj)!=NULL; }
|
||||
@@ -149,8 +149,8 @@ class OSGTEXT_EXPORT BitmapFont:public RasterFont
|
||||
|
||||
|
||||
BitmapFont() {}
|
||||
BitmapFont(const BitmapFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
RasterFont(font,cloner) {}
|
||||
BitmapFont(const BitmapFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
RasterFont(font,copyop) {}
|
||||
BitmapFont(const std::string& font,
|
||||
int point_size);
|
||||
|
||||
@@ -168,8 +168,8 @@ class OSGTEXT_EXPORT PixmapFont:public RasterFont
|
||||
public:
|
||||
|
||||
PixmapFont() {}
|
||||
PixmapFont(const PixmapFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
RasterFont(font,cloner) {}
|
||||
PixmapFont(const PixmapFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
RasterFont(font,copyop) {}
|
||||
|
||||
PixmapFont(const std::string& font,
|
||||
int point_size);
|
||||
@@ -188,8 +188,8 @@ class OSGTEXT_EXPORT TextureFont:public RasterFont
|
||||
public:
|
||||
|
||||
TextureFont() {}
|
||||
TextureFont(const TextureFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
RasterFont(font,cloner) {}
|
||||
TextureFont(const TextureFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
RasterFont(font,copyop) {}
|
||||
|
||||
TextureFont(const std::string& font,
|
||||
int point_size);
|
||||
@@ -211,8 +211,8 @@ class OSGTEXT_EXPORT OutlineFont:public VectorFont
|
||||
public:
|
||||
|
||||
OutlineFont() {}
|
||||
OutlineFont(const OutlineFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
VectorFont(font,cloner) {}
|
||||
OutlineFont(const OutlineFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
VectorFont(font,copyop) {}
|
||||
|
||||
OutlineFont(const std::string& font,
|
||||
int point_size,
|
||||
@@ -232,8 +232,8 @@ class OSGTEXT_EXPORT PolygonFont:public VectorFont
|
||||
public:
|
||||
|
||||
PolygonFont() {}
|
||||
PolygonFont(const PolygonFont& font,const osg::Cloner& cloner=osg::ShallowCopy()):
|
||||
VectorFont(font,cloner) {}
|
||||
PolygonFont(const PolygonFont& font,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
|
||||
VectorFont(font,copyop) {}
|
||||
|
||||
PolygonFont(const std::string& font,
|
||||
int point_size,
|
||||
|
||||
@@ -15,7 +15,7 @@ class OSGTEXT_EXPORT Paragraph : public osg::Geode
|
||||
public:
|
||||
|
||||
Paragraph();
|
||||
Paragraph(const Paragraph& paragraph,const osg::Cloner& cloner=osg::ShallowCopy());
|
||||
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)
|
||||
|
||||
@@ -67,11 +67,11 @@ class OSGTEXT_EXPORT Text : public osg::Drawable
|
||||
};
|
||||
|
||||
Text();
|
||||
Text(const Text& text,const osg::Cloner& cloner=osg::ShallowCopy());
|
||||
Text(const Text& text,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
|
||||
Text(Font* font);
|
||||
|
||||
virtual osg::Object* cloneType() const { return new Text(); }
|
||||
virtual osg::Object* clone(const osg::Cloner& cloner) const { return new Text(*this,cloner); }
|
||||
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new Text(*this,copyop); }
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Text*>(obj)!=NULL; }
|
||||
virtual const char* className() const { return "Text"; }
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
|
||||
RenderBin();
|
||||
|
||||
virtual osg::Object* cloneType() const { return new RenderBin(); }
|
||||
virtual osg::Object* clone(const osg::Cloner&) const { return new RenderBin(); } // note only implements a clone of type.
|
||||
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* className() const { return "RenderBin"; }
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
||||
|
||||
|
||||
RenderStage();
|
||||
virtual osg::Object* cloneType(const osg::Cloner&) const { return new RenderStage(); }
|
||||
virtual osg::Object* clone(const osg::Cloner&) const { return new RenderStage(); } // note only implements a clone of type.
|
||||
virtual osg::Object* cloneType(const osg::CopyOp&) const { return new RenderStage(); }
|
||||
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStage(); } // note only implements a clone of type.
|
||||
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStage*>(obj)!=0L; }
|
||||
virtual const char* className() const { return "RenderStage"; }
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class OSGUTIL_EXPORT RenderStageLighting : public osg::Object
|
||||
|
||||
RenderStageLighting();
|
||||
virtual osg::Object* cloneType() const { return new RenderStageLighting(); }
|
||||
virtual osg::Object* clone(const osg::Cloner&) const { return new RenderStageLighting(); } // note only implements a clone of type.
|
||||
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* className() const { return "RenderStageLighting"; }
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage
|
||||
|
||||
|
||||
virtual osg::Object* cloneType() const { return new RenderToTextureStage(); }
|
||||
virtual osg::Object* clone(const osg::Cloner&) const { return new RenderToTextureStage(); } // note only implements a clone of type.
|
||||
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* className() const { return "RenderToTextureStage"; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user