Files
Dario Sassi 2dccb76184 EgtMachKernel :
- aggiunta possibilità di scalare la tavola
- migliorata NewName (se si propone Nome_1 ora se già esiste prova con Nome_2, Nome_3 e non Nome_1_1, ...) 
- in milling curve composite gestite come entità atomiche per sequenziamento
- in milling gestito offset longitudinale
- in milling migliorato calcolo elevazione per attacchi/uscite
- in simulazione tolto reset iniziale utensili.
2016-06-28 13:34:31 +00:00

110 lines
3.2 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : Table.cpp Data : 25.05.15 Versione : 1.6e7
// Contenuto : Oggetto tavola per gruppo tavola di macchina.
//
//
//
// Modifiche : 25.05.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "Table.h"
#include "MachConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkUserObjFactory.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EGkUiUnits.h"
using namespace std ;
//----------------------------------------------------------------------------
USEROBJ_REGISTER( "EMkTable", Table) ;
//----------------------------------------------------------------------------
const string&
Table::GetClassName( void) const
{
return USEROBJ_GETNAME( Table) ;
}
//----------------------------------------------------------------------------
Table*
Table::Clone( void) const
{
// alloco oggetto
Table* pTab = new(nothrow) Table ;
// eseguo copia dei dati
if ( pTab != nullptr) {
try { pTab->m_nOwnerId = GDB_ID_NULL ;
pTab->m_pGeomDB = nullptr ;
pTab->m_sName = m_sName ;
pTab->m_nType = m_nType ;
pTab->m_ptRef1 = m_ptRef1 ;
}
catch( ...) {
delete pTab ;
return nullptr ;
}
}
// ritorno l'oggetto
return pTab ;
}
//----------------------------------------------------------------------------
bool
Table::Dump( string& sOut, bool bMM, const char* szNewLine) const
{
sOut += GetClassName() + szNewLine ;
sOut += "Id=" + ToString( m_nOwnerId) + szNewLine ;
sOut += "Name=" + m_sName + szNewLine ;
sOut += "Type=" + ToString( m_nType) + szNewLine ;
sOut += "Ref1=(" + ToString( GetInUiUnits(m_ptRef1, bMM), 4) + ")" + szNewLine ;
return true ;
}
//----------------------------------------------------------------------------
bool
Table::SetOwner( int nId, IGeomDB* pGDB)
{
m_nOwnerId = nId ;
m_pGeomDB = pGDB ;
return ( m_nOwnerId != GDB_ID_NULL && m_pGeomDB != nullptr) ;
}
//----------------------------------------------------------------------------
int
Table::GetOwner( void) const
{
return m_nOwnerId ;
}
//----------------------------------------------------------------------------
IGeomDB*
Table::GetGeomDB( void) const
{
return m_pGeomDB ;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
Table::Table( void)
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_nType( MCH_TT_NONE), m_ptRef1()
{
}
//----------------------------------------------------------------------------
bool
Table::Set( const string& sName, int nType, const Point3d& ptRef1, const BBox3d& b3Area1)
{
m_sName = sName ;
m_nType = nType ;
m_ptRef1 = ptRef1 ;
m_b3Area1 = b3Area1 ;
return true ;
}