EgtGeomKernel 1.5c1 :

- aggiunta prima gestione attributi.
This commit is contained in:
Dario Sassi
2014-03-06 08:17:26 +00:00
parent 76f1c1ceac
commit 2a2c0065ed
21 changed files with 1284 additions and 714 deletions
+44
View File
@@ -128,6 +128,8 @@ GdbExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR&
return ExecuteCurveBez( sCmd2, vsParams) ;
else if ( sCmd1 == "CC" || sCmd1 == "CURVECOMPO")
return ExecuteCurveCompo( sCmd2, vsParams) ;
else if ( sCmd1 == "COL" || sCmd1 == "COLOR")
return ExecuteColor( sCmd2, vsParams) ;
else if ( sCmd1 == "COPY")
return ExecuteCopy( sCmd2, vsParams) ;
else if ( sCmd1 == "ERASE")
@@ -882,6 +884,48 @@ GdbExecutor::GetFrameParam( const std::string& sParam, Frame3d& frF)
}
}
//----------------------------------------------------------------------------
bool
GdbExecutor::ExecuteColor( const string& sCmd2, const STRVECTOR& vsParams)
{
// impostazione colore di default
if ( sCmd2 == "DEF" || sCmd2 == "DEFAULT") {
// 3 parametri ( Red, Green, Blue)
if ( vsParams.size() != 3)
return false ;
// recupero i colori
int nRed ;
int nGreen ;
int nBlue ;
if ( ! FromString( vsParams[0], nRed) ||
! FromString( vsParams[1], nGreen) ||
! FromString( vsParams[2], nBlue))
return false ;
Color cCol( nRed, nGreen, nBlue) ;
return m_pGDB->SetDefaultColor( cCol) ;
}
// impostazione colore su oggetto
else {
// 4 o 5 parametri ( Id, Red, Green, Blue, Alpha)
if ( vsParams.size() != 4 && vsParams.size() != 5)
return false ;
// recupero i colori
int nRed ;
int nGreen ;
int nBlue ;
if ( ! FromString( vsParams[1], nRed) ||
! FromString( vsParams[2], nGreen) ||
! FromString( vsParams[3], nBlue))
return false ;
int nAlpha = 100 ;
if ( vsParams.size() == 5 &&
! FromString( vsParams[4], nAlpha))
return false ;
Color cCol( nRed, nGreen, nBlue, nAlpha) ;
return m_pGDB->SetColor( GetIdParam( vsParams[0]), cCol) ;
}
}
//----------------------------------------------------------------------------
bool
GdbExecutor::ExecuteCopy( const std::string& sCmd2, const STRVECTOR& vsParams)