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 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);
55 virtual void setAllEdgeValue(
const double &v);
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 getNodeDoubleMin(
Graph* g = NULL) {
73 virtual double getNodeDoubleMax(
Graph* g = NULL) {
76 virtual double getEdgeDoubleValue(
const edge e)
const {
77 return getEdgeValue(e);
79 virtual double getEdgeDoubleMin(
Graph* g = NULL) {
82 virtual double getEdgeDoubleMax(
Graph* g = NULL) {
86 void nodesUniformQuantification(
unsigned int);
88 void edgesUniformQuantification(
unsigned int);
99 void treatEvent(
const Event&);
113 static const std::string propertyTypename;
114 std::string getTypename()
const {
115 return propertyTypename;