Include : aggiunto EGkGeoVector3d.h per interfaccia.

This commit is contained in:
Dario Sassi
2013-11-22 14:57:50 +00:00
parent 1d2aef267c
commit 09edd2497b
6 changed files with 91 additions and 26 deletions
+16 -16
View File
@@ -16,25 +16,25 @@
//----------------- Costanti generali ----------------------------------------
// unità di lunghezza di riferimento : millimetro
#define ONEMM 1
#define ONEINCH 25.4
const double ONEMM = 1.0 ;
const double ONEINCH = 25.4 ;
// epsilon per lunghezze e versori
#define EPS_SMALL (1e-3)
#define EPS_ZERO (1e-7)
const double EPS_SMALL = 1e-3 ;
const double EPS_ZERO = 1e-7 ;
// infinito per lunghezze
#define INFINITO (1e10)
// epsilon per gli angoli (in gradi)
#define EPS_ANG_SMALL (1e-3)
#define EPS_ANG_ZERO (1e-7)
#define SIN_EPS_ANG_SMALL (EPS_ANG_SMALL*DEGTORAD)
#define SIN_EPS_ANG_ZERO (EPS_ANG_ZERO*DEGTORAD)
#define COS_ORTO_ANG_SMALL SIN_EPS_ANG_SMALL
#define COS_ORTO_ANG_ZERO SIN_EPS_ANG_ZERO
const double INFINITO = 1e10 ;
// conversione da gradi a radianti e viceversa
#define PIGRECO (3.14159265358979324)
#define DEGTORAD (PIGRECO / 180.)
#define RADTODEG (180. / PIGRECO)
const double PIGRECO = 3.14159265358979324 ;
const double DEGTORAD = PIGRECO / 180. ;
const double RADTODEG = 180. / PIGRECO ;
// epsilon per gli angoli (in gradi)
const double EPS_ANG_SMALL = 1e-3 ;
const double EPS_ANG_ZERO = 1e-7 ;
const double SIN_EPS_ANG_SMALL = EPS_ANG_SMALL * DEGTORAD ;
const double SIN_EPS_ANG_ZERO = EPS_ANG_ZERO * DEGTORAD ;
const double COS_ORTO_ANG_SMALL = SIN_EPS_ANG_SMALL ;
const double COS_ORTO_ANG_ZERO = SIN_EPS_ANG_ZERO ;
+10 -10
View File
@@ -15,9 +15,9 @@
//----------------- Costanti famiglie oggetto geometrico ----------------------
#define GEO_ZERODIM 0x100
#define GEO_CURVE 0x200
#define GEO_SURF 0x400
const int GEO_ZERODIM = 0x100 ;
const int GEO_CURVE = 0x200 ;
const int GEO_SURF = 0x400 ;
//----------------- Costanti tipo oggetto geometrico --------------------------
enum GeoObjType { GEO_NONE = 0,
@@ -30,10 +30,10 @@ enum GeoObjType { GEO_NONE = 0,
SRF_TRIMESH = ( GEO_SURF + 0)} ;
//----------------- Costanti chiavi oggetto geometrico ------------------------
#define KEY_GEO_VECT3D "G_VEC"
#define KEY_GEO_PNT3D "G_PNT"
#define KEY_CRV_LINE "C_LIN"
#define KEY_CRV_ARC "C_ARC"
#define KEY_CRV_BEZ "C_BEZ"
#define KEY_CRV_COMPO "C_CMP"
#define KEY_SRF_TRIMESH "S_TRM"
static const char* KEY_GEO_VECT3D = "G_VEC" ;
static const char* KEY_GEO_PNT3D = "G_PNT" ;
static const char* KEY_CRV_LINE = "C_LIN" ;
static const char* KEY_CRV_ARC = "C_ARC" ;
static const char* KEY_CRV_BEZ = "C_BEZ" ;
static const char* KEY_CRV_COMPO = "C_CMP" ;
static const char* KEY_SRF_TRIMESH = "S_TRM" ;
+10
View File
@@ -24,6 +24,16 @@ class _declspec( novtable) IGeoPoint3d : public IGeoObj
} ;
//-----------------------------------------------------------------------------
inline IGeoPoint3d* CreateGeoPoint3d( void)
{ return (static_cast<IGeoPoint3d*>( CreateGeoObj( KEY_GEO_PNT3D))) ; }
inline IGeoPoint3d* CloneGeoPoint3d( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_PNT3D)
return nullptr ;
return (static_cast<IGeoPoint3d*>(pGObj->Clone())) ; }
inline bool CopyGeoPoint3d( const IGeoPoint3d* pGPSou, IGeoPoint3d* pGPDest)
{ if ( pGPSou == nullptr || pGPDest == nullptr)
return false ;
return pGPDest->Set( *(pGPSou->GetPoint())) ; }
inline const IGeoPoint3d* GetGeoPoint3d( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_PNT3D)
return nullptr ;
+44
View File
@@ -0,0 +1,44 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EGkGeoVector3d.h Data : 22.11.13 Versione : 1.3a1
// Contenuto : Dichiarazione della interfaccia IGeoVector3d.
//
//
//
// Modifiche : 22.11.13 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkGeoObj.h"
//-----------------------------------------------------------------------------
class _declspec( novtable) IGeoVector3d : public IGeoObj
{
public :
virtual bool Set( const Vector3d& vtV) = 0 ;
virtual const Vector3d* GetVector( void) const = 0 ;
} ;
//-----------------------------------------------------------------------------
inline IGeoVector3d* CreateGeoVector3d( void)
{ return (static_cast<IGeoVector3d*>( CreateGeoObj( KEY_GEO_VECT3D))) ; }
inline IGeoVector3d* CloneGeoVector3d( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_VECT3D)
return nullptr ;
return (static_cast<IGeoVector3d*>(pGObj->Clone())) ; }
inline bool CopyGeoVector3d( const IGeoVector3d* pGVSou, IGeoVector3d* pGVDest)
{ if ( pGVSou == nullptr || pGVDest == nullptr)
return false ;
return pGVDest->Set( *(pGVSou->GetVector())) ; }
inline const IGeoVector3d* GetGeoVector3d( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_VECT3D)
return nullptr ;
return (static_cast<const IGeoVector3d*>(pGObj)) ; }
inline IGeoVector3d* GetGeoVector3d( IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != GEO_VECT3D)
return nullptr ;
return (static_cast<IGeoVector3d*>(pGObj)) ; }
+4
View File
@@ -53,6 +53,10 @@ class EGK_EXPORT Point3d
double z ;
} ;
//----------------------------------------------------------------------------
// Punti notevoli
//----------------------------------------------------------------------------
const Point3d ORIG( 0, 0, 0) ;
//----------------------------------------------------------------------------
// Somma di due punti
+7
View File
@@ -69,6 +69,13 @@ class EGK_EXPORT Vector3d
double z ;
} ;
//----------------------------------------------------------------------------
// Vettori notevoli
//----------------------------------------------------------------------------
const Vector3d X_AX( 1, 0, 0) ;
const Vector3d Y_AX( 0, 1, 0) ;
const Vector3d Z_AX( 0, 0, 1) ;
//----------------------------------------------------------------------------
// Opposto di un vettore
//----------------------------------------------------------------------------