From b8a763d69a34d502920845d256e1e830bdadcb0e Mon Sep 17 00:00:00 2001 From: Damien Dupuis Date: Wed, 11 Feb 2009 12:48:42 +0000 Subject: [PATCH] - Add Temperature ColorScale from dark blue to red (mid color is at 80% of the scale) the goal was to test it with edge in global routing But fireScale is better -_- --- hurricane/src/hviewer/ColorScale.cpp | 25 +++++++++++++++++++ hurricane/src/hviewer/Graphics.cpp | 4 ++- .../src/hviewer/hurricane/viewer/ColorScale.h | 11 ++++++++ .../src/hviewer/hurricane/viewer/Graphics.h | 4 +++ 4 files changed, 43 insertions(+), 1 deletion(-) diff --git a/hurricane/src/hviewer/ColorScale.cpp b/hurricane/src/hviewer/ColorScale.cpp index 8768051d..05a94b53 100644 --- a/hurricane/src/hviewer/ColorScale.cpp +++ b/hurricane/src/hviewer/ColorScale.cpp @@ -143,4 +143,29 @@ namespace Hurricane { } +// ------------------------------------------------------------------- +// Class : "Hurricane::TemperatureColorScale" + + + TemperatureColorScale::TemperatureColorScale () + : ColorScale("Temperature") + { + for ( size_t i=0 ; i<153 ; i++ ) { + _red [i] = 0; + _green[i] = 0; + _blue [i] = (size_t)(0.83*(float)(i))+128; + } + for ( size_t i=153 ; i<204 ; i++ ) { + _red [i] = (size_t)(2.5*(float)(i)-382.5); + _green[i] = 0; + _blue [i] = 255; + } + for ( size_t i=204 ; i<256 ; i++ ) { + _red [i] = (size_t)(2.5*(float)(i)-382.5); + _green[i] = 0; + _blue [i] = (size_t)(-5*(int)(i)+1275); + } + } + + } // End of Hurricane namespace. diff --git a/hurricane/src/hviewer/Graphics.cpp b/hurricane/src/hviewer/Graphics.cpp index b4afc183..22b71f6c 100644 --- a/hurricane/src/hviewer/Graphics.cpp +++ b/hurricane/src/hviewer/Graphics.cpp @@ -49,6 +49,7 @@ namespace Hurricane { , _active(NULL) , _fireColorScale() , _rainbowColorScale() + , _temperatureColorScale() , _qtEnabled(false) { } @@ -105,7 +106,8 @@ namespace Hurricane { _styles[si]->qtAllocate (); _fireColorScale.qtAllocate (); - _rainbowColorScale.qtAllocate (); + _rainbowColorScale.qtAllocate(); + _temperatureColorScale.qtAllocate(); Breakpoint::setStopCb ( Graphics::breakpointStopCb ); } diff --git a/hurricane/src/hviewer/hurricane/viewer/ColorScale.h b/hurricane/src/hviewer/hurricane/viewer/ColorScale.h index 3de4d7f7..33d8eaa6 100644 --- a/hurricane/src/hviewer/hurricane/viewer/ColorScale.h +++ b/hurricane/src/hviewer/hurricane/viewer/ColorScale.h @@ -46,6 +46,7 @@ namespace Hurricane { enum ScaleType { Grey = 1 , Fire , Rainbow + , Temperature }; public: @@ -94,6 +95,16 @@ namespace Hurricane { }; +// ------------------------------------------------------------------- +// Class : "Hurricane::TemperatureColorScale" + + + class TemperatureColorScale : public ColorScale { + public: + TemperatureColorScale (); + }; + + // Functions. inline const Name& ColorScale::getName () const { return _name; } diff --git a/hurricane/src/hviewer/hurricane/viewer/Graphics.h b/hurricane/src/hviewer/hurricane/viewer/Graphics.h index 64b4d843..075d8b95 100644 --- a/hurricane/src/hviewer/hurricane/viewer/Graphics.h +++ b/hurricane/src/hviewer/hurricane/viewer/Graphics.h @@ -85,6 +85,7 @@ namespace Hurricane { DisplayStyle* _active; FireColorScale _fireColorScale; RainbowColorScale _rainbowColorScale; + TemperatureColorScale _temperatureColorScale; bool _qtEnabled; // Internals - Constructors & Destructors. @@ -145,6 +146,9 @@ namespace Hurricane { case ColorScale::Rainbow: return _rainbowColorScale; break; + case ColorScale::Temperature: + return _temperatureColorScale; + break; } return _fireColorScale; }