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>
38 if (existLocalProperty(name)) {
40 assert (dynamic_cast<PropertyType *>(prop)!=NULL);
41 return dynamic_cast<PropertyType *
>(prop);
44 PropertyType* prop =
new PropertyType(
this, name);
45 this->addLocalProperty(name, prop);
50 template<
typename PropertyType>
52 if (existProperty(name)) {
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 indentifies it uniquely. Either there already e...
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...
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.