Files
EgtMachKernel/Table.cpp
T
Dario Sassi 2f016585bb EgtMachKernel :
- in calcolo angoli macchina aggiunta segnalazione di direzione utensile irraggiungibile
- in disposizione aggiunti controlli di sottopezzo e grezzo in tavola
- in simulazione la Move ora restituisce uno stato
- migliorato calcolo elevazione per lavorazioni con lama
- la tavola macchina conserva l'area utile.
2015-11-23 09:06:44 +00:00

111 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* pAx = new(nothrow) Table ;
// eseguo copia dei dati
if ( pAx != nullptr) {
try { pAx->m_nOwnerId = GDB_ID_NULL ;
pAx->m_pGeomDB = nullptr ;
pAx->m_sName = m_sName ;
pAx->m_nType = m_nType ;
pAx->m_ptRef1 = m_ptRef1 ;
}
catch( ...) {
delete pAx ;
return nullptr ;
}
}
// ritorno l'oggetto
return pAx ;
}
//----------------------------------------------------------------------------
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 ;
}