00001
00002 #ifndef METRICSINFO_H
00003 #define METRICSINFO_H
00004
00005 #include <QString>
00006
00007 class SgNode;
00008
00012 class MetricsInfo
00013 {
00014 public:
00015 MetricsInfo()
00016 : caption( "" ),
00017
00018 minValue( 0.0 ),
00019 maxValue( 0.0 ),
00020 minNormalize( 0.0 ),
00021 maxNormalize( 0.0 ),
00022 normalizeByRange( true ),
00023 listId( -1 )
00024 {}
00025
00026 MetricsInfo( const QString& name_, double minValue_, double maxValue_, bool normalizeByRange_ = true )
00027 :
00028 caption( name_ ),
00029
00030 minValue( minValue_ ),
00031 maxValue( maxValue_ ),
00032 minNormalize( minValue_ ),
00033 maxNormalize( maxValue_ ),
00034 normalizeByRange( normalizeByRange_ ),
00035 listId( -1 )
00036 {}
00037
00038 bool operator==( const MetricsInfo& other )
00039 {
00040 if( caption == other.caption &&
00041 minValue == other.minValue &&
00042 minNormalize == other.minNormalize &&
00043 maxNormalize == other.maxNormalize &&
00044 normalizeByRange == other.normalizeByRange &&
00045 normalizeMetricName == other.normalizeMetricName &&
00046 listId == other.listId )
00047 return true;
00048
00049 return false;
00050 }
00051
00052 bool operator!=( const MetricsInfo& other )
00053 {
00054 return !( *this == other );
00055 }
00056
00057 double eval( SgNode *node, const QString& metricName ) const;
00058
00059 QString caption;
00060 double minValue;
00061 double maxValue;
00062 double minNormalize;
00063 double maxNormalize;
00064 bool normalizeByRange;
00065 QString normalizeMetricName;
00066 int listId;
00067 };
00068
00069 #endif