EgtGraphics 1.5c8 :
- gestione stato Mark con disegno alone attorno ad oggetto - modifiche ad esecutore.
This commit is contained in:
+19
-27
@@ -32,7 +32,15 @@ CreateSceExecutor( void)
|
||||
SceExecutor::SceExecutor( void)
|
||||
{
|
||||
m_pScene = nullptr ;
|
||||
m_pOtherExec = nullptr ;
|
||||
m_pParser = nullptr ;
|
||||
// assegno chiavi a funzioni di esecuzione
|
||||
m_ExecMgr.Init( 16) ;
|
||||
m_ExecMgr.Insert( "RD", &SceExecutor::ExecuteRedraw) ;
|
||||
m_ExecMgr.Insert( "REDRAW", &SceExecutor::ExecuteRedraw) ;
|
||||
m_ExecMgr.Insert( "ZM", &SceExecutor::ExecuteZoom) ;
|
||||
m_ExecMgr.Insert( "ZOOM", &SceExecutor::ExecuteZoom) ;
|
||||
m_ExecMgr.Insert( "CENTER", &SceExecutor::ExecuteCenter) ;
|
||||
m_ExecMgr.Insert( "CAMERA", &SceExecutor::ExecuteCamera) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -53,23 +61,12 @@ SceExecutor::SetScene( IEGrScene* pScene)
|
||||
bool
|
||||
SceExecutor::SetCmdParser( ICmdParser* pParser)
|
||||
{
|
||||
// imposto eventuale parser dipendente
|
||||
if ( m_pOtherExec != nullptr)
|
||||
m_pOtherExec->SetCmdParser( pParser) ;
|
||||
|
||||
return true ;
|
||||
m_pParser = pParser ;
|
||||
return ( m_pParser != nullptr) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SceExecutor::AddExecutor( ICmdExecutor* pOtherExec)
|
||||
{
|
||||
m_pOtherExec = pOtherExec ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
int
|
||||
SceExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR& vsParams)
|
||||
{
|
||||
// verifico validità Scene
|
||||
@@ -78,19 +75,14 @@ SceExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR&
|
||||
return false ;
|
||||
}
|
||||
|
||||
// esecuzione comando
|
||||
if ( sCmd1 == "RD" || sCmd1 == "REDRAW")
|
||||
return ExecuteRedraw( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "ZM" || sCmd1 == "ZOOM")
|
||||
return ExecuteZoom( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "CENTER")
|
||||
return ExecuteCenter( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "CAMERA")
|
||||
return ExecuteCamera( sCmd2, vsParams) ;
|
||||
else if ( m_pOtherExec != nullptr)
|
||||
return m_pOtherExec->Execute( sCmd1, sCmd2, vsParams) ;
|
||||
// verifico validità CmdParser
|
||||
if ( m_pParser == nullptr) {
|
||||
LOG_ERROR( GetEGrLogger(), "Error : null CmdParser.")
|
||||
return ER_ERR ;
|
||||
}
|
||||
|
||||
return false ;
|
||||
// esecuzione comando
|
||||
return m_ExecMgr.Execute( *this, sCmd1, sCmd2, vsParams) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user