//---------------------------------------------------------------------------- // EgalTech 2018-2019 //---------------------------------------------------------------------------- // File : CAToolSurfTm.h Data : 06.06.19 Versione : 2.1f1 // Contenuto : Dichiarazioni per classe CAToolSurfTm. // // // // Modifiche : 27.04.18 DS Creazione modulo. // 06.06.19 DS Aggiunta gestione di pił superfici. // //---------------------------------------------------------------------------- #pragma once #include "SurfTriMesh.h" #include "Tool.h" #include "/EgtDev/Include/EGkHashGrids2d.h" #include "/EgtDev/Include/EGkCAvToolSurfTm.h" #include //----------------------------------------------------------------------------- class CAvToolSurfTm : public ICAvToolSurfTm { public : // ICAvToolSurfTm bool SetSurfTm( const ISurfTriMesh& Stm) override ; bool AddSurfTm( const ISurfTriMesh& Stm) override ; bool SetStdTool( double dH, double dR, double dCornR) override ; bool SetAdvTool( double dH, double dR, double dTipH, double dTipR, double dCornR) override ; bool SetSawTool( double dH, double dR, double dThick, double dStemR, double dCornR) override ; bool SetGenTool( const ICurveComposite* pToolOutline) override ; double GetToolRadius( void) const override { return m_Tool.GetRadius() ; } double GetToolHeight( void) const override { return m_Tool.GetHeigth() ; } double GetToolTipHeight( void) const override { return m_Tool.GetTipHeigth() ; } ; double GetToolTipRadius( void) const override { return m_Tool.GetTipRadius() ; } ; double GetToolCornRadius( void) const override { return m_Tool.GetCornRadius() ; } ; CISURFTMPVECTOR GetvStm( void) const { CISURFTMPVECTOR vcStm ; for ( int i = 0 ; i < int( m_vSTM.size()) ; ++ i) vcStm.emplace_back( CloneSurfTriMesh( m_vSTM[i])) ; return vcStm ; } const ICurveComposite& GetToolOutline( bool bApprox = false) const override { return ( bApprox ? m_Tool.GetApproxOutline() : m_Tool.GetOutline()) ;} bool TestPosition( const Point3d& ptT, const Vector3d& vtDir, const Vector3d& vtMove, double& dTotDist, Vector3d* pvtTriaN = nullptr) const override ; bool TestPositionAdv( const Point3d& ptT, const Vector3d& vtDir, const Vector3d& vtMove, double& dTotDist, VCT3DVECTOR& vVtN) const override ; bool TestSeries( PNTUVECTOR& vPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dProgCoeff = 1) override ; bool TestSeriesAdv( PNTUVVECTVECTOR& vPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dProgCoeff = 1) override ; bool TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dLinTol, double dProgCoeff = 1) override ; public : CAvToolSurfTm( void) ; bool Clear( void) ; private : bool TestSubSeries( int nId, PNTUVECTOR& vPntM, const Vector3d& vtDir, int nFirst, int nLast, double dProgCoeff) ; bool TestSubSeriesAdv( int nId, PNTUVVECTVECTOR& vPntM, const Vector3d& vtDir, int nFirst, int nLast, double dProgCoeff) ; bool TestSubPath( int nId, PNTULIST& lPntM, const Vector3d& vtDir, double dLinTol, double dProgCoeff) ; double MyTestPosition( Point3d& ptT, const Vector3d& vtDir, const Vector3d& vtMove, Vector3d& vtTriaN) const ; double MyTestPositionAdv( Point3d& ptT, const Vector3d& vtDir, const Vector3d& vtMove, VCT3DVECTOR& vVtTriaN) const ; double MyTestPositionHG( Point3d& ptT, const Vector3d& vtDir, Vector3d& vtTriaN) const ; double MyTestPositionHGAdv( Point3d& ptT, const Vector3d& vtDir, VCT3DVECTOR& vVtTriaN) const ; bool MyTestMidPointHG( PNTULIST& lPntM, const PNTULIST::iterator& itPntMPrev, const PNTULIST::iterator& itPntMCurr, const Point3d& ptPrev, const Point3d& ptCurr, const Vector3d& vtDir, double dLinTol, int nLev) const ; bool PrepareHashGrid( void) ; int GetSurfInd( int nT) const ; private : typedef std::vector CSURFTMPVECTOR ; // vettore di puntatori a const SurfTriMesh private : Frame3d m_frMove ; CSURFTMPVECTOR m_vSTM ; INTVECTOR m_vBaseInd ; HashGrids2d m_HGrids ; Tool m_Tool ; int m_nTotPnt ; std::atomic m_nCurrPnt ; std::atomic m_bBreak ; } ;