EgtMachKernel 1.8e6 :
- aggiunte GetMachiningStartPoint e GetMachiningEndPoint.
This commit is contained in:
Binary file not shown.
@@ -251,6 +251,8 @@ class MachMgr : public IMachMgr
|
||||
bool GetMachiningParam( int nType, std::string& sVal) const override ;
|
||||
bool GetMachiningGeometry( SELVECTOR& vIds) const override ;
|
||||
bool IsMachiningEmpty( void) const override ;
|
||||
bool GetMachiningStartPoint( Point3d& ptStart) const override ;
|
||||
bool GetMachiningEndPoint( Point3d& ptEnd) const override ;
|
||||
// Simulation
|
||||
bool SimStart( bool bFirst) override ;
|
||||
bool SimMove( int& nStatus) override ;
|
||||
|
||||
@@ -1043,3 +1043,35 @@ MachMgr::IsMachiningEmpty( void) const
|
||||
// restituisco lo stato
|
||||
return pMch->IsEmpty() ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetMachiningStartPoint( Point3d& ptStart) const
|
||||
{
|
||||
// recupero la lavorazione corrente
|
||||
int nCurrMchId = GetCurrMachining() ;
|
||||
if ( nCurrMchId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// ne recupero il gestore
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// restituisco il punto iniziale del primo percorso di lavorazione
|
||||
return pMch->GetStartPoint( ptStart) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetMachiningEndPoint( Point3d& ptEnd) const
|
||||
{
|
||||
// recupero la lavorazione corrente
|
||||
int nCurrMchId = GetCurrMachining() ;
|
||||
if ( nCurrMchId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// ne recupero il gestore
|
||||
Machining* pMch = GetMachining( m_pGeomDB->GetUserObj( nCurrMchId)) ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
// restituisco il punto finale dell'ultimo percorso di lavorazione
|
||||
return pMch->GetEndPoint( ptEnd) ;
|
||||
}
|
||||
|
||||
+55
-10
@@ -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)
|
||||
|
||||
+3
-1
@@ -43,10 +43,12 @@ class Machining : public Operation
|
||||
virtual bool GetGeometry( SELVECTOR& vIds) const = 0 ;
|
||||
|
||||
public :
|
||||
bool PostApply( void) ;
|
||||
bool GetStartPoint( Point3d& ptStart) const ;
|
||||
bool GetEndPoint( Point3d& ptEnd) const ;
|
||||
|
||||
protected :
|
||||
Machining( void) ;
|
||||
bool PostApply( void) ;
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user