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

148 lines
8.4 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2016-2016
//----------------------------------------------------------------------------
// File : SawFinishing.h Data : 05.04.16 Versione : 1.6o4
// Contenuto : Dichiarazione della classe SawFinishing.
//
//
//
// Modifiche : 05.04.16 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "Machining.h"
#include "SawFinishingData.h"
#include "ToolData.h"
#include "MachiningConst.h"
class ICurve ;
class ICurveLine ;
class ICurveArc ;
class ICurveComposite ;
//----------------------------------------------------------------------------
class SawFinishing : public Machining
{
public : // IUserObj
SawFinishing* 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_SAWFINISHING ; }
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 :
SawFinishing( void) ;
private :
bool VerifyGeometry( SelData Id, int& nSubs) ;
ICurve* GetCurve( SelData Id) ;
bool AdjustGeometry( int nAuxId) ;
bool CalculateStraightAlongToolPath( int nAuxId, int nClId) ;
bool CalculateStraightAcrossToolPath( int nAuxId, int nClId) ;
bool CalculateCurvedAlongToolPath( int nAuxId, int nClId) ;
bool CalculateCurvedAcrossToolPath( 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 ClassifySection( ICurve* pCrv, INTVECTOR& vnClass) ;
bool CalcAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax, const Frame3d& frSect,
const Point3d& ptGdStart, const Point3d& ptGdEnd, const Vector3d& vtGdDir,
double dDepth, double dRaxMaxZ, const Vector3d& vtTool, const Vector3d& vtCorr) ;
bool CalcAlongStdCuts( ICurve* pSect, double dUmin, double dUmax,
bool bSkipMin, bool bSkipMax, bool bInvert, const Frame3d& frSect,
const Point3d& ptGdStart, const Point3d& ptGdEnd, const Vector3d& vtGdDir,
double dDepth, double dRawMaxZ, const Vector3d& vtTool, const Vector3d& vtCorr) ;
bool CalcAlongOneWayCut( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtDir,
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bVert) ;
bool CalcAlongZigZagCut( const Point3d& ptStart, const Point3d& ptEnd, const Vector3d& vtDir,
const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, bool bVert, bool bFirst) ;
bool CalcAcrossOneWayCut( const PolyLine& PL, const Vector3d& vtMove,
const Vector3d& vtTool, const Vector3d& vtCorr, double dRawZ, double dDepth) ;
bool CalcAcrossZigZagCut( const PolyLine& PL, const Vector3d& vtMove,
const Vector3d& vtTool, const Vector3d& vtCorr, double dRawZ, double dDepth, bool bFirst) ;
bool CalcCurvedAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax, const Frame3d& frSect,
ICurve* pGuide, double dDepth, double dRaxMaxZ, const Vector3d& vtTool) ;
bool CalcCurvedAlongStdCuts( ICurve* pSect, double dUmin, double dUmax,
bool bSkipMin, bool bSkipMax, bool bInvert, const Frame3d& frSect,
ICurve* pGuide, double dDepth, double dRawMaxZ, const Vector3d& vtTool) ;
bool CalcCurvedAlongZigZagCut( const ICurve* pCut, const Vector3d& vtTool, bool bVert, bool bFirst, double& dEndElev) ;
bool CalcCurvedAcrossZigZagCut( const PolyLine& PL, const Vector3d& vtMove, const Point3d& ptAxRot, double dAngRotDeg,
const Vector3d& vtTool, const Vector3d& vtCorr, const Vector3d& vtPrev, double dDepth,
bool bFirst, bool bCorner) ;
bool AddApproach( const Point3d& ptP, const Vector3d& vtCorr,
double dSafeZ, double dElev, double dAppr) ;
bool AddCornerApproach( const Point3d& ptP, const Vector3d& vtCorr, const Vector3d& vtPrev,
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) ;
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 GetVertFeed() const
{ return ( IsNullLenValue( m_Params.m_dVertFeed) ? m_TParams.m_dFeed : m_Params.m_dVertFeed) ; }
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
SawFinishingData m_Params ; // parametri lavorazione
ToolData m_TParams ; // parametri utensile
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nCuts ; // numero di passate generate
} ;