Tulip
4.6.0
Better Visualization Through Research
|
00001 /* 00002 * 00003 * This file is part of Tulip (www.tulip-software.org) 00004 * 00005 * Authors: David Auber and the Tulip development Team 00006 * from LaBRI, University of Bordeaux 00007 * 00008 * Tulip is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation, either version 3 00011 * of the License, or (at your option) any later version. 00012 * 00013 * Tulip is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 * See the GNU General Public License for more details. 00017 * 00018 */ 00019 00020 #ifndef NUMERICPROPERTY_H 00021 #define NUMERICPROPERTY_H 00022 00023 #include <tulip/PropertyInterface.h> 00024 00025 namespace tlp { 00026 00027 /** 00028 * @brief Interface all numerical properties. 00029 * Property values are always returned as double 00030 **/ 00031 class NumericProperty : public PropertyInterface { 00032 public: 00033 /** 00034 * @brief Returns the value associated with the node n in this property. 00035 * @param n The node for which we want to get the value of the property. 00036 **/ 00037 virtual double getNodeDoubleValue(const node n) const=0; 00038 00039 /** 00040 * @brief Gets the default node value of the property. 00041 * @return The default value of nodes. 00042 */ 00043 virtual double getNodeDoubleDefaultValue() const=0; 00044 00045 /** 00046 * @brief Gets the minimum value on the nodes. 00047 * @param graph The graph on which to compute. 00048 * @return The minimal value on this graph for this property. 00049 **/ 00050 virtual double getNodeDoubleMin(Graph* graph = NULL)=0; 00051 00052 /** 00053 * @brief Gets the maximum value on the nodes. 00054 * @param graph The graph on which to compute. 00055 * @return The maximal value on this graph for this property. 00056 **/ 00057 virtual double getNodeDoubleMax(Graph* graph = NULL)=0; 00058 00059 /** 00060 * @brief Returns the value associated with the edge e in this property. 00061 * @param e The edge for which we want to get the value of the property. 00062 **/ 00063 virtual double getEdgeDoubleValue(const edge e) const=0; 00064 00065 /** 00066 * @brief Gets the default edge value of the property. 00067 * @return The default value of edges. 00068 */ 00069 virtual double getEdgeDoubleDefaultValue() const=0; 00070 00071 /** 00072 * @brief Gets the minimum value on the edges. 00073 * @param graph The graph on which to compute. 00074 * @return The minimal value on this graph for this property. 00075 **/ 00076 virtual double getEdgeDoubleMin(Graph* graph = NULL)=0; 00077 00078 /** 00079 * @brief Gets the maximum value on the edges. 00080 * @param graph The graph on which to compute. 00081 * @return The maximal value on this graph for this property. 00082 **/ 00083 virtual double getEdgeDoubleMax(Graph* graph = NULL)=0; 00084 00085 /** 00086 * @brief computes a uniform quantification for the nodes 00087 * associated values 00088 */ 00089 virtual void nodesUniformQuantification(unsigned int)=0; 00090 00091 /** 00092 * @brief computes a uniform quantification for the edges 00093 * associated values 00094 */ 00095 virtual void edgesUniformQuantification(unsigned int)=0; 00096 00097 /** 00098 * @brief computes a uniform quantification for the nodes/edges 00099 * associated values 00100 */ 00101 void uniformQuantification(unsigned int k) { 00102 nodesUniformQuantification(k); 00103 edgesUniformQuantification(k); 00104 } 00105 00106 /** 00107 * @brief Creates a property of the same type (e.g. tlp::DoubleProperty) 00108 * The new property will be a copy of this property's values for all 00109 * the elements of the graph 00110 * @param graph The Graph in which to create the new property. 00111 * @return The newly created property. 00112 */ 00113 virtual NumericProperty* copyProperty(Graph *graph) = 0; 00114 }; 00115 00116 } 00117 00118 #endif //NUMERICPROPERTY_H