6319efb8a1
- modifiche per sgrossatura e finitura di cornici su guide curve (manca spatolatura).
122 lines
6.1 KiB
C++
122 lines
6.1 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2016-2016
|
|
//----------------------------------------------------------------------------
|
|
// File : SawRoughing.h Data : 30.03.16 Versione : 1.6o4
|
|
// Contenuto : Dichiarazione della classe SawRoughing.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 30.03.16 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "Machining.h"
|
|
#include "SawRoughingData.h"
|
|
#include "ToolData.h"
|
|
#include "MachiningConst.h"
|
|
|
|
class ICurve ;
|
|
class ICurveLine ;
|
|
class ICurveArc ;
|
|
class ICurveComposite ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class SawRoughing : public Machining
|
|
{
|
|
public : // IUserObj
|
|
SawRoughing* 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_SAWROUGHING ; }
|
|
bool IsEmpty( void) const override
|
|
{ return ( m_nCuts == 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 ;
|
|
|
|
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( bool* pbChanged = nullptr) override ;
|
|
const ToolData& GetToolData( void) const override ;
|
|
bool GetGeometry( SELVECTOR& vIds) const override ;
|
|
|
|
public :
|
|
SawRoughing( void) ;
|
|
|
|
private :
|
|
bool VerifyGeometry( SelData Id, int& nSubs) ;
|
|
ICurve* GetCurve( SelData Id) ;
|
|
bool AdjustGeometry( int nAuxId) ;
|
|
bool CalculateToolPath( int nAuxId, int nClId) ;
|
|
bool CalculateCurvedToolPath( int nAuxId, int nClId) ;
|
|
bool CalculateSection( int nSectGrpId, ICurve*& pSect) ;
|
|
bool TrimSection( ICurve* pCrv) ;
|
|
bool CalculateGuideLine( int nGuideId, const BBox3d& b3Sect,
|
|
Point3d& ptGdStart, Point3d& ptGdEnd, Vector3d& vtGdDir) ;
|
|
bool CalculateOneWayCut( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtDir,
|
|
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bFirst, bool bLast) ;
|
|
bool CalculateZigZagCut( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtDir,
|
|
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bFirst, bool bLast,
|
|
int& nCount) ;
|
|
bool CalculateCurvedZigZagCut( const ICurve* pCut, const Vector3d& vtTool, double dElev, bool bFirst, bool bLast,
|
|
int& nCount) ;
|
|
bool AddApproach( const Point3d& ptP, const Vector3d& vtCorr, bool bFirst,
|
|
double dSafeZ, double dElev, double dAppr) ;
|
|
bool AddRetract( const Point3d& ptP, const Vector3d& vtCorr, double dSafeZ, double dElev, double dAppr) ;
|
|
bool CalculateToolAndCorrVersors( const Vector3d& vtTang, int nHeadSide,
|
|
Vector3d& vtTool, Vector3d& vtCorr) ;
|
|
bool GetHeightOnSection( const ICurve* pSect, double dX, double dYmin, double dYmax, double& dY) ;
|
|
bool GetWidthOnSection( const ICurve* pSect, double dY, double dXmin, double dXmax, double& dX) ;
|
|
bool CalculateSideElevation( const ICurve* pCut, double& dElev) ;
|
|
|
|
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
|
|
bool m_bStraight ; // flag per cornici diritte/curve
|
|
SawRoughingData m_Params ; // parametri lavorazione
|
|
ToolData m_TParams ; // parametri utensile
|
|
int m_nStatus ; // stato di aggiornamento della lavorazione
|
|
int m_nCuts ; // numero di tagli generati
|
|
} ;
|