Files
EgtMachKernel/Exit.cpp
T
Dario Sassi 3076dccb4b EgtMachKernel 1.6e7 :
- introdotto uso ObjUser per gruppi di macchina
- prima versione prototipo delle forature
- migliorie al calolo angoli e posizioni macchina.
2015-05-26 06:49:55 +00:00

111 lines
3.0 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : Exit.cpp Data : 25.05.15 Versione : 1.6e7
// Contenuto : Oggetto uscita per gruppo uscita di testa di macchina.
//
//
//
// Modifiche : 25.05.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "Exit.h"
#include "MachConst.h"
#include "/EgtDev/Include/EGkGdbConst.h"
#include "/EgtDev/Include/EGkObjUserFactory.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
using namespace std ;
//----------------------------------------------------------------------------
OBJUSER_REGISTER( "EMkExit", Exit) ;
//----------------------------------------------------------------------------
const string&
Exit::GetClassName( void) const
{
return OBJUSER_GETNAME( Exit) ;
}
//----------------------------------------------------------------------------
Exit*
Exit::Clone( void) const
{
// alloco oggetto
Exit* pExit = new(nothrow) Exit ;
// eseguo copia dei dati
if ( pExit != nullptr) {
try { pExit->m_nOwnerId = GDB_ID_NULL ;
pExit->m_sName = m_sName ;
pExit->m_ptPos = m_ptPos ;
pExit->m_vtTDir = m_vtTDir ;
pExit->m_sTool = m_sTool ;
}
catch( ...) {
delete pExit ;
return nullptr ;
}
}
// ritorno l'oggetto
return pExit ;
}
//----------------------------------------------------------------------------
bool
Exit::Dump( string& sOut, const char* szNewLine) const
{
sOut += GetClassName() + szNewLine ;
sOut += "Id=" + ToString( m_nOwnerId) + szNewLine ;
sOut += "Name=" + m_sName + szNewLine ;
sOut += "Pos=" + ToString( m_ptPos) + szNewLine ;
sOut += "TDir=" + ToString( m_vtTDir) + szNewLine ;
sOut += "Tool=" + m_sTool + szNewLine ;
return true ;
}
//----------------------------------------------------------------------------
bool
Exit::SetOwner( int nId)
{
m_nOwnerId = nId ;
return true ;
}
//----------------------------------------------------------------------------
int
Exit::GetOwner( void) const
{
return m_nOwnerId ;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
Exit::Exit( void)
: m_nOwnerId( GDB_ID_NULL)
{
}
//----------------------------------------------------------------------------
bool
Exit::Set( const string& sName, const Point3d& ptPos, const Vector3d& vtTDir)
{
m_sName = sName ;
m_ptPos = ptPos ;
m_vtTDir = vtTDir ;
m_sTool.clear() ;
return true ;
}
//----------------------------------------------------------------------------
bool
Exit::SetTool( const string& sTool)
{
m_sTool = sTool ;
return true ;
}