EgtMachKernel 1.6k10 :

- sistemazioni varie in grezzi, lavorazioni, ....
This commit is contained in:
Dario Sassi
2015-12-07 08:03:39 +00:00
parent 5eb5cb387f
commit 42e1a696a1
33 changed files with 1354 additions and 277 deletions
+25 -8
View File
@@ -27,6 +27,8 @@ using namespace std ;
//----------------------------------------------------------------------------
static std::string DIS_TABLE = "Tab" ;
static std::string DIS_REF1 = "Ref1" ;
static std::string DIS_AREA1 = "Area1" ;
static std::string DIS_FXD_TOT = "FxT" ;
static std::string DIS_FXD_NAME = "FxN" ;
static std::string DIS_FXD_POS = "FxP" ;
@@ -56,9 +58,9 @@ Disposition::Clone( void) const
Disposition* pDisp = new(nothrow) Disposition ;
// eseguo copia dei dati
if ( pDisp != nullptr) {
try { pDisp->m_nOwnerId = GDB_ID_NULL ;
pDisp->m_pGeomDB = nullptr ;
pDisp->m_sTabName = m_sTabName ;
try { pDisp->m_sTabName = m_sTabName ;
pDisp->m_ptRef1 = m_ptRef1 ;
pDisp->m_b3Area1 = m_b3Area1 ;
pDisp->m_bTabOk = m_bTabOk ;
pDisp->m_vFixData = m_vFixData ;
pDisp->m_vMvrData = m_vMvrData ;
@@ -78,6 +80,8 @@ Disposition::Dump( string& sOut, bool bMM, const char* szNewLine) const
{
sOut += GetClassName() + "[mm]" + szNewLine ;
sOut += "Tab=" + m_sTabName + ( m_bTabOk ? " (ok)" : " (to verify)") + szNewLine ;
sOut += "Ref1=(" + ToString( m_ptRef1, 3) + ")" + szNewLine ;
sOut += "Area1=(" + ToString( m_b3Area1, 3) + ")" + szNewLine ;
for ( const auto& FixData : m_vFixData) {
sOut += "FxD=" + FixData.sName + "," +
ToString( FixData.nId) + ",(" +
@@ -114,10 +118,16 @@ Disposition::Save( STRVECTOR& vString) const
int nFxdLines = 1 + 3 * nFxdTot ;
int nMvdTot = int( m_vMvrData.size()) ;
int nMvdLines = 1 + 4 * nMvdTot ;
vString.insert( vString.begin(), 1 + nFxdLines + nMvdLines, "") ;
vString.insert( vString.begin(), 3 + nFxdLines + nMvdLines, "") ;
// nome
if ( ! SetVal( DIS_TABLE, m_sTabName, vString[++k]))
return false ;
// Primo riferimento
if ( ! SetVal( DIS_REF1, m_ptRef1, vString[++k]))
return false ;
// Prima area
if ( ! SetVal( DIS_AREA1, m_b3Area1, vString[++k]))
return false ;
// dati sottopezzi
if ( ! SetVal( DIS_FXD_TOT, nFxdTot, vString[++k]))
return false ;
@@ -146,18 +156,24 @@ Disposition::Save( STRVECTOR& vString) const
bool
Disposition::Load( const STRVECTOR& vString)
{
if ( vString.size() < 3)
if ( vString.size() < 5)
return false ;
int k = - 1 ;
// nome
if ( ! GetVal( vString[++k], DIS_TABLE, m_sTabName))
return false ;
// primo riferimento
if ( ! GetVal( vString[++k], DIS_REF1, m_ptRef1))
return false ;
// prima area
if ( ! GetVal( vString[++k], DIS_AREA1, m_b3Area1))
return false ;
// dati sottopezzi
int nFxdTot ;
if ( ! GetVal( vString[++k], DIS_FXD_TOT, nFxdTot))
return false ;
int nFxdLines = 1 + 3 * nFxdTot ;
if ( int( vString.size()) < 1 + nFxdLines + 1)
if ( int( vString.size()) < 3 + nFxdLines + 1)
return false ;
m_vFixData.insert( m_vFixData.begin(), nFxdTot, FixtureData()) ;
for ( auto& FixData : m_vFixData) {
@@ -171,7 +187,7 @@ Disposition::Load( const STRVECTOR& vString)
if ( ! GetVal( vString[++k], DIS_MVD_TOT, nMvdTot))
return false ;
int nMvdLines = 1 + 4 * nMvdTot ;
if ( int( vString.size()) < 1 + nFxdLines + nMvdLines)
if ( int( vString.size()) < 3 + nFxdLines + nMvdLines)
return false ;
m_vMvrData.insert( m_vMvrData.begin(), nMvdTot, MoveRawData()) ;
for ( auto& MvrData : m_vMvrData) {
@@ -645,7 +661,8 @@ Disposition::ApplyRotationToRawPart( int nRawId, double dAngCDeg, double dAngADe
// recupero riferimento del grezzo (coincide con quello globale)
Frame3d* pfrRaw = m_pGeomDB->GetGroupFrame( nRawId) ;
// lo trasformo nel nuovo riferimento
pfrRaw->Set( pfrRaw->Orig(), dAngCDeg, dAngADeg, dAngC1Deg) ;
Point3d ptOrig = pfrRaw->Orig() ; // necessario copiarlo
pfrRaw->Set( ptOrig, dAngCDeg, dAngADeg, dAngC1Deg) ;
return true ;
}