Tulip  5.1.0
Large graphs analysis and drawing
PropertyInterface.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 
20 #ifndef PROPERTY_INTERFACE_H
21 #define PROPERTY_INTERFACE_H
22 
23 #include <string>
24 #include <iostream>
25 #include <tulip/tulipconf.h>
26 #include <tulip/Observable.h>
27 #include <tulip/Node.h>
28 #include <tulip/Edge.h>
29 
30 namespace tlp {
31 
32 struct DataMem;
33 
34 class Graph;
35 template<class itType >
36 struct Iterator;
37 
38 //=============================================================
39 /**
40  * @ingroup Graph
41  * @brief PropertyInterface describes the interface of a graph property.
42  *
43  * The intent of a property is to hold a value for each node and edge (e.g. the degree of the nodes).
44  *
45  * A property can be used in two different ways :
46  * Either it is attached to a graph; and in this case creating and deleting the property is handled by the graph
47  * (@see Graph::getProperty()).
48  *
49  * Either is is detached from a graph, and you have to handle creation and deletion yourself.
50  * This is most useful for some algorithms that need a temporary property, but do not want the property to appear on the graph
51  * after the computation.
52  */
53 class TLP_SCOPE PropertyInterface: public Observable {
54  friend class PropertyManager;
55 protected:
56  // name of the property when registered as a property of a graph
57  std::string name;
58  // the graph for whom the property is registered
59  Graph *graph;
60 
61 public:
63 
64  virtual ~PropertyInterface();
65 
66  /**
67  * @brief Erases the value stored for the given node.
68  * The new value for the node is the default value.
69  */
70  virtual void erase(const node) = 0;
71 
72  /**
73  * @brief Erases the value stored for the given edge.
74  * The new value for the edge is the default value.
75  */
76  virtual void erase(const edge) = 0;
77 
78  /**
79  * @brief Copies the value of a node in another property to a node in this property.
80  * @param destination The node whose value will be set.
81  * @param source The node whose value to copy.
82  * @param property The property from which to copy the source node value.
83  * @param ifNotDefault If true, the copy will only be performed if the source node's value is not the default value.
84  * @return True if the copy was performed, false otherwise.
85  */
86  virtual bool copy(const node destination, const node source, PropertyInterface *property,
87  bool ifNotDefault = false) =0;
88  /**
89  * @brief Copies the value of an edge in another property to an edge in this property.
90  * @param destination The edge whose value will be set.
91  * @param source The edge whose value to copy.
92  * @param property The property from which to copy the source edge value.
93  * @param ifNotDefault If true, the copy will only be performed if the source edge's value is not the default value.
94  * @return True if the copy was performed, false otherwise.
95  */
96  virtual bool copy(const edge destination, const edge source, PropertyInterface *property,
97  bool ifNotDefault = false) =0;
98 
99  /**
100  * @brief Copies the values of the source property to this property.
101  * @param source The property from which to copy values.
102  * @warning Be careful when using this method, if you are interested by observing the updates of the values of the current property, because no event is sent for nodes/edges whose value is the default value of the source property.
103  */
104  virtual void copy(PropertyInterface* source) = 0;
105 
106  /**
107  * @brief Creates a property of the same type (e.g. tlp::DoubleProperty) in the graph.
108  * The new property will not contain a copy of this property's values.
109  * @param graph The Graph in which to create the new property.
110  * @param name The name of the new property.
111  * @return The newly created property.
112  */
113  virtual PropertyInterface* clonePrototype(Graph *graph, const std::string& name) const =0;
114 
115  /**
116  * @brief Gets a string describing the type of the property (e.g. "graph", "double", "layout", "string", "integer", "color", "size").
117  * @return The name of this property's type.
118  */
119  virtual const std::string& getTypename() const = 0;
120 
121  /**
122  * @brief Gets the name of the property (e.g. viewLayout).
123  * @return The name of this property.
124  */
125  const std::string& getName() const {
126  return name;
127  }
128 
129  /**
130  * @brief Rename a property
131  * @param the new name
132  * @return returns true if the renaming succeeded.
133  * It may fails if a property with the given name already exists
134  */
135  bool rename(const std::string& newName);
136  /**
137  * @cond DOXYGEN_HIDDEN
138  * @brief Gets the graph on which this property has been defined.
139  * This is an internal function and its behavior can change.
140  * DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING.
141  *
142  * Be wary that is might be a different graph that the one you used to get this property.
143  * For instance:
144  * @code
145  * Graph* g = tlp::newGraph();
146  * Graph*sub = g->addCloneSubGraph();
147  *
148  * IntegerProperty* prop = g->getProperty<IntegerProperty>("test");
149  * //prop->getGraph() returns g
150  *
151  * IntegerProperty* prop2 = sub->getProperty<IntegerProperty>("test");
152  * //prop2->getGraph() returns g
153  * @endcode
154  *
155  * This is due to the inheritance system of the properties.
156  *
157  * @return The Graph this property is local to.
158  * @endcond
159  */
160  tlp::Graph * getGraph() const {
161  return graph;
162  }
163 
164  /**
165  * @brief Gets a string representation of the node default value.
166  * @param n The node to get the value of.
167  * @return A string representation of the node default value.
168  */
169  virtual std::string getNodeStringValue( const node n ) const = 0;
170 
171  /**
172  * @brief Gets a string representation of the edge default value.
173  * @param e The edge to get the value of.
174  * @return A string representation of the edge default value.
175  */
176  virtual std::string getEdgeStringValue( const edge e ) const = 0;
177 
178  /**
179  * @brief Sets a new value on the node, represented by the string parameter.
180  * @param n The node on which to set the new value.
181  * @param value A string representing the value to set on the node.
182  * @return Whether the string was a correct representation for this property's type. If not, the value is not set.
183  */
184  virtual bool setNodeStringValue( const node n, const std::string & value ) = 0;
185 
186  /**
187  * @brief Sets a new value on the edge, represented by the string parameter.
188  * @param e The edge on which to set value on.
189  * @param value A string representing the value to set on the edge.
190  * @return Whether the string was a correct representation for this property's type. If not, the value is not set.
191  */
192  virtual bool setEdgeStringValue( const edge e, const std::string & value ) = 0;
193 
194  /**
195  * @brief Gets a string representation of the node default value.
196  * @return A string representation of the node default value.
197  */
198  virtual std::string getNodeDefaultStringValue() const = 0;
199 
200  /**
201  * @brief Gets a string representation of the edge default value.
202  * @return A string representation of the edge default value.
203  */
204  virtual std::string getEdgeDefaultStringValue() const = 0;
205 
206  /**
207  * @brief Sets the value assigned as the default one to the future added nodes from a string representation.
208  *
209  * @since Tulip 5.0
210  *
211  * @param value A string representing the new value to set on future added nodes.
212  *
213  * @return Whether the given string was a correct representation for this property's type. If not, the default value is not set.
214  */
215  virtual bool setNodeDefaultStringValue( const std::string & value ) = 0;
216 
217  /**
218  * @brief Sets all the nodes value to the value represented by the string. For some types, some parsing will be necessary (e.g. LayoutProperty).
219  * All previous values are lost and the represented value is assigned as the default one to the future added nodes.
220  *
221  * @param value A string representing the new value to set on all the nodes.
222  *
223  * @return Whether the given string was a correct representation for this property's type. If not, the values are not set.
224  */
225  virtual bool setAllNodeStringValue( const std::string & value ) = 0;
226 
227  /**
228  * @brief Sets all the nodes value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty).
229  * Only the nodes from that graph will have their value modified in the property
230  * and the default node value will not be modified.
231  *
232  * @since Tulip 4.10
233  *
234  * @deprecated Since Tulip 5.0 this method signature is deprecated use method setStringValueToGraphNodes instead
235  *
236  * @param value A string representing the new value to set on all the nodes.
237  * @param graph A graph that defines the set of nodes.
238  *
239  * @warning If the provided graph is not a descendant of the one associated to that property (including itself), no node value will be modified in it.
240  *
241  * @return Whether the given string was a correct representation for this property's type. If not, the values are not set.
242  */
243  _DEPRECATED virtual bool setAllNodeStringValue( const std::string & value, const Graph *graph ) = 0;
244 
245  /**
246  * @brief Sets all the nodes value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty).
247  * Only the nodes from that graph will have their value modified in the property
248  * and the default node value will not be modified.
249  *
250  * @since Tulip 5.0
251  *
252  * @param value A string representing the new value to set on all the nodes.
253  * @param graph A graph that defines the set of nodes.
254  *
255  * @warning If the provided graph is not a descendant of the one associated to that property (including itself), no node value will be modified in it.
256  *
257  * @return Whether the given string was a correct representation for this property's type. If not, the values are not set.
258  */
259  virtual bool setStringValueToGraphNodes( const std::string & value, const Graph *graph ) = 0;
260 
261  /**
262  * @brief Sets the value assigned as the default one to the future added edges from a string representation.
263  *
264  * @since Tulip 5.0
265  *
266  * @param value A string representing the new value to set on future added edges.
267  *
268  * @return Whether the given string was a correct representation for this property's type. If not, the default value is not set.
269  */
270  virtual bool setEdgeDefaultStringValue( const std::string & value ) = 0;
271 
272  /**
273  * @brief Sets all the edges value to the value represented by the string. For some types, some parsing will be necessary (e.g. LayoutProperty).
274  * All previous values are lost and the represented value is assigned as the default one to the future added edges.
275  *
276  * @param value A string representing the new value to set on all the edges.
277  *
278  * @return Whether the given string was a correct representation for this property's type. If not, the values are not set.
279  */
280  virtual bool setAllEdgeStringValue( const std::string & value ) = 0;
281 
282  /**
283  * @brief Sets all the edges value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty).
284  * Only the edges from that graph will have their value modified in the property
285  * and the default edge value will not be modified.
286  *
287  * @since Tulip 4.10
288  *
289  * @deprecated Since Tulip 5.0 this method signature is deprecated use method setStringValueToGraphEdges instead
290  *
291  * @param value A string representing the new value to set on all the edges.
292  * @param graph A graph that defines the set of edges.
293  *
294  * @warning If the provided graph is not a descendant of the one associated to that property (including itself), no edge value will be modified in it.
295  *
296  * @return Whether the given string was a correct representation for this property's type. If not, the values are not set.
297  */
298  _DEPRECATED virtual bool setAllEdgeStringValue( const std::string & value, const Graph *graph ) = 0;
299 
300  /**
301  * @brief Sets all the edges value to the value represented by the string for a graph. For some types, some parsing will be necessary (e.g. LayoutProperty).
302  * Only the edges from that graph will have their value modified in the property
303  * and the default edge value will not be modified.
304  *
305  * @since Tulip 5.0
306  *
307  * @param value A string representing the new value to set on all the edges.
308  * @param graph A graph that defines the set of edges.
309  *
310  * @warning If the provided graph is not a descendant of the one associated to that property (including itself), no edge value will be modified in it.
311  *
312  * @return Whether the given string was a correct representation for this property's type. If not, the values are not set.
313  */
314  virtual bool setStringValueToGraphEdges( const std::string & value, const Graph *graph ) = 0;
315 
316  /**
317  * @brief Gets a pointer to the tlp::DataMem structure that contains the node default value.
318  * @return The DataMem structure containing the node default value.
319  * @warning The ownership of this pointer is given to the caller.
320  */
321  virtual DataMem* getNodeDefaultDataMemValue() const = 0;
322 
323  /**
324  * @brief Gets a pointer to the tlp::DataMem structure that contains the edge default value.
325  * @return The DataMem structure containing the edge default value.
326  * @warning The ownership of this pointer is given to the caller.
327  */
328  virtual DataMem* getEdgeDefaultDataMemValue() const = 0;
329 
330  /**
331  * @brief Sets all the nodes value to the value contained in the given DataMem structure.
332  * All previous values are lost.
333  * @param value The value to set on all the nodes.
334  */
335  virtual void setAllNodeDataMemValue(const DataMem* value) = 0;
336 
337  /**
338  * @brief Sets all the edges value to the value contained in the given DataMem structure.
339  * All previous values are lost.
340  * @param value The value to set on all the edges.
341  */
342  virtual void setAllEdgeDataMemValue(const DataMem* v ) = 0;
343 
344  /**
345  * @brief Gets the node value, contained in a tlp::DataMem structure.
346  * @param n The node to get the value of.
347  * @return The value of the node, in a tlp::DataMem.
348  *
349  * @warning The ownership of this pointer is given to the caller.
350  */
351  virtual DataMem* getNodeDataMemValue( const node n ) const = 0;
352 
353  /**
354  * @brief Gets the edge value, contained in a tlp::DataMem structure.
355  * @param n The edge to get the value of.
356  * @return The value of the edge, in a tlp::DataMem.
357  *
358  * @warning The ownership of this pointer is given to the caller.
359  */
360  virtual DataMem* getEdgeDataMemValue( const edge e ) const = 0;
361 
362  /**
363  * @brief Returns the value in a DataMem if it is not default, otherwise returns NULL.
364  * @param n The node to get the value of.
365  * @return The value of the node if it is not default, or NULL.
366  *
367  * @warning The ownership of this pointer is given to the caller.
368  */
369  virtual DataMem* getNonDefaultDataMemValue( const node n ) const = 0;
370 
371  /**
372  * @brief Returns the value in a DataMem if it is not default, otherwise returns NULL.
373  * @param e The edge to get the value of.
374  * @return The value of the edge if it is not default, or NULL.
375  *
376  * @warning The ownership of this pointer is given to the caller.
377  */
378  virtual DataMem* getNonDefaultDataMemValue( const edge e ) const = 0;
379 
380  /**
381  * @brief Sets the node value.
382  * @param n The node to set the value of.
383  * @param value The value to set to this node.
384  */
385  virtual void setNodeDataMemValue( const node n, const DataMem* value) = 0;
386 
387  /**
388  * @brief Sets the edge value.
389  * @param e The edge to set the value of.
390  * @param value The value to set to this edge.
391  */
392  virtual void setEdgeDataMemValue( const edge e, const DataMem* v) = 0;
393 
394  /**
395  * @brief Gets an Iterator on all non-default valuated nodes.
396  * When given a Graph as parameter, only nodes belonging to this graph are iterated over.
397  * @return An Iterator over nodes whose value is not default.
398  *
399  * @warning The ownership of the iterator is given to the caller.
400  */
401  virtual tlp::Iterator<node>* getNonDefaultValuatedNodes(const Graph* = NULL) const = 0;
402 
403  /**
404  * @brief Returns the number of nodes with a non default value.
405  * When given a Graph as parameter, only the number of nodes with a non default value belonging to this graph is returned.
406  * @return the number of nodes with a non default value.
407  *
408  */
409  virtual unsigned int numberOfNonDefaultValuatedNodes(const Graph* = NULL) const = 0;
410 
411  /**
412  * @brief Gets an Iterator on all non-default valuated edges.
413  * When given a Graph as parameter, only edges belonging to this graph are iterated over.
414  * @return An Iterator over edges whose value is not default.
415  *
416  * @warning The ownership of the iterator is given to the caller.
417  */
418  virtual tlp::Iterator<edge>* getNonDefaultValuatedEdges(const Graph* = NULL) const = 0;
419 
420  /**
421  * @brief Returns the number of edges with a non default value.
422  * @return the number of edges with a non default value.
423  *
424  */
425  virtual unsigned int numberOfNonDefaultValuatedEdges(const Graph* = NULL) const = 0;
426 
427  /**
428  * @brief Returns the size in bytes of a node's value.
429  * @return the size of a node's value (0 means the size is not fixed)
430  *
431  */
432  virtual unsigned int nodeValueSize() const = 0;
433 
434  /**
435  * @brief Writes the nodes default value
436  *
437  */
438  virtual void writeNodeDefaultValue(std::ostream&) const = 0;
439 
440  /**
441  * @brief Writes the value of a node
442  *
443  */
444  virtual void writeNodeValue(std::ostream&, node) const = 0;
445 
446  /**
447  * @brief Reads the nodes default value
448  *
449  */
450  virtual bool readNodeDefaultValue(std::istream&) = 0;
451 
452  /**
453  * @brief Reads the value of a node
454  *
455  */
456  virtual bool readNodeValue(std::istream&, node) = 0;
457 
458  /**
459  * @brief Returns the size in bytes of an edge's value.
460  * @return the size of a node's value (0 means the size is not fixed)
461  *
462  */
463  virtual unsigned int edgeValueSize() const = 0;
464 
465  /**
466  * @brief Writes the edges default value
467  *
468  */
469  virtual void writeEdgeDefaultValue(std::ostream&) const = 0;
470 
471  /**
472  * @brief Writes the value of an edge
473  *
474  */
475  virtual void writeEdgeValue(std::ostream&, edge) const = 0;
476 
477  /**
478  * @brief Reads the edges default value
479  *
480  */
481  virtual bool readEdgeDefaultValue(std::istream&) = 0;
482 
483  /**
484  * @brief Reads the value of an edge
485  *
486  */
487  virtual bool readEdgeValue(std::istream&, edge) = 0;
488 
489  /**
490  * @brief Sets the value of the metanode to a computed value.
491  *
492  * The value is computed by this property's MetaValueCalculator.
493  * @param metaNode The metanode to compute a value on.
494  * @param subgraph The subgraph pointed by the metanode.
495  * @param metaGraph The graph who owns the meta node.
496  */
497  virtual void computeMetaValue(node metaNode, Graph* subgraph, Graph* metaGraph)=0;
498 
499  /**
500  * @brief Sets the value of the metaedge to a computed value.
501  * @param metaEdge The meta edge to compute a value on.
502  * @param it The edges represented by the meta edge.
503  * @param metaGraph The graph who owns the meta edge.
504  */
505  virtual void computeMetaValue(edge metaEdge, tlp::Iterator<edge>* it, Graph* metaGraph)=0;
506 
507  /**
508  * @brief Base class for computing values on meta nodes and edges.
509  */
511  public:
512  virtual ~MetaValueCalculator() {}
513  };
514 
515  /**
516  * @brief Gets the MetaValueCalculator of this property.
517  * @return The MetaValueCalculator of this property
518  */
520  return metaValueCalculator;
521  }
522 
523  /**
524  * @brief Sets the Calculator for meta nodes and edges.
525  * @param calculator The object containing the logic for computing the meta values for the nodes and edges.
526  *
527  * @warning The ownership of the MetaValueCalculator is not taken by the property.
528  */
529  virtual void setMetaValueCalculator(MetaValueCalculator* calculator) {
530  metaValueCalculator = calculator;
531  }
532 
533  /**
534  * @brief Compares the value this property holds for the two given nodes.
535  * @param n1 The first node to compare the value of.
536  * @param n2 The second node to compare the value of.
537  * @return 0 if the values are identical, a positive value if n1 is greater than n2, and a negative value if n1 is less than n2.
538  */
539  virtual int compare(const node n1,const node n2) const = 0;
540 
541  /**
542  * @brief Compares the value this property holds for the two given edges.
543  * @param e1 The first edge to compare the value of.
544  * @param e2 The second edge to compare the value of.
545  * @return 0 if the values are identical, a positive value if e1 is greater than e2, and a negative value if e1 is less than e2.
546  */
547  virtual int compare(const edge e1,const edge e2) const = 0;
548 
549 protected:
550  MetaValueCalculator* metaValueCalculator;
551 
552  // for notification of PropertyObserver
553  void notifyBeforeSetNodeValue(const node n);
554  void notifyAfterSetNodeValue(const node n);
555  void notifyBeforeSetEdgeValue(const edge e);
556  void notifyAfterSetEdgeValue(const edge e);
557  void notifyBeforeSetAllNodeValue();
558  void notifyAfterSetAllNodeValue();
559  void notifyBeforeSetAllEdgeValue();
560  void notifyAfterSetAllEdgeValue();
561  void notifyDestroy();
562  void notifyRename(const std::string& newName);
563 };
564 
565 /**
566  * @ingroup Graph
567  * @brief VectorPropertyInterface describes the interface of a graph property whose holded value is a vector (std::vector)
568  *
569  */
571 public:
573 
575 
576  /**
577  * @brief Sets a new vector represented by the string parameter as the node value.
578  * @param n The node on which to set the new value.
579  * @param value A string listing the elements of the vector to set on the node.
580  * @param openChar an optional character opening the list of elements. Default value is '('; when set to '\0' it indicates that there is no opening character.
581  * @param sepChar an optional character separing the elements of the list. Default value is ','.
582  * @param closeChar an optional character closing the list of elements. Default value is ')'; when set to '\0' it indicates that there is no opening character.
583  * @return Whether the string was a correct representation for this property's type. If not, the value is not set.
584  */
585  virtual bool setNodeStringValueAsVector(const node n, const std::string & value, char openChar = '(', char sepChar = ',', char closeChar = ')') = 0;
586 
587  /**
588  * @brief Sets a new vector represented by the string parameter as the edge value.
589  * @param e The edge on which to set value on.
590  * @param value A string listing the elements of the vector to set on the edge.
591  * @param openChar an optional character opening the list of elements. Default value is '('; when set to '\0' it indicates that there is no opening character.
592  * @param sepChar an optional character separing the elements of the list. Default value is ','.
593  * @param closeChar an optional character closing the list of elements. Default value is ')'; when set to '\0' it indicates that there is no opening character.
594  * @return Whether the string was a correct representation for this property's type. If not, the value is not set.
595  */
596  virtual bool setEdgeStringValueAsVector(const edge e, const std::string & value, char openChar = '(', char sepChar = ',', char closeChar = ')') = 0;
597 };
598 
599 /**
600  * @ingroup Observation
601  * @brief Contains additional information about events on a property,
602  * such as the property it happened on, the node/edge eventually concerned and such.
603  * It also contains the detailed type of the event.
604  */
605 class TLP_SCOPE PropertyEvent :public Event {
606 public:
607 
608  // be careful about the ordering of the constants
609  // in the enum below because it is used in some assertions
610  enum PropertyEventType {TLP_BEFORE_SET_NODE_VALUE = 0,
611  TLP_AFTER_SET_NODE_VALUE,
612  TLP_BEFORE_SET_ALL_NODE_VALUE,
613  TLP_AFTER_SET_ALL_NODE_VALUE,
614  TLP_BEFORE_SET_ALL_EDGE_VALUE,
615  TLP_AFTER_SET_ALL_EDGE_VALUE,
616  TLP_BEFORE_SET_EDGE_VALUE,
617  TLP_AFTER_SET_EDGE_VALUE
618  };
619  PropertyEvent(const PropertyInterface& prop, PropertyEventType propEvtType,
620  Event::EventType evtType = Event::TLP_MODIFICATION,
621  unsigned int id = UINT_MAX)
622  : Event(prop, evtType), evtType(propEvtType), eltId(id) {}
623 
624  PropertyInterface* getProperty() const {
625  return reinterpret_cast<PropertyInterface *>(sender());
626  }
627 
628  node getNode() const {
629  assert(evtType < TLP_BEFORE_SET_ALL_NODE_VALUE);
630  return node(eltId);
631  }
632 
633  edge getEdge() const {
634  assert(evtType > TLP_AFTER_SET_ALL_EDGE_VALUE);
635  return edge(eltId);
636  }
637 
638  PropertyEventType getType() const {
639  return evtType;
640  }
641 
642 protected:
643  PropertyEventType evtType;
644  unsigned int eltId;
645 };
646 }
647 
648 //================================================================================
649 // these functions allow to use tlp::PropertyInterface as a key in a hash-based data structure (e.g. hashmap).
650 //================================================================================
651 
652 ///@cond DOXYGEN_HIDDEN
653 TLP_BEGIN_HASH_NAMESPACE {
654  template <>
655  struct TLP_SCOPE hash<const tlp::PropertyInterface *> {
656  size_t operator()(const tlp::PropertyInterface *prop) const {return size_t(prop);}
657  };
658  template <>
659  struct TLP_SCOPE hash<tlp::PropertyInterface *> {
660  size_t operator()(tlp::PropertyInterface *prop) const {return size_t(prop);}
661  };
662 } TLP_END_HASH_NAMESPACE
663 ///@endcond
664 
665 #endif // PROPERTY_INTERFACE_H
PropertyInterface describes the interface of a graph property.
Interface for Tulip iterators. Allows basic iteration operations only.
Definition: Iterator.h:39
Contains additional information about events on a property, such as the property it happened on...
MetaValueCalculator * getMetaValueCalculator()
Gets the MetaValueCalculator of this property.
The edge struct represents an edge in a Graph object.
Definition: Edge.h:39
The node struct represents a node in a Graph object.
Definition: Node.h:39
VectorPropertyInterface describes the interface of a graph property whose holded value is a vector (s...
Event is the base class for all events used in the Observation mechanism.
Definition: Observable.h:47
const std::string & getName() const
Gets the name of the property (e.g. viewLayout).
Base class for computing values on meta nodes and edges.
virtual void setMetaValueCalculator(MetaValueCalculator *calculator)
Sets the Calculator for meta nodes and edges.
The Observable class is the base of Tulip&#39;s observation system.
Definition: Observable.h:123