//---------------------------------------------------------------------------- // EgalTech 2015-2015 //---------------------------------------------------------------------------- // File : EMkMachMgr.h Data : 23.03.15 Versione : 1.6c6 // Contenuto : Dichiarazione della interfaccia IMachMgr. // // // // Modifiche : 23.03.15 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "/EgtDev/Include/EGkGeomDB.h" //----------------------- Macro per import/export ---------------------------- #undef EMK_EXPORT #if defined( I_AM_EMK) // da definirsi solo nella DLL #define EMK_EXPORT __declspec( dllexport) #else #define EMK_EXPORT __declspec( dllimport) #endif //----------------------------------------------------------------------------- class __declspec( novtable) IMachMgr { public : // Basic virtual ~IMachMgr( void) {} virtual bool Init( const std::string& sMachinesDir, IGeomDB* pGeomDB, int nContextId, const std::string& sLuaLibsDir, const std::string& sLuaLastRequire) = 0 ; virtual bool Update( void) = 0 ; virtual bool Insert( int nInsGrp) = 0 ; // MachGroups virtual int GetMachGroupNbr( void) const = 0 ; virtual int GetFirstMachGroup( void) const = 0 ; virtual int GetNextMachGroup( int nId) const = 0 ; virtual bool GetMachGroupNewName( std::string& sName) const = 0 ; virtual int AddMachGroup( const std::string& sName, const std::string& sMachineName) = 0 ; virtual bool RemoveMachGroup( int nId) = 0 ; virtual std::string GetMachGroupName( int nId) const = 0 ; virtual int GetMachGroupId( const std::string& sName) const = 0 ; virtual bool SetCurrMachGroup( int nId) = 0 ; virtual bool ResetCurrMachGroup( void) = 0 ; virtual int GetCurrMachGroup( void) const = 0 ; // RawParts virtual int GetRawPartNbr( void) const = 0 ; virtual int GetFirstRawPart( void) const = 0 ; virtual int GetNextRawPart( int nId) const = 0 ; virtual int AddRawPart( const Point3d& ptOrig, double dWidth, double dLen, double dHeight, Color cCol) = 0 ; virtual int AddRawPartWithPart( int nPartId, int nCrvSrfId, double dOverMat, Color cCol) = 0 ; virtual bool ModifyRawPartHeight( int nRawId, double dHeight) = 0 ; virtual bool RemoveRawPart( int nRawId) = 0 ; virtual bool RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg) = 0 ; virtual bool MoveToCornerRawPart( int nRawId, const Point3d& ptCorner, int nFlag) = 0 ; virtual bool MoveToCenterRawPart( int nRawId, const Point3d& ptCenter, int nFlag) = 0 ; virtual bool MoveRawPart( int nRawId, const Vector3d& vtMove) = 0 ; // Parts virtual int GetPartInRawPartNbr( int nRawId) const = 0 ; virtual int GetFirstPartInRawPart( int nRawId) const = 0 ; virtual int GetNextPartInRawPart( int nId) const = 0 ; virtual bool AddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId) = 0 ; virtual bool RemovePartFromRawPart( int nPartId) = 0 ; virtual bool TranslatePartInRawPart( int nPartId, const Vector3d& vtMove) = 0 ; virtual bool RotatePartInRawPart( int nPartId, const Vector3d& vtAx, double dAngRotDeg) = 0 ; // Tables and Fixtures virtual bool SetTable( const std::string& sTable) = 0 ; virtual int AddSubPiece( const std::string& sName, const Point3d& ptPos) = 0 ; // Machine virtual bool SetAxisPos( const std::string& sAxis, double dVal) = 0 ; virtual bool GetAxisPos( const std::string& sAxis, double& dVal) = 0 ; virtual bool GetAxisHomePos( const std::string& sAxis, double& dHomeVal) = 0 ; virtual bool ResetAxisPos( const std::string& sAxis) = 0 ; virtual bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) = 0 ; virtual bool ResetHeadSet( const std::string& sHead) = 0 ; virtual bool SetCalcTable( const std::string& sTable) = 0 ; virtual bool SetCalcTool( const std::string& sTool, const std::string& sHead, int nExit) = 0 ; virtual bool GetCalcAngles( const Vector3d& vtDirT, const Vector3d& vtDirA, int& nStat, double& dAngA1, double& dAngB1, double& dAngA2, double& dAngB2) = 0 ; virtual bool GetCalcPositions( const Point3d& ptP, double dAngA, double dAngB, int& nStat, double& dX, double& dY, double& dZ) = 0 ; virtual bool VerifyOutOfStroke( double dX, double dY, double dZ, double dAngA, double dAngB, int& nStat) = 0 ; // Operations virtual int AddDrilling( const std::string& sName) = 0 ; } ; //----------------------------------------------------------------------------- extern "C" { EMK_EXPORT IMachMgr* CreateMachMgr(void) ; } //------------------------ Costanti per flag MoveToCorner --------------------- // indica la posizione del corner rispetto al grezzo enum RawPartCornerPos { MCH_CR_TL = 1, // top left MCH_CR_TR = 2, // top right MCH_CR_BL = 3, // bottom left MCH_CR_BR = 4} ; // bottom right //------------------------ Costanti per flag MoveToCenter --------------------- // indica la posizione del centro rispetto al grezzo enum RawPartCenterPos { MCH_CE_TC = 1, // top center MCH_CE_ML = 2, // middle left MCH_CE_MR = 3, // middle right MCH_CE_BC = 4, // bottom center MCH_CE_MC = 5} ; // middle center under