EgtMachKernel 1.8e6 :

- aggiunte GetMachiningStartPoint e GetMachiningEndPoint.
This commit is contained in:
Dario Sassi
2017-06-01 15:02:59 +00:00
parent 6c7a60b60a
commit 44a9bdadf6
5 changed files with 92 additions and 11 deletions
+55 -10
View File
@@ -16,17 +16,8 @@
#include "DllMain.h"
#include "MachMgr.h"
#include "Machining.h"
#include "MachiningConst.h"
#include "CamData.h"
#include "/EgtDev/Include/EGkAngle.h"
#include "/EgtDev/Include/EGkGeoPoint3d.h"
#include "/EgtDev/Include/EGkCurveLine.h"
#include "/EgtDev/Include/EGkCurveArc.h"
#include "/EgtDev/Include/EgkDistPointCurve.h"
#include "/EgtDev/Include/EgkIntersCurves.h"
#include "/EgtDev/Include/EGkIntersLineSurfTm.h"
#include "/EgtDev/Include/EGkGeomDB.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
#include "/EgtDev/Include/EGkCurve.h"
using namespace std ;
@@ -71,6 +62,60 @@ Machining:: NeedPrevHome( void) const
return false ;
}
//----------------------------------------------------------------------------
bool
Machining::GetStartPoint( Point3d& ptStart) const
{
// verifico validità gestore DB geometrico
if ( m_pGeomDB == nullptr)
return false ;
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
if ( nClId == GDB_ID_NULL)
return false ;
// recupero la prima entità del primo sottogruppo
int nEntId = m_pGeomDB->GetFirstInGroup( m_pGeomDB->GetFirstGroupInGroup( nClId)) ;
if ( nEntId == GDB_ID_NULL)
return false ;
// recupero il punto iniziale di questa entità
const IGeoObj* pGeoObj = m_pGeomDB->GetGeoObj( nEntId) ;
if ( pGeoObj->GetType() == GEO_PNT3D) {
ptStart = GetGeoPoint3d( pGeoObj)->GetPoint() ;
return true ;
}
else if ( ( pGeoObj->GetType() & GEO_CURVE) != 0)
return GetCurve( pGeoObj)->GetStartPoint( ptStart) ;
else
return false ;
}
//----------------------------------------------------------------------------
bool
Machining::GetEndPoint( Point3d& ptEnd) const
{
// verifico validità gestore DB geometrico
if ( m_pGeomDB == nullptr)
return false ;
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( GetOwner(), MCH_CL) ;
if ( nClId == GDB_ID_NULL)
return false ;
// recupero l'ultima entità dell'ultimo sottogruppo
int nEntId = m_pGeomDB->GetLastInGroup( m_pGeomDB->GetLastGroupInGroup( nClId)) ;
if ( nEntId == GDB_ID_NULL)
return false ;
// recupero il punto finale di questa entità
const IGeoObj* pGeoObj = m_pGeomDB->GetGeoObj( nEntId) ;
if ( pGeoObj->GetType() == GEO_PNT3D) {
ptEnd = GetGeoPoint3d( pGeoObj)->GetPoint() ;
return true ;
}
else if ( ( pGeoObj->GetType() & GEO_CURVE) != 0)
return GetCurve( pGeoObj)->GetEndPoint( ptEnd) ;
else
return false ;
}
//----------------------------------------------------------------------------
bool
Machining::PostApply( void)