9. TUTORIAL 003 : Properties

This tutorial will show you how to add / create properties to a Graph. For local or inherited properties, see tututorial 005. An instance of a property is owned by a graph and is an association table between the elements of graph (nodes and edges) and values of a predefined type.

1. Header files and predefined properties

In tulip API, every type of property is declared in its own header file. Following is a list of those header files and the type of value which can be associated to an element of the graph:

2. Creation of a property.

The creation of a property is accomplished by the function Graph::getLocalProperty<TypeProperty>("name of the property"). This function returns a pointer to a property. The real type of the property is given with the template parameter. If the property of the given name does not yet exists, a new one is created and returned.

Warning

Using of delete on that property will cause a segmentation violation (use delLocalProperty instead).