1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
// File: IGESCAFControl.cxx
// Created: Wed Aug 16 18:46:01 2000
// Author: Andrey BETENEV
// <abv@doomox.nnov.matra-dtv.fr>
#include <IGESCAFControl.ixx>
//=======================================================================
//function : DecodeColor
//purpose :
//=======================================================================
Quantity_Color IGESCAFControl::DecodeColor (const Standard_Integer color)
{
switch ( color ) {
case 1: return Quantity_Color ( Quantity_NOC_BLACK );
case 2: return Quantity_Color ( Quantity_NOC_RED );
case 3: return Quantity_Color ( Quantity_NOC_GREEN );
case 4: return Quantity_Color ( Quantity_NOC_BLUE1 );
case 5: return Quantity_Color ( Quantity_NOC_YELLOW );
case 6: return Quantity_Color ( Quantity_NOC_MAGENTA1 );
case 7: return Quantity_Color ( Quantity_NOC_CYAN1 );
case 8:
default:return Quantity_Color ( Quantity_NOC_WHITE );
}
}
//=======================================================================
//function : DecodeColor
//purpose :
//=======================================================================
Standard_Integer IGESCAFControl::EncodeColor (const Quantity_Color &col)
{
Standard_Integer code = 0;
if ( Abs ( col.Red() - 1. ) <= col.Epsilon() ) code |= 0x001;
else if ( Abs ( col.Red() ) > col.Epsilon() ) return 0;
if ( Abs ( col.Green() - 1. ) <= col.Epsilon() ) code |= 0x010;
else if ( Abs ( col.Green() ) > col.Epsilon() ) return 0;
if ( Abs ( col.Blue() - 1. ) <= col.Epsilon() ) code |= 0x100;
else if ( Abs ( col.Blue() ) > col.Epsilon() ) return 0;
switch ( code ) {
case 0x000: return 1;
case 0x001: return 2;
case 0x010: return 3;
case 0x100: return 4;
case 0x011: return 5;
case 0x101: return 6;
case 0x110: return 7;
case 0x111:
default : return 8;
}
}