EgtGeomKernel 1.5f1 :

- aggiunta entità testo (con font Nfe e di sistema)
- in tutte le rotate ora l'angolo è in gradi
- aggiunta trasformazione Shear (scorrimento)
- aggiunta trsformazione LocToLoc
- Set/GetInfo specializzate per i diversi tipi di informazioni
- Copy e Relocate con possibilità di indicare l'entità di riferimento rispetto a cui inserire
- aggiunte trasformazioni a PolyLine.
This commit is contained in:
Dario Sassi
2014-06-03 13:19:54 +00:00
parent a52d73aa7a
commit 41a38fef3b
44 changed files with 3257 additions and 248 deletions
+28 -37
View File
@@ -24,14 +24,9 @@
void
Vector3d::FromSpherical( double dLen, double dAngVertDeg, double dAngOrizzDeg)
{
double dAngVertRad ;
double dAngOrizzRad ;
double dSinAngVert ;
dAngVertRad = dAngVertDeg * DEGTORAD ;
dAngOrizzRad = dAngOrizzDeg * DEGTORAD ;
dSinAngVert = sin( dAngVertRad) ;
double dAngVertRad = dAngVertDeg * DEGTORAD ;
double dAngOrizzRad = dAngOrizzDeg * DEGTORAD ;
double dSinAngVert = sin( dAngVertRad) ;
x = dLen * dSinAngVert * cos( dAngOrizzRad) ;
y = dLen * dSinAngVert * sin( dAngOrizzRad) ;
z = dLen * cos( dAngVertRad) ;
@@ -43,10 +38,7 @@ Vector3d::FromSpherical( double dLen, double dAngVertDeg, double dAngOrizzDeg)
void
Vector3d::FromPolar( double dLen, double dAngDeg)
{
double dAngRad ;
dAngRad = dAngDeg * DEGTORAD ;
double dAngRad = dAngDeg * DEGTORAD ;
x = dLen * cos( dAngRad) ;
y = dLen * sin( dAngRad) ;
z = 0 ;
@@ -158,8 +150,9 @@ Vector3d::Normalize( double dEps)
// Rotazione
//----------------------------------------------------------------------------
bool
Vector3d::Rotate( const Vector3d& vtAx, double dAngRad)
Vector3d::Rotate( const Vector3d& vtAx, double dAngDeg)
{
double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( vtAx, cos( dAngRad), sin( dAngRad)) ;
}
@@ -169,31 +162,21 @@ Vector3d::Rotate( const Vector3d& vtAx, double dAngRad)
bool
Vector3d::Rotate( const Vector3d& vtAx, double dCosAng, double dSinAng)
{
double dCompPar ;
Vector3d vtDirAx ;
Vector3d vtCompPar ;
Vector3d vtCompPerp ;
Vector3d vtPerp2 ;
Vector3d vtNewCompPerpX ;
Vector3d vtNewCompPerpY ;
Vector3d vtNewCompPerp ;
// ricavo versore asse di rotazione
vtDirAx = vtAx ;
Vector3d vtDirAx = vtAx ;
if ( ! vtDirAx.Normalize())
return false ;
// separazione del vettore nelle componenti parallela e perp. asse
dCompPar = *this * vtDirAx ;
vtCompPar = vtDirAx * dCompPar ;
vtCompPerp = *this - vtCompPar ;
double dCompPar = *this * vtDirAx ;
Vector3d vtCompPar = vtDirAx * dCompPar ;
Vector3d vtCompPerp = *this - vtCompPar ;
// calcolo vettore perp. componente perp. e asse
vtPerp2 = vtDirAx ^ vtCompPerp ;
Vector3d vtPerp2 = vtDirAx ^ vtCompPerp ;
// calcolo componenti perp. del vettore ruotato
vtNewCompPerpX = dCosAng * vtCompPerp ;
vtNewCompPerpY = dSinAng * vtPerp2 ;
vtNewCompPerp = vtNewCompPerpX + vtNewCompPerpY ;
Vector3d vtNewCompPerpX = dCosAng * vtCompPerp ;
Vector3d vtNewCompPerpY = dSinAng * vtPerp2 ;
Vector3d vtNewCompPerp = vtNewCompPerpX + vtNewCompPerpY ;
// calcolo del vettore ruotato
*this = vtCompPar + vtNewCompPerp ;
@@ -224,17 +207,13 @@ Vector3d::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dC
bool
Vector3d::Mirror( const Vector3d& vtNorm)
{
double dCompNorm ;
Vector3d vtDirNorm ;
// ricavo versore normale al piano di simmetria
vtDirNorm = vtNorm ;
Vector3d vtDirNorm = vtNorm ;
if ( ! vtDirNorm.Normalize())
return false ;
// calcolo la componente parallela alla normale
dCompNorm = *this * vtDirNorm ;
double dCompNorm = *this * vtDirNorm ;
// il simmetrico è il vettore originale meno il doppio della componente parallela
*this = *this - 2 * dCompNorm * vtDirNorm ;
@@ -242,6 +221,18 @@ Vector3d::Mirror( const Vector3d& vtNorm)
return true ;
}
//----------------------------------------------------------------------------
// Scorrimento
//----------------------------------------------------------------------------
bool
Vector3d::Shear( const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff)
{
// costruisco il vettore
*this += dCoeff * ( *this * vtNorm) * vtDir ;
return true ;
}
//----------------------------------------------------------------------------
// Cambio di riferimento : dal riferimento al globale
//----------------------------------------------------------------------------