EgtGeomKernel 1.5a6 : prima versione di scalatura non uniforme,
aggiunto comando COUNTER in tsc.
This commit is contained in:
+49
-9
@@ -1,13 +1,13 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
// EgalTech 2013-2014
|
||||
//----------------------------------------------------------------------------
|
||||
// File : GdbExecutor.cpp Data : 25.11.13 Versione : 1.3a5
|
||||
// File : GdbExecutor.cpp Data : 19.01.14 Versione : 1.5a6
|
||||
// Contenuto : Implementazione della classe GdbExecutor.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 27.03.13 DS Creazione modulo.
|
||||
//
|
||||
// 19.01.14 DS Agg. COUNTER.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -126,6 +126,8 @@ GdbExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR&
|
||||
return ExecuteSave( vsParams) ;
|
||||
else if ( sCmd1 == "OUTSCL")
|
||||
return ExecuteOutScl( sCmd2, vsParams) ;
|
||||
else if ( sCmd1 == "COUNTER")
|
||||
return ExecuteCounter( sCmd2, vsParams) ;
|
||||
|
||||
return false ;
|
||||
}
|
||||
@@ -749,6 +751,18 @@ GdbExecutor::GetPointWParam( const std::string& sParam, Point3d& ptP, double& dW
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::GetFrameParam( const std::string& sParam, Frame3d& frF)
|
||||
{
|
||||
// deve essere nome di frame già nel DB
|
||||
const IGeoFrame3d* pFr ;
|
||||
if ( ( pFr = GetGeoFrame3d( m_pGDB->GetGeoObj( GetIdParam( sParam)))) == nullptr)
|
||||
return false ;
|
||||
frF = pFr->GetFrame() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::ExecuteCopy( const STRVECTOR& vsParams)
|
||||
@@ -858,19 +872,26 @@ GdbExecutor::ExecuteScale( const STRVECTOR& vsParams)
|
||||
STRVECTOR vsNames ;
|
||||
STRVECTOR::iterator Iter ;
|
||||
Point3d ptPC ;
|
||||
Frame3d frRef ;
|
||||
double dCoeffX ;
|
||||
double dCoeffY ;
|
||||
double dCoeffZ ;
|
||||
|
||||
|
||||
// 5 parametri ( Nome, Punto, CoeffX, CoeffY, CoeffZ)
|
||||
// 5 parametri ( Nome, Punto o Frame, CoeffX, CoeffY, CoeffZ)
|
||||
if ( vsParams.size() != 5)
|
||||
return false ;
|
||||
// recupero lista nomi
|
||||
if ( ! GetNamesParam( vsParams[0], vsNames))
|
||||
return false ;
|
||||
// recupero il punto
|
||||
if ( ! GetPointParam( vsParams[1], ptPC))
|
||||
// provo a recuperare un punto
|
||||
if ( GetPointParam( vsParams[1], ptPC))
|
||||
frRef.Set( ptPC, Frame3d::TOP) ;
|
||||
// provo a recuperare un frame
|
||||
else if ( GetFrameParam( vsParams[1], frRef))
|
||||
;
|
||||
// altrimenti errore
|
||||
else
|
||||
return false ;
|
||||
// recupero i coefficienti
|
||||
if ( ! FromString( vsParams[2], dCoeffX) ||
|
||||
@@ -879,7 +900,7 @@ GdbExecutor::ExecuteScale( const STRVECTOR& vsParams)
|
||||
return false ;
|
||||
// esecuzione scalature
|
||||
for ( Iter = vsNames.begin() ; Iter != vsNames.end() ; ++Iter) {
|
||||
if ( ! m_pGDB->Scale( GetIdParam( *Iter), ptPC, dCoeffX, dCoeffY, dCoeffZ))
|
||||
if ( ! m_pGDB->Scale( GetIdParam( *Iter), frRef, dCoeffX, dCoeffY, dCoeffZ))
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -1116,7 +1137,7 @@ GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
for ( Iter = vsNames.begin() ; Iter != vsNames.end() ; ++Iter) {
|
||||
// recupero l'oggetto ed eseguo l'output
|
||||
nId = GetIdParam( *Iter) ;
|
||||
if ( ! m_OutScl.PutCurve( m_pGDB->GetGeoObj( nId), nFlag))
|
||||
if ( ! m_OutScl.PutGeoObj( m_pGDB->GetGeoObj( nId), nFlag))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
@@ -1160,7 +1181,7 @@ GdbExecutor::OutGroupScl( int nId, int nFlag)
|
||||
while ( bNext) {
|
||||
nGdbType = Iter.GetGdbType() ;
|
||||
if ( nGdbType == GDB_GEO) {
|
||||
if ( ! m_OutScl.PutCurve( Iter.GetGeoObj(), nFlag))
|
||||
if ( ! m_OutScl.PutGeoObj( Iter.GetGeoObj(), nFlag))
|
||||
return false ;
|
||||
}
|
||||
else if ( nGdbType == GDB_GROUP) {
|
||||
@@ -1173,3 +1194,22 @@ GdbExecutor::OutGroupScl( int nId, int nFlag)
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::ExecuteCounter( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
{
|
||||
// avvio il counter
|
||||
if ( sCmd2 == "START") {
|
||||
m_Counter.Start() ;
|
||||
}
|
||||
// fermo il counter ed emetto i risultati
|
||||
else if ( sCmd2 == "STOP") {
|
||||
m_Counter.Stop() ;
|
||||
string sOut = " " + ( ( vsParams.size() >= 1) ? vsParams[0] : "ExecTime =") ;
|
||||
sOut += " " + ToString( m_Counter.GetTime(), 2) + " ms" ;
|
||||
LOG_INFO( GetEGkLogger(), sOut.c_str())
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
Reference in New Issue
Block a user