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 getNodeDoubleDefaultValue()
const {
71 return getNodeDefaultValue();
73 virtual double getNodeDoubleMin(
Graph* g = NULL) {
76 virtual double getNodeDoubleMax(
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(
Graph* g = NULL) {
88 virtual double getEdgeDoubleMax(
Graph* g = NULL) {
92 void nodesUniformQuantification(
unsigned int);
94 void edgesUniformQuantification(
unsigned int);
105 void treatEvent(
const Event&);
119 static const std::string propertyTypename;
120 std::string getTypename()
const {
121 return propertyTypename;