- 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. } // End of Hurricane namespace.

View File

@ -49,6 +49,7 @@ namespace Hurricane {
, _active(NULL) , _active(NULL)
, _fireColorScale() , _fireColorScale()
, _rainbowColorScale() , _rainbowColorScale()
, _temperatureColorScale()
, _qtEnabled(false) , _qtEnabled(false)
{ {
} }
@ -105,7 +106,8 @@ namespace Hurricane {
_styles[si]->qtAllocate (); _styles[si]->qtAllocate ();
_fireColorScale.qtAllocate (); _fireColorScale.qtAllocate ();
_rainbowColorScale.qtAllocate (); _rainbowColorScale.qtAllocate();
_temperatureColorScale.qtAllocate();
Breakpoint::setStopCb ( Graphics::breakpointStopCb ); Breakpoint::setStopCb ( Graphics::breakpointStopCb );
} }

View File

@ -46,6 +46,7 @@ namespace Hurricane {
enum ScaleType { Grey = 1 enum ScaleType { Grey = 1
, Fire , Fire
, Rainbow , Rainbow
, Temperature
}; };
public: public:
@ -94,6 +95,16 @@ namespace Hurricane {
}; };
// -------------------------------------------------------------------
// Class : "Hurricane::TemperatureColorScale"
class TemperatureColorScale : public ColorScale {
public:
TemperatureColorScale ();
};
// Functions. // Functions.
inline const Name& ColorScale::getName () const { return _name; } inline const Name& ColorScale::getName () const { return _name; }

View File

@ -85,6 +85,7 @@ namespace Hurricane {
DisplayStyle* _active; DisplayStyle* _active;
FireColorScale _fireColorScale; FireColorScale _fireColorScale;
RainbowColorScale _rainbowColorScale; RainbowColorScale _rainbowColorScale;
TemperatureColorScale _temperatureColorScale;
bool _qtEnabled; bool _qtEnabled;
// Internals - Constructors & Destructors. // Internals - Constructors & Destructors.
@ -145,6 +146,9 @@ namespace Hurricane {
case ColorScale::Rainbow: case ColorScale::Rainbow:
return _rainbowColorScale; return _rainbowColorScale;
break; break;
case ColorScale::Temperature:
return _temperatureColorScale;
break;
} }
return _fireColorScale; return _fireColorScale;
} }