Files
Dario Sassi 04bb4165c9 EgtMachKernel :
- modifiche a UpdateToolData per impostare lavorazione da riverificare se sono cambiati i dati dell'utensile.
2026-01-11 18:53:35 +01:00

177 lines
11 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
// File : Sawing.h Data : 07.06.15 Versione : 1.6f2
// Contenuto : Dichiarazione della classe Sawing.
//
//
//
// Modifiche : 07.06.15 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "SawingData.h"
#include "ToolData.h"
#include "MachiningConst.h"
class ICurve ;
class ICurveLine ;
class ICurveArc ;
class ICurveComposite ;
struct FseVar ;
//----------------------------------------------------------------------------
class Sawing : public Machining
{
public : // IUserObj
Sawing* 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_SAWING ; }
bool IsEmpty( int nEmptyType = NEED_GEOM) const override
{ if ( m_nCuts == 0)
return true ;
if ( nEmptyType == NEED_ONE_TP_OK)
return ( ! IsAtLeastOnePathOk()) ;
if ( nEmptyType == NEED_ALL_TP_OK)
return ( ! AreAllPathsOk()) ;
return false ; }
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 ;
public : // Machining
bool Prepare( const std::string& sSawName) 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( void) override ;
const ToolData& GetToolData( void) const override ;
bool GetGeometry( SELVECTOR& vIds) const override ;
public :
Sawing( void) ;
private :
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
ICurve* GetCurve( SelData Id) ;
bool Chain( int nGrpDestId) ;
bool VerifySideAngle( void) ;
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
bool ProcessEntity( const ICurve* pCrvP, const ICurve* pCrvC, const ICurve* pCrvN,
double dDepth, double dExtraCut, double dRbHeight, bool bIsFirst, bool bIsLast,
const std::string& sName, int nPvId, int nClId) ;
bool ProcessLine( const ICurve* pCrvP, const ICurveLine* pLineC, const ICurve* pCrvN,
double dDepth, double dExtraCut, double dRbHeight, bool bIsFirst, bool bIsLast,
const std::string& sName, int nPvId, int nClId) ;
bool GenerateLinePv( const ICurveLine* pLine, const Vector3d& vtTool, const Vector3d& vtCorr,
double dElev, double dExtraCut, double dRbHeight, const std::string& sName,
double dLiElev, double dStartWhiskExt, double dEndWhiskExt, int nPvId) ;
bool GenerateLineCl( const ICurveLine* pLine, const Vector3d& vtTool, const Vector3d& vtCorr,
double dElev, double dExtraCut, const std::string& sName,
double dLiStep, double dDeltaLiExt, double dDeltaLoExt, const FseVar& FvVar, int nClId) ;
bool ProcessExtCurve( const ICurve* pCrvP, const ICurveComposite* pCrvC, const ICurve* pCrvN,
double dDepth, double dExtraCut, double dRbHeight, bool bIsFirst, bool bIsLast,
const std::string& sName, int nPvId, int nClId) ;
bool GenerateExtCurvePv( const ICurveComposite* pCrv, double dOffs,
double dElev, double dExtraCut, double dRbHeight, const std::string& sName, int nPvId) ;
ICurveComposite* GenerateExtArcPvTrueCut( const ICurveArc* pArc, double dIntRad, double dExtRad,
double dSafety) ;
ICurveComposite* GenerateExtArcPvPreCut( const ICurveArc* pArc, double dIntRad, double dExtRad,
double dDeltaT, double dSafety) ;
ICurveComposite* GenerateExtArcPvPostCut( const ICurveArc* pArc, double dIntRad, double dExtRad,
double dDeltaT, double dSafety) ;
bool GenerateExtCurveCl( const ICurveComposite* pCrv,
double dElev, double dExtraCut, const std::string& sName, int nClId) ;
bool ProcessIntArc( const ICurve* pCrvP, const ICurveArc* pArcC, const ICurve* pCrvN,
double dDepth, double dExtraCut, double dRbHeight, bool bIsFirst, bool bIsLast,
const std::string& sName, int nPvId, int nClId) ;
bool GenerateIntArcPv( const ICurveArc* pArc,
const Vector3d& vtStaTool, const Vector3d& vtMidTool, const Vector3d& vtEndTool,
const Vector3d& vtStaCorr, const Vector3d& vtMidCorr, const Vector3d& vtEndCorr,
double dElev, double dExtraCut, double dRbHeight, double dLenCoeff, const std::string& sName, int nPvId) ;
ICurveComposite* GenerateIntArcPvTrueCut( const ICurveArc* pArc, double dDeltaInt, double dDeltaExt,
double dSafety) ;
ICurveComposite* GenerateIntArcPvPreCut( const ICurveArc* pArc, double dDeltaInt, double dDeltaExt,
double dSlantThick, double dDeltaT, double dSafety) ;
ICurveComposite* GenerateIntArcPvPostCut( const ICurveArc* pArc, double dIntRad, double dExtRad,
double dSlantThick, double dDeltaT, double dSafety) ;
bool GenerateIntArcCl( const ICurveArc* pArc,
const Vector3d& vtStaTool, const Vector3d& vtMidTool, const Vector3d& vtEndTool,
const Vector3d& vtStaCorr, const Vector3d& vtMidCorr, const Vector3d& vtEndCorr,
double dElev, double dExtraCut, const std::string& sName, int nClId) ;
bool CalculateToolAndCorrVersors( const Vector3d& vtTang, int nHeadSide, int nWorkSide, double dSideAng,
Vector3d& vtTool, Vector3d& vtCorr) ;
bool AdjustForSide( ICurve* pCurve) ;
bool AdjustIntArcForSide( ICurve* pCurve, double dSideAng) ;
bool AdjustLineForEdges( ICurveLine* pLine, double dElev, const Vector3d& vtCorr, const Vector3d& vtThick,
bool bIsFirst, bool bIsLast, bool bExtAngPC, bool bExtAngCN, double dLiElev,
bool& ToSkip, double& dDeltaLiExt, double& dDeltaLoExt) ;
bool AdjustCurveForEdges( ICurve* pCrv, double dElev, double dLenCoeff,
bool bIsFirst, bool bIsLast, bool bExtAngPC, bool bExtAngCN, bool& ToSkip) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ;
bool AddRetract( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ;
bool AreHeadWorkOnSameSide( void) const ;
bool AdjustFeeds( void) ;
private :
double GetSpeed( void) const
{ return ( IsNullAngValue( m_Params.m_dSpeed) ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
double GetFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dFeed) ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
double GetStartFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dStartFeed) ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
double GetEndFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dEndFeed) ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
double GetTipFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
double GetBackFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dBackFeed) ? m_TParams.m_dFeed : m_Params.m_dBackFeed) ; }
double GetSideAngFeed( void) const
{ return ( IsNullLenValue( m_Params.m_dSideAngFeed) ? m_TParams.m_dFeed : m_Params.m_dSideAngFeed) ; }
double GetOffsL( void) const
{ return ( IsUnknownValue( m_Params.m_dOffsL) ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
double GetOffsR( void) const
{ return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
double GetStepBack( void) const
{ return ( IsUnknownValue( m_Params.m_dStepBack) ? m_Params.m_dStep : m_Params.m_dStepBack) ; }
double GetStepLast( void) const
{ return ( IsUnknownValue( m_Params.m_dStepLast) ? GetStepBack() : m_Params.m_dStepLast) ; }
double GetStepSideAng( void) const
{ return ( IsUnknownValue( m_Params.m_dStepSideAng) ? m_Params.m_dStep : m_Params.m_dStepSideAng) ; }
double GetStepSideAngBack( void) const
{ return ( IsUnknownValue( m_Params.m_dStepSideAngBack) ? GetStepSideAng() : m_Params.m_dStepSideAngBack) ; }
private :
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
SawingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
bool m_bDownSE ; // flag per attacco/uscita senza risalite se fuori dal grezzo
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nCuts ; // numero di tagli generati
} ;