- 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 -_-
This commit is contained in:
Damien Dupuis 2009-02-11 12:48:42 +00:00
parent 035bf7bc44
commit b8a763d69a
4 changed files with 43 additions and 1 deletions

View File

@ -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.

View File

@ -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 );
}

View File

@ -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; }

View File

@ -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;
}