7bad9a5cc6
- miglioria nel calcolo assi per robot (verifica continuità).
178 lines
8.6 KiB
C++
178 lines
8.6 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : CamData.h Data : 10.06.15 Versione : 1.6f2
|
|
// Contenuto : Dichiarazione della classe CamData.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 10.06.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkVector3d.h"
|
|
#include "/EgtDev/Include/EGkUserObj.h"
|
|
#include "/EgtDev/Include/EGkSelection.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
class CamData : public IUserObj
|
|
{
|
|
public : // IUserObj
|
|
CamData* 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 SetOwner( int nId, IGeomDB* pGDB) override ;
|
|
int GetOwner( void) const override ;
|
|
IGeomDB* GetGeomDB( void) 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 ;
|
|
bool GetDrawPolyLines( POLYLINELIST& lstPL) const override ;
|
|
bool Translate( const Vector3d& vtMove) override ;
|
|
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) override
|
|
{ double dAngRad = dAngDeg * DEGTORAD ;
|
|
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
|
|
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) override ;
|
|
bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) override ;
|
|
bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) override ;
|
|
bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) override ;
|
|
bool ToGlob( const Frame3d& frRef) override ;
|
|
bool ToLoc( const Frame3d& frRef) override ;
|
|
bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) override ;
|
|
|
|
public :
|
|
CamData( void) ;
|
|
bool SetMoveType( int nMove) ;
|
|
bool SetToolDir( const Vector3d& vtDir) ;
|
|
bool SetCorrDir( const Vector3d& vtDir) ;
|
|
bool SetAuxDir( const Vector3d& vtDir) ;
|
|
bool SetEndPoint( const Point3d& ptEnd) ;
|
|
bool SetCenter( const Point3d& ptCen) ;
|
|
bool SetAngCen( double dAngCen) ;
|
|
bool SetNormDir( const Vector3d& vtDir) ;
|
|
bool SetDeltaN( double dDeltaN) ;
|
|
bool SetFeed( double dFeed) ;
|
|
bool SetOrigFeed( double dOrigFeed) ;
|
|
bool SetFlag( int nFlag) ;
|
|
bool SetFlag2( int nFlag2) ;
|
|
bool SetIndex( int nIndex) ;
|
|
bool SetAxes( int nStatus, const DBLVECTOR& vAxVal) ;
|
|
bool ChangeAxesMask( int nMask) ;
|
|
bool ResetAxes( void)
|
|
{ m_nAxesStatus = AS_NONE ; return true ; }
|
|
bool SetAxesCen( const Point3d ptAxCen) ;
|
|
bool SetAxesRad( double dRad) ;
|
|
bool SetAxesAngCen( double dAngCen) ;
|
|
bool SetAxesNormDir( const Vector3d& vtDir) ;
|
|
bool SetBackAuxDir( const Vector3d& vtDir) ;
|
|
bool SetToolShow( bool bShow)
|
|
{ m_bToolShow = bShow ; return true ; }
|
|
int GetMoveType( void) const
|
|
{ return m_nMove ; }
|
|
bool IsRapid( void) const
|
|
{ return ( m_nMove == 0) ; }
|
|
bool IsLine( void) const
|
|
{ return ( m_nMove == 0 || m_nMove == 1) ; }
|
|
bool IsArc( void) const
|
|
{ return ( m_nMove == 2 || m_nMove == 3) ; }
|
|
const Vector3d& GetToolDir( void) const
|
|
{ return m_vtTool ; }
|
|
const Vector3d& GetCorrDir( void) const
|
|
{ return m_vtCorr ; }
|
|
const Vector3d& GetAuxDir( void) const
|
|
{ return m_vtAux ; }
|
|
const Point3d& GetEndPoint( void) const
|
|
{ return m_ptEnd ; }
|
|
const Point3d& GetCenter( void) const
|
|
{ return m_ptCen ; }
|
|
double GetAngCen( void) const
|
|
{ return m_dAngCen ; }
|
|
const Vector3d& GetNormDir( void) const
|
|
{ return m_vtN ; }
|
|
double GetDeltaN( void) const
|
|
{ return m_dDeltaN ; }
|
|
double GetFeed( void) const
|
|
{ return m_dFeed ; }
|
|
double GetOrigFeed( void) const
|
|
{ return m_dOrigFeed ; }
|
|
int GetFlag( void) const
|
|
{ return m_nFlag ; }
|
|
int GetFlag2( void) const
|
|
{ return m_nFlag2 ; }
|
|
int GetIndex( void) const
|
|
{ return m_nIndex ; }
|
|
int GetAxesStatus( void) const
|
|
{ return m_nAxesStatus ; }
|
|
int GetAxesMask( void) const
|
|
{ return m_nAxesMask ; }
|
|
const DBLVECTOR& GetAxesVal( void) const
|
|
{ return m_vMachAxes ; }
|
|
const Point3d& GetAxesCen( void) const
|
|
{ return m_ptMachCen ; }
|
|
double GetAxesRad( void) const
|
|
{ return m_dMachRad ; }
|
|
double GetAxesAngCen( void) const
|
|
{ return m_dMachAngCen ; }
|
|
const Vector3d& GetAxesNormDir( void) const
|
|
{ return m_vtMachN ; }
|
|
const Vector3d& GetBackAuxDir( void) const
|
|
{ return m_vtBackAux ; }
|
|
bool GetToolShow( void) const
|
|
{ return m_bToolShow ; }
|
|
|
|
public :
|
|
enum { AS_NONE = 0,
|
|
AS_OK = 1,
|
|
AS_OUTSTROKE = 2,
|
|
AS_DIR_ERR = 3,
|
|
AS_ERR = 4} ;
|
|
enum { MSK_L1 = 1,
|
|
MSK_L2 = 2,
|
|
MSK_L3 = 4,
|
|
MSK_R1 = 8,
|
|
MSK_R2 = 16,
|
|
MSK_R3 = 32,
|
|
MSK_R4 = 64} ;
|
|
|
|
private :
|
|
void ResetObjGraphics( void) ;
|
|
|
|
private :
|
|
int m_nOwnerId ;
|
|
IGeomDB* m_pGeomDB ;
|
|
int m_nMove ; // tipo movimento (0=rapido, 1=lineare, 2=arco CW, 3=arco CCW)
|
|
int m_nCorre ; // tipo correzione (0, 41, 42, 141, 142, 40)
|
|
bool m_bToolShow ; // flag per forzare la visualizzazione della direzione utensile in ogni caso
|
|
Vector3d m_vtTool ; // versore fresa
|
|
Vector3d m_vtCorr ; // versore correzione
|
|
Vector3d m_vtAux ; // versore ausiliario
|
|
Point3d m_ptEnd ; // punto finale
|
|
Point3d m_ptCen ; // centro per archi
|
|
double m_dAngCen ; // angolo al centro per archi
|
|
Vector3d m_vtN ; // vettore normale al piano di giacitura per archi
|
|
double m_dDeltaN ; // delta fine rispetto a inizio su normale
|
|
double m_dFeed ; // velocità di avanzamento in lavorazione
|
|
double m_dOrigFeed ; // velocità originale di avanzamento (sul tip utensile)
|
|
int m_nFlag ; // flag per usi vari
|
|
int m_nFlag2 ; // secondo flag per usi vari
|
|
int m_nIndex ; // indice per usi vari
|
|
int m_nAxesStatus ; // stato dei valori degli assi
|
|
int m_nAxesMask ; // mask di emissione degli assi (bit a bit)
|
|
DBLVECTOR m_vMachAxes ; // valori degli assi macchina
|
|
Point3d m_ptMachCen ; // centro arco espresso in assi macchina
|
|
double m_dMachRad ; // raggio arco espresso in macchina
|
|
double m_dMachAngCen ; // angolo al centro per archi espresso in macchina
|
|
Vector3d m_vtMachN ; // vettore normale al piano di giacitura per archi espresso in macchina
|
|
Vector3d m_vtBackAux ; // vettore ausiliario di testa ruotato con assi macchina e riportato sul pezzo in lavoro
|
|
} ;
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
inline const CamData* GetCamData( const IUserObj* pUserObj)
|
|
{ return dynamic_cast<const CamData*>( pUserObj) ; }
|
|
inline CamData* GetCamData( IUserObj* pUserObj)
|
|
{ return dynamic_cast< CamData*>( pUserObj) ; }
|