19 #include <tulip/PluginProgress.h> 20 #include <tulip/PropertyInterface.h> 23 template<
typename ATTRIBUTETYPE>
28 template<
typename ATTRIBUTETYPE>
31 notifyBeforeSetAttribute(name);
33 notifyAfterSetAttribute(name);
36 template<
typename PropertyType>
40 assert (dynamic_cast<PropertyType *>(prop)!=NULL);
41 return dynamic_cast<PropertyType *
>(prop);
44 PropertyType* prop =
new PropertyType(
this, name);
50 template<
typename PropertyType>
54 assert (dynamic_cast<PropertyType *>(prop)!=NULL);
55 return dynamic_cast<PropertyType *
>(prop);
58 return getLocalProperty<PropertyType>(name);
PropertyType * getLocalProperty(const std::string &name)
Gets a property on this graph. The name of a property identifies it uniquely. Either there already ex...
PropertyInterface describes the interface of a graph property.
void set(const std::string &key, const T &value)
Stores a copy of the given param, associated with the key. The value must have a well-formed copy con...
A container that can store data from any type.
virtual PropertyInterface * getProperty(const std::string &name) const =0
Gets an existing property. In DEBUG mode an assertion checks the existence of the property...
virtual bool existProperty(const std::string &name) const =0
Checks if a property exists in this graph or one of its ancestors.
virtual bool existLocalProperty(const std::string &name) const =0
Checks if a property exists in this graph.
const DataSet & getAttributes() const
Gets the attributes of the graph.
void setAttribute(const std::string &name, const ATTRIBUTETYPE &value)
Sets an attribute on the graph.
bool get(const std::string &key, T &value) const
Returns the stored value associated with the given key. The stored value is a copy of the original va...
bool getAttribute(const std::string &name, ATTRIBUTETYPE &value) const
Gets an attribute on the graph.
virtual void addLocalProperty(const std::string &name, PropertyInterface *prop)=0
Adds a property to the graph. The graph takes ownership of the property. If you want to delete it...