Files
EgtMachKernel/Table.cpp
T
Dario Sassi b373807375 EgtMachKernel :
- aggiunta gestione prima disposizione in lista operazioni
- migliorato controllo dati macchina al caricamento
- ora macchina deve essere disegnata e definita cinematicamente con tutti gli assi a 0,
  si definisce la posizione home e dopo il carico viene posta in questa posizione.
2015-05-31 14:10:00 +00:00

109 lines
3.1 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/EGkObjUserFactory.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
using namespace std ;
//----------------------------------------------------------------------------
OBJUSER_REGISTER( "EMkTable", Table) ;
//----------------------------------------------------------------------------
const string&
Table::GetClassName( void) const
{
return OBJUSER_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, 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( m_ptRef1) + ")" + 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)
{
m_sName = sName ;
m_nType = nType ;
m_ptRef1 = ptRef1 ;
return true ;
}