clear method
void
clear()
Implementation
void clear( int backColor, int scaleColor, int unitColor, double unitX, double unitY, int textColor, double textX, double textY ){
int i;
int tmp;
double pos, end;
if( unitX > 0.0 ){
while( true ){
tmp = _gWorld.imgSizX( unitX );
if( (tmp < 0) || (tmp >= 2) ){
break;
}
unitX *= 10.0;
}
}
if( unitY > 0.0 ){
while( true ){
tmp = _gWorld.imgSizY( unitY );
if( (tmp < 0) || (tmp >= 2) ){
break;
}
unitY *= 10.0;
}
}
// グラフ画面の背景塗りつぶし
_gWorld.clear( backColor );
int saveColor = _gWorld.color();
_gWorld.setColor( unitColor );
// 水平方向目盛り線の描画
if( unitX > 0.0 ){
pos = _gWorld.wndPosX( 0 );
end = _gWorld.wndPosX( _gWorld.width() - 1 );
i = pos ~/ unitX;
if( (_gWorld.wndPosX( 1 ) - pos) > 0.0 ){
while( (pos = i * unitX) <= end ){
_drawVLine( pos );
i++;
}
} else {
while( (pos = i * unitX) >= end ){
_drawVLine( pos );
i--;
}
}
}
// 垂直方向目盛り線の描画
if( unitY > 0.0 ){
pos = _gWorld.wndPosY( 0 );
end = _gWorld.wndPosY( _gWorld.height() - 1 );
i = pos ~/ unitY;
if( (_gWorld.wndPosY( 1 ) - pos) > 0.0 ){
while( (pos = i * unitY) <= end ){
_drawHLine( pos );
i++;
}
} else {
while( (pos = i * unitY) >= end ){
_drawHLine( pos );
i--;
}
}
}
_gWorld.setColor( scaleColor );
// X軸の描画
_drawHLine( 0.0 );
// Y軸の描画
_drawVLine( 0.0 );
_gWorld.setColor( textColor );
// 水平方向目盛り文字の描画
unitX *= textX;
if( unitX > 0.0 ){
pos = _gWorld.wndPosX( 0 );
end = _gWorld.wndPosX( _gWorld.width() - 1 );
i = pos ~/ unitX;
if( (_gWorld.wndPosX( 1 ) - pos) > 0.0 ){
while( (pos = i * unitX) <= end ){
_drawXText( pos, 0.0 );
i++;
}
} else {
while( (pos = i * unitX) >= end ){
_drawXText( pos, 0.0 );
i--;
}
}
}
// 垂直方向目盛り文字の描画
unitY *= textY;
if( unitY > 0.0 ){
pos = _gWorld.wndPosY( 0 );
end = _gWorld.wndPosY( _gWorld.height() - 1 );
i = pos ~/ unitY;
if( (_gWorld.wndPosY( 1 ) - pos) > 0.0 ){
while( (pos = i * unitY) <= end ){
_drawYText( 0.0, pos );
i++;
}
} else {
while( (pos = i * unitY) >= end ){
_drawYText( 0.0, pos );
i--;
}
}
}
_gWorld.setColor( saveColor );
}