14#ifndef PROPERTYMANAGER
15#define PROPERTYMANAGER 1
42 bool getProperty(
const std::string& name, T& value)
const
44 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(
_mutex);
52 void setProperty(
const std::string& name,
const T& value)
54 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(
_mutex);
74 const UserValueObject* uvo =
dynamic_cast<const UserValueObject*
>(object);
78 value = uvo->getValue();
105 std::string propertyName;
108 OSG_NOTICE<<
"Reading propertyName="<<propertyName<<std::endl;
115 OSG_NOTICE<<
"Reading value="<<value<<std::endl;
144 typedef std::map<double, osg::ref_ptr<osg::UserDataContainer> >
KeyFrameMap;
#define OSG_NOTICE
Definition Notify:86
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
std::vector< Node * > NodePath
A vector of Nodes pointers which is used to describe the path from a root node to a descendant.
Definition Node:47
The osgPresentation library is a NodeKit that extends the core scene graph to support 3D scene graph ...
Definition AnimationMaterial:26
bool getUserValue(const osg::NodePath &nodepath, const std::string &name, T &value)
Definition PropertyManager:70
OSGPRESENTATION_EXPORT const osg::Object * getUserObject(const osg::NodePath &nodepath, const std::string &name)
OSGPRESENTATION_EXPORT bool containsPropertyReference(const std::string &str)
Deprecated.
Definition Callback:215
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
Image Buffer class.
Definition ImageSequence:29
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 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
Object()
Construct an object.
Definition Object:69
bool getUserValue(const std::string &name, T &value) const
Convenience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value.
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
int unref() const
Decrement the reference count by one, indicating that a pointer to this object is no longer referenci...
Definition Referenced:178
int ref() const
Increment the reference count by one, indicating that this object has another pointer which is refere...
Definition Referenced:161
Internal structure for storing all user data.
Definition UserDataContainer:26
Definition ValueObject:283
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
GUIEventHandler provides a basic interface for any class which wants to handle a GUI Events.
Definition GUIEventHandler:50
Definition PropertyManager:30
int unref() const
Definition PropertyManager:59
META_Object(osgPresentation, PropertyManager) template< typename T > bool getProperty(const std
Convenience method that casts the named UserObject to osg::TemplateValueObject<T> and gets the value.
Definition PropertyManager:37
PropertyManager(const PropertyManager &pm, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
Definition PropertyManager:34
OpenThreads::Mutex _mutex
Definition PropertyManager:63
PropertyManager()
Definition PropertyManager:33
int ref() const
Definition PropertyManager:58
PropertyReader & operator>>(T &value)
Definition PropertyManager:121
osg::NodePath _nodePath
Definition PropertyManager:127
PropertyReader(const osg::NodePath &nodePath, const std::string &str)
Definition PropertyManager:91
bool ok()
Definition PropertyManager:123
bool read(T &value)
Definition PropertyManager:97
std::istringstream _sstream
Definition PropertyManager:128
bool fail()
Definition PropertyManager:124
bool _errorGenerated
Definition PropertyManager:126
double _firstTime
Definition PropertyManager:175
PropertyManager * getPropertyManager() const
Definition PropertyManager:142
double _latestTime
Definition PropertyManager:176
void assign(osg::UserDataContainer *destination, osg::UserDataContainer *source)
const KeyFrameMap & getKeyFrameMap() const
Definition PropertyManager:147
virtual void update(osg::Node &node)
KeyFrameMap & getKeyFrameMap()
Definition PropertyManager:146
KeyFrameMap _keyFrameMap
Definition PropertyManager:173
void setPropertyManager(PropertyManager *pm)
Definition PropertyManager:141
bool getPause() const
Definition PropertyManager:157
PropertyAnimation()
Definition PropertyManager:135
double _pauseTime
Definition PropertyManager:178
bool _pause
Definition PropertyManager:177
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
Callback method called by the NodeVisitor when visiting a node.
osg::ref_ptr< PropertyManager > _pm
Definition PropertyManager:168
void setPause(bool pause)
std::map< double, osg::ref_ptr< osg::UserDataContainer > > KeyFrameMap
Definition PropertyManager:144
void addKeyFrame(double time, osg::UserDataContainer *udc)
Definition PropertyManager:149
void assign(osg::UserDataContainer *udc, osg::Object *obj)
double getAnimationTime() const
ImageSequenceUpdateCallback(osg::ImageSequence *is, PropertyManager *pm, const std::string &propertyName)
Definition PropertyManager:186
osg::ref_ptr< osg::ImageSequence > _imageSequence
Definition PropertyManager:193
virtual void operator()(osg::Node *node, osg::NodeVisitor *nv)
Callback method called by the NodeVisitor when visiting a node.
std::string _propertyName
Definition PropertyManager:195
osg::ref_ptr< PropertyManager > _propertyManager
Definition PropertyManager:194
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
Deprecated, Handle events, return true if handled, false otherwise.
osg::ref_ptr< PropertyManager > _propertyManager
Definition PropertyManager:205
PropertyEventCallback(PropertyManager *pm)
Definition PropertyManager:200
#define OSGPRESENTATION_EXPORT
Definition Export:38