//---------------------------------------------------------------------------- // EgalTech 2016-2016 //---------------------------------------------------------------------------- // File : Operation.h Data : 29.04.16 Versione : 1.6p4 // Contenuto : Dichiarazione della classe Operation da cui derivano // Disposition e Machining. // // // // Modifiche : 29.04.16 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 CamData ; //---------------------------------------------------------------------------- class Operation : 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 ; } virtual bool RemoveHome( void) ; public : virtual bool IsEmpty( void) const = 0 ; protected : virtual const std::string& GetToolName( void) const = 0 ; virtual const std::string& GetHeadName( void) const = 0 ; virtual int GetExitNbr( void) const = 0 ; virtual int GetSolCh( void) const = 0 ; virtual const std::string& GetToolTcPos( void) const = 0 ; virtual bool NeedPrevHome( void) const = 0 ; virtual bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const = 0 ; protected : Operation( 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 GetElevation( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double dRad, double& dElev) ; bool GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist) ; bool GetMinDistanceFromRawSide( int nPhase, const Point3d& ptP, double& dDist, Vector3d& vtDir) ; bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist) ; bool GetRawGlobBox( int nPhase, int nPathId, double dToler, BBox3d& b3Raw) ; bool GetInitialAxesValues( DBLVECTOR& vAxVal) ; bool GetClPathInitialAxesValues( int nClPathId, DBLVECTOR& vAxVal) ; bool GetFinalAxesValues( DBLVECTOR& vAxVal) ; bool GetClPathFinalAxesValues( int nClPathId, DBLVECTOR& vAxVal) ; std::string ExtractHint( const std::string& sNotes) ; bool CalculateAxesValues( const std::string& sHint) ; bool CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes, double dRot1W, DBLVECTOR& vAxRotPrec, int& nOutStrC) ; bool AdjustStartEndMovements( void) ; bool AdjustOneStartMovement( int nClPathId, const DBLVECTOR& vAxPrev, bool bHomeZ) ; bool ToolChangeNeeded( const Operation& Op1, const Operation& Op2) ; bool AddRise( DBLVECTOR& vAxVal, double dDelta = - 1) ; bool RemoveRise( void) ; bool AddHome( void) ; bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) ; bool TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) ; bool SpecialMoveZup( Vector3d& vtTool, DBLVECTOR& vAx, bool& bModif) ; 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) protected : bool SetPathId( int nPathId) ; bool SetToolDir( const Vector3d& vtDir) ; bool SetCorrDir( const Vector3d& vtDir) ; bool SetAuxDir( const Vector3d& vtDir) ; bool SetCorrAuxDir( const Vector3d& vtDir) ; bool SetFeed( double dFeed) ; bool SetFlag( int nFlag) ; bool GetCurrPos( Point3d& ptCurr) const { if ( ! m_bCurr) return false ; ptCurr = m_ptCurr ; return true ; } int AddRapidStart( const Point3d& ptP) ; int AddRapidStart( const Point3d& ptP, const std::string& sName) ; int AddRapidMove( const Point3d& ptP) ; int AddRapidMove( const Point3d& ptP, const std::string& sName) ; int AddLinearMove( const Point3d& ptP) ; int AddLinearMove( const Point3d& ptP, const std::string& sName) ; int AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, const Vector3d& vtN) ; int AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen, const Vector3d& vtN, const std::string& sName) ; bool ResetMoveData( void) ; protected : 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 Operation* GetOperation( const IUserObj* pUserObj) { return dynamic_cast( pUserObj) ; } inline Operation* GetOperation( IUserObj* pUserObj) { return dynamic_cast< Operation*>( pUserObj) ; }