Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
NumericProperty.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
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 NUMERICPROPERTY_H
21 #define NUMERICPROPERTY_H
22 
23 #include <tulip/PropertyInterface.h>
24 
25 namespace tlp {
26 
27 /**
28  * @brief Interface all numerical properties.
29  * Property values are always returned as double
30  **/
32 public:
33  /**
34  * @brief Returns the value associated with the node n in this property.
35  * @param n The node for which we want to get the value of the property.
36  **/
37  virtual double getNodeDoubleValue(const node n) const=0;
38 
39  /**
40  * @brief Gets the minimum value on the nodes.
41  * @param graph The graph on which to compute.
42  * @return The minimal value on this graph for this property.
43  **/
44  virtual double getNodeDoubleMin(Graph* graph = NULL)=0;
45 
46  /**
47  * @brief Gets the maximum value on the nodes.
48  * @param graph The graph on which to compute.
49  * @return The maximal value on this graph for this property.
50  **/
51  virtual double getNodeDoubleMax(Graph* graph = NULL)=0;
52 
53  /**
54  * @brief Returns the value associated with the edge e in this property.
55  * @param e The edge for which we want to get the value of the property.
56  **/
57  virtual double getEdgeDoubleValue(const edge e) const=0;
58 
59  /**
60  * @brief Gets the minimum value on the edges.
61  * @param graph The graph on which to compute.
62  * @return The minimal value on this graph for this property.
63  **/
64  virtual double getEdgeDoubleMin(Graph* graph = NULL)=0;
65 
66  /**
67  * @brief Gets the maximum value on the edges.
68  * @param graph The graph on which to compute.
69  * @return The maximal value on this graph for this property.
70  **/
71  virtual double getEdgeDoubleMax(Graph* graph = NULL)=0;
72 
73  /**
74  * @brief computes a uniform quantification for the nodes
75  * associated values
76  */
77  virtual void nodesUniformQuantification(unsigned int)=0;
78 
79  /**
80  * @brief computes a uniform quantification for the edges
81  * associated values
82  */
83  virtual void edgesUniformQuantification(unsigned int)=0;
84 
85  /**
86  * @brief computes a uniform quantification for the nodes/edges
87  * associated values
88  */
89  void uniformQuantification(unsigned int k) {
92  }
93 
94  /**
95  * @brief Creates a property of the same type (e.g. tlp::DoubleProperty)
96  * The new property will not a copy of this property's values for all
97  * the elements of the graph
98  * @param graph The Graph in which to create the new property.
99  * @return The newly created property.
100  */
101  virtual NumericProperty* copyProperty(Graph *graph) = 0;
102 };
103 
104 }
105 
106 #endif //NUMERICPROPERTY_H