Tulip  4.7.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
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 default node value of the property.
41  * @return The default value of nodes.
42  */
43  virtual double getNodeDoubleDefaultValue() const=0;
44 
45  /**
46  * @brief Gets the minimum value on the nodes.
47  * @param graph The graph on which to compute.
48  * @return The minimal value on this graph for this property.
49  **/
50  virtual double getNodeDoubleMin(Graph* graph = NULL)=0;
51 
52  /**
53  * @brief Gets the maximum value on the nodes.
54  * @param graph The graph on which to compute.
55  * @return The maximal value on this graph for this property.
56  **/
57  virtual double getNodeDoubleMax(Graph* graph = NULL)=0;
58 
59  /**
60  * @brief Returns the value associated with the edge e in this property.
61  * @param e The edge for which we want to get the value of the property.
62  **/
63  virtual double getEdgeDoubleValue(const edge e) const=0;
64 
65  /**
66  * @brief Gets the default edge value of the property.
67  * @return The default value of edges.
68  */
69  virtual double getEdgeDoubleDefaultValue() const=0;
70 
71  /**
72  * @brief Gets the minimum value on the edges.
73  * @param graph The graph on which to compute.
74  * @return The minimal value on this graph for this property.
75  **/
76  virtual double getEdgeDoubleMin(Graph* graph = NULL)=0;
77 
78  /**
79  * @brief Gets the maximum value on the edges.
80  * @param graph The graph on which to compute.
81  * @return The maximal value on this graph for this property.
82  **/
83  virtual double getEdgeDoubleMax(Graph* graph = NULL)=0;
84 
85  /**
86  * @brief computes a uniform quantification for the nodes
87  * associated values
88  */
89  virtual void nodesUniformQuantification(unsigned int)=0;
90 
91  /**
92  * @brief computes a uniform quantification for the edges
93  * associated values
94  */
95  virtual void edgesUniformQuantification(unsigned int)=0;
96 
97  /**
98  * @brief computes a uniform quantification for the nodes/edges
99  * associated values
100  */
101  void uniformQuantification(unsigned int k) {
104  }
105 
106  /**
107  * @brief Creates a property of the same type (e.g. tlp::DoubleProperty)
108  * The new property will be a copy of this property's values for all
109  * the elements of the graph
110  * @param graph The Graph in which to create the new property.
111  * @return The newly created property.
112  */
113  virtual NumericProperty* copyProperty(Graph *graph) = 0;
114 };
115 
116 }
117 
118 #endif //NUMERICPROPERTY_H
virtual double getNodeDoubleMax(Graph *graph=NULL)=0
Gets the maximum value on the nodes.
virtual double getNodeDoubleDefaultValue() const =0
Gets the default node value of the property.
virtual NumericProperty * copyProperty(Graph *graph)=0
Creates a property of the same type (e.g. tlp::DoubleProperty) The new property will be a copy of thi...
PropertyInterface describes the interface of a graph property.
virtual double getNodeDoubleValue(const node n) const =0
Returns the value associated with the node n in this property.
virtual void edgesUniformQuantification(unsigned int)=0
computes a uniform quantification for the edges associated values
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
void uniformQuantification(unsigned int k)
computes a uniform quantification for the nodes/edges associated values
virtual void nodesUniformQuantification(unsigned int)=0
computes a uniform quantification for the nodes associated values
Interface all numerical properties. Property values are always returned as double.
virtual double getNodeDoubleMin(Graph *graph=NULL)=0
Gets the minimum value on the nodes.
virtual double getEdgeDoubleMax(Graph *graph=NULL)=0
Gets the maximum value on the edges.
virtual double getEdgeDoubleMin(Graph *graph=NULL)=0
Gets the minimum value on the edges.
virtual double getEdgeDoubleDefaultValue() const =0
Gets the default edge value of the property.
virtual double getEdgeDoubleValue(const edge e) const =0
Returns the value associated with the edge e in this property.