20 #ifndef TULIP_METRIC_H 21 #define TULIP_METRIC_H 23 #include <tulip/tuliphash.h> 24 #include <tulip/PropertyTypes.h> 25 #include <tulip/AbstractProperty.h> 26 #include <tulip/PropertyAlgorithm.h> 27 #include <tulip/minmaxproperty.h> 28 #include <tulip/NumericProperty.h> 32 class PropertyContext;
34 typedef MinMaxProperty<tlp::DoubleType, tlp::DoubleType, tlp::NumericProperty> DoubleMinMaxProperty;
47 static const std::string propertyTypename;
48 const std::string& getTypename()
const {
49 return propertyTypename;
52 virtual void setNodeValue(
const node n,
const double &v);
53 virtual void setEdgeValue(
const edge e,
const double &v);
54 virtual void setAllNodeValue(
const double &v,
const Graph* graph = NULL);
55 virtual void setAllEdgeValue(
const double &v,
const Graph *graph = NULL);
57 enum PredefinedMetaValueCalculator {NO_CALC = 0, AVG_CALC = 1, SUM_CALC = 2,
58 MAX_CALC = 3, MIN_CALC = 4
63 void setMetaValueCalculator(PredefinedMetaValueCalculator nodeCalc = AVG_CALC,
64 PredefinedMetaValueCalculator edgeCalc = AVG_CALC);
67 virtual double getNodeDoubleValue(
const node n)
const {
68 return getNodeValue(n);
70 virtual double getNodeDoubleDefaultValue()
const {
71 return getNodeDefaultValue();
73 virtual double getNodeDoubleMin(
const Graph* g = NULL) {
76 virtual double getNodeDoubleMax(
const Graph* g = NULL) {
79 virtual double getEdgeDoubleValue(
const edge e)
const {
80 return getEdgeValue(e);
82 virtual double getEdgeDoubleDefaultValue()
const {
83 return getEdgeDefaultValue();
85 virtual double getEdgeDoubleMin(
const Graph* g = NULL) {
88 virtual double getEdgeDoubleMax(
const Graph* g = NULL) {
92 void nodesUniformQuantification(
unsigned int);
94 void edgesUniformQuantification(
unsigned int);
105 void treatEvent(
const Event&);
116 DoubleVectorProperty(
Graph *g,
const std::string& n=
""):AbstractVectorProperty<DoubleVectorType, tlp::DoubleType>(g, n) {}
119 static const std::string propertyTypename;
120 const std::string& getTypename()
const {
121 return propertyTypename;
This class extends upon PropertyInterface, and adds type-safe methods to get and set the node and edg...
PropertyInterface describes the interface of a graph property.
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.
A graph property that maps a double value to graph elements.
Event is the base class for all events used in the Observation mechanism.
Interface all numerical properties. Property values are always returned as double.
A graph property that maps a std::vector<double> value to graph elements.