Compare commits

..

13 Commits

Author SHA1 Message Date
Daniele Bariletti 33cd3aa310 Merge remote-tracking branch 'origin/HEAD' into Bezier_trim&mesh 2023-06-21 09:39:17 +02:00
Daniele Bariletti e2295d2502 Include :
- aggiunte funzioni per superfici di bezier.
2023-06-21 09:39:09 +02:00
DarioS 328f571012 Include :
- aggiornamento prototipi
- aggiunta costante per verifica collisione in simulazione con poliedri.
2023-06-19 08:00:20 +02:00
DarioS 129dfa412e Include :
- aggiornamento prototipi
- aggiornamento codici mensili di protezione.
2023-06-05 08:05:31 +02:00
DarioS 6f0c532456 Include :
- aggiornamento prototipi.
2023-05-30 17:06:21 +02:00
DarioS b3d649894f Include :
- aggiornamenti per migliore gestione delle chiavi di rete.
2023-05-30 10:22:05 +02:00
Daniele Bariletti bb030c1008 Merge remote-tracking branch 'origin/HEAD' into Bezier_trim&mesh 2023-05-19 14:58:43 +02:00
DarioS 05243da50b Include :
- a plane3d aggiunto metodo per calcolo piano dati tre punti.
2023-05-16 09:38:26 +02:00
DarioS 80423a1eb6 Include :
- modifiche a Vector3d e Point3d per controllo validità coordinate (isfinite).
2023-05-15 14:51:16 +02:00
DarioS 0318d44994 Include :
- aggiornamento prototipi
- a BBox3d aggiunto metodo Overlaps per box con orientamento diverso.
2023-05-14 11:54:02 +02:00
DarioS bd7ed86369 Include :
- aggiornamento prototipi.
2023-05-08 08:24:58 +02:00
DarioS 65fee5de7b Include :
- aggiornamento codici protezione librerie per cambio mese.
2023-05-03 09:36:31 +02:00
DarioS f614420f37 Include :
- miglioramenti interfacce di Vector3d, Point3d e Frame3d
- aggiunta costante ICurve::APL_SPECIAL_INT per nuovo tipo di approssimazione (come SPéECIAL ma con almeno tre punti per curve non rettilinee).
2023-04-24 15:38:36 +02:00
20 changed files with 218 additions and 78 deletions
+41 -7
View File
@@ -1,14 +1,14 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2022
// EgalTech 2013-2023
//----------------------------------------------------------------------------
// File : EGkBBox3d.h Data : 17.08.22 Versione : 2.4h1
// File : EGkBBox3d.h Data : 12.05.23 Versione : 2.5e3
// Contenuto : Dichiarazione della classe axis aligned bounding box BBox3d.
//
//
//
// Modifiche : 14.01.13 DS Creazione modulo.
// 17.08.22 DS Aggiunte GetDimX, GetDimY, GetDimZ.
//
// 12.05.23 DS Aggiunta Overlaps con Box su riferimento.
//
//----------------------------------------------------------------------------
@@ -90,10 +90,11 @@ class EGK_EXPORT BBox3d
bool EnclosesXY( const Point3d& ptP) const ;
bool Encloses( const BBox3d& b3Box) const ;
bool EnclosesXY( const BBox3d& b3Box) const ;
bool Overlaps( const BBox3d& b3B) const ;
bool OverlapsXY( const BBox3d& b3B) const ;
bool FindIntersection( const BBox3d& b3B, BBox3d& b3Int) const ;
bool FindIntersectionXY( const BBox3d& b3B, BBox3d& b3Int) const ;
bool Overlaps( const BBox3d& b3Box) const ;
bool OverlapsXY( const BBox3d& b3Box) const ;
bool Overlaps( const Frame3d& frBox, const BBox3d& b3Box) const ;
bool FindIntersection( const BBox3d& b3Box, BBox3d& b3Int) const ;
bool FindIntersectionXY( const BBox3d& b3Box, BBox3d& b3Int) const ;
double SqDistFromPoint( const Point3d& ptP) const ;
double SqDistFromPointXY( const Point3d& ptP) const ;
double DistFromPoint( const Point3d& ptP) const
@@ -126,3 +127,36 @@ class EGK_EXPORT BBox3d
Point3d m_ptMin ;
Point3d m_ptMax ;
} ;
//----------------------------------------------------------------------------
//! Restituisce una copia in locale del box passato
//----------------------------------------------------------------------------
inline const BBox3d
GetToLoc( const BBox3d& b3Box, const Frame3d& frRef)
{
BBox3d b3New = b3Box ;
b3New.ToLoc( frRef) ;
return b3New ;
}
//----------------------------------------------------------------------------
//! Restituisce una copia in globale del box passato
//----------------------------------------------------------------------------
inline const BBox3d
GetToGlob( const BBox3d& b3Box, const Frame3d& frRef)
{
BBox3d b3New = b3Box ;
b3New.ToGlob( frRef) ;
return b3New ;
}
//----------------------------------------------------------------------------
//! Restituisce una copia dal primo al secondo riferimento del box passato
//----------------------------------------------------------------------------
inline const BBox3d
GetLocToLoc( const BBox3d& b3Box, const Frame3d& frOri, const Frame3d& frDest)
{
BBox3d b3New = b3Box ;
b3New.LocToLoc( frOri, frDest) ;
return b3New ;
}
+3 -3
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2020-2020
// EgalTech 2020-2023
//----------------------------------------------------------------------------
// File : EGkCDeSurfTmSurfTm.h Data : 13.11.20 Versione :
// File : EGkCDeClosedSurfTmClosedSurfTm.h Data : 14.06.23 Versione : 2.5f3
// Contenuto : Dichiarazione funzione verifica collisione tra
// SurfTm e SurfTm.
//
@@ -27,4 +27,4 @@
// di collisione o inconsistenza dei parametri di input.
// Le due superfici devono essere espresse nel medesimo sistema di riferimento.
// La distanza di sicurezza ha effetto solo se maggiore di EPS_SMALL.
EGK_EXPORT bool CDeClosedSurfTmClosedSurfTm( const SurfTriMesh& SurfA, const SurfTriMesh& SurfB, double dSafeDist) ;
EGK_EXPORT bool CDeClosedSurfTmClosedSurfTm( const ISurfTriMesh& SurfA, const ISurfTriMesh& SurfB, double dSafeDist) ;
+1 -1
View File
@@ -28,5 +28,5 @@
// Raggio principale R1, raggio secondario R2.
// Il toro è posto nel piano XY del suo riferimento, centrato sull'origine.
// La funzione restituisce true in caso di collisione.
EGK_EXPORT bool CDeConvexTorusClosedSurfTm( const Frame3d& frTorusFrame, double dRad1, double dRad2,
EGK_EXPORT bool CDeConvexTorusClosedSurfTm( const Frame3d& frTorus, double dRad1, double dRad2,
double dSafeDist, const ISurfTriMesh& tmSurf) ;
+1
View File
@@ -31,6 +31,7 @@ class __declspec( novtable) ICurve : public IGeoObj
PP_END = 3} ; // punto coincidente con la fine
enum ApprLineType { APL_STD = 0, // approssimazione standard
APL_SPECIAL = 10, // come STD, per composite conserva estremi di curve componenti
APL_SPECIAL_INT = 20, // come SPECIAL, per composite anche almeno un interno di componenti non rettilinei
APL_LEFT = 1, // linee sempre a sinistra
APL_LEFT_CONVEX = 11, // linee sempre a sinistra convesse
APL_RIGHT = 2, // linee sempre a destra
+1 -1
View File
@@ -47,4 +47,4 @@ EGK_EXPORT const std::string& GetNfeFontDir( void) ;
// restituisce il nome del font di default
EGK_EXPORT const std::string& GetDefaultFont( void) ;
// imposto il gestore eventi
EGK_EXPORT bool SetEGkProcessEvents( pfProcEvents pFun) ;
EGK_EXPORT bool SetEGkProcessEvents( pfProcEvents pFun) ;
+1 -1
View File
@@ -36,7 +36,7 @@ class __declspec( novtable) IExtDimension : public IGeoObj
const Vector3d& vtN, const std::string& sText) = 0 ;
virtual bool SetDiametral( const Point3d& ptCen, const Point3d& ptPos,
const Vector3d& vtN, const std::string& sText) = 0 ;
virtual bool SetAngular( const Point3d& ptP1, const Point3d& ptV, const Point3d& ptP2, const Point3d& ptPos,
virtual bool SetAngular( const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptV, const Point3d& ptPos,
const Vector3d& vtN, const std::string& sText ) = 0 ;
virtual const Vector3d& GetNormVersor( void) const = 0 ;
virtual const Vector3d& GetDirVersor( void) const = 0 ;
+51 -18
View File
@@ -56,23 +56,23 @@ class EGK_EXPORT Frame3d
bool ToLoc( const Frame3d& frRef) ;
bool LocToLoc( const Frame3d& frOri, const Frame3d& frDest) ;
Frame3d& operator*=( const Frame3d& frRef)
{ this->ToGlob( frRef) ; return *this ;}
{ ToGlob( frRef) ; return *this ; }
Frame3d& operator/=( const Frame3d& frRef)
{ this->ToLoc( frRef) ; return *this ;}
{ ToLoc( frRef) ; return *this ; }
bool IsValid( void) const
{ return ( m_nType != ERR) ; }
int GetType( void) const
{ return m_nType ;}
{ return m_nType ; }
int GetZType( void) const
{ return m_nZType ;}
{ return m_nZType ; }
const Point3d& Orig( void) const
{ return m_ptOrig ;}
{ return m_ptOrig ; }
const Vector3d& VersX( void) const
{ return m_vtVersX ;}
{ return m_vtVersX ; }
const Vector3d& VersY( void) const
{ return m_vtVersY ;}
{ return m_vtVersY ; }
const Vector3d& VersZ( void) const
{ return m_vtVersZ ;}
{ return m_vtVersZ ; }
bool GetRotationsCAC1( double& dAngC, double& dAngA, double& dAngC1) const ;
bool GetFixedAxesRotationsABC( double& dAngADeg, double& dAngBDeg, double& dAngCDeg) const ;
@@ -97,23 +97,56 @@ const Frame3d GLOB_FRM ;
//----------------------------------------------------------------------------
// Prodotto di due frame (porta il primo dal secondo nel globale)
//----------------------------------------------------------------------------
inline Frame3d
operator*( const Frame3d& frRef1, const Frame3d& frRef2)
inline const Frame3d
operator*( const Frame3d& frRef, const Frame3d& frOri)
{
Frame3d frRefR = frRef1 ;
frRefR.ToGlob( frRef2) ;
return frRefR ;
Frame3d frNew = frRef ;
frNew.ToGlob( frOri) ;
return frNew ;
}
//----------------------------------------------------------------------------
// Divisione di due frame (porta il primo dal globale nel secondo)
//----------------------------------------------------------------------------
inline Frame3d
operator/( const Frame3d& frRef1, const Frame3d& frRef2)
inline const Frame3d
operator/( const Frame3d& frRef, const Frame3d& frDest)
{
Frame3d frRefR = frRef1 ;
frRefR.ToLoc( frRef2) ;
return frRefR ;
Frame3d frNew = frRef ;
frNew.ToLoc( frDest) ;
return frNew ;
}
//----------------------------------------------------------------------------
//! Restituisce una copia in locale del frame passato
//----------------------------------------------------------------------------
inline const Frame3d
GetToLoc ( const Frame3d& frRef, const Frame3d& frDest)
{
Frame3d frNew = frRef ;
frNew.ToLoc( frDest) ;
return frNew ;
}
//----------------------------------------------------------------------------
//! Restituisce una copia in globale del frame passato
//----------------------------------------------------------------------------
inline const Frame3d
GetToGlob( const Frame3d& frRef, const Frame3d& frOri)
{
Frame3d frNew = frRef ;
frNew.ToGlob( frOri) ;
return frNew ;
}
//----------------------------------------------------------------------------
//! Restituisce una copia dal primo al secondo riferimento del frame passato
//----------------------------------------------------------------------------
inline const Frame3d
GetLocToLoc( const Frame3d& frRef, const Frame3d& frOri, const Frame3d& frDest)
{
Frame3d frNew = frRef ;
frNew.LocToLoc( frOri, frDest) ;
return frNew ;
}
//----------------------------------------------------------------------------
+10
View File
@@ -38,6 +38,16 @@ class Plane3d
m_dDist = ( ptP - ORIG) * m_vtN ;
return true ;
}
bool Set( const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3)
{ if ( AreSamePointApprox( ptP1, ptP2) ||
AreSamePointApprox( ptP2, ptP3) ||
AreSamePointApprox( ptP3, ptP1)) {
m_vtN = V_NULL ;
return false ;
}
Vector3d vtN = ( ptP2 - ptP1) ^ ( ptP3 - ptP2) ;
return Set( ptP1, vtN) ;
}
void Reset( void)
{ m_vtN = V_NULL ;
m_dDist = 0 ;
+21 -18
View File
@@ -42,6 +42,9 @@ class EGK_EXPORT Point3d
void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ;}
public :
//! Verifica la validità delle coordinate del punto
bool IsValid( void) const
{ return ( std::isfinite( x) && std::isfinite( y) && std::isfinite( z)) ; }
//! Verifica se il punto è quasi l'origine
bool IsSmall( void) const
{ return ( ( x * x + y * y + z * z) < SQ_EPS_SMALL) ; }
@@ -50,19 +53,19 @@ class EGK_EXPORT Point3d
{ return ( ( x * x + y * y + z * z) < SQ_EPS_ZERO) ; }
//! Somma sul posto con un vettore
Point3d& operator +=( const Vector3d& vtV)
{ this->x += vtV.x ; this->y += vtV.y ; this->z += vtV.z ; return *this ; }
{ x += vtV.x ; y += vtV.y ; z += vtV.z ; return *this ; }
//! Sottrazione sul posto con un vettore
Point3d& operator -=( const Vector3d& vtV)
{ this->x -= vtV.x ; this->y -= vtV.y ; this->z -= vtV.z ; return *this ; }
{ x -= vtV.x ; y -= vtV.y ; z -= vtV.z ; return *this ; }
//! Somma sul posto con un altro punto (valida solo se equivalente ad una combinazione baricentrica)
Point3d& operator +=( const Point3d& ptP)
{ this->x += ptP.x ; this->y += ptP.y ; this->z += ptP.z ; return *this ; }
{ x += ptP.x ; y += ptP.y ; z += ptP.z ; return *this ; }
//! Moltiplicazione sul posto con un numero
Point3d& operator *=( double dMul)
{ this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; }
{ x *= dMul ; y *= dMul ; z *= dMul ; return *this ; }
//! Divisione sul posto con un numero
Point3d& operator /=( double dDiv)
{ double dMul = 1 / dDiv ; this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; }
{ double dMul = 1 / dDiv ; x *= dMul ; y *= dMul ; z *= dMul ; return *this ; }
//! Traslazione dato il vettore di movimento
void Translate( const Vector3d& vtMove) ;
//! Rotazione attorno ad un asse per un punto, dato l'angolo in gradi
@@ -102,7 +105,7 @@ const Point3d ORIG( 0, 0, 0) ;
//----------------------------------------------------------------------------
//! Somma di due punti (valida solo se equivalente ad una combinazione baricentrica)
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
operator+( const Point3d& ptP1, const Point3d& ptP2)
{
return Point3d( ptP1.x + ptP2.x, ptP1.y + ptP2.y, ptP1.z + ptP2.z) ;
@@ -111,16 +114,16 @@ operator+( const Point3d& ptP1, const Point3d& ptP2)
//----------------------------------------------------------------------------
//! Somma di un punto e un vettore
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
operator+( const Point3d& ptP1, const Vector3d& vtV2)
{
return Point3d( ptP1.x + vtV2.x, ptP1.y + vtV2.y, ptP1.z + vtV2.z) ;
}
//----------------------------------------------------------------------------
//! Opposto di un punto
//! Opposto di un punto, genera un vettore
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator-( const Point3d& ptP)
{
return Vector3d( - ptP.x, - ptP.y, - ptP.z) ;
@@ -129,7 +132,7 @@ operator-( const Point3d& ptP)
//----------------------------------------------------------------------------
//! Differenza di due punti, genera un vettore
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator-( const Point3d& ptP1, const Point3d& ptP2)
{
return Vector3d( ptP1.x - ptP2.x, ptP1.y - ptP2.y, ptP1.z - ptP2.z) ;
@@ -138,7 +141,7 @@ operator-( const Point3d& ptP1, const Point3d& ptP2)
//----------------------------------------------------------------------------
//! Sottrazione di un punto e un vettore
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
operator-( const Point3d& ptP1, const Vector3d& vtV2)
{
return Point3d( ptP1.x - vtV2.x, ptP1.y - vtV2.y, ptP1.z - vtV2.z) ;
@@ -147,7 +150,7 @@ operator-( const Point3d& ptP1, const Vector3d& vtV2)
//----------------------------------------------------------------------------
//! Prodotto con uno scalare
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
operator*( const Point3d& ptP, double dMul)
{
return Point3d( ptP.x * dMul, ptP.y * dMul, ptP.z * dMul) ;
@@ -156,7 +159,7 @@ operator*( const Point3d& ptP, double dMul)
//----------------------------------------------------------------------------
//! Prodotto di uno scalare con un punto
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
operator*( double dMul, const Point3d& ptP)
{
return Point3d( ptP.x * dMul, ptP.y * dMul, ptP.z * dMul) ;
@@ -165,7 +168,7 @@ operator*( double dMul, const Point3d& ptP)
//----------------------------------------------------------------------------
//! Divisione per uno scalare
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
operator/( const Point3d& ptP, double dDiv)
{
double dMul ;
@@ -177,7 +180,7 @@ operator/( const Point3d& ptP, double dDiv)
//----------------------------------------------------------------------------
//! Somma mediata di due punti (baricentrica)
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
Media( const Point3d& ptP1, const Point3d& ptP2, double dCoeff = 0.5)
{
return Point3d( ( 1 - dCoeff) * ptP1.x + dCoeff * ptP2.x,
@@ -368,7 +371,7 @@ AreSamePointXYExact( const Point3d& ptP1, const Point3d& ptP2)
//----------------------------------------------------------------------------
//! Restituisce una copia in locale del punto passato
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
GetToLoc( const Point3d& ptP, const Frame3d& frRef)
{
Point3d ptQ = ptP ;
@@ -379,7 +382,7 @@ GetToLoc( const Point3d& ptP, const Frame3d& frRef)
//----------------------------------------------------------------------------
//! Restituisce una copia in globale del punto passato
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
GetToGlob( const Point3d& ptP, const Frame3d& frRef)
{
Point3d ptQ = ptP ;
@@ -390,7 +393,7 @@ GetToGlob( const Point3d& ptP, const Frame3d& frRef)
//----------------------------------------------------------------------------
//! Restituisce una copia dal primo al secondo riferimento del punto passato
//----------------------------------------------------------------------------
inline Point3d
inline const Point3d
GetLocToLoc( const Point3d& ptP, const Frame3d& frOri, const Frame3d& frDest)
{
Point3d ptQ = ptP ;
+3 -2
View File
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
// EgalTech 2014-2023
//----------------------------------------------------------------------------
// File : EGkStmFromTriangleSoup.h Data : 19.05.14 Versione : 1.5e7
// File : EGkStmFromTriangleSoup.h Data : 07.05.23 Versione : 2.5e2
// Contenuto : Dichiarazione della classe StmFromTriangleSoup.
//
//
@@ -36,6 +36,7 @@ class StmFromTriangleSoup
EGK_EXPORT bool Start( int nBuckets = GRID_STD_BUCKETS) ;
EGK_EXPORT bool AddTriangle( const Triangle3d& Tria) ;
EGK_EXPORT bool AddTriangle( const Point3d& ptP0, const Point3d& ptP1, const Point3d& ptP2) ;
EGK_EXPORT bool AddSurfTriMesh( const ISurfTriMesh& stmSource) ;
EGK_EXPORT bool End( void) ;
EGK_EXPORT ISurfTriMesh* GetSurf( void) ;
+2
View File
@@ -37,6 +37,7 @@ class __declspec( novtable) ISurfBezier : public ISurf
virtual bool SetControlPoint( int nIndU, int nIndV, const Point3d& ptCtrl, double dW) = 0 ;
virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl, double dW) = 0 ;
virtual bool SetTrimRegion( const ISurfFlatRegion& sfrTrimReg) = 0 ;
virtual ISurfFlatRegion* GetTrimRegion( void) const = 0 ;
virtual bool GetInfo( int& nDegU, int& nDegV, int& nSpanU, int& nSpanV, bool& bIsRat, bool& bTrimmed) const = 0 ;
virtual const Point3d& GetControlPoint( int nIndU, int nIndV, bool* pbOk) const = 0 ;
virtual const Point3d& GetControlPoint( int nInd, bool* pbOk) const = 0 ;
@@ -57,6 +58,7 @@ class __declspec( novtable) ISurfBezier : public ISurf
virtual bool GetControlCurveOnU( int nIndV, PolyLine& plCtrlU) const = 0 ;
virtual bool GetControlCurveOnV( int nIndU, PolyLine& plCtrlV) const = 0 ;
virtual const ISurfTriMesh* GetAuxSurf( void) const = 0 ;
virtual bool GetLeaves ( std::vector<std::tuple<int, Point3d, Point3d>>& vLeaves) const = 0 ;
} ;
//-----------------------------------------------------------------------------
+21 -18
View File
@@ -44,6 +44,9 @@ class EGK_EXPORT Vector3d
void Set( double dX, double dY, double dZ) { x = dX ; y = dY ; z = dZ ; }
public :
//! Verifica la validità delle coordinate del vettore
bool IsValid( void) const
{ return ( std::isfinite( x) && std::isfinite( y) && std::isfinite( z)) ; }
//! Quadrato della lunghezza del vettore
double SqLen( void) const
{ return ( x * x + y * y + z * z) ; }
@@ -110,21 +113,21 @@ class EGK_EXPORT Vector3d
{ return ( ! IsX() && ! IsY() && ! IsZ()) ; }
//! Somma sul posto con altro vettore
Vector3d& operator +=( const Vector3d& vtV)
{ this->x += vtV.x ; this->y += vtV.y ; this->z += vtV.z ; return *this ; }
{ x += vtV.x ; y += vtV.y ; z += vtV.z ; return *this ; }
//! Sottrazione sul posto con altro vettore
Vector3d& operator -=( const Vector3d& vtV)
{ this->x -= vtV.x ; this->y -= vtV.y ; this->z -= vtV.z ; return *this ; }
{ x -= vtV.x ; y -= vtV.y ; z -= vtV.z ; return *this ; }
//! Moltiplicazione sul posto con un numero
Vector3d& operator *=( double dMul)
{ this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; }
{ x *= dMul ; y *= dMul ; z *= dMul ; return *this ; }
//! Divisione sul posto con un numero
Vector3d& operator /=( double dDiv)
{ double dMul = 1 / dDiv ; this->x *= dMul ; this->y *= dMul ; this->z *= dMul ; return *this ; }
{ double dMul = 1 / dDiv ; x *= dMul ; y *= dMul ; z *= dMul ; return *this ; }
//! Ritorna la rappresentazione in coordinate sferiche
void ToSpherical( double* pdLen, double* pdAngVertDeg, double* pdAngOrizzDeg) const ;
//! Inversione del vettore
void Invert( void)
{ x = - x ; y = - y ; z = - z ; }
{ x = -x ; y = -y ; z = -z ; }
//! Normalizzazione del vettore (trasformazione in versore)
bool Normalize( double dEps = EPS_SMALL) ;
//! Rotazione attorno ad un asse, dato l'angolo in gradi
@@ -199,7 +202,7 @@ EGK_EXPORT Vector3d FromNearestHorizontalOrtho( const Vector3d& vtV, const Vecto
//----------------------------------------------------------------------------
//! Opposto di un vettore
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator-( const Vector3d& vtV)
{
return ( Vector3d( - vtV.x, - vtV.y, - vtV.z)) ;
@@ -208,7 +211,7 @@ operator-( const Vector3d& vtV)
//----------------------------------------------------------------------------
//! Somma di due vettori
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator+( const Vector3d& vtV1, const Vector3d& vtV2)
{
return ( Vector3d( vtV1.x + vtV2.x, vtV1.y + vtV2.y, vtV1.z + vtV2.z)) ;
@@ -217,7 +220,7 @@ operator+( const Vector3d& vtV1, const Vector3d& vtV2)
//----------------------------------------------------------------------------
//! Sottrazione di due vettori
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator-( const Vector3d& vtV1, const Vector3d& vtV2)
{
return ( Vector3d( vtV1.x - vtV2.x, vtV1.y - vtV2.y, vtV1.z - vtV2.z)) ;
@@ -226,7 +229,7 @@ operator-( const Vector3d& vtV1, const Vector3d& vtV2)
//----------------------------------------------------------------------------
//! Prodotto con uno scalare
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator*( const Vector3d& vtV, double dMul)
{
return ( Vector3d( vtV.x * dMul, vtV.y * dMul, vtV.z * dMul)) ;
@@ -235,7 +238,7 @@ operator*( const Vector3d& vtV, double dMul)
//----------------------------------------------------------------------------
//! Prodotto di uno scalare con un vettore
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator*( double dMul, const Vector3d& vtV)
{
return ( Vector3d( vtV.x * dMul, vtV.y * dMul, vtV.z * dMul)) ;
@@ -244,7 +247,7 @@ operator*( double dMul, const Vector3d& vtV)
//----------------------------------------------------------------------------
//! Divisione con uno scalare
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator/( const Vector3d& vtV, double dDiv)
{
double dMul = 1 / dDiv ;
@@ -272,7 +275,7 @@ ScalarXY( const Vector3d& vtV1, const Vector3d& vtV2)
//----------------------------------------------------------------------------
//! Prodotto vettoriale
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
operator^( const Vector3d& vtV1, const Vector3d& vtV2)
{
return ( Vector3d( vtV1.y * vtV2.z - vtV1.z * vtV2.y,
@@ -292,7 +295,7 @@ CrossXY( const Vector3d& vtV1, const Vector3d& vtV2)
//----------------------------------------------------------------------------
//! Somma mediata di due vettori (baricentrica)
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
Media( const Vector3d& vtV1, const Vector3d& vtV2, double dCoeff = 0.5)
{
return ( Vector3d( ( 1 - dCoeff) * vtV1.x + dCoeff * vtV2.x,
@@ -303,7 +306,7 @@ Media( const Vector3d& vtV1, const Vector3d& vtV2, double dCoeff = 0.5)
//----------------------------------------------------------------------------
//! Restituisce il componente del vettore parallelo a quello di riferimento
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
ParallCompo( const Vector3d& vtV, const Vector3d& vtRef)
{
if ( vtRef.IsNormalized())
@@ -315,7 +318,7 @@ ParallCompo( const Vector3d& vtV, const Vector3d& vtRef)
//----------------------------------------------------------------------------
//! Restituisce il componente del vettore ortogonale a quello di riferimento
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
OrthoCompo( const Vector3d& vtV, const Vector3d& vtRef)
{
if ( vtRef.IsNormalized())
@@ -426,7 +429,7 @@ AreOrthoExact( const Vector3d& vtV1, const Vector3d& vtV2)
//----------------------------------------------------------------------------
//! Restituisce una copia in locale del vettore passato
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
GetToLoc( const Vector3d& vtV, const Frame3d& frRef)
{
Vector3d vtW = vtV ;
@@ -437,7 +440,7 @@ GetToLoc( const Vector3d& vtV, const Frame3d& frRef)
//----------------------------------------------------------------------------
//! Restituisce una copia in globale del vettore passato
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
GetToGlob( const Vector3d& vtV, const Frame3d& frRef)
{
Vector3d vtW = vtV ;
@@ -448,7 +451,7 @@ GetToGlob( const Vector3d& vtV, const Frame3d& frRef)
//----------------------------------------------------------------------------
//! Restituisce una copia dal primo al secondo riferimento del vettore passato
//----------------------------------------------------------------------------
inline Vector3d
inline const Vector3d
GetLocToLoc( const Vector3d& vtV, const Frame3d& frOri, const Frame3d& frDest)
{
Vector3d vtW = vtV ;
+6
View File
@@ -28,3 +28,9 @@ class ILogger ;
EGN_EXPORT const char* GetEGnVersion( void) ;
// permette di impostare il logger per la Dll
EGN_EXPORT void SetEGnLogger( ILogger* pLogger) ;
// imposta la chiave di protezione
EGN_EXPORT void SetEGnKey( const std::string& sKey) ;
// imposta il tipo di chiave di protezione
EGN_EXPORT void SetEGnKeyType( int nType) ;
// imposta se chiave hardware di rete
EGN_EXPORT void SetEGnNetHwKey( bool bNetHwKey) ;
+35
View File
@@ -0,0 +1,35 @@
//----------------------------------------------------------------------------
// EgalTech 2023-2023
//----------------------------------------------------------------------------
// File : EGnGetKeyData.h Data : 29.05.23 Versione : 2.5e3
// Contenuto : Prototipo funzioni gestione dati chiavi di protezione.
//
//
//
// Modifiche : 29.05.23 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#define NOMINMAX
#include <windows.h>
#include <string>
//----------------------- Macro per import/export ----------------------------
#undef EGN_EXPORT
#if defined( I_AM_EGN) // da definirsi solo nella DLL
#define EGN_EXPORT __declspec( dllexport)
#else
#define EGN_EXPORT __declspec( dllimport)
#endif
//-----------------------------------------------------------------------------
EGN_EXPORT bool SetEGnKeyLevel( int nRet, int nKeyLev, int nKeyExpDays) ;
EGN_EXPORT int GetEGnKeyLevel( int nProd, int nVer, int nLev, int& nKeyLev, int& nKeyExpDays) ;
EGN_EXPORT bool SetEGnKeyOptions( int nRet, int nKeyOpt1, int nKeyOpt2, int nKeyOptExpDays) ;
EGN_EXPORT int GetEGnKeyOptions( int nProd, int nVer, int nLev, unsigned int& nKeyOpt1, unsigned int& nKeyOpt2, int& nKeyOptExpDays) ;
// Interpretazione della stringa di LockId
EGN_EXPORT bool GetLockIdStringInfo( const std::string& sLockId, int& nKeyType, bool& bNetKey, int& nUserId) ;
+1
View File
@@ -50,6 +50,7 @@ EIN_EXPORT void __stdcall EgtDisableCommandLogger( void) ;
EIN_EXPORT BOOL __stdcall EgtGetVersionInfo( wchar_t*& wsVer) ;
EIN_EXPORT BOOL __stdcall EgtGetKeyInfo( wchar_t*& wsKey) ;
EIN_EXPORT BOOL __stdcall EgtSetLockType( int nType) ;
EIN_EXPORT BOOL __stdcall EgtSetLockId( const wchar_t* wsLockId) ;
EIN_EXPORT BOOL __stdcall EgtSetNetHwKey( BOOL bNetHwKey) ;
EIN_EXPORT BOOL __stdcall EgtGetKeyLevel( int nProd, int nVer, int nLev, int* pnKLev) ;
EIN_EXPORT BOOL __stdcall EgtGetKeyOptions( int nProd, int nVer, int nLev, unsigned int* pnOpt2) ;
+2 -1
View File
@@ -35,7 +35,8 @@ enum SimCollObjType { MCH_SIM_COB_NULL = 0,
MCH_SIM_COB_BOX = 1,
MCH_SIM_COB_CYL = 2,
MCH_SIM_COB_SPHE = 3,
MCH_SIM_COB_CONE = 4} ;
MCH_SIM_COB_CONE = 4,
MCH_SIM_COB_POLY = 101} ;
//------------------------ Stato di visualizzazione della macchina ------------
enum MachLook { MCH_LOOK_NONE = -1,
+8 -2
View File
@@ -55,7 +55,8 @@ EXE_EXPORT bool ExeGetExecutableVersion( std::string& sVer) ;
EXE_EXPORT bool ExeGetVersionInfo( std::string& sVer, const char* szNewLine) ;
EXE_EXPORT bool ExeGetKeyInfo( std::string& sKey) ;
EXE_EXPORT bool ExeSetLockType( int nType) ;
EXE_EXPORT bool ExeSetNetHwKey( bool bNetHwKey) ;
EXE_EXPORT bool ExeSetLockId( const std::string& sLockId) ;
EXE_EXPORT bool ExeSetNetHwKey( bool bNetHwKey, int nUserId = 0) ;
EXE_EXPORT bool ExeGetKeyLevel( int nProd, int nVer, int nLev, int& nKLev) ;
EXE_EXPORT bool ExeGetKeyOptions( int nProd, int nVer, int nLev, unsigned int& nOpt2) ;
EXE_EXPORT bool ExeGetKeyLeftDays( int& nLeftDays) ;
@@ -227,12 +228,14 @@ EXE_EXPORT int ExeCreateAlignedDimension( int nParentId, const Point3d& ptP1, c
const Point3d& ptDim, const std::string& sText, int nRefType) ;
EXE_EXPORT int ExeCreateRadialDimension( int nParentId, int nCrvId, const Point3d& ptDim, const std::string& sText, int nRefType) ;
EXE_EXPORT int ExeCreateDiametralDimension( int nParentId, int nCrvId, const Point3d& ptDim, const std::string& sText, int nRefType) ;
EXE_EXPORT int ExeCreateAngularDimension( int nParentId, const Point3d& ptP1, const Point3d& ptV, const Point3d& ptP2,
EXE_EXPORT int ExeCreateAngularDimension( int nParentId, const Point3d& ptP1, const Point3d& ptP0, const Point3d& ptP2,
const Point3d& ptDim, const std::string& sText, int nRefType) ;
EXE_EXPORT int ExeCreateAngularDimensionFromLines( int nParentId, const INTVECTOR vLineIds, const Point3d& ptDim,
const std::string& sText, int nRefType) ;
EXE_EXPORT int ExeCreateAngularDimensionFromArc( int nParentId, int nCrvId, const Point3d& ptDim,
const std::string& sText, int nRefType) ;
EXE_EXPORT int ExeCreateAngularDimensionFromCircle( int nParentId, int nCrvId, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptDim,
const std::string& sText, int nRefType) ;
// GeomDB Create Curve
EXE_EXPORT int ExeCreateLine( int nParentId, const Point3d& ptIni, const Point3d& ptFin, int nRefType) ;
@@ -350,6 +353,7 @@ EXE_EXPORT int ExeCreateSurfTmBySurfBezier( int nParentId, int nSbezId) ;
EXE_EXPORT int ExeCreateSurfTmByVolZmap( int nParentId, int nZmapId, int nPart) ;
EXE_EXPORT int ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV, const PNTVECTOR& vPnt, int nRefType) ;
EXE_EXPORT int ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV, const PNTUVECTOR& vPntW, int nRefType) ;
EXE_EXPORT int ExeCreateSurfBezierLeaves( int nParentId, int nSurfBzId, int nTextHeight) ;
// GeomDB Create Volume
EXE_EXPORT int ExeCreateVolZmap( int nParentId, const Point3d& ptIni, double dDimX,
@@ -599,6 +603,7 @@ EXE_EXPORT bool ExeSurfTmIntersect( int nId1, int nId2, bool bTwoColors = false)
EXE_EXPORT bool ExeSurfTmResetTwoColors( int nId) ;
EXE_EXPORT int ExeSurfTmSplit( int nId, int nSplitterId, int* pnCount) ;
EXE_EXPORT bool ExeSurfTmCut( int nId, int nCutterId, bool bInVsOut, bool bSaveOnEq) ;
EXE_EXPORT bool ExeSurfBzTrim( int nId, int nCutterId) ;
// GeomDb Volume Modify
EXE_EXPORT int ExeExplodeVolume( int nId, int* pnCount) ;
@@ -789,6 +794,7 @@ EXE_EXPORT int ExeCDeRectPrismoidSolid( const Frame3d& frPrismoid, double dBase
EXE_EXPORT int ExeCDeCylSolid( const Frame3d& frCyl, double dR, double dH, int nSolidId, double dSafeDist, int nRefType) ;
EXE_EXPORT int ExeCDeConeSolid( const Frame3d& frCone, double dR1, double dR2, double dH, int nSolidId, double dSafeDist, int nRefType) ;
EXE_EXPORT int ExeCDeSpheSolid( const Point3d& ptCen, double dR, int nSolidId, double dSafeDist, int nRefType) ;
EXE_EXPORT int ExeCDeSolidSolid( int nSolid1Id, int nSolid2Id, double dSafeDist) ;
// Maximum Filler
EXE_EXPORT bool ExeMaxFillerStart( void) ;
+1 -1
View File
@@ -24,7 +24,7 @@
//----------------------------------------------------------------------------
const int KEY_BASELIB_PROD = 207 ;
const int KEY_BASELIB_VER = 2504 ;
const int KEY_BASELIB_VER = 2506 ;
const int KEY_BASELIB_LEV = 1 ;
//----------------------------------------------------------------------------
+1
View File
@@ -28,6 +28,7 @@ int GetKeyLevel( const std::string& sKey, int nProd, int nVer, int nLev,
int GetKeyOptions( const std::string& sKey, int nProd, int nVer, int nLev,
unsigned int& nKOpt1, unsigned int& nKOpt2, int& nKOptExpDays) ;
int GetCurrDay( void) ;
int GetMinDay( void) ;
//-------------------------- Constants ----------------------------------------
// Codici di ritorno
+8 -5
View File
@@ -1,13 +1,14 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2022
// EgalTech 2014-2023
//----------------------------------------------------------------------------
// File : SELkLockId.cpp Data : 16.05.22 Versione : 2.4e3
// File : SELkLockId.cpp Data : 30.05.23 Versione : 2.5e5
// Contenuto : Dichiarazione funzioni per gestione/calcolo Id protezione,
// da macchina o da chiave hardware.
//
//
// Modifiche : 10.09.14 DS Creazione modulo.
// 16.05.22 DS Aggiunta gestione chiave di rete.
// 30.05.23 DS Aggiunta gestione utente di rete e rilascio chiave di rete.
//
//----------------------------------------------------------------------------
@@ -16,10 +17,12 @@
#include <string>
//-------------------------------------------------------------------------------
// Imposto il tipo di protezione
// Imposto il tipo di protezione ammessa (ANY, HW, SW)
bool SetLockType( int nType) ;
// Forzo chiave di rete (se prevista protezione hardware)
bool SetNetHwKey( bool bNetHwKey) ;
// Imposto chiave di rete e identificativo utente (0-9)
bool SetNetHwKey( bool bNetHwKey, int nUserId) ;
// Libero chiave di rete (da eseguire al termine del programma)
bool CloseNetHwKey( void) ;
// Recupero l'identificativo in chiaro della protezione
bool GetLockId( std::string& sLockId) ;
// Recupero l'identificativo cifrato della protezione