EgtGeomKernel :
- in Tsc sostituita OutScl con OutTsc - in Tsc aggiunti nomi predefiniti per vettori, punti e riferimenti.
This commit is contained in:
+93
-49
@@ -101,7 +101,7 @@ GdbExecutor::GdbExecutor( void)
|
||||
m_ExecMgr.Insert( "NEW", &GdbExecutor::ExecuteNew) ;
|
||||
m_ExecMgr.Insert( "LOAD", &GdbExecutor::ExecuteLoad) ;
|
||||
m_ExecMgr.Insert( "SAVE", &GdbExecutor::ExecuteSave) ;
|
||||
m_ExecMgr.Insert( "OUTSCL", &GdbExecutor::ExecuteOutScl) ;
|
||||
m_ExecMgr.Insert( "OUTTSC", &GdbExecutor::ExecuteOutTsc) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -776,6 +776,21 @@ GdbExecutor::GetVectorParam( const std::string& sParam, Vector3d& vtV)
|
||||
FromString( vsParams[1], vtV.y) &&
|
||||
FromString( vsParams[2], vtV.z)) ;
|
||||
}
|
||||
// se altrimenti vettore predefinito X_AX
|
||||
else if ( sParam == "X_AX") {
|
||||
vtV = X_AX ;
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti vettore predefinito Y_AX
|
||||
else if ( sParam == "Y_AX") {
|
||||
vtV = Y_AX ;
|
||||
return true ;
|
||||
}
|
||||
// se altrimenti vettore predefinito Z_AX
|
||||
else if ( sParam == "Z_AX") {
|
||||
vtV = Z_AX ;
|
||||
return true ;
|
||||
}
|
||||
// altrimenti nome di vettore già nel DB
|
||||
else {
|
||||
const IGeoVector3d* pV ;
|
||||
@@ -805,6 +820,11 @@ GdbExecutor::GetPointParam( const std::string& sParam, Point3d& ptP)
|
||||
FromString( vsParams[1], ptP.y) &&
|
||||
FromString( vsParams[2], ptP.z)) ;
|
||||
}
|
||||
// se altrimenti punto predefinito ORIG
|
||||
else if ( sParam == "ORIG") {
|
||||
ptP = ORIG ;
|
||||
return true ;
|
||||
}
|
||||
// altrimenti nome di punto già nel DB
|
||||
else {
|
||||
const IGeoPoint3d* pPt ;
|
||||
@@ -837,13 +857,18 @@ GdbExecutor::GetPointWParam( const std::string& sParam, Point3d& ptP, double& dW
|
||||
FromString( vsParams[2], ptP.z) &&
|
||||
FromString( vsParams[3], dW)) ;
|
||||
}
|
||||
// se 2 parti, nome di punto già nel DB e un peso
|
||||
// se 2 parti, nome di punto predefinito o già nel DB e un peso
|
||||
else if ( vsParams.size() == 2) {
|
||||
const IGeoPoint3d* pPt ;
|
||||
// recupero il punto
|
||||
if ( ( pPt = GetGeoPoint3d( m_pGDB->GetGeoObj( GetIdParam( vsParams[0])))) == nullptr)
|
||||
return false ;
|
||||
ptP = pPt->GetPoint() ;
|
||||
if ( vsParams[0] == "ORIG") {
|
||||
ptP = ORIG ;
|
||||
}
|
||||
else {
|
||||
const IGeoPoint3d* pPt ;
|
||||
if ( ( pPt = GetGeoPoint3d( m_pGDB->GetGeoObj( GetIdParam( vsParams[0])))) == nullptr)
|
||||
return false ;
|
||||
ptP = pPt->GetPoint() ;
|
||||
}
|
||||
// recupero il peso
|
||||
return FromString( vsParams[1], dW) ;
|
||||
}
|
||||
@@ -880,6 +905,11 @@ GdbExecutor::GetFrameParam( const std::string& sParam, Frame3d& frF)
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
// se altrimenti riferimento predefinito GLOB
|
||||
else if ( sParam == "GLOB") {
|
||||
frF = GLOB_FRM ;
|
||||
return true ;
|
||||
}
|
||||
// altrimenti nome di frame già nel DB
|
||||
else {
|
||||
const IGeoFrame3d* pFr ;
|
||||
@@ -923,7 +953,7 @@ GdbExecutor::GetColorParam( const std::string& sParam, bool& bByParent, Color& c
|
||||
bByParent = false ;
|
||||
return true ;
|
||||
}
|
||||
// altrimeti
|
||||
// altrimenti
|
||||
else {
|
||||
// verifico se colore dal padre
|
||||
string sTemp = sParam ;
|
||||
@@ -1585,23 +1615,23 @@ GdbExecutor::ExecuteSave( const std::string& sCmd2, const STRVECTOR& vsParams)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
GdbExecutor::ExecuteOutTsc( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
{
|
||||
// apro il file di uscita Scl
|
||||
// apro il file di uscita Tsc
|
||||
if ( sCmd2 == "OPEN") {
|
||||
// 1 parametro
|
||||
if ( vsParams.size() != 1)
|
||||
return false ;
|
||||
// apro il file e scrivo intestazione
|
||||
return m_OutScl.Open( vsParams[0]) ;
|
||||
return m_OutTsc.Open( vsParams[0]) ;
|
||||
}
|
||||
// chiudo il file di uscita Scl
|
||||
// chiudo il file di uscita Tsc
|
||||
else if ( sCmd2 == "CLOSE") {
|
||||
// nessun parametro
|
||||
if ( vsParams.size() != 0)
|
||||
return false ;
|
||||
// scrivo terminazioni e chiudo il file
|
||||
return m_OutScl.Close() ;
|
||||
return m_OutTsc.Close() ;
|
||||
}
|
||||
// imposto materiale corrente
|
||||
else if ( sCmd2 == "SETRGB") {
|
||||
@@ -1615,17 +1645,29 @@ GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
! FromString( vsParams[2], dBlue))
|
||||
return false ;
|
||||
// definisco il materiale opportuno
|
||||
return m_OutScl.SetMaterial( dRed, dGreen, dBlue) ;
|
||||
return m_OutTsc.SetMaterial( dRed, dGreen, dBlue) ;
|
||||
}
|
||||
// imposto pezzo e layer correnti
|
||||
else if ( sCmd2 == "SETPL") {
|
||||
// 2 parametri
|
||||
if ( vsParams.size() != 2)
|
||||
// imposto nuovo gruppo
|
||||
else if ( sCmd2 == "SETGR") {
|
||||
Frame3d frF ;
|
||||
// nessun parametro
|
||||
if ( vsParams.size() == 0)
|
||||
frF.Reset() ;
|
||||
// un parametro ( Id del gruppo)
|
||||
else if ( vsParams.size() == 1) {
|
||||
// recupero l'indice del gruppo
|
||||
int nId = GetIdParam( vsParams[0]) ;
|
||||
// recupero il riferimento del gruppo
|
||||
if ( ! m_pGDB->GetGroupGlobFrame( nId, frF))
|
||||
return false ;
|
||||
}
|
||||
// altrimenti, errore
|
||||
else
|
||||
return false ;
|
||||
// eseguo
|
||||
return m_OutScl.SetPartLay( vsParams[0], vsParams[1]) ;
|
||||
return m_OutTsc.NewGroupRef( frF, 0) ;
|
||||
}
|
||||
// emetto gruppo
|
||||
// emetto gruppo con tutto il suo contenuto
|
||||
else if ( sCmd2 == "PUTGR") {
|
||||
// almeno un parametro
|
||||
if ( vsParams.size() < 1)
|
||||
@@ -1644,7 +1686,7 @@ GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
INTVECTOR::iterator Iter ;
|
||||
for ( Iter = vnNames.begin() ; Iter != vnNames.end() ; ++Iter) {
|
||||
// recupero l'oggetto ed eseguo l'output
|
||||
if ( ! OutGroupScl( *Iter, nFlag))
|
||||
if ( ! OutGroupTsc( *Iter, nFlag))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
@@ -1668,7 +1710,7 @@ GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
INTVECTOR::iterator Iter ;
|
||||
for ( Iter = vnNames.begin() ; Iter != vnNames.end() ; ++Iter) {
|
||||
// recupero l'oggetto ed eseguo l'output
|
||||
if ( ! m_OutScl.PutGeoObj( m_pGDB->GetGeoObj( *Iter), nFlag))
|
||||
if ( ! m_OutTsc.PutGeoObj( m_pGDB->GetGeoObj( *Iter), nFlag))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
@@ -1679,49 +1721,51 @@ GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GdbExecutor::OutGroupScl( int nId, int nFlag)
|
||||
GdbExecutor::OutGroupTsc( int nId, int nFlag, int nLev)
|
||||
{
|
||||
bool bNext ;
|
||||
int nParentId ;
|
||||
int nGdbType ;
|
||||
Frame3d frFrame ;
|
||||
|
||||
|
||||
m_OutScl.Remark( "Start Group ---") ;
|
||||
// emetto dati gruppo
|
||||
if ( m_pGDB->GetGroupGlobFrame( nId, frFrame)) {
|
||||
nParentId = m_pGDB->GetParentId( nId) ;
|
||||
if ( nParentId > GDB_ID_ROOT) {
|
||||
if ( ! m_OutScl.SetPartLayRef( ToString( nParentId), ToString( nId), frFrame))
|
||||
m_OutTsc.Remark( "Start Group ---") ;
|
||||
// emetto dati gruppo ( se non è radice)
|
||||
if ( nId > GDB_ID_ROOT) {
|
||||
Frame3d frFrame ;
|
||||
if ( ( nLev == 0 && m_pGDB->GetGroupGlobFrame( nId, frFrame)) ||
|
||||
( nLev > 0 && m_pGDB->GetGroupFrame( nId, frFrame))) {
|
||||
if ( ! m_OutTsc.NewGroupRef( frFrame, nLev))
|
||||
return false ;
|
||||
m_OutScl.PutCurrRef() ;
|
||||
m_OutTsc.PutCurrRef() ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
// emetto eventuale box
|
||||
if ( ( nFlag & 8) != 0) {
|
||||
BBox3d b3Loc ;
|
||||
if ( m_pGDB->GetLocalBBox( nId, b3Loc)) {
|
||||
m_OutTsc.PushGroup() ;
|
||||
if ( ! m_OutTsc.NewGroup( nLev))
|
||||
return false ;
|
||||
m_OutTsc.PutBBox( b3Loc) ;
|
||||
m_OutTsc.PopGroup() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
// emetto eventuale box
|
||||
if ( ( nFlag & 8) != 0) {
|
||||
BBox3d b3Loc ;
|
||||
if ( m_pGDB->GetLocalBBox( nId, b3Loc))
|
||||
m_OutScl.PutBBox( b3Loc) ;
|
||||
}
|
||||
// emetto entità gruppo
|
||||
m_OutScl.Remark( "Entities :") ;
|
||||
m_OutTsc.Remark( "Entities :") ;
|
||||
GdbIterator Iter( m_pGDB) ;
|
||||
bNext = Iter.GoToFirstInGroup( nId) ;
|
||||
bool bNext = Iter.GoToFirstInGroup( nId) ;
|
||||
while ( bNext) {
|
||||
nGdbType = Iter.GetGdbType() ;
|
||||
int nGdbType = Iter.GetGdbType() ;
|
||||
if ( nGdbType == GDB_TY_GEO) {
|
||||
if ( ! m_OutScl.PutGeoObj( Iter.GetGeoObj(), nFlag))
|
||||
if ( ! m_OutTsc.PutGeoObj( Iter.GetGeoObj(), nFlag))
|
||||
return false ;
|
||||
}
|
||||
else if ( nGdbType == GDB_TY_GROUP) {
|
||||
if ( ! OutGroupScl( Iter.GetId(), nFlag))
|
||||
m_OutTsc.PushGroup() ;
|
||||
if ( ! OutGroupTsc( Iter.GetId(), nFlag, nLev + 1))
|
||||
return false ;
|
||||
m_OutTsc.PopGroup() ;
|
||||
}
|
||||
bNext = Iter.GoToNext() ;
|
||||
}
|
||||
m_OutScl.Remark( "End Group ---") ;
|
||||
m_OutTsc.Remark( "End Group ---") ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user