a4831980e7
- piccoli aggiustamenti.
204 lines
5.8 KiB
C++
204 lines
5.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2019-2023
|
|
//----------------------------------------------------------------------------
|
|
// File : MachMgrClEntities.cpp Data : 27.10.23 Versione : 2.5j4
|
|
// Contenuto : Implementazione interrogazione entità CL della classe MachMgr.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 15.10.19 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "DllMain.h"
|
|
#include "MachMgr.h"
|
|
#include "MachConst.h"
|
|
#include "CamData.h"
|
|
|
|
using namespace std ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntMove( int nEntId, int& nMove) const
|
|
{
|
|
// default
|
|
nMove = 0 ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero il tipo di movimento
|
|
nMove = pCamData->GetMoveType() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntFlag( int nEntId, int& nFlag, int& nFlag2) const
|
|
{
|
|
// default
|
|
nFlag = 0 ;
|
|
nFlag2 = 0 ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero i flag
|
|
nFlag = pCamData->GetFlag() ;
|
|
nFlag2 = pCamData->GetFlag2() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntIndex( int nEntId, int& nIndex) const
|
|
{
|
|
// default
|
|
nIndex = 0 ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero l'indice
|
|
nIndex = pCamData->GetIndex() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntFeed( int nEntId, double& dFeed) const
|
|
{
|
|
// default
|
|
dFeed = 0 ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero la feed
|
|
dFeed = pCamData->GetFeed() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntAxesStatus( int nEntId, int& nStatus) const
|
|
{
|
|
// default
|
|
nStatus = 0 ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero il tipo di movimento
|
|
nStatus = pCamData->GetAxesStatus() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntAxesMask( int nEntId, int& nMask) const
|
|
{
|
|
// default
|
|
nMask = 0 ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero il tipo di movimento
|
|
nMask = pCamData->GetAxesMask() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntAxesVal( int nEntId, DBLVECTOR& vAxes) const
|
|
{
|
|
// default
|
|
vAxes.clear() ;
|
|
// verifico validita GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero i valori degli assi
|
|
vAxes = pCamData->GetAxesVal() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntTDir( int nEntId, Vector3d& vtTDir) const
|
|
{
|
|
// default
|
|
vtTDir = V_NULL ;
|
|
// verifico validità GeomBD
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero TDir
|
|
vtTDir = pCamData->GetToolDir() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntCDir( int nEntId, Vector3d& vtCDir) const
|
|
{
|
|
// default
|
|
vtCDir = V_NULL ;
|
|
// verifico validità GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero CDir
|
|
vtCDir = pCamData->GetCorrDir() ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
MachMgr::GetClEntADir( int nEntId, Vector3d& vtADir) const
|
|
{
|
|
// default
|
|
vtADir = V_NULL ;
|
|
// verifico validità GeomDB
|
|
if ( m_pGeomDB == nullptr)
|
|
return false ;
|
|
// recupero l'oggetto CamData
|
|
const CamData* pCamData = GetCamData( m_pGeomDB->GetUserObj( nEntId)) ;
|
|
if ( pCamData == nullptr)
|
|
return false ;
|
|
// recupero ADir
|
|
vtADir = pCamData->GetAuxDir() ;
|
|
return true ;
|
|
}
|