EgtExchange 2.2f3 :
- in import BTL aggiunte curve per smussi a processo DoubleCut (1/2-011-X) - in import BTL estesa gestione Outline e Aperture.
This commit is contained in:
+52
-9
@@ -59,6 +59,7 @@ static const std::string PAR_XZ = "XZ" ;
|
||||
static const std::string PAR_YX = "YX" ;
|
||||
static const std::string PAR_YY = "YY" ;
|
||||
static const std::string PAR_YZ = "YZ" ;
|
||||
static const std::string PAR_PROCESS = "PROCESS" ;
|
||||
static const std::string PAR_SIDE = "SIDE" ;
|
||||
static const std::string PAR_P = "P" ;
|
||||
|
||||
@@ -485,16 +486,23 @@ ImportBtl::ReadTransformation( const string& sVal, Frame3d& frRef)
|
||||
bool
|
||||
ImportBtl::ReadOutline( void)
|
||||
{
|
||||
bool bProcFound = false ;
|
||||
int nSide = BTL_SIDE_NONE ;
|
||||
FCEDEQUE dqFce ;
|
||||
STRVECTOR vsUAtt ;
|
||||
// ciclo sulle linee
|
||||
string sLine ;
|
||||
while ( m_theScanner.GetLine( sLine)) {
|
||||
// spezzo la linea
|
||||
string sKey, sVal ;
|
||||
SplitFirst( sLine, ":", sKey, sVal) ;
|
||||
// se attributo utente
|
||||
if ( sKey == KEY_USERATTRIBUTE) {
|
||||
vsUAtt.emplace_back( sVal) ;
|
||||
continue ;
|
||||
}
|
||||
// se cambio tipologia, concludo
|
||||
if ( sKey != KEY_OUTLINE) {
|
||||
else if ( sKey != KEY_OUTLINE) {
|
||||
m_theScanner.UngetLine( sLine) ;
|
||||
break ;
|
||||
}
|
||||
@@ -502,6 +510,14 @@ ImportBtl::ReadOutline( void)
|
||||
// tipo
|
||||
int nFlag ;
|
||||
GetParamP( sVal, 8, nFlag) ;
|
||||
// se non ancora assegnato, leggo se da lavorare
|
||||
if ( ! bProcFound) {
|
||||
string sToDo ;
|
||||
GetInfo( sVal, PAR_PROCESS, sToDo) ;
|
||||
if ( sToDo.find( "YES") != 0)
|
||||
vsUAtt.emplace_back( "DO:0") ;
|
||||
bProcFound = true ;
|
||||
}
|
||||
// se non ancora assegnata, leggo faccia di riferimento
|
||||
if ( nSide == BTL_SIDE_NONE)
|
||||
GetInfo( sVal, PAR_SIDE, nSide) ;
|
||||
@@ -521,23 +537,30 @@ ImportBtl::ReadOutline( void)
|
||||
dqFce.emplace_back( nFlag, ptP, ptM, 0., 0, 0) ;
|
||||
}
|
||||
// inserimento del contorno nel pezzo
|
||||
return m_BtlGeom.AddPartOutline( nSide, dqFce) ;
|
||||
return m_BtlGeom.AddPartOutline( nSide, dqFce, vsUAtt) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ImportBtl::ReadAperture( void)
|
||||
{
|
||||
bool bProcFound = false ;
|
||||
int nSide = BTL_SIDE_NONE ;
|
||||
FCEDEQUE dqFce ;
|
||||
STRVECTOR vsUAtt ;
|
||||
// ciclo sulle linee
|
||||
string sLine ;
|
||||
while ( m_theScanner.GetLine( sLine)) {
|
||||
// spezzo la linea
|
||||
string sKey, sVal ;
|
||||
SplitFirst( sLine, ":", sKey, sVal) ;
|
||||
// se attributo utente
|
||||
if ( sKey == KEY_USERATTRIBUTE) {
|
||||
vsUAtt.emplace_back( sVal) ;
|
||||
continue ;
|
||||
}
|
||||
// se cambio tipologia, concludo
|
||||
if ( sKey != KEY_APERTURE) {
|
||||
else if ( sKey != KEY_APERTURE) {
|
||||
m_theScanner.UngetLine( sLine) ;
|
||||
break ;
|
||||
}
|
||||
@@ -547,10 +570,20 @@ ImportBtl::ReadAperture( void)
|
||||
GetParamP( sVal, 8, nFlag) ;
|
||||
// se tipo start ed esistono precedenti entità, ne derivo una apertura
|
||||
if ( nFlag == FreeContourEnt::START && dqFce.size() > 0) {
|
||||
if ( ! m_BtlGeom.AddPartAperture( nSide, dqFce))
|
||||
if ( ! m_BtlGeom.AddPartAperture( nSide, dqFce, vsUAtt))
|
||||
return false ;
|
||||
nSide = BTL_SIDE_NONE ;
|
||||
bProcFound = false ;
|
||||
dqFce.clear() ;
|
||||
vsUAtt.clear() ;
|
||||
}
|
||||
// se non ancora assegnato, leggo se da lavorare
|
||||
if ( ! bProcFound) {
|
||||
string sToDo ;
|
||||
GetInfo( sVal, PAR_PROCESS, sToDo) ;
|
||||
if ( sToDo.find( "YES") != 0)
|
||||
vsUAtt.emplace_back( "DO:0") ;
|
||||
bProcFound = true ;
|
||||
}
|
||||
// se non ancora assegnata, leggo faccia di riferimento
|
||||
if ( nSide == BTL_SIDE_NONE)
|
||||
@@ -571,7 +604,7 @@ ImportBtl::ReadAperture( void)
|
||||
dqFce.emplace_back( nFlag, ptP, ptM, 0., 0, 0) ;
|
||||
}
|
||||
// inserimento dell'ultima apertura nel pezzo
|
||||
return m_BtlGeom.AddPartAperture( nSide, dqFce) ;
|
||||
return m_BtlGeom.AddPartAperture( nSide, dqFce, vsUAtt) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -777,16 +810,26 @@ ImportBtl::GetProcessParams( const string& sText, const string& sProcType,
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ImportBtl::GetInfo( const string& sText, const string& sPar, int& nVal)
|
||||
ImportBtl::GetInfo( const string& sText, const string& sPar, string& sVal)
|
||||
{
|
||||
// cerco l'identificativo del parametro
|
||||
size_t nPos = sText.find( sPar + ":") ;
|
||||
if ( nPos == string::npos)
|
||||
return false ;
|
||||
// recupero la stringa successiva
|
||||
const int SVAL_LEN = 14 ;
|
||||
string sVal = sText.substr( nPos + sPar.length() + 1, SVAL_LEN) ;
|
||||
TrimLeft( sVal, " \t\r\n0") ;
|
||||
const int SVAL_LEN = 6 ;
|
||||
sVal = sText.substr( nPos + sPar.length() + 1, SVAL_LEN) ;
|
||||
Trim( sVal, " \t\r\n0") ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ImportBtl::GetInfo( const string& sText, const string& sPar, int& nVal)
|
||||
{
|
||||
string sVal ;
|
||||
if ( ! GetInfo( sText, sPar, sVal))
|
||||
return false ;
|
||||
nVal = 0 ;
|
||||
FromString( sVal, nVal) ;
|
||||
return true ;
|
||||
|
||||
Reference in New Issue
Block a user