c0de1755be
- gestione tagli con lama esterno e interno archi per marmo.
119 lines
5.6 KiB
C++
119 lines
5.6 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : Machining.h Data : 07.06.15 Versione : 1.6f2
|
|
// Contenuto : Dichiarazione della classe Machining da cui derivano
|
|
// tutti i gestori delle lavorazioni.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 07.06.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkPoint3d.h"
|
|
#include "/EgtDev/Include/EGkUserObj.h"
|
|
#include "/EgtDev/Include/EGkSelection.h"
|
|
#include "/EgtDev/Include/EgtNumCollection.h"
|
|
|
|
class MachMgr ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Machining : public IUserObj
|
|
{
|
|
public : // IUserObj
|
|
bool SetOwner( int nId, IGeomDB* pGDB) override ;
|
|
int GetOwner( void) const override ;
|
|
IGeomDB* GetGeomDB( void) const override ;
|
|
|
|
public :
|
|
virtual bool Init( MachMgr* pMchMgr) ;
|
|
virtual bool SetPhase( int nPhase)
|
|
{ m_nPhase = nPhase ; return true ; }
|
|
virtual int GetPhase( void) const
|
|
{ return m_nPhase ; }
|
|
|
|
public :
|
|
virtual bool Prepare( const std::string& sMchName) = 0 ;
|
|
virtual bool SetParam( int nType, bool bVal) = 0 ;
|
|
virtual bool SetParam( int nType, int nVal) = 0 ;
|
|
virtual bool SetParam( int nType, double dVal) = 0 ;
|
|
virtual bool SetParam( int nType, const std::string& sVal) = 0 ;
|
|
virtual bool SetGeometry( const SELVECTOR& vIds) = 0 ;
|
|
virtual bool Preview( bool bRecalc) = 0 ;
|
|
virtual bool Apply( bool bRecalc) = 0 ;
|
|
virtual bool GetParam( int nType, bool& bVal) const = 0 ;
|
|
virtual bool GetParam( int nType, int& nVal) const = 0 ;
|
|
virtual bool GetParam( int nType, double& dVal) const = 0 ;
|
|
virtual bool GetParam( int nType, std::string& sVal) const = 0 ;
|
|
virtual const ToolData& GetToolData( void) const = 0 ;
|
|
virtual bool GetGeometry( SELVECTOR& vIds) const = 0 ;
|
|
virtual bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) = 0 ;
|
|
virtual bool IsEmpty( void) const = 0 ;
|
|
|
|
protected :
|
|
Machining( void) ;
|
|
|
|
protected :
|
|
bool GetElevation( int nPhase, const Point3d& ptP,
|
|
const Vector3d& vtDir, double& dElev) ;
|
|
bool GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2,
|
|
const Vector3d& vtDir, double& dElev) ;
|
|
bool GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3,
|
|
const Vector3d& vtDir, double& dElev) ;
|
|
bool GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist) ;
|
|
bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist) ;
|
|
bool GetInitialAxesValues( DBLVECTOR& vAxVal) ;
|
|
bool GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) ;
|
|
bool GetFinalAxesValues( DBLVECTOR& vAxVal) ;
|
|
bool GetClPathFinalAxesValues( int nClPathId, DBLVECTOR& vAxVal) ;
|
|
bool CalculateAxesValues( void) ;
|
|
bool CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W,
|
|
double& dAngAprec, double& dAngBprec, int& nOutStrC) ;
|
|
bool AdjustStartEndMovements( void) ;
|
|
bool AdjustOneStartMovement( int nClPathId, const DBLVECTOR& vAxPrev) ;
|
|
bool ToolChangeNeeded( const ToolData& T1, const ToolData& T2) ;
|
|
bool AddRise( DBLVECTOR& vAxVal, double dDelta = - 1) ;
|
|
bool RemoveRise( void) ;
|
|
bool AddHome( void) ;
|
|
bool RemoveHome( void) ;
|
|
bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) ;
|
|
|
|
protected :
|
|
bool SetPathId( int nPathId) ;
|
|
bool SetToolDir( const Vector3d& vtDir) ;
|
|
bool SetCorrDir( const Vector3d& vtDir) ;
|
|
bool SetAuxDir( const Vector3d& vtDir) ;
|
|
bool SetFeed( double dFeed) ;
|
|
bool SetFlag( int nFlag) ;
|
|
int AddRapidStart( const Point3d& ptP) ;
|
|
int AddRapidMove( const Point3d& ptP) ;
|
|
int AddLinearMove( const Point3d& ptP) ;
|
|
int AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, double dDeltaZ = 0) ;
|
|
bool ResetMoveData( void) ;
|
|
|
|
protected :
|
|
int m_nOwnerId ; // identificativo dell'oggetto geometrico possessore
|
|
IGeomDB* m_pGeomDB ; // puntatore al DB geometrico
|
|
MachMgr* m_pMchMgr ; // puntatore al gestore di tutte le lavorazioni
|
|
int m_nPhase ; // indice della fase di appartenenza (da 1 in su)
|
|
int m_nPathId ; // identificativo del gruppo corrente di inserimento dati
|
|
bool m_bCurr ; // punto corrente valido
|
|
Point3d m_ptCurr ; // posizione corrente
|
|
Vector3d m_vtTool ; // direzione fresa corrente
|
|
Vector3d m_vtCorr ; // direzione correzione corrente
|
|
Vector3d m_vtAux ; // direzione ausiliaria corrente
|
|
double m_dFeed ; // feed corrente
|
|
int m_nFlag ; // flag corrente
|
|
} ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
inline const Machining* GetMachining( const IUserObj* pUserObj)
|
|
{ return dynamic_cast<const Machining*>( pUserObj) ; }
|
|
inline Machining* GetMachining( IUserObj* pUserObj)
|
|
{ return dynamic_cast< Machining*>( pUserObj) ; }
|
|
|