//---------------------------------------------------------------------------- // EgalTech 2024-2024 //---------------------------------------------------------------------------- // File : FiveAxisMilling.h Data : 22.05.24 Versione : 2.6e5 // Contenuto : Dichiarazione della classe FiveAxisMilling. // // // // Modifiche : 22.05.24 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "Machining.h" #include "FiveAxisMillingData.h" #include "ToolData.h" class ICurve ; class ICurveComposite ; //---------------------------------------------------------------------------- class FiveAxisMilling : public Machining { public : // IUserObj FiveAxisMilling* 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_FIVEAXISMILLING ; } bool IsEmpty( int nEmptyType = NEED_GEOM) const override { if ( m_nMills == 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& 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( void) override ; const ToolData& GetToolData( void) const override ; bool GetGeometry( SELVECTOR& vIds) const override ; public : FiveAxisMilling( void) ; private : bool MyApply( bool bRecalc, bool bPostApply) ; bool VerifyGeometry( SelData Id, int& nSubs) ; double GetApproxLinTol( void) const override ; 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 GetStartFeed() const { return ( IsNullLenValue( m_Params.m_dStartFeed) ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; } double GetEndFeed() const { return ( IsNullLenValue( m_Params.m_dEndFeed) ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; } double GetTipFeed() const { return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; } double GetOffsL() const { return ( IsUnknownValue( m_Params.m_dOffsL) ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; } double GetOffsR() const { return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; } private : SELVECTOR m_vId ; // identificativi entità geometriche da lavorare FiveAxisMillingData m_Params ; // parametri lavorazione ToolData m_TParams ; // parametri utensile int m_nStatus ; // stato di aggiornamento della lavorazione int m_nMills ; // numero di percorsi di lavoro generati bool m_bRunning ; // flag di calcoli in corso } ;