Use of copy-constructors
explicitly initialize the base class in a copy-constructor instead of implicitly calling the default constructor.
This commit is contained in:
parent
4ae7c90d49
commit
aef8f13290
@ -664,7 +664,8 @@ SGPropertyNode::SGPropertyNode ()
|
|||||||
* Copy constructor.
|
* Copy constructor.
|
||||||
*/
|
*/
|
||||||
SGPropertyNode::SGPropertyNode (const SGPropertyNode &node)
|
SGPropertyNode::SGPropertyNode (const SGPropertyNode &node)
|
||||||
: _index(node._index),
|
: SGReferenced(node),
|
||||||
|
_index(node._index),
|
||||||
_name(node._name),
|
_name(node._name),
|
||||||
_parent(0), // don't copy the parent
|
_parent(0), // don't copy the parent
|
||||||
_type(node._type),
|
_type(node._type),
|
||||||
|
@ -90,7 +90,7 @@ Effect::Effect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Effect::Effect(const Effect& rhs, const CopyOp& copyop)
|
Effect::Effect(const Effect& rhs, const CopyOp& copyop)
|
||||||
: root(rhs.root), parametersProp(rhs.parametersProp), _cache(0),
|
: osg::Object(rhs,copyop), root(rhs.root), parametersProp(rhs.parametersProp), _cache(0),
|
||||||
_isRealized(rhs._isRealized)
|
_isRealized(rhs._isRealized)
|
||||||
{
|
{
|
||||||
typedef vector<ref_ptr<Technique> > TechniqueList;
|
typedef vector<ref_ptr<Technique> > TechniqueList;
|
||||||
|
@ -36,6 +36,7 @@ EffectCullVisitor::EffectCullVisitor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
EffectCullVisitor::EffectCullVisitor(const EffectCullVisitor& rhs) :
|
EffectCullVisitor::EffectCullVisitor(const EffectCullVisitor& rhs) :
|
||||||
|
osg::Referenced(rhs),
|
||||||
CullVisitor(rhs)
|
CullVisitor(rhs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ Technique::Technique(bool alwaysValid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Technique::Technique(const Technique& rhs, const osg::CopyOp& copyop) :
|
Technique::Technique(const Technique& rhs, const osg::CopyOp& copyop) :
|
||||||
|
osg::Object(rhs,copyop),
|
||||||
_contextMap(rhs._contextMap), _alwaysValid(rhs._alwaysValid),
|
_contextMap(rhs._contextMap), _alwaysValid(rhs._alwaysValid),
|
||||||
_shadowingStateSet(copyop(rhs._shadowingStateSet.get())),
|
_shadowingStateSet(copyop(rhs._shadowingStateSet.get())),
|
||||||
_validExpression(rhs._validExpression),
|
_validExpression(rhs._validExpression),
|
||||||
|
@ -103,7 +103,7 @@ protected:
|
|||||||
struct ContextInfo : public osg::Referenced
|
struct ContextInfo : public osg::Referenced
|
||||||
{
|
{
|
||||||
ContextInfo() : valid(UNKNOWN) {}
|
ContextInfo() : valid(UNKNOWN) {}
|
||||||
ContextInfo(const ContextInfo& rhs) : valid(rhs.valid()) {}
|
ContextInfo(const ContextInfo& rhs) : osg::Referenced(rhs), valid(rhs.valid()) {}
|
||||||
ContextInfo& operator=(const ContextInfo& rhs)
|
ContextInfo& operator=(const ContextInfo& rhs)
|
||||||
{
|
{
|
||||||
valid = rhs.valid;
|
valid = rhs.valid;
|
||||||
|
@ -34,7 +34,8 @@ public:
|
|||||||
SGSceneUserData() {}
|
SGSceneUserData() {}
|
||||||
SGSceneUserData(const SGSceneUserData& rhs,
|
SGSceneUserData(const SGSceneUserData& rhs,
|
||||||
const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY)
|
const osg::CopyOp& copyOp = osg::CopyOp::SHALLOW_COPY)
|
||||||
: _bvhNode(rhs._bvhNode), _velocity(rhs._velocity),
|
: osg::Object(rhs,copyOp),
|
||||||
|
_bvhNode(rhs._bvhNode), _velocity(rhs._velocity),
|
||||||
_pickCallbacks(rhs._pickCallbacks)
|
_pickCallbacks(rhs._pickCallbacks)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user