cdbc4bfb63
- aggiunta gestione quota di base del tool holder ( se negativa indica spazio libero su testa).
132 lines
6.9 KiB
C++
132 lines
6.9 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2019-2019
|
|
//----------------------------------------------------------------------------
|
|
// File : WaterJetting.h Data : 08.07.19 Versione : 2.1gf2
|
|
// Contenuto : Dichiarazione della classe WaterJetting.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 08.07.19 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "Machining.h"
|
|
#include "WaterJettingData.h"
|
|
#include "ToolData.h"
|
|
#include "/EgtDev/Include/EGkCurve.h"
|
|
|
|
class ICurveComposite ;
|
|
class ISurfFlatRegion ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class WaterJetting : public Machining
|
|
{
|
|
public : // IUserObj
|
|
WaterJetting* Clone( void) const override ;
|
|
const std::string& GetClassName( void) const override ;
|
|
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
|
|
bool ToSave( void) const override
|
|
{ return true ; }
|
|
bool Save( int nBaseId, STRVECTOR& vString) const override ;
|
|
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
|
|
|
public : // Operation
|
|
int GetType( void) const override
|
|
{ return OPER_WATERJETTING ; }
|
|
bool IsEmpty( void) const override
|
|
{ return ( m_nMills == 0) ; }
|
|
bool UpdateStatus( int nModif) override
|
|
{ m_nStatus |= nModif ; return true ; }
|
|
|
|
protected : // Operation
|
|
int GetSolCh( void) const override
|
|
{ return m_Params.m_nSolCh ; }
|
|
bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const override ;
|
|
bool AdjustArcCenterForAxesCalc( const CamData* pCamData, Point3d& ptCen) const override ;
|
|
|
|
public : // Machining
|
|
bool Prepare( const std::string& sMillName) override ;
|
|
bool SetParam( int nType, bool bVal) override ;
|
|
bool SetParam( int nType, int nVal) override ;
|
|
bool SetParam( int nType, double dVal) override ;
|
|
bool SetParam( int nType, const std::string& sVal) override ;
|
|
bool SetGeometry( const SELVECTOR& vIds) override ;
|
|
bool Preview( bool bRecalc) override ;
|
|
bool Apply( bool bRecalc, bool bPostApply) override ;
|
|
bool Update( bool bPostApply) override ;
|
|
bool GetParam( int nType, bool& bVal) const override ;
|
|
bool GetParam( int nType, int& nVal) const override ;
|
|
bool GetParam( int nType, double& dVal) const override ;
|
|
bool GetParam( int nType, std::string& sVal) const override ;
|
|
bool UpdateToolData( bool* pbChanged = nullptr) override ;
|
|
const ToolData& GetToolData( void) const override ;
|
|
bool GetGeometry( SELVECTOR& vIds) const override ;
|
|
|
|
public :
|
|
WaterJetting( void) ;
|
|
|
|
private :
|
|
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
|
|
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
|
|
bool Chain( int nGrpDestId) ;
|
|
bool VerifySideAngle( void) ;
|
|
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
|
|
bool AdjustPathForInternalAngles( ICurveComposite* pCompo) ;
|
|
bool GeneratePreView( int nPathId, const ICurveComposite* pCompo, double dAddedOverlap) ;
|
|
bool AddLeadInPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ;
|
|
bool AddLeadOutPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ;
|
|
bool AddLoopsPreview( const ICurveComposite* pCompo, ISurfFlatRegion* pSPV) ;
|
|
bool AddStandardWj( const ICurveComposite* pCompo, const Vector3d& vtTool, bool bSplitArcs) ;
|
|
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ) ;
|
|
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ) ;
|
|
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
|
const ICurveComposite* pCompo, Point3d& ptP1) const ;
|
|
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
|
|
const Vector3d& vtN, bool bSplitArcs) ;
|
|
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
|
|
bool bSplitArcs, Point3d& ptP1) ;
|
|
double GetRadiusForStartEndElevation( void) const ;
|
|
bool GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, double dElev) const ;
|
|
bool GetPointAboveRaw( const Point3d& ptP) const ;
|
|
bool SetToolCorrAuxDir( const Vector3d& vtTool, const Vector3d& vtCorr) ;
|
|
bool CalcAndSetToolCorrAuxDir( const ICurveComposite* pCompo, double dU) ;
|
|
Vector3d CalcToolDir( const ICurveComposite* pCompo, double dU) ;
|
|
Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU) ;
|
|
bool CalcOffset( ICurveComposite* pCompo, double dSignOffs) ;
|
|
bool IsExternalAngle( double dAng) ;
|
|
bool IsInternalAngle( double dAng) ;
|
|
bool VerifyMaxLenCurves( ICurveComposite* pCompo, double dMaxLen) ;
|
|
|
|
private :
|
|
double GetSpeed() const
|
|
{ return ( IsNullAngValue( m_Params.m_dSpeed) ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
|
|
double GetFeed() const
|
|
{ return ( IsNullLenValue( m_Params.m_dFeed) ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
|
|
double GetActualFeed() const
|
|
{ return ( ( m_Params.m_dThickRef < EPS_SMALL ? 1. : m_Params.m_dThickRef / m_dElev) * GetFeed()) ; }
|
|
double GetActualReducedFeed() const
|
|
{ return ( 100. - m_Params.m_nCornerSlowPerc) / 100. * GetActualFeed() ; }
|
|
double GetTipFeed() const
|
|
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
|
|
double GetOffsR() const
|
|
{ return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
|
|
int GetLeadInType( void) const ;
|
|
int GetLeadOutType( void) const ;
|
|
friend class LeadIOStatus ;
|
|
|
|
private :
|
|
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
|
|
WaterJettingData m_Params ; // parametri lavorazione
|
|
ToolData m_TParams ; // parametri utensile
|
|
double m_dTHoldBase ; // posizione base del porta-utensile
|
|
double m_dTHoldLen ; // lunghezza del porta-utensile
|
|
double m_dTHoldDiam ; // diametro del porta-utensile
|
|
double m_dElev ; // elevazione del percorso tenendo conto dell'angolo di fianco
|
|
int m_nStatus ; // stato di aggiornamento della lavorazione
|
|
int m_nMills ; // numero di percorsi di lavoro generati
|
|
int m_nHeadSolCh ; // criterio scelta soluzione impostato nella testa
|
|
Point3d m_ptLastProbe ; // ultimo punto tastato
|
|
} ; |