//---------------------------------------------------------------------------- // EgalTech 2018-2018 //---------------------------------------------------------------------------- // File : Mortising.h Data : 25.02.18 Versione : 1.9c1 // Contenuto : Dichiarazione della classe Mortising. // // // // Modifiche : 25.02.18 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "Machining.h" #include "MortisingData.h" #include "ToolData.h" struct SqHole ; class ICurve ; class ICurveComposite ; //---------------------------------------------------------------------------- class Mortising : public Machining { public : // IUserObj Mortising* 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_MORTISING ; } bool IsEmpty( void) const override { return ( m_nMortises == 0) ; } bool UpdateStatus( int nModif) override { m_nStatus |= nModif ; return true ; } protected : // Operation int GetSolCh( void) const override { return m_Params.m_nSolCh ; } 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 : Mortising( void) ; private : bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ; ICurve* GetCurve( SelData Id) ; bool Chain( int nGrpDestId) ; bool CalcSurfAuxView( int nAuxId, int nAuxViewId) ; bool ProcessPath( int nPathId, int nPvId, int nClId) ; bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double dThick, double& dElev) const ; bool GenerateMortisingPv( int nPathId, const ICurveComposite* pCompo) ; bool GenerateMortisingCl( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev, double dOkStep) ; double GetRadiusForStartEndElevation( void) const ; 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 MortisingData m_Params ; // parametri lavorazione ToolData m_TParams ; // parametri utensile int m_nStatus ; // stato di aggiornamento della lavorazione int m_nMortises ; // numero di mortasature generate } ;