EgtGeomKernel 1.8k3 :

- miglioramenti a Zmap.
This commit is contained in:
Dario Sassi
2017-11-25 18:50:54 +00:00
parent 33d2690ec8
commit 4252497bb3
7 changed files with 702 additions and 711 deletions
+7 -78
View File
@@ -52,6 +52,7 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
// Riporto le coordinate cicliche nell'ordine di partenza
Vector3d vtNmi = vtNMin ;
Vector3d vtNma = vtNMax ;
// Passo dalla grilgia al sistema intrinseco
if ( nGrid == 1) {
swap( vtNmi.x, vtNmi.z) ;
swap( vtNmi.y, vtNmi.z) ;
@@ -318,41 +319,7 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
return true ;
}
//----------------------------------------------------------------------------
bool
VolZmap::SubtractIntervals( unsigned int nGrid, const Point3d & ptP,
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax)
{
// Controllo che il numero di griglia sia entro i limiti.
if ( nGrid < 0 || nGrid > 2)
return false ;
// ptP è espresso nel sistema locale e viene convertito in quello intrinseco (localFrame)
Point3d ptPL = ptP ;
ptPL.ToLoc( m_MapFrame[nGrid]) ;
double dX, dY, dZ ; // Coordinate di ptPL nel sistema intrinseco
double dhMin, dhMax ; // Altezze dMin e dMax RIESPRESSE nel sistema intrinseco (dMin e dMax sono altezze rispetto a ptP)
dX = ptPL.x ; dY = ptPL.y ; dZ = ptPL.z ;
dhMin = dZ + dMin ; dhMax = dZ + dMax ;
// Cerco il punto della griglia più vicino
double integerPartX = floor( dX / m_dStep) ;
double integerPartY = floor( dY / m_dStep) ;
unsigned int i = static_cast <unsigned int> (integerPartX) ; // Indici del punto di griglia più vicino.
unsigned int j = static_cast <unsigned int> (integerPartY) ; // i = 0, 1, ..., m_Nx - 1 ; j = 0, 1, ..., m_Ny - 1 ;
// Controllo che gli indici ottenuti siano nella griglia:
// se sono dentro la griglia chiamo l'altra subtract
if ( i >= 0 && i < m_nNx[nGrid] &&
j >= 0 && j < m_nNy[nGrid])
return SubtractIntervals( nGrid, i, j, dhMin, dhMax, vtNMin, vtNMax) ;
// altrimenti non succede niente
else
return true ;
}
//----------------------------------------------------------------------------
bool
@@ -585,46 +552,8 @@ VolZmap::AddIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
return true ;
}
//----------------------------------------------------------------------------
bool
VolZmap::AddIntervals( unsigned int nGrid, const Point3d & ptP,
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax)
{
// // Controllo che il numero di griglia sia entro i limiti.
// if ( nGrid < 0 || nGrid > 2)
// return false ;
//
// // ptP è espresso nel sistema locale e viene convertito in quello intrinseco (localFrame)
// Point3d ptPL = ptP ;
// ptPL.ToLoc( m_MapFrame[nGrid]) ;
//
// double dX, dY, dZ ; // Coordinate di ptPL nel sistema intrinseco
// double dhMin, dhMax ; // Altezze dMin e dMax RIESPRESSE nel sistema intrinseco (dMin e dMax sono altezze rispetto a ptP)
//
// dX = ptPL.x ; dY = ptPL.y ; dZ = ptPL.z ;
// dhMin = dZ + dMin ; dhMax = dZ + dMax ;
//
// // Cerco il punto della griglia più vicino
// double integerPartX = floor( dX / m_dStep) ;
// double integerPartY = floor( dY / m_dStep) ;
//
// unsigned int i = static_cast <unsigned int> (integerPartX) ; // Indici del punto di griglia più vicino.
// unsigned int j = static_cast <unsigned int> (integerPartY) ; // i = 0, 1, ..., m_Nx - 1 ; j = 0, 1, ..., m_Ny - 1
//
// // Controllo che gli indici ottenuti siano nella griglia:
// // se sono dentro la griglia chiamo l'altra add
// if ( i >= 0 && i < m_nNx[nGrid] &&
// j >= 0 && j < m_nNy[nGrid])
//
// return AddIntervals( nGrid, i, j, dhMin, dhMax, vtNMin, vtNMax) ;
// else
// // altrimenti non succede niente
return false ;
}
// ------------------------- LAVORAZIONI --------------------------------------------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Point3d& ptPe, const Vector3d& vtDe)
@@ -645,10 +574,10 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
Point3d ptLe[3] ;
ptLs[0] = ptPs ;
ptLs[0].ToLoc( m_MapFrame[0]) ;
ptLs[0].ToLoc( m_MapFrame) ;
ptLe[0] = ptPe ;
ptLe[0].ToLoc( m_MapFrame[0]) ;
ptLe[0].ToLoc( m_MapFrame) ;
if ( m_nMapNum > 1) {
ptLs[1].x = ptLs[0].y ; ptLs[1].y = ptLs[0].z ; ptLs[1].z = ptLs[0].x ;
@@ -671,11 +600,11 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
Vector3d vtLe[3] ;
vtLs[0] = vtDs ;
vtLs[0].ToLoc( m_MapFrame[0]) ;
vtLs[0].ToLoc( m_MapFrame) ;
vtLs[0].Normalize() ;
vtLe[0] = vtDe ;
vtLe[0].ToLoc( m_MapFrame[0]) ;
vtLe[0].ToLoc( m_MapFrame) ;
vtLe[0].Normalize() ;
if ( m_nMapNum > 1) {
@@ -691,11 +620,11 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
Vector3d vtALe[3] ;
vtALs[0] = vtAs ;
vtALs[0].ToLoc( m_MapFrame[0]) ;
vtALs[0].ToLoc( m_MapFrame) ;
vtALs[0].Normalize() ;
vtALe[0] = vtAe ;
vtALe[0].ToLoc( m_MapFrame[0]) ;
vtALe[0].ToLoc( m_MapFrame) ;
vtALe[0].Normalize() ;
if ( m_nMapNum > 1) {