//---------------------------------------------------------------------------- // EgalTech 2015-2016 //---------------------------------------------------------------------------- // File : Machining.h Data : 29.04.16 Versione : 1.6p4 // Contenuto : Dichiarazione della classe Machining da cui derivano // tutti i gestori delle lavorazioni. // // // // Modifiche : 07.06.15 DS Creazione modulo. // 24.02.26 RE Aggiunta Gestione Preview per Utensile e Testa // // //---------------------------------------------------------------------------- #pragma once #include "Operation.h" //---------------------------------------------------------------------------- class Machining : public Operation { protected : // Operation const std::string& GetToolName( void) const override ; const std::string& GetHeadName( void) const override ; int GetExitNbr( void) const override ; const std::string& GetToolTcPos( void) const override ; bool NeedPrevHome( void) const override ; bool GetDoubleToolData( std::string& sDblTool, std::string& sDblTcPos, std::string& sDblHead, int& nDblExit) const override ; 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, bool bPostApply) = 0 ; virtual bool Update( bool bPostApply) = 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 bool UpdateToolData( void) = 0 ; virtual const ToolData& GetToolData( void) const = 0 ; virtual bool GetGeometry( SELVECTOR& vIds) const = 0 ; virtual bool GetSkippedGeometry( SELVECTOR& vIds) const { vIds.clear() ; return false ; } public : bool GetStartPoint( Point3d& ptStart) const ; bool GetEndPoint( Point3d& ptEnd) const ; bool ChangeToolPreviewShow( int nFlag) ; bool PrepareToolPreview( void) ; bool RemoveToolPreview( void) ; int GetToolPreviewStepCount( void) const ; int ToolPreview( int nEntId, int nStep) const ; protected : Machining( void) ; ~Machining( void) ; bool SpecialApply( std::string& sErr) ; bool PostApply( std::string& sErr) ; int GetDoubleType( const std::string& sUserNotes) const ; bool GetDoubleToolData( std::string& sDblTool, std::string& sDblTcPos, std::string& sDblHead, int& nDblExit, double& dDblLen) const ; bool CalcMirrorPlaneByDouble( int nDouble, const std::string& sUserNotes, Point3d& ptOn, Vector3d& vtNorm) const ; bool CalcMirrorByDouble( int nClId, const std::string& sUserNotes) const ; bool ActivateDrillingUnit( int nHeadId, const INTVECTOR& vActExit) const ; private : int GetToolPreviewNext( int nEntId, int nParentId, int nStId) const ; int GetToolPreviewPrev( int nEntId, int nParentId, int nStId) const ; bool MyPrepareToolPreview( bool bDouble) ; bool MyChangeToolPreviewShow( int nLookFlag, bool bDouble) ; bool MyToolPreview( int nEntId, bool bDouble) const ; bool MyShowMultiDrillingTool( const INTVECTOR& vActExit) const ; private : int m_nLookFlag ; // flag di Visualizzazione per Preview // lavorazione singola int m_nPreviewHeadId ; // Id del gruppo della testa di Preview int m_nPreviewExitId ; // Id del gruppo dell'uscita di Preview int m_nPreviewToolTip ; // Id del gruppo contenente il punto ToolTip INTVECTOR m_vPreviewAxisIds ; // indici degli assi di Preview // lavorazione in doppio int m_nPreviewHeadIdDBL ; // Id del gruppo della testa di Preview int m_nPreviewExitIdDBL ; // Id del gruppo dell'uscita di Preview int m_nPreviewToolTipDBL ; // Id del gruppo contenente il punto di ToolTip INTVECTOR m_vPreviewAxisIdsDBL ; // indici degli assi di Preview } ; //---------------------------------------------------------------------------- inline const Machining* GetMachining( const IUserObj* pUserObj) { return dynamic_cast( pUserObj) ; } inline Machining* GetMachining( IUserObj* pUserObj) { return dynamic_cast< Machining*>( pUserObj) ; }