28class UserDataContainer;
39#define _ADDQUOTES(def) #def
40#define ADDQUOTES(def) _ADDQUOTES(def)
46#define META_Object(library,name) \
47 virtual osg::Object* cloneType() const { return new name (); } \
48 virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
49 virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
50 virtual const char* libraryName() const { return #library; }\
51 virtual const char* className() const { return #name; }
54#define OSG_INIT_SINGLETON_PROXY(ProxyName, Func) static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName;
208 if (name)
setName(std::string(name));
280 void setUserValue(
const std::string& name,
const T& value);
321 T* ptr =
dynamic_cast<T*
>(obj.
get());
329 OSG_WARN<<
"Warning: osg::clone(const T*, osg::CopyOp&) cloned object not of type T, returning NULL."<<std::endl;
335 OSG_WARN<<
"Warning: osg::clone(const T*, osg::CopyOp&) passed null object to clone, returning NULL."<<std::endl;
346 newObject->setName(name);
351 OSG_WARN<<
"Warning: osg::clone(const T*, const std::string&, const osg::CopyOp) passed null object to clone, returning NULL."<<std::endl;
363 T* ptr =
dynamic_cast<T*
>(obj.
get());
371 OSG_WARN<<
"Warning: osg::cloneType(const T*) cloned object not of type T, returning NULL."<<std::endl;
377 OSG_WARN<<
"Warning: osg::cloneType(const T*) passed null object to clone, returning NULL."<<std::endl;
#define OSG_WARN
Definition Notify:85
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
void resizeGLObjectBuffers(osg::Object *object, unsigned int maxSize)
Definition Object:396
void releaseGLObjects(osg::Object *object, osg::State *state=0)
Definition Object:400
T * clone(const T *t, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
Definition Object:315
T * cloneType(const T *t)
Definition Object:357
Callback for attaching a script to a Node's via there UserDataContainer for the purpose of overriding...
Definition Callback:134
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Pure virtual base class for drawable geometry.
Definition Drawable:89
Image class for encapsulating the storage texture image data.
Definition Image:179
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
void setUserData(const ref_ptr< T > &ud)
Definition Object:261
virtual const char * libraryName() const =0
return the name of the object's library.
void setUserDataContainer(osg::UserDataContainer *udc)
set the UserDataContainer object.
void setDataVariance(DataVariance dv)
Set the data variance of this object.
Definition Object:228
void setName(const char *name)
Set the name of object using a C style string.
Definition Object:206
void setUserValue(const std::string &name, const T &value)
Convenience method that creates the osg::TemplateValueObject<T> to store the specified value and adds...
Definition ValueObject:377
virtual const UserDataContainer * asUserDataContainer() const
convert 'const this' into a const UserDataContainer pointer if Object is a UserDataContainer,...
Definition Object:179
virtual NodeVisitor * asNodeVisitor()
Convert 'this' into a NodeVisitor pointer if Object is a NodeVisitor, otherwise return 0.
Definition Object:111
virtual void setName(const std::string &name)
Set the name of object using C++ style string.
Definition Object:203
virtual Drawable * asDrawable()
Convert 'this' into a Drawable pointer if Object is a Drawable, otherwise return 0.
Definition Object:151
virtual const StateAttribute * asStateAttribute() const
convert 'const this' into a const StateAttribute pointer if Object is a StateAttribute,...
Definition Object:131
virtual UserDataContainer * asUserDataContainer()
Convert 'this' into a UserDataContainer pointer if Object is a UserDataContainer, otherwise return 0.
Definition Object:175
virtual ValueObject * asValueObject()
Convert 'this' into a ValueObject pointer if Object is a ValueObject, otherwise return 0.
Definition Object:183
virtual const ValueObject * asValueObject() const
Convert 'this' into a ValueObject pointer if Object is a ValueObject, otherwise return 0.
Definition Object:187
virtual const Image * asImage() const
Convert 'this' into a Image pointer if Object is a Image, otherwise return 0.
Definition Object:195
virtual ~Object()
Object destructor.
virtual Object * clone(const CopyOp &) const =0
Clone an object, with Object* return type.
virtual bool isSameKindAs(const Object *) const
Definition Object:85
Object()
Construct an object.
Definition Object:69
virtual Object * cloneType() const =0
Clone the type of an object, with Object* return type.
Object(bool threadSafeRefUnref)
Definition Object:71
virtual const Uniform * asUniform() const
convert 'const this' into a const Uniform pointer if Object is a Uniform, otherwise return 0.
Definition Object:139
virtual CallbackObject * asCallbackObject()
Convert 'this' into a CallbackObject pointer if Object is a CallbackObject, otherwise return 0.
Definition Object:167
virtual const Camera * asCamera() const
convert 'const this' into a const Camera pointer if Node is a Camera, otherwise return 0.
Definition Object:147
virtual StateSet * asStateSet()
Convert 'this' into a StateSet pointer if Object is a StateSet, otherwise return 0.
Definition Object:119
DataVariance
Definition Object:217
@ DYNAMIC
Definition Object:218
@ STATIC
Definition Object:219
@ UNSPECIFIED
Definition Object:220
virtual const char * className() const =0
return the name of the object's class type.
virtual Referenced * getUserData()
Get user data.
virtual Node * asNode()
Convert 'this' into a Node pointer if Object is a Node, otherwise return 0.
Definition Object:103
osg::UserDataContainer * getUserDataContainer()
get the UserDataContainer attached to this object.
Definition Object:243
virtual StateAttribute * asStateAttribute()
Convert 'this' into a StateAttribute pointer if Object is a StateAttribute, otherwise return 0.
Definition Object:127
void setUserDataContainer(const ref_ptr< T > &udc)
Definition Object:240
const osg::UserDataContainer * getUserDataContainer() const
get the const UserDataContainer attached to this object.
Definition Object:246
virtual void computeDataVariance()
Compute the DataVariance based on an assessment of callback etc.
Definition Object:234
virtual Callback * asCallback()
Convert 'this' into a Callback pointer if Object is a Callback, otherwise return 0.
Definition Object:159
virtual const Drawable * asDrawable() const
convert 'const this' into a const Drawable pointer if Object is a Drawable, otherwise return 0.
Definition Object:155
DataVariance _dataVariance
Definition Object:304
virtual const NodeVisitor * asNodeVisitor() const
convert 'const this' into a const NodeVisitor pointer if Object is a NodeVisitor, otherwise return 0.
Definition Object:115
virtual const Callback * asCallback() const
convert 'const this' into a const Callback pointer if Object is a Callback, otherwise return 0.
Definition Object:163
virtual void resizeGLObjectBuffers(unsigned int)
Resize any per context GLObject buffers to specified size.
Definition Object:284
virtual const Referenced * getUserData() const
Get const user data.
osg::UserDataContainer * _userDataContainer
Definition Object:306
virtual Image * asImage()
Convert 'this' into a Image pointer if Object is a Image, otherwise return 0.
Definition Object:191
virtual const Node * asNode() const
convert 'const this' into a const Node pointer if Object is a Node, otherwise return 0.
Definition Object:107
virtual Uniform * asUniform()
Convert 'this' into a Uniform pointer if Object is a Uniform, otherwise return 0.
Definition Object:135
std::string getCompoundClassName() const
return the compound class name that combines the library name and class name.
Definition Object:98
virtual Camera * asCamera()
Convert 'this' into a Camera pointer if Node is a Camera, otherwise return 0.
Definition Object:143
virtual const CallbackObject * asCallbackObject() const
convert 'const this' into a const CallbackObject pointer if Object is a CallbackObject,...
Definition Object:171
const std::string & getName() const
Get the name of object.
Definition Object:213
virtual void setThreadSafeRefUnref(bool threadSafe)
Set whether to use a mutex to ensure ref() and unref() are thread safe.
Object(const Object &, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor, optional CopyOp object can be used to control shallow vs deep copying of dynamic da...
virtual const StateSet * asStateSet() const
convert 'const this' into a const StateSet pointer if Object is a StateSet, otherwise return 0.
Definition Object:123
virtual void releaseGLObjects(osg::State *=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
Definition Object:289
bool getUserValue(const std::string &name, T &value) const
Convenience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value.
osg::UserDataContainer * getOrCreateUserDataContainer()
Convenience method that returns the UserDataContainer, and if one doesn't already exist creates and a...
std::string _name
Definition Object:303
virtual void setUserData(Referenced *obj)
Set user data, data must be subclassed from Referenced to allow automatic memory handling.
DataVariance getDataVariance() const
Get the data variance of this object.
Definition Object:231
DummyObject()
Definition Object:386
META_Object(osg, DummyObject) protected
Definition Object:390
DummyObject(const DummyObject &org, const CopyOp ©op)
Definition Object:387
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
T * release()
release the pointer from ownership by this ref_ptr<>, decrementing the objects refencedCount() via un...
Definition ref_ptr:126
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
Stores a set of modes and attributes which represent a set of OpenGL state.
Definition StateSet:46
Uniform encapsulates glUniform values.
Definition Uniform:414
Internal structure for storing all user data.
Definition UserDataContainer:26
Definition ValueObject:67
#define OSG_EXPORT
Definition Export:39