EgtGeomKernel 2.1b1 :
- modifiche a Zmap per mantenimento liste triangoli.
This commit is contained in:
Binary file not shown.
+116
-104
@@ -138,12 +138,18 @@ VolZmap::CopyFrom( const VolZmap& vzmSrc)
|
||||
m_nTempProp = vzmSrc.m_nTempProp ;
|
||||
|
||||
// dimensiono membri legati ai blocchi
|
||||
m_BlockToUpdate.resize( m_nNumBlock) ;
|
||||
m_InterBlockVox.resize( m_nNumBlock) ;
|
||||
m_InterBlockTria.resize( m_nNumBlock) ;
|
||||
m_SliceXY.resize( m_nNumBlock) ;
|
||||
m_SliceXZ.resize( m_nNumBlock) ;
|
||||
m_SliceYZ.resize( m_nNumBlock) ;
|
||||
m_BlockToUpdate = vzmSrc.m_BlockToUpdate ;
|
||||
m_BlockUpGradingCounter = vzmSrc.m_BlockUpGradingCounter ;
|
||||
m_InterBlockVox = vzmSrc.m_InterBlockVox ;
|
||||
m_InterBlockOriginalSharpTria = vzmSrc.m_InterBlockOriginalSharpTria ;
|
||||
m_InterBlockToBeFlippedSharpTria = vzmSrc.m_InterBlockToBeFlippedSharpTria ;
|
||||
m_BlockSharpTria = vzmSrc.m_BlockSharpTria ;
|
||||
m_BlockSmoothTria = vzmSrc.m_BlockSmoothTria ;
|
||||
m_BlockBigTria = vzmSrc.m_BlockBigTria ;
|
||||
m_SingleMapTria = vzmSrc.m_SingleMapTria ;
|
||||
m_SliceXY = vzmSrc.m_SliceXY ;
|
||||
m_SliceXZ = vzmSrc.m_SliceXZ ;
|
||||
m_SliceYZ = vzmSrc.m_SliceYZ ;
|
||||
|
||||
// imposto ricalcolo grafica
|
||||
ResetGraphics() ;
|
||||
@@ -156,7 +162,7 @@ bool
|
||||
VolZmap::ResetGraphics( void)
|
||||
{
|
||||
m_OGrMgr.Reset() ;
|
||||
for ( unsigned int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount)
|
||||
for ( int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount)
|
||||
m_BlockToUpdate[nCount] = true ;
|
||||
return true ;
|
||||
}
|
||||
@@ -196,7 +202,7 @@ VolZmap::Dump( string& sOut, bool bMM, const char* szNewLine) const
|
||||
sOut += "Dim=" + ToString( m_nDim[0]) +
|
||||
"(" + ToString( m_nNx[0]) + "x" + ToString( m_nNy[0]) + ")" + szNewLine ;
|
||||
else {
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
sOut += "Dim" + ToString( i+1) + "=" + ToString( m_nDim[i]) +
|
||||
"(" + ToString( m_nNx[i]) + "x" + ToString( m_nNy[i]) + ")" + szNewLine ;
|
||||
}
|
||||
@@ -245,7 +251,7 @@ VolZmap::Save( NgeWriter& ngeOut) const
|
||||
if ( ! ngeOut.WriteFrame( m_MapFrame, ";", true))
|
||||
return false ;
|
||||
// per ogni mappa : numero di passi in X e Y e quote z estremali
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
if ( ! ngeOut.WriteInt( m_nNx[i], ",", false))
|
||||
return false ;
|
||||
if ( ! ngeOut.WriteInt( m_nNy[i], ",", false))
|
||||
@@ -256,11 +262,11 @@ VolZmap::Save( NgeWriter& ngeOut) const
|
||||
return false ;
|
||||
}
|
||||
// ciclo sulle mappe
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
// ciclo sui dexel
|
||||
for ( unsigned int j = 0 ; j < m_nDim[i] ; ++ j) {
|
||||
for ( int j = 0 ; j < m_nDim[i] ; ++ j) {
|
||||
// numero di estremi
|
||||
unsigned int nDim = unsigned int( m_Values[i][j].size()) ;
|
||||
int nDim = int( m_Values[i][j].size()) ;
|
||||
if ( ! ngeOut.WriteInt( nDim, ":", false))
|
||||
return false ;
|
||||
// se dexel nullo
|
||||
@@ -271,7 +277,7 @@ VolZmap::Save( NgeWriter& ngeOut) const
|
||||
}
|
||||
// altrimenti
|
||||
else {
|
||||
for ( unsigned int k = 0 ; k < nDim ; ++ k) {
|
||||
for ( int k = 0 ; k < nDim ; ++ k) {
|
||||
if ( ! ngeOut.WriteDouble( m_Values[i][j][k].dMin, ",", false))
|
||||
return false ;
|
||||
if ( ! ngeOut.WriteInt( m_Values[i][j][k].nToolMin, ";", false))
|
||||
@@ -327,7 +333,7 @@ VolZmap::Load( NgeReader& ngeIn)
|
||||
if ( ! ngeIn.ReadFrame( m_MapFrame, ";", true))
|
||||
return false ;
|
||||
// per ogni mappa : numero di passi in X e Y e quote z estremali
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
if ( ! ngeIn.ReadInt( m_nNx[i], ",", false))
|
||||
return false ;
|
||||
if ( ! ngeIn.ReadInt( m_nNy[i], ",", false))
|
||||
@@ -339,13 +345,13 @@ VolZmap::Load( NgeReader& ngeIn)
|
||||
return false ;
|
||||
}
|
||||
// ciclo sulle mappe
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
// dimensiono i vettori
|
||||
m_Values[i].resize( m_nDim[i]) ;
|
||||
// ciclo sui dexel
|
||||
for ( unsigned int j = 0 ; j < m_nDim[i] ; ++ j) {
|
||||
for ( int j = 0 ; j < m_nDim[i] ; ++ j) {
|
||||
// leggo il numero di estremi nel dexel
|
||||
unsigned int nDim ;
|
||||
int nDim ;
|
||||
if ( ! ngeIn.ReadInt( nDim, ":", false))
|
||||
return false ;
|
||||
// se dexel nullo
|
||||
@@ -360,7 +366,7 @@ VolZmap::Load( NgeReader& ngeIn)
|
||||
// dimensiono l'array
|
||||
m_Values[i][j].resize( nDim) ;
|
||||
// leggo i valori
|
||||
for ( unsigned int k = 0 ; k < nDim ; ++ k) {
|
||||
for ( int k = 0 ; k < nDim ; ++ k) {
|
||||
if ( ! ngeIn.ReadDouble( m_Values[i][j][k].dMin, ",", false))
|
||||
return false ;
|
||||
if ( ! ngeIn.ReadInt( m_Values[i][j][k].nToolMin, ";", false))
|
||||
@@ -381,13 +387,17 @@ VolZmap::Load( NgeReader& ngeIn)
|
||||
}
|
||||
|
||||
// imposto aggiornamento obbligatorio su tutti i blocchi
|
||||
m_BlockToUpdate.resize( m_nNumBlock) ;
|
||||
for ( unsigned int nCount = 0 ; nCount < m_nNumBlock ; ++ nCount)
|
||||
m_BlockToUpdate[nCount] = true ;
|
||||
m_BlockToUpdate.resize( m_nNumBlock, true) ;
|
||||
m_BlockUpGradingCounter.resize( m_nNumBlock + ( m_nMapNum == 1 ? 0 : 1), 0) ;
|
||||
|
||||
// per triangoli di feature di frontiera tra blocchi
|
||||
m_InterBlockVox.resize( m_nNumBlock) ;
|
||||
m_InterBlockTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockOriginalSharpTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockToBeFlippedSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSmoothTria.resize( m_nNumBlock) ;
|
||||
m_BlockBigTria.resize( m_nNumBlock) ;
|
||||
m_SingleMapTria.resize( m_nNumBlock) ;
|
||||
m_SliceXY.resize( m_nNumBlock) ;
|
||||
m_SliceXZ.resize( m_nNumBlock) ;
|
||||
m_SliceYZ.resize( m_nNumBlock) ;
|
||||
@@ -415,13 +425,13 @@ VolZmap::GetLocalBBox( BBox3d& b3Loc, int nFlag) const
|
||||
// calcolo preciso
|
||||
// ciclo sui dexel (punti in basso con ciclo aggiunto per punti in alto di ultima riga)
|
||||
double dY = 0 ;
|
||||
for ( size_t j = 0 ; j <= m_nNy[0] ; ++ j) {
|
||||
size_t jc = ( ( j != m_nNy[0]) ? j : m_nNy[0] - 1) ;
|
||||
for ( int j = 0 ; j <= m_nNy[0] ; ++ j) {
|
||||
int jc = ( ( j != m_nNy[0]) ? j : m_nNy[0] - 1) ;
|
||||
double dX = 0 ;
|
||||
// punto a sinistra di ogni dexel (aggiungo un ciclo per fare punto a destra di ultimo)
|
||||
for ( size_t i = 0 ; i <= m_nNx[0] ; ++ i) {
|
||||
size_t ic = ( ( i != m_nNx[0]) ? i : m_nNx[0] - 1) ;
|
||||
size_t nPos = ic + jc * m_nNx[0] ;
|
||||
for ( int i = 0 ; i <= m_nNx[0] ; ++ i) {
|
||||
int ic = ( ( i != m_nNx[0]) ? i : m_nNx[0] - 1) ;
|
||||
int nPos = ic + jc * m_nNx[0] ;
|
||||
if ( m_Values[0][nPos].size() > 0) {
|
||||
Point3d ptP = m_MapFrame.Orig() + dX * m_MapFrame.VersX() + dY * m_MapFrame.VersY() ;
|
||||
b3Loc.Add( ptP + m_Values[0][nPos][0].dMin * m_MapFrame.VersZ()) ;
|
||||
@@ -459,13 +469,13 @@ VolZmap::GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag) const
|
||||
// calcolo preciso
|
||||
// ciclo sui dexel (punti in basso con ciclo aggiunto per punti in alto di ultima riga)
|
||||
double dY = 0 ;
|
||||
for ( size_t j = 0 ; j <= m_nNy[0] ; ++ j) {
|
||||
size_t jc = ( ( j != m_nNy[0]) ? j : m_nNy[0] -1) ;
|
||||
for ( int j = 0 ; j <= m_nNy[0] ; ++ j) {
|
||||
int jc = ( ( j != m_nNy[0]) ? j : m_nNy[0] -1) ;
|
||||
double dX = 0 ;
|
||||
// punto a sinistra di ogni dexel (aggiungo un ciclo per fare punto a destra di ultimo)
|
||||
for ( size_t i = 0 ; i <= m_nNx[0] ; ++ i) {
|
||||
size_t ic = ( ( i != m_nNx[0]) ? i : m_nNx[0] -1) ;
|
||||
size_t nPos = ic + jc * m_nNx[0] ;
|
||||
for ( int i = 0 ; i <= m_nNx[0] ; ++ i) {
|
||||
int ic = ( ( i != m_nNx[0]) ? i : m_nNx[0] -1) ;
|
||||
int nPos = ic + jc * m_nNx[0] ;
|
||||
if ( m_Values[0][nPos].size() > 0) {
|
||||
Point3d ptP = frUse.Orig() + dX * frUse.VersX() + dY * frUse.VersY() ;
|
||||
b3Ref.Add( ptP + m_Values[0][nPos][0].dMin * frUse.VersZ()) ;
|
||||
@@ -607,9 +617,9 @@ VolZmap::CheckMapConnection( void)
|
||||
m_nConnectedCompoCount = 0 ;
|
||||
// Imposto a 0 tutti il valore del numero della componente
|
||||
// connessa di ciascun tratto di ciascun dexel.
|
||||
for ( size_t tMap = 0 ; tMap < m_nMapNum ; ++ tMap) {
|
||||
for ( size_t tDex = 0 ; tDex < m_nDim[tMap] ; ++ tDex) {
|
||||
for ( size_t tInt = 0 ; tInt < m_Values[tMap][tDex].size() ; ++ tInt) {
|
||||
for ( int tMap = 0 ; tMap < m_nMapNum ; ++ tMap) {
|
||||
for ( int tDex = 0 ; tDex < m_nDim[tMap] ; ++ tDex) {
|
||||
for ( int tInt = 0 ; tInt < int( m_Values[tMap][tDex].size()) ; ++ tInt) {
|
||||
|
||||
m_Values[tMap][tDex][tInt].nCompo = 0 ;
|
||||
// Controlli sui tratti di dexel non incidenti su nodi del reticolo
|
||||
@@ -651,14 +661,14 @@ VolZmap::CheckMapConnection( void)
|
||||
}
|
||||
|
||||
// Ciclo sui dexel lungo Z
|
||||
for ( size_t tI = 0 ; tI < m_nNx[0] ; ++ tI) {
|
||||
for ( size_t tJ = 0 ; tJ < m_nNy[0] ; ++ tJ) {
|
||||
for ( int tI = 0 ; tI < m_nNx[0] ; ++ tI) {
|
||||
for ( int tJ = 0 ; tJ < m_nNy[0] ; ++ tJ) {
|
||||
// Numero del dexel lungo Z
|
||||
size_t tDexZ = tJ * m_nNx[0] + tI ;
|
||||
int tDexZ = tJ * m_nNx[0] + tI ;
|
||||
// Numero di intervalli nel dexel
|
||||
size_t tStopIntZ = m_Values[0][tDexZ].size() ;
|
||||
int tStopIntZ = int( m_Values[0][tDexZ].size()) ;
|
||||
// Ciclo sugli intervalli del dexel
|
||||
for ( size_t tIntZ = 0 ; tIntZ < tStopIntZ ; ++ tIntZ) {
|
||||
for ( int tIntZ = 0 ; tIntZ < tStopIntZ ; ++ tIntZ) {
|
||||
|
||||
if ( m_Values[0][tDexZ][tIntZ].nCompo == 0) {
|
||||
++ m_nConnectedCompoCount ;
|
||||
@@ -708,10 +718,10 @@ VolZmap::ExpandFromXInterval( IntContaier& IntCont)
|
||||
// Copio i dati dell'intervallo corrente
|
||||
IntervalIndexes CurrInterval = IntCont.top() ;
|
||||
IntCont.pop() ;
|
||||
size_t tDex = CurrInterval.tDex ;
|
||||
size_t tGrIndex1 = CurrInterval.tDex % m_nNx[1] ;
|
||||
size_t tGrIndex2 = CurrInterval.tDex / m_nNx[1] ;
|
||||
size_t tInt = CurrInterval.tInt ;
|
||||
int tDex = CurrInterval.tDex ;
|
||||
int tGrIndex1 = CurrInterval.tDex % m_nNx[1] ;
|
||||
int tGrIndex2 = CurrInterval.tDex / m_nNx[1] ;
|
||||
int tInt = CurrInterval.tInt ;
|
||||
// Quote estreme del segmento lungo X
|
||||
double dMinX = m_Values[1][tDex][tInt].dMin ;
|
||||
double dMaxX = m_Values[1][tDex][tInt].dMax ;
|
||||
@@ -719,17 +729,17 @@ VolZmap::ExpandFromXInterval( IntContaier& IntCont)
|
||||
double dMaxDX = max( floor( ( dMaxX + EPS_SMALL) / m_dStep - 0.5), 0.) ;
|
||||
// Indici estremi dei dei dexel ortogonali
|
||||
// che possono intersecare il segmento di partenza
|
||||
size_t tStartI = min( size_t( dMinDX), size_t( m_nNx[0] - 1)) ;
|
||||
size_t tStopI = min( size_t( dMaxDX), size_t( m_nNx[0] - 1)) ;
|
||||
int tStartI = min( int( dMinDX), ( m_nNx[0] - 1)) ;
|
||||
int tStopI = min( int( dMaxDX), ( m_nNx[0] - 1)) ;
|
||||
// Posizione YZ del dexel
|
||||
double dY = ( tGrIndex1 + 0.5) * m_dStep ;
|
||||
double dZ = ( tGrIndex2 + 0.5) * m_dStep ;
|
||||
// Ciclo sugli indici dei dexel che potrebbero
|
||||
// intersecare il segmento di partenza
|
||||
for ( size_t tI = tStartI ; tI <= tStopI ; ++ tI) {
|
||||
for ( int tI = tStartI ; tI <= tStopI ; ++ tI) {
|
||||
// Analizzo i dexel della griglia 0.
|
||||
size_t tStopZ = m_Values[0][tGrIndex1 * m_nNx[0] + tI].size() ;
|
||||
for ( size_t tIntZ = 0 ; tIntZ < tStopZ ; ++ tIntZ) {
|
||||
int tStopZ = int( m_Values[0][tGrIndex1 * m_nNx[0] + tI].size()) ;
|
||||
for ( int tIntZ = 0 ; tIntZ < tStopZ ; ++ tIntZ) {
|
||||
// Estremi del dexel lunog Z
|
||||
double dZmin = m_Values[0][tGrIndex1 * m_nNx[0] + tI][tIntZ].dMin ;
|
||||
double dZmax = m_Values[0][tGrIndex1 * m_nNx[0] + tI][tIntZ].dMax ;
|
||||
@@ -748,8 +758,8 @@ VolZmap::ExpandFromXInterval( IntContaier& IntCont)
|
||||
}
|
||||
}
|
||||
// Analizzo i dexel della griglia 2
|
||||
size_t tStopY = m_Values[2][tI * m_nNx[2] + tGrIndex2].size() ;
|
||||
for ( size_t tIntY = 0 ; tIntY < tStopY ; ++ tIntY) {
|
||||
int tStopY = int( m_Values[2][tI * m_nNx[2] + tGrIndex2].size()) ;
|
||||
for ( int tIntY = 0 ; tIntY < tStopY ; ++ tIntY) {
|
||||
// Estremi del segmento del dexel lungo Y
|
||||
double dYmin = m_Values[2][tI * m_nNx[2] + tGrIndex2][tIntY].dMin ;
|
||||
double dYmax = m_Values[2][tI * m_nNx[2] + tGrIndex2][tIntY].dMax ;
|
||||
@@ -779,10 +789,10 @@ VolZmap::ExpandFromYInterval( IntContaier& IntCont)
|
||||
// Copio i dati dell'intervallo corrente
|
||||
IntervalIndexes CurrInterval = IntCont.top() ;
|
||||
IntCont.pop() ;
|
||||
size_t tDex = CurrInterval.tDex ;
|
||||
size_t tGrIndex1 = CurrInterval.tDex % m_nNx[2] ;
|
||||
size_t tGrIndex2 = CurrInterval.tDex / m_nNx[2] ;
|
||||
size_t tInt = CurrInterval.tInt ;
|
||||
int tDex = CurrInterval.tDex ;
|
||||
int tGrIndex1 = CurrInterval.tDex % m_nNx[2] ;
|
||||
int tGrIndex2 = CurrInterval.tDex / m_nNx[2] ;
|
||||
int tInt = CurrInterval.tInt ;
|
||||
// Quote estreme del segmento lungo Y
|
||||
double dMinY = m_Values[2][tDex][tInt].dMin ;
|
||||
double dMaxY = m_Values[2][tDex][tInt].dMax ;
|
||||
@@ -790,17 +800,17 @@ VolZmap::ExpandFromYInterval( IntContaier& IntCont)
|
||||
double dMaxDY = max( floor( ( dMaxY + EPS_SMALL) / m_dStep - 0.5), 0.) ;
|
||||
// Indici estremi dei dei dexel ortogonali
|
||||
// che possono intersecare il segmento di partenza
|
||||
size_t tStartJ = min( size_t( dMinDY), size_t( m_nNy[0] - 1)) ;
|
||||
size_t tStopJ = min( size_t( dMaxDY), size_t( m_nNy[0] - 1)) ;
|
||||
int tStartJ = min( int( dMinDY), ( m_nNy[0] - 1)) ;
|
||||
int tStopJ = min( int( dMaxDY), ( m_nNy[0] - 1)) ;
|
||||
// Posizione XZ del dexel
|
||||
double dX = ( tGrIndex2 + 0.5) * m_dStep ;
|
||||
double dZ = ( tGrIndex1 + 0.5) * m_dStep ;
|
||||
// Ciclo sugli indici dei dexel che potrebbero
|
||||
// intersecare il segmento di partenza
|
||||
for ( size_t tJ = tStartJ ; tJ <= tStopJ ; ++ tJ) {
|
||||
for ( int tJ = tStartJ ; tJ <= tStopJ ; ++ tJ) {
|
||||
// Analizzo i dexel della griglia 0.
|
||||
size_t tStopZ = m_Values[0][tJ * m_nNx[0] + tGrIndex2].size() ;
|
||||
for ( size_t tIntZ = 0 ; tIntZ < tStopZ ; ++ tIntZ) {
|
||||
int tStopZ = int( m_Values[0][tJ * m_nNx[0] + tGrIndex2].size()) ;
|
||||
for ( int tIntZ = 0 ; tIntZ < tStopZ ; ++ tIntZ) {
|
||||
// Estremi del dexel lunog Z
|
||||
double dZmin = m_Values[0][tJ * m_nNx[0] + tGrIndex2][tIntZ].dMin ;
|
||||
double dZmax = m_Values[0][tJ * m_nNx[0] + tGrIndex2][tIntZ].dMax ;
|
||||
@@ -819,8 +829,8 @@ VolZmap::ExpandFromYInterval( IntContaier& IntCont)
|
||||
}
|
||||
}
|
||||
// Analizzo i dexel della griglia 1
|
||||
size_t tStopX = m_Values[1][tGrIndex1 * m_nNx[1] + tJ].size() ;
|
||||
for ( size_t tIntX = 0 ; tIntX < tStopX ; ++ tIntX) {
|
||||
int tStopX = int( m_Values[1][tGrIndex1 * m_nNx[1] + tJ].size()) ;
|
||||
for ( int tIntX = 0 ; tIntX < tStopX ; ++ tIntX) {
|
||||
// Estremi del segmento del dexel lungo X
|
||||
double dXmin = m_Values[1][tGrIndex1 * m_nNx[1] + tJ][tIntX].dMin ;
|
||||
double dXmax = m_Values[1][tGrIndex1 * m_nNx[1] + tJ][tIntX].dMax ;
|
||||
@@ -850,10 +860,10 @@ VolZmap::ExpandFromZInterval( IntContaier& IntCont)
|
||||
// Copio i dati dell'intervallo corrente
|
||||
IntervalIndexes CurrInterval = IntCont.top() ;
|
||||
IntCont.pop() ;
|
||||
size_t tDex = CurrInterval.tDex ;
|
||||
size_t tGrIndex1 = CurrInterval.tDex % m_nNx[0] ;
|
||||
size_t tGrIndex2 = CurrInterval.tDex / m_nNx[0] ;
|
||||
size_t tInt = CurrInterval.tInt ;
|
||||
int tDex = CurrInterval.tDex ;
|
||||
int tGrIndex1 = CurrInterval.tDex % m_nNx[0] ;
|
||||
int tGrIndex2 = CurrInterval.tDex / m_nNx[0] ;
|
||||
int tInt = CurrInterval.tInt ;
|
||||
// Quote estreme del segmento lungo Z
|
||||
double dMinZ = m_Values[0][tDex][tInt].dMin ;
|
||||
double dMaxZ = m_Values[0][tDex][tInt].dMax ;
|
||||
@@ -861,17 +871,17 @@ VolZmap::ExpandFromZInterval( IntContaier& IntCont)
|
||||
double dMaxDZ = max( floor( ( dMaxZ + EPS_SMALL) / m_dStep - 0.5), 0.) ;
|
||||
// Indici estremi dei dexel ortogonali
|
||||
// che possono intersecare il segmento di partenza
|
||||
size_t tStartK = min( size_t( dMinDZ), size_t( m_nNy[1] - 1)) ;
|
||||
size_t tStopK = min( size_t( dMaxDZ), size_t( m_nNy[1] - 1)) ;
|
||||
int tStartK = min( int( dMinDZ), ( m_nNy[1] - 1)) ;
|
||||
int tStopK = min( int( dMaxDZ), ( m_nNy[1] - 1)) ;
|
||||
// Posizione XY del dexel
|
||||
double dX = ( tGrIndex1 + 0.5) * m_dStep ;
|
||||
double dY = ( tGrIndex2 + 0.5) * m_dStep ;
|
||||
// Ciclo sugli indici dei dexel che potrebbero
|
||||
// intersecare il segmento di partenza
|
||||
for ( size_t tK = tStartK ; tK <= tStopK ; ++ tK) {
|
||||
for ( int tK = tStartK ; tK <= tStopK ; ++ tK) {
|
||||
// Analizzo i dexel della griglia 1.
|
||||
size_t tStopX = m_Values[1][tK * m_nNx[1] + tGrIndex2].size() ;
|
||||
for ( size_t tIntX = 0 ; tIntX < tStopX ; ++ tIntX) {
|
||||
int tStopX = int( m_Values[1][tK * m_nNx[1] + tGrIndex2].size()) ;
|
||||
for ( int tIntX = 0 ; tIntX < tStopX ; ++ tIntX) {
|
||||
// Estremi del segmento del dexel lungo X
|
||||
double dXmin = m_Values[1][tK * m_nNx[1] + tGrIndex2][tIntX].dMin ;
|
||||
double dXmax = m_Values[1][tK * m_nNx[1] + tGrIndex2][tIntX].dMax ;
|
||||
@@ -890,8 +900,8 @@ VolZmap::ExpandFromZInterval( IntContaier& IntCont)
|
||||
}
|
||||
}
|
||||
// Analizzo i dexel della griglia 2
|
||||
size_t tStopY = m_Values[2][tGrIndex1 * m_nNx[2] + tK].size() ;
|
||||
for ( size_t tIntY = 0 ; tIntY < tStopY ; ++ tIntY) {
|
||||
int tStopY = int( m_Values[2][tGrIndex1 * m_nNx[2] + tK].size()) ;
|
||||
for ( int tIntY = 0 ; tIntY < tStopY ; ++ tIntY) {
|
||||
// Estremi del segmento del dexel lungo Y
|
||||
double dYmin = m_Values[2][tGrIndex1 * m_nNx[2] + tK][tIntY].dMin ;
|
||||
double dYmax = m_Values[2][tGrIndex1 * m_nNx[2] + tK][tIntY].dMax ;
|
||||
@@ -1084,32 +1094,33 @@ VolZmap::ClonePart( int nPart) const
|
||||
}
|
||||
|
||||
// Calcolo il numero di voxel lungo x,y e z
|
||||
unsigned int nVoxNumX = pVolume->m_nNx[0] / pVolume->N_DEXVOXRATIO +
|
||||
( pVolume->m_nNx[0] % pVolume->N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumY = pVolume->m_nNy[0] / pVolume->N_DEXVOXRATIO +
|
||||
( pVolume->m_nNy[0] % pVolume->N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumZ = pVolume->m_nNy[1] / pVolume->N_DEXVOXRATIO +
|
||||
( pVolume->m_nNy[1] % pVolume->N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumX = pVolume->m_nNx[0] / pVolume->N_DEXVOXRATIO +
|
||||
( pVolume->m_nNx[0] % pVolume->N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumY = pVolume->m_nNy[0] / pVolume->N_DEXVOXRATIO +
|
||||
( pVolume->m_nNy[0] % pVolume->N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumZ = pVolume->m_nNy[1] / pVolume->N_DEXVOXRATIO +
|
||||
( pVolume->m_nNy[1] % pVolume->N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
|
||||
// Definisco il numero di blocchi lungo x,y e z
|
||||
pVolume->m_nFracLin[0] = max( 1u, nVoxNumX / pVolume->m_nVoxNumPerBlock +
|
||||
pVolume->m_nFracLin[0] = max( 1, nVoxNumX / pVolume->m_nVoxNumPerBlock +
|
||||
( nVoxNumX % pVolume->m_nVoxNumPerBlock >= pVolume->m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
pVolume->m_nFracLin[1] = max( 1u, nVoxNumY / pVolume->m_nVoxNumPerBlock +
|
||||
pVolume->m_nFracLin[1] = max( 1, nVoxNumY / pVolume->m_nVoxNumPerBlock +
|
||||
( nVoxNumY % pVolume->m_nVoxNumPerBlock >= pVolume->m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
pVolume->m_nFracLin[2] = max( 1u, nVoxNumZ / pVolume->m_nVoxNumPerBlock +
|
||||
pVolume->m_nFracLin[2] = max( 1, nVoxNumZ / pVolume->m_nVoxNumPerBlock +
|
||||
( nVoxNumZ % pVolume->m_nVoxNumPerBlock >= pVolume->m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
|
||||
// Dimensiono il vettore dei blocchi
|
||||
pVolume->m_nNumBlock = pVolume->m_nFracLin[0] * pVolume->m_nFracLin[1] * pVolume->m_nFracLin[2] ;
|
||||
pVolume->m_BlockToUpdate.resize( pVolume->m_nNumBlock) ;
|
||||
// Setto tutti i blocchi come da aggiornare per la grafica
|
||||
for ( unsigned int nCount = 0 ; nCount < pVolume->m_nNumBlock ; ++ nCount)
|
||||
pVolume->m_BlockToUpdate[nCount] = true ;
|
||||
|
||||
pVolume->m_BlockToUpdate.resize( pVolume->m_nNumBlock, true) ;
|
||||
// Dimensiono il vettore dei contatori degli aggiornamenti della grafica dei blocchi
|
||||
pVolume->m_BlockUpGradingCounter.resize( pVolume->m_nNumBlock + 1, 0) ;
|
||||
// Dimensiono raccolta di voxel di confine
|
||||
pVolume->m_InterBlockVox.resize( pVolume->m_nNumBlock) ;
|
||||
// Dimensiono raccolta triangoli di feature tra blocchi
|
||||
pVolume->m_InterBlockTria.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_InterBlockOriginalSharpTria.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_BlockSharpTria.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_BlockSmoothTria.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_BlockBigTria.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_SliceXY.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_SliceXZ.resize( pVolume->m_nNumBlock) ;
|
||||
pVolume->m_SliceYZ.resize( pVolume->m_nNumBlock) ;
|
||||
@@ -1147,7 +1158,7 @@ VolZmap::RemovePart( int nPart)
|
||||
|
||||
// Elimino i segmenti con indice nPart + 1 e aggiorno quelli con indice superiore
|
||||
// Ciclo sulle mappe.
|
||||
for ( int nMap = 0 ; nMap < int( m_nMapNum) ; ++ nMap) {
|
||||
for ( int nMap = 0 ; nMap < m_nMapNum ; ++ nMap) {
|
||||
// Ciclo sui dexel della mappa.
|
||||
for ( int nDex = 0 ; nDex < int( m_Values[nMap].size()) ; ++ nDex) {
|
||||
// Ciclo sugli intervalli del dexel.
|
||||
@@ -1155,8 +1166,8 @@ VolZmap::RemovePart( int nPart)
|
||||
// Se l'intervallo appartiene alla componente da eliminare, lo cancello.
|
||||
if ( m_Values[nMap][nDex][nInt].nCompo == nPart + 1) {
|
||||
SetToModifyDexelBlocks( nMap, nDex, nInt) ;
|
||||
m_Values[nMap][nDex].erase( m_Values[nMap][nDex].begin() + nInt) ;
|
||||
-- nInt ;
|
||||
m_Values[nMap][nDex].erase( m_Values[nMap][nDex].begin() + nInt) ;
|
||||
-- nInt ;
|
||||
}
|
||||
else if ( m_Values[nMap][nDex][nInt].nCompo > nPart + 1)
|
||||
m_Values[nMap][nDex][nInt].nCompo -= 1 ;
|
||||
@@ -1240,7 +1251,7 @@ VolZmap::SetToModifyDexelBlocks( int nGrid, int nDex, int nInt)
|
||||
}
|
||||
}
|
||||
|
||||
else if ( nGrid == 1) {
|
||||
else if ( nGrid == 1) {
|
||||
|
||||
int nYStop = 1 ;
|
||||
int nZStop = 1 ;
|
||||
@@ -1577,26 +1588,27 @@ VolZmap::Compact( void)
|
||||
}
|
||||
|
||||
// Calcolo il numero di voxel lungo x,y e z
|
||||
unsigned int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
|
||||
// Definisco il numero di blocchi lungo x,y e z
|
||||
m_nFracLin[0] = max( 1u, nVoxNumX / m_nVoxNumPerBlock + ( nVoxNumX % m_nVoxNumPerBlock >= m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
m_nFracLin[1] = max( 1u, nVoxNumY / m_nVoxNumPerBlock + ( nVoxNumY % m_nVoxNumPerBlock >= m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
m_nFracLin[2] = max( 1u, nVoxNumZ / m_nVoxNumPerBlock + ( nVoxNumZ % m_nVoxNumPerBlock >= m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
m_nFracLin[0] = max( 1, nVoxNumX / m_nVoxNumPerBlock + ( nVoxNumX % m_nVoxNumPerBlock >= m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
m_nFracLin[1] = max( 1, nVoxNumY / m_nVoxNumPerBlock + ( nVoxNumY % m_nVoxNumPerBlock >= m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
m_nFracLin[2] = max( 1, nVoxNumZ / m_nVoxNumPerBlock + ( nVoxNumZ % m_nVoxNumPerBlock >= m_nVoxNumPerBlock / 2 ? 1 : 0)) ;
|
||||
|
||||
// Dimensiono il vettore dei blocchi
|
||||
m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ;
|
||||
m_BlockToUpdate.resize( m_nNumBlock) ;
|
||||
// Setto tutti i blocchi come da aggiornare per la grafica
|
||||
for ( int nCount = 0 ; nCount < int( m_nNumBlock) ; ++ nCount)
|
||||
m_BlockToUpdate[nCount] = true ;
|
||||
|
||||
m_BlockToUpdate.resize( m_nNumBlock, true) ;
|
||||
// Dimensiono il vettore dei contatori di aggiornamenti dei blocchi
|
||||
m_BlockUpGradingCounter.resize( m_nNumBlock, 0) ;
|
||||
// Dimensiono raccolta di voxel di confine
|
||||
m_InterBlockVox.resize( m_nNumBlock) ;
|
||||
// Dimensiono raccolta triangoli di feature tra blocchi
|
||||
m_InterBlockTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockOriginalSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSmoothTria.resize( m_nNumBlock) ;
|
||||
m_BlockBigTria.resize( m_nNumBlock) ;
|
||||
m_SliceXY.resize( m_nNumBlock) ;
|
||||
m_SliceXZ.resize( m_nNumBlock) ;
|
||||
m_SliceYZ.resize( m_nNumBlock) ;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2015-2015
|
||||
// EgalTech 2015-2019
|
||||
//----------------------------------------------------------------------------
|
||||
// File : VolZmap.h Data : 22.01.15 Versione : 1.6a4
|
||||
// File : VolZmap.h Data : 11.02.19 Versione : 2.1b1
|
||||
// Contenuto : Dichiarazione della classe Volume Zmap.
|
||||
//
|
||||
//
|
||||
@@ -84,12 +84,12 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
bool GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) const override ;
|
||||
bool SetTolerances( double dLinTol, double dAngTolDeg = 90) override ;
|
||||
bool SetStdTool( const std::string& sToolName, double dH, double dR, double dCornR, int nFlag) override ;
|
||||
bool SetAdvTool( const std::string& sToolName,
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, int nFlag) override ;
|
||||
bool SetAdvTool( const std::string& sToolName,
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, int nFlag) override ;
|
||||
bool SetSawTool( const std::string& sToolName,
|
||||
double dH, double dR, double dThick, double dStemR, double dCornR, int nFlag) override ;
|
||||
bool SetGenTool( const std::string& sToolName, const ICurveComposite* pToolOutline, int nFlag) override ;
|
||||
bool SetMortiserTool( const std::string& sToolName, double dH, double dW, double dTh, double dRc, int nFlag) override ;
|
||||
bool SetMortiserTool( const std::string& sToolName, double dH, double dW, double dTh, double dRc, int nFlag) override ;
|
||||
bool SetChiselTool( const std::string& sToolName, double dH, double dW, double dTh, int nFlag) override ;
|
||||
const ICurveComposite& GetToolOutline( bool bApprox = false) const override
|
||||
{ return ( bApprox ? m_Tool.GetApproxOutline() : m_Tool.GetOutline()) ;}
|
||||
@@ -108,6 +108,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
bool Cut( const Plane3d& plPlane) override ;
|
||||
bool Compact( void) override ;
|
||||
|
||||
|
||||
public : // IGeoObjRW
|
||||
int GetNgeId( void) const override ;
|
||||
bool Save( NgeWriter& ngeOut) const override ;
|
||||
@@ -123,7 +124,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
LOG_ERROR( GetEGkLogger(), "VolZmap : copy error")
|
||||
return *this ; }
|
||||
|
||||
private :
|
||||
private :
|
||||
enum CubeType { VOX_EXTERN = 1,
|
||||
VOX_ON_BOUNDARY = 0,
|
||||
VOX_INNER = -1} ;
|
||||
@@ -136,8 +137,8 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
} ;
|
||||
typedef std::unordered_map <int, HeigthAndColor> FlatVoxelContainer ;
|
||||
// Struttura indici di voxel
|
||||
struct VoxelIndexes {
|
||||
int nI, nJ, nK ;
|
||||
struct VoxelIndexes {
|
||||
int nI, nJ, nK ;
|
||||
} ;
|
||||
// Struttura per componenti connesse
|
||||
struct ConComp {
|
||||
@@ -154,17 +155,26 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
int nNumComp ;
|
||||
ConComp Compo[4] ;
|
||||
} ;
|
||||
// Triangoli
|
||||
struct TriaStruct {
|
||||
// Triangoli sharp-feature
|
||||
struct SharpTriaStruct {
|
||||
int i, j, k ;
|
||||
PNTVECTOR ptCompoVert ;
|
||||
std::vector<TRIA3DEXVECTOR> vCompoTria ;
|
||||
std::vector<BOOLVECTOR> vbFlipped ;
|
||||
} ;
|
||||
// Vettore di TriaStruct con sharp feature interni a un blocco
|
||||
typedef std::vector<TriaStruct> TriHolder ;
|
||||
// Vettore di TriHolder con sharp feature di frontiera: il primo indice individua il blocco, il secondo il voxel
|
||||
typedef std::vector<TriHolder> TriaMatrix ;
|
||||
// Triangoli smooth
|
||||
struct SmoothTriaStruct {
|
||||
int i, j, k ;
|
||||
TRIA3DEXVECTOR vTria ;
|
||||
};
|
||||
// Vettore di SharpTriaStruct con sharp feature
|
||||
typedef std::vector<SharpTriaStruct> SharpTriHolder ;
|
||||
// Vettore di SmoothTriaStruct con triangoli smooth
|
||||
typedef std::vector<SmoothTriaStruct> SmoothTriHolder ;
|
||||
// Vettore di SharpTriHolder con sharp feature: il primo indice individua il blocco, il secondo il voxel
|
||||
typedef std::vector<SharpTriHolder> SharpTriaMatrix ;
|
||||
// Vettore di SmoothTriHolder smooth: il primo indice individua il blocco, il secondo il voxel
|
||||
typedef std::vector<SmoothTriHolder> SmoothTriaMatrix ;
|
||||
// Tavola hash di Voxel
|
||||
typedef std::unordered_map <int, Voxel> VoxelContainer ;
|
||||
// Unordered map per la coerenza topologica
|
||||
@@ -173,121 +183,122 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
private :
|
||||
bool CopyFrom( const VolZmap& clSrc) ;
|
||||
bool ResetGraphics( void) ;
|
||||
bool GetChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nDimChk, TRIA3DEXLIST& lstTria) const ;
|
||||
bool CalcChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, TRIA3DEXLIST& lstTria) const ;
|
||||
bool CalcDexelPrisms( int nPos1, int nPos2, TRIA3DEXLIST& lstTria) const ;
|
||||
bool GetChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nDimChk, int nBlock) const ;
|
||||
bool CalcChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nBlock) const ;
|
||||
bool CalcDexelPrisms( int nPos1, int nPos2, int nBlock) const ;
|
||||
bool AddDexelSideFace( int nPos, int nPosAdj, const Point3d& ptP, const Point3d& ptQ,
|
||||
const Vector3d& vtZ, const Vector3d& vtNorm, TRIA3DEXLIST& lstTria) const ;
|
||||
bool ProcessCube( int nVoxI, int nVoxJ, int nVoxK, TRIA3DEXLIST& lstTria, VoxelContainer& VoxCont, bool bEnh) const ;
|
||||
const Vector3d& vtZ, const Vector3d& vtNorm, int nBlock) const ;
|
||||
bool ProcessCell( int nGrid, int nCellI, int nCellJ, const Plane3d& plPlane, std::vector<CurveLine>& vLine) const ;
|
||||
bool ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, VoxelContainer& vVox) const ;
|
||||
bool ExtMarchingCubes( std::vector<VoxelIndexes>& vVox, TRIA3DEXLIST& lstTria, bool bEnh) const ;
|
||||
bool UpGradeGraphics( bool bAllBlocks, INTVECTOR& nModifiedBlocks) const ;
|
||||
bool UpGradeGraphicsSingleMap( bool bAllBlocks, INTVECTOR& nModifiedBlocks) const ;
|
||||
bool ExtMarchingCubes( int nBlock, VoxelContainer& vVox) const ;
|
||||
bool RegulateFeaturesChain( std::vector<VoxelContainer>& vVecVox) const ;
|
||||
bool CreateSharpFeatureTriangle( int nBlock, const VoxelContainer& vVox, TriHolder& triHold) const ;
|
||||
bool CreateSharpFeatureTriangle( const VoxelContainer& vVox, TriHolder& triHold) const ;
|
||||
bool FlipEdgesII( TriHolder& TriHold) const ;
|
||||
bool FlipEdgesBB( TriaMatrix& InterTria) const ;
|
||||
bool CreateSharpFeatureTriangle( int nBlock, const VoxelContainer& vVox) const ;
|
||||
bool CreateSharpFeatureTriangle( const VoxelContainer& vVox, SharpTriHolder& triHold) const ;
|
||||
bool CreateSmoothTriangle( int nIndex, int nVertNum, AppliedVector TriVert[], bool bWasSharp, SmoothTriaStruct& VoxSmoothTria) const ;
|
||||
bool FlipEdgesII( int nBlock) const ;
|
||||
bool FlipEdgesBB() const ;
|
||||
bool IsThereMat( int nI, int nJ, int nK) const ;
|
||||
bool InOut( const Plane3d& plPlane, int nGrid, int nI, int nJ) const ;
|
||||
int CalcIndex( int nI, int nJ, int nK) const ;
|
||||
int CalcIndexForPlaneCells( const Plane3d& plPlane, int nGrid, int nCellI, int nCellJ) const ;
|
||||
int CalcIndexForPlaneCells( const Plane3d& plPlane, int nGrid, int nCellI, int nCellJ) const ;
|
||||
bool IntersPos( int nVec1[], int nVec2[], bool bFirstCorner, AppliedVector& vfField) const ;
|
||||
bool IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP, double dPrec = EPS_SMALL) const ;
|
||||
bool GetPointVoxel( const Point3d& ptP, int& nVoxI, int& nVoxJ, int& nVoxK) const ;
|
||||
bool IsZInsideInterval( int nGrid, int nDex, double dZ) const ;
|
||||
// Per regolarizzazione della catena di feature
|
||||
// Per regolarizzazione della catena di feature
|
||||
bool FindAdjComp( const std::vector<VoxelContainer>& vVecVox, int nCurBlock, int nCurVox, int nCurComp,
|
||||
INTVECTOR& vAdjBlockVoxComp, INTVECTOR& vAdjBordBlockVoxComp) const ;
|
||||
// OPERAZIONI SU INTERVALLI
|
||||
bool SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
bool SubtractIntervals( int nGrid, int nI, int nJ,
|
||||
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax) ;
|
||||
bool AddIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
bool AddIntervals( int nGrid, int nI, int nJ,
|
||||
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax) ;
|
||||
// SOTTRAZIONI
|
||||
// UTENSILI
|
||||
// Asse di simmetria parallelo a Z
|
||||
bool CylBall_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Mrt_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Mrt_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Chs_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Chs_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool GenTool_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool GenTool_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_ZPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_ZDrilling( int nGrid, const Point3d & ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_ZPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Mrt_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Mrt_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Chs_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Chs_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool GenTool_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool GenTool_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
// Asse di simmetria nel piano
|
||||
bool CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_XYMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_XYMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
// Asse di simmetria con orientazione generica
|
||||
bool CylBall_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Mrt_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Mrt_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ; // E' in realtà un Perp
|
||||
bool Chs_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Chs_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ; // E' in realtà un Perp
|
||||
bool GenTool_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool GenTool_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool CylBall_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Conus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool Mrt_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Mrt_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ; // E' in realtà un Perp
|
||||
bool Chs_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool Chs_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux) ; // E' in realtà un Perp
|
||||
bool GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
bool GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir) ;
|
||||
|
||||
// COMPONENTI
|
||||
// Asse di simmetria diretto come l'asse Z
|
||||
bool CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir,
|
||||
bool CompCyl_ZDrilling( int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir,
|
||||
double dHei, double dRad) ;
|
||||
bool CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir,
|
||||
bool CompConus_ZDrilling( int nGrid, const Point3d& ptLs, const Point3d& ptLe, const Vector3d& vtToolDir,
|
||||
double dHei, double dMaxRad, double dMinRad) ;
|
||||
bool CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
bool CompPar_ZDrilling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
bool CompCyl_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dRad) ;
|
||||
bool CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
bool CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dMaxRad, double dMinRad) ;
|
||||
bool CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
bool CompPar_ZMilling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux) ; // E' in realtà MillingPerp
|
||||
// Asse di simmetria con orientazione generica
|
||||
bool CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
bool CompCyl_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dRad, bool bTapB, bool bTapT) ;
|
||||
bool CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
bool CompConus_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT) ;
|
||||
bool CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
bool CompPar_Drilling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux) ;
|
||||
bool CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
bool CompCyl_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dRad, bool bTapB, bool bTapT) ;
|
||||
bool CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
bool CompConus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT) ;
|
||||
bool CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
bool CompPar_Milling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux) ; // E' in realtà MillingPerp
|
||||
// Generica traslazione sfera
|
||||
bool CompBall_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, double dRad) ;
|
||||
bool CompBall_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, double dRad) ;
|
||||
// BBox per utensili e solidi semplici con movimenti di traslazione
|
||||
inline bool TestToolBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ) ;
|
||||
inline bool TestCompoBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
inline bool TestToolBBox( int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
int& nStI, int& nStJ, int& nEnI, int& nEnJ) ;
|
||||
inline bool TestCompoBBox( int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
double dRad, double dTipRad, double dHei,
|
||||
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ) ;
|
||||
inline bool TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtD, const Vector3d& vtA,
|
||||
int& nStI, int& nStJ, int& nEnI, int& nEnJ) ;
|
||||
inline bool TestParaBBox( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtD, const Vector3d& vtA,
|
||||
double dLenX, double dLenY, double dLenZ,
|
||||
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ) ;
|
||||
int& nStI, int& nStJ, int& nEnI, int& nEnJ) ;
|
||||
// Intersezioni
|
||||
bool IntersLineBox( const Point3d& ptP, const Vector3d& vtV, const Point3d& ptMin, const Point3d& ptMax) const ;
|
||||
bool IntersLineBox( const Point3d& ptP, const Vector3d& vtV, const Point3d& ptMin, const Point3d& ptMax,
|
||||
double& dU1, double& dU2) const ;
|
||||
bool IntersLineZMapLattice( const Point3d& ptP, const Vector3d& vtV, double& dU1, double& dU2) const ;
|
||||
bool IntersLineZMapBBox( const Point3d& ptP, const Vector3d& vtV, double& dU1, double& dU2) const ;
|
||||
bool IntersLineDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
bool IntersLineDexel( const Point3d& ptP, const Vector3d& vtV, int nGrid, int nI, int nJ,
|
||||
double& dU1, double& dU2) const ;
|
||||
bool IntersRayDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
bool IntersRayDexel( const Point3d& ptP, const Vector3d& vtV, int nGrid, int nI, int nJ,
|
||||
double& dU1, double& dU2) const ;
|
||||
bool IntersLineCylinder( const Point3d& ptLineSt, const Vector3d& vtLineDir,
|
||||
const Frame3d& CylFrame, double dH, double dRad, bool bTapLow, bool bTapUp,
|
||||
@@ -301,11 +312,11 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) ;
|
||||
bool IntersLineMyPolyhedron( const Point3d& ptLineSt, const Vector3d& vtLineDir,
|
||||
const Frame3d& PolyFrame, double dLenX, double dLenY, double dLenZ, double dDeltaX,
|
||||
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) ;
|
||||
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) ;
|
||||
bool TestIntersPlaneZmapBBox( const Plane3d& plPlane) const ;
|
||||
// Voxel: esistenza e passaggio da N a ijk per i voxel
|
||||
bool IsValidVoxel( int nN) const ;
|
||||
bool IsValidVoxel( int nI, int nJ, int nK) const ;
|
||||
bool IsValidVoxel( int nI, int nJ, int nK) const ;
|
||||
bool GetVoxIJKFromN( int nN, int& nI, int& nJ, int& nK) const ;
|
||||
bool GetVoxNFromIJK( int nI, int nJ, int nK, int& nN) const ;
|
||||
// Funzioni di gestione dei blocchi
|
||||
@@ -320,18 +331,18 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
bool GetFirstVoxIJK( int& i, int& j, int& k) const ;
|
||||
bool GetLastVoxIJK( int& i, int& j, int& k) const ;
|
||||
bool IsVoxelOnBoxEdge( int i, int j, int k) const ;
|
||||
bool IsTriangleOnBorder( const Triangle3dEx& trTria, const int nBlockLimits[], const int nVoxIJK[]) const ;
|
||||
bool IsTriangleOnBorder( const Triangle3dEx& trTria, const int nBlockLimits[], const int nVoxIJK[]) const ;
|
||||
// Funzioni per facce canoniche con grandi triangoli
|
||||
bool ProcessVoxContXY( FlatVoxelContainer& VoxContXY, bool bPlus, TRIA3DEXLIST& lstTria) const ;
|
||||
bool ProcessVoxContYZ( FlatVoxelContainer& VoxContYZ, bool bPlus, TRIA3DEXLIST& lstTria) const ;
|
||||
bool ProcessVoxContXZ( FlatVoxelContainer& VoxContXZ, bool bPlus, TRIA3DEXLIST& lstTria) const ;
|
||||
bool ProcessVoxContXY( FlatVoxelContainer& VoxContXY, int nBlock, bool bPlus) const ;
|
||||
bool ProcessVoxContYZ( FlatVoxelContainer& VoxContYZ, int nBlock, bool bPlus) const ;
|
||||
bool ProcessVoxContXZ( FlatVoxelContainer& VoxContXZ, int nBlock, bool bPlus) const ;
|
||||
bool Find( const FlatVoxelContainer& VoxCont, int nI, int nJ, int nK, double dPos, int nTool) const ;
|
||||
bool Remove( FlatVoxelContainer& VoxCont, int nI, int nJ, int nK) const ;
|
||||
// Connessione Zmap
|
||||
struct IntervalIndexes {
|
||||
size_t tMap ;
|
||||
size_t tDex ;
|
||||
size_t tInt ;
|
||||
int tMap ;
|
||||
int tDex ;
|
||||
int tInt ;
|
||||
} ;
|
||||
typedef std::stack <IntervalIndexes> IntContaier ;
|
||||
bool CheckMapConnection( void) ;
|
||||
@@ -350,13 +361,13 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
Status m_nStatus ; // stato
|
||||
int m_nTempProp ; // proprietà temporanea
|
||||
int m_nTempProp ; // proprietà temporanea
|
||||
double m_dStep ; // passo delle griglie
|
||||
unsigned int m_nMapNum ; // numero di griglie ( 1 o 3)
|
||||
int m_nMapNum ; // numero di griglie ( 1 o 3)
|
||||
Frame3d m_MapFrame ; // riferimento intrinseco dello Zmap
|
||||
unsigned int m_nNx[N_MAPS] ; // dimensione di ciascuna griglia in X
|
||||
unsigned int m_nNy[N_MAPS] ; // dimensione di ciascuna griglia in Y
|
||||
unsigned int m_nDim[N_MAPS] ; // dimensione di ciascuna griglia ( X * Y)
|
||||
int m_nNx[N_MAPS] ; // dimensione di ciascuna griglia in X
|
||||
int m_nNy[N_MAPS] ; // dimensione di ciascuna griglia in Y
|
||||
int m_nDim[N_MAPS] ; // dimensione di ciascuna griglia ( X * Y)
|
||||
double m_dMinZ[N_MAPS] ; // minimo in Zlocale di ciascuna griglia
|
||||
double m_dMaxZ[N_MAPS] ; // massimo in Zlocale di ciascuna griglia
|
||||
|
||||
@@ -373,17 +384,23 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
|
||||
int m_nShape ; // Forma : 0 generica, 1 box, 2 estrusione
|
||||
|
||||
unsigned int m_nVoxNumPerBlock ; // Numero di voxel per blocco
|
||||
unsigned int m_nFracLin[3] ; // Numero di blocchi per ogni asse
|
||||
unsigned int m_nNumBlock ; // Numero totale di blocchi
|
||||
int m_nVoxNumPerBlock ; // Numero di voxel per blocco
|
||||
int m_nFracLin[3] ; // Numero di blocchi per ogni asse
|
||||
int m_nNumBlock ; // Numero totale di blocchi
|
||||
|
||||
mutable BOOLVECTOR m_BlockToUpdate ;
|
||||
mutable INTVECTOR m_BlockUpGradingCounter ;
|
||||
|
||||
int m_nConnectedCompoCount ; // Se == - 1 il numero di componenti non è noto
|
||||
// Se >= 0 è il numero di componenti connesse
|
||||
|
||||
mutable std::vector<VoxelContainer> m_InterBlockVox ;
|
||||
mutable TriaMatrix m_InterBlockTria ;
|
||||
mutable std::vector<VoxelContainer> m_InterBlockVox ;
|
||||
mutable SharpTriaMatrix m_InterBlockOriginalSharpTria ;
|
||||
mutable SharpTriaMatrix m_InterBlockToBeFlippedSharpTria ;
|
||||
mutable SharpTriaMatrix m_BlockSharpTria ;
|
||||
mutable SmoothTriaMatrix m_BlockSmoothTria ;
|
||||
mutable std::vector<TRIA3DEXVECTOR> m_BlockBigTria ;
|
||||
mutable std::vector<TRIA3DEXVECTOR> m_SingleMapTria ;
|
||||
|
||||
mutable std::vector<InterVoxMatter> m_SliceXY ;
|
||||
mutable std::vector<InterVoxMatter> m_SliceXZ ;
|
||||
@@ -408,5 +425,3 @@ inline VolZmap* GetBasicVolZmap( IGeoObj* pGObj)
|
||||
{ if ( pGObj == nullptr || pGObj->GetType() != VOL_ZMAP)
|
||||
return nullptr ;
|
||||
return (static_cast<VolZmap*>(pGObj)) ; }
|
||||
|
||||
|
||||
|
||||
+184
-43
@@ -16,11 +16,11 @@
|
||||
#include "CurveLine.h"
|
||||
#include "VolZmap.h"
|
||||
#include "GeoConst.h"
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
#include "/EgtDev/Include/EGkIntersLineTria.h"
|
||||
#include "/EgtDev/Include/EGkIntersLinePlane.h"
|
||||
#include "/EgtDev/Include/EGkIntersLineSphere.h"
|
||||
#include "/EgtDev/Include/EGkChainCurves.h"
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -122,12 +122,12 @@ VolZmap::IntersLineZMapBBox( const Point3d& ptP, const Vector3d& vtV, double& dU
|
||||
// con quello intrinseco dello Zmap solo nel caso della prima griglia. Per le altre griglie
|
||||
// è necessario permutare ciclicamente le coordinate.
|
||||
bool
|
||||
VolZmap::IntersLineDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
VolZmap::IntersLineDexel( const Point3d& ptP, const Vector3d& vtV, int nGrid, int nI, int nJ,
|
||||
double& dU1, double& dU2) const
|
||||
{
|
||||
// Determino l'indice del dexel e il numero di suoi intervalli
|
||||
unsigned int nDexelPos = nJ * m_nNx[nGrid] + nI ;
|
||||
unsigned int nDexelSize = unsigned int( m_Values[nGrid][nDexelPos].size()) ;
|
||||
int nDexelPos = nJ * m_nNx[nGrid] + nI ;
|
||||
int nDexelSize = int( m_Values[nGrid][nDexelPos].size()) ;
|
||||
|
||||
// Se non c'è materiale non devo fare alcunché
|
||||
if ( nDexelSize == 0)
|
||||
@@ -143,7 +143,7 @@ VolZmap::IntersLineDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int
|
||||
dU1 = INFINITO ;
|
||||
dU2 = - INFINITO ;
|
||||
bool bInters = false ;
|
||||
for ( unsigned int nIndex = 0 ; nIndex < nDexelSize ; nIndex += 1) {
|
||||
for ( int nIndex = 0 ; nIndex < nDexelSize ; nIndex += 1) {
|
||||
// estremi del box del singolo intervallo
|
||||
Point3d ptE1( dXmin, dYmin, m_Values[nGrid][nDexelPos][nIndex].dMin) ;
|
||||
Point3d ptE2( dXmax, dYmax, m_Values[nGrid][nDexelPos][nIndex].dMax) ;
|
||||
@@ -164,12 +164,12 @@ VolZmap::IntersLineDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int
|
||||
// con quello intrinseco dello Zmap solo nel caso della prima griglia. Per le altre griglie
|
||||
// è necessario permutare ciclicamente le coordinate.
|
||||
bool
|
||||
VolZmap::IntersRayDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
VolZmap::IntersRayDexel( const Point3d& ptP, const Vector3d& vtV, int nGrid, int nI, int nJ,
|
||||
double& dU1, double& dU2) const
|
||||
{
|
||||
// Determino l'indice del dexel e il numero di suoi intervalli
|
||||
unsigned int nDexelPos = nJ * m_nNx[nGrid] + nI ;
|
||||
unsigned int nDexelSize = unsigned int( m_Values[nGrid][nDexelPos].size()) ;
|
||||
int nDexelPos = nJ * m_nNx[nGrid] + nI ;
|
||||
int nDexelSize = int( m_Values[nGrid][nDexelPos].size()) ;
|
||||
|
||||
// Se non c'è materiale non devo fare alcunché
|
||||
if ( nDexelSize == 0)
|
||||
@@ -185,7 +185,7 @@ VolZmap::IntersRayDexel( const Point3d& ptP, const Vector3d& vtV, unsigned int n
|
||||
dU1 = INFINITO ;
|
||||
dU2 = - INFINITO ;
|
||||
bool bInters = false ;
|
||||
for ( unsigned int nIndex = 0 ; nIndex < nDexelSize ; nIndex += 1) {
|
||||
for ( int nIndex = 0 ; nIndex < nDexelSize ; nIndex += 1) {
|
||||
// estremi del box del singolo intervallo
|
||||
Point3d ptE1( dXmin, dYmin, m_Values[nGrid][nDexelPos][nIndex].dMin) ;
|
||||
Point3d ptE2( dXmax, dYmax, m_Values[nGrid][nDexelPos][nIndex].dMax) ;
|
||||
@@ -391,6 +391,13 @@ VolZmap::GetDepthWithDexel( const Point3d& ptP, const Vector3d& vtV, double& dIn
|
||||
bool
|
||||
VolZmap::GetDepthWithVoxel( const Point3d& ptP, const Vector3d& vtD, double& dInLength, double& dOutLength, bool bEnh) const
|
||||
{
|
||||
// Serve che punto e vettore siano espressi sia nel sistema intrinseco dello Zmap (m_MapFrame) sia in quello
|
||||
// in cui esso è immerso; questo perché i dexel sono espressi in quello intrinseco e i triangoli in quello
|
||||
// in cui esso è immerso.
|
||||
Point3d ptOutP = ptP ;
|
||||
Vector3d vtOutD = vtD ;
|
||||
ptOutP.ToGlob( m_MapFrame) ;
|
||||
vtOutD.ToGlob( m_MapFrame) ;
|
||||
// Intersezione fra semiretta e BBox dello Zmap
|
||||
double dU1, dU2 ;
|
||||
bool bLineBBoxInters = IntersLineZMapBBox( ptP, vtD, dU1, dU2) && ( dU1 > 0 || dU2 > 0) ;
|
||||
@@ -402,6 +409,15 @@ VolZmap::GetDepthWithVoxel( const Point3d& ptP, const Vector3d& vtD, double& dIn
|
||||
return true ;
|
||||
}
|
||||
|
||||
// Se la grafica non è aggiornata la ricalcolo
|
||||
bool bUpGrade = false ;
|
||||
for ( int nBl = 0 ; nBl < int( m_nNumBlock) ; ++ nBl) {
|
||||
bUpGrade = bUpGrade || m_BlockToUpdate[nBl] ;
|
||||
}
|
||||
INTVECTOR nModifiedBlocks ;
|
||||
if ( bUpGrade)
|
||||
UpGradeGraphics( false, nModifiedBlocks) ;
|
||||
|
||||
// Determino il voxel di partenza
|
||||
int nVoxI, nVoxJ, nVoxK ;
|
||||
if ( ! GetPointVoxel( ptP, nVoxI, nVoxJ, nVoxK)) {
|
||||
@@ -429,12 +445,15 @@ VolZmap::GetDepthWithVoxel( const Point3d& ptP, const Vector3d& vtD, double& dIn
|
||||
( ( nVoxJ + 1) * N_DEXVOXRATIO + 0.5) * m_dStep,
|
||||
( ( nVoxK + 1) * N_DEXVOXRATIO + 0.5) * m_dStep) ;
|
||||
// Studio il voxel corrente
|
||||
if ( IntersLineBox( ptP, vtD, ptMin, ptMax)) {
|
||||
VoxelIndexes NewVox ;
|
||||
NewVox.nI = nVoxI ;
|
||||
NewVox.nJ = nVoxJ ;
|
||||
NewVox.nK = nVoxK ;
|
||||
vVox.emplace_back( NewVox) ;
|
||||
if ( IntersLineBox( ptP, vtD, ptMin, ptMax)) {
|
||||
int nCurVoxIndex = CalcIndex( nVoxI, nVoxJ, nVoxK) ;
|
||||
if ( nCurVoxIndex != 0 && nCurVoxIndex != 255) {
|
||||
VoxelIndexes NewVox ;
|
||||
NewVox.nI = nVoxI ;
|
||||
NewVox.nJ = nVoxJ ;
|
||||
NewVox.nK = nVoxK ;
|
||||
vVox.emplace_back( NewVox) ;
|
||||
}
|
||||
}
|
||||
// Interseco la retta con i piani frontiera del voxel
|
||||
double dMaxTX = ( abs( vtD.x) > EPS_ZERO ?
|
||||
@@ -458,10 +477,6 @@ VolZmap::GetDepthWithVoxel( const Point3d& ptP, const Vector3d& vtD, double& dIn
|
||||
}
|
||||
}
|
||||
|
||||
// Triangoli di frontiera dei voxel
|
||||
TRIA3DEXLIST lstTria ;
|
||||
ExtMarchingCubes( vVox, lstTria, bEnh) ;
|
||||
|
||||
// Dati dell'intersezione
|
||||
struct LineTriaInt {
|
||||
int nNum ;
|
||||
@@ -474,31 +489,157 @@ VolZmap::GetDepthWithVoxel( const Point3d& ptP, const Vector3d& vtD, double& dIn
|
||||
: nNum( 2), dPar1( dP1), dPar2( dP2), dDot( dD) {}
|
||||
} ;
|
||||
vector<LineTriaInt> vInt ;
|
||||
|
||||
// Ciclo sui triangoli dei voxel
|
||||
for ( auto it = lstTria.begin() ; it != lstTria.end() ; ++it ) {
|
||||
// Triangolo corrente e suoi punti di intersezione con la retta
|
||||
const Triangle3d& CurrTria = *it ;
|
||||
Point3d ptLineTria1, ptLineTria2 ;
|
||||
// Studio dell'intersezione della retta con il triangolo corrente
|
||||
int nIntType = IntersLineTria( ptP, vtD, 1.5 * dU2, CurrTria, ptLineTria1, ptLineTria2) ;
|
||||
// Se non ci sono intersezioni passo al prossimo triangolo
|
||||
if ( nIntType == ILTT_NO)
|
||||
continue ;
|
||||
// se altrimenti c'è una sola intersezione
|
||||
else if ( nIntType == ILTT_VERT ||
|
||||
nIntType == ILTT_EDGE ||
|
||||
nIntType == ILTT_IN) {
|
||||
vInt.emplace_back( ( ptLineTria1 - ptP) * vtD, vtD * CurrTria.GetN()) ;
|
||||
}
|
||||
// altrimenti ci sono due intersezioni
|
||||
else {
|
||||
double dP1 = ( ptLineTria1 - ptP) * vtD ;
|
||||
double dP2 = ( ptLineTria2 - ptP) * vtD ;
|
||||
double dD = vtD * CurrTria.GetN() ;
|
||||
vInt.emplace_back( ( dP1 < dP2 ? dP1 : dP2), ( dP1 < dP2 ? dP2 : dP1), dD) ;
|
||||
int nPrevBlockN = - 1 ;
|
||||
// Ciclo sui voxel
|
||||
for ( int nVx = 0 ; nVx < int( vVox.size()) ; ++ nVx) {
|
||||
int nCurVoxIJK[3] = { vVox[nVx].nI, vVox[nVx].nJ, vVox[nVx].nK} ;
|
||||
int nCurBlockIJK[3] ;
|
||||
if ( GetVoxelBlockIJK( nCurVoxIJK, nCurBlockIJK)) {
|
||||
int nCurBlockN ;
|
||||
GetBlockNFromIJK( nCurBlockIJK, nCurBlockN) ;
|
||||
// Triangoli sharp fra blocchi
|
||||
for ( int nBlVx = 0 ; nBlVx < int( m_InterBlockToBeFlippedSharpTria[nCurBlockN].size()) ; ++ nBlVx) {
|
||||
if ( m_InterBlockToBeFlippedSharpTria[nCurBlockN][nBlVx].i == nCurVoxIJK[0] &&
|
||||
m_InterBlockToBeFlippedSharpTria[nCurBlockN][nBlVx].j == nCurVoxIJK[1] &&
|
||||
m_InterBlockToBeFlippedSharpTria[nCurBlockN][nBlVx].k == nCurVoxIJK[2]) {
|
||||
for ( int nBlCm = 0 ; nBlCm < int( m_InterBlockToBeFlippedSharpTria[nCurBlockN][nBlVx].vCompoTria.size()) ; ++ nBlCm) {
|
||||
for ( int nBlTr = 0 ; nBlTr < int( m_InterBlockToBeFlippedSharpTria[nCurBlockN][nBlVx].vCompoTria[nBlCm].size()) ; ++ nBlTr) {
|
||||
Triangle3d CurrTria = m_InterBlockToBeFlippedSharpTria[nCurBlockN][nBlVx].vCompoTria[nBlCm][nBlTr] ;
|
||||
Point3d ptLineTria1, ptLineTria2 ;
|
||||
// Studio dell'intersezione della retta con il triangolo corrente
|
||||
int nIntType = IntersLineTria( ptOutP, vtOutD, 1.5 * dU2, CurrTria, ptLineTria1, ptLineTria2) ;
|
||||
// Se non ci sono intersezioni passo al prossimo triangolo
|
||||
if ( nIntType == ILTT_NO)
|
||||
continue ;
|
||||
// se altrimenti c'è una sola intersezione
|
||||
else if ( nIntType == ILTT_VERT ||
|
||||
nIntType == ILTT_EDGE ||
|
||||
nIntType == ILTT_IN) {
|
||||
vInt.emplace_back( ( ptLineTria1 - ptOutP) * vtOutD, vtOutD * CurrTria.GetN()) ;
|
||||
}
|
||||
// altrimenti ci sono due intersezioni
|
||||
else {
|
||||
double dP1 = ( ptLineTria1 - ptOutP) * vtOutD ;
|
||||
double dP2 = ( ptLineTria2 - ptOutP) * vtOutD ;
|
||||
double dD = vtOutD * CurrTria.GetN() ;
|
||||
vInt.emplace_back( ( dP1 < dP2 ? dP1 : dP2), ( dP1 < dP2 ? dP2 : dP1), dD) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Triangoli sharp interni
|
||||
for ( int nBlVx = 0 ; nBlVx < int( m_BlockSharpTria[nCurBlockN].size()) ; ++ nBlVx) {
|
||||
if ( m_BlockSharpTria[nCurBlockN][nBlVx].i == nCurVoxIJK[0] &&
|
||||
m_BlockSharpTria[nCurBlockN][nBlVx].j == nCurVoxIJK[1] &&
|
||||
m_BlockSharpTria[nCurBlockN][nBlVx].k == nCurVoxIJK[2]) {
|
||||
for ( int nBlCm = 0 ; nBlCm < int( m_BlockSharpTria[nCurBlockN][nBlVx].vCompoTria.size()) ; ++ nBlCm) {
|
||||
for ( int nBlTr = 0 ; nBlTr < int( m_BlockSharpTria[nCurBlockN][nBlVx].vCompoTria[nBlCm].size()) ; ++ nBlTr) {
|
||||
Triangle3d CurrTria = m_BlockSharpTria[nCurBlockN][nBlVx].vCompoTria[nBlCm][nBlTr] ;
|
||||
Point3d ptLineTria1, ptLineTria2 ;
|
||||
// Studio dell'intersezione della retta con il triangolo corrente
|
||||
int nIntType = IntersLineTria( ptOutP, vtOutD, 1.5 * dU2, CurrTria, ptLineTria1, ptLineTria2) ;
|
||||
// Se non ci sono intersezioni passo al prossimo triangolo
|
||||
if ( nIntType == ILTT_NO)
|
||||
continue ;
|
||||
// se altrimenti c'è una sola intersezione
|
||||
else if ( nIntType == ILTT_VERT ||
|
||||
nIntType == ILTT_EDGE ||
|
||||
nIntType == ILTT_IN) {
|
||||
vInt.emplace_back( ( ptLineTria1 - ptOutP) * vtOutD, vtOutD * CurrTria.GetN()) ;
|
||||
}
|
||||
// altrimenti ci sono due intersezioni
|
||||
else {
|
||||
double dP1 = ( ptLineTria1 - ptOutP) * vtOutD ;
|
||||
double dP2 = ( ptLineTria2 - ptOutP) * vtOutD ;
|
||||
double dD = vtOutD * CurrTria.GetN() ;
|
||||
vInt.emplace_back( ( dP1 < dP2 ? dP1 : dP2), ( dP1 < dP2 ? dP2 : dP1), dD) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Triangoli smooth
|
||||
for ( int nBlVx = 0 ; nBlVx < int( m_BlockSmoothTria[nCurBlockN].size()) ; ++ nBlVx) {
|
||||
if ( m_BlockSmoothTria[nCurBlockN][nBlVx].i == nCurVoxIJK[0] &&
|
||||
m_BlockSmoothTria[nCurBlockN][nBlVx].j == nCurVoxIJK[1] &&
|
||||
m_BlockSmoothTria[nCurBlockN][nBlVx].k == nCurVoxIJK[2]) {
|
||||
for ( int nBlTr = 0 ; nBlTr < int( m_BlockSmoothTria[nCurBlockN][nBlVx].vTria.size()) ; ++ nBlTr) {
|
||||
Triangle3d CurrTria = m_BlockSmoothTria[nCurBlockN][nBlVx].vTria[nBlTr] ;
|
||||
Point3d ptLineTria1, ptLineTria2 ;
|
||||
// Studio dell'intersezione della retta con il triangolo corrente
|
||||
int nIntType = IntersLineTria( ptOutP, vtOutD, 1.5 * dU2, CurrTria, ptLineTria1, ptLineTria2) ;
|
||||
// Se non ci sono intersezioni passo al prossimo triangolo
|
||||
if ( nIntType == ILTT_NO)
|
||||
continue ;
|
||||
// se altrimenti c'è una sola intersezione
|
||||
else if ( nIntType == ILTT_VERT ||
|
||||
nIntType == ILTT_EDGE ||
|
||||
nIntType == ILTT_IN) {
|
||||
vInt.emplace_back( ( ptLineTria1 - ptOutP) * vtOutD, vtOutD * CurrTria.GetN()) ;
|
||||
}
|
||||
// altrimenti ci sono due intersezioni
|
||||
else {
|
||||
double dP1 = ( ptLineTria1 - ptOutP) * vtOutD ;
|
||||
double dP2 = ( ptLineTria2 - ptOutP) * vtOutD ;
|
||||
double dD = vtOutD * CurrTria.GetN() ;
|
||||
vInt.emplace_back( ( dP1 < dP2 ? dP1 : dP2), ( dP1 < dP2 ? dP2 : dP1), dD) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Triangoli grandi
|
||||
if ( nCurBlockN != nPrevBlockN) {
|
||||
for ( int nBlTr = 0 ; nBlTr < int( m_BlockBigTria[nCurBlockN].size()) ; ++ nBlTr) {
|
||||
Triangle3d CurrTria = m_BlockBigTria[nCurBlockN][nBlTr] ;
|
||||
Point3d ptLineTria1, ptLineTria2 ;
|
||||
// Studio dell'intersezione della retta con il triangolo corrente
|
||||
int nIntType = IntersLineTria( ptOutP, vtOutD, 1.5 * dU2, CurrTria, ptLineTria1, ptLineTria2) ;
|
||||
// Se non ci sono intersezioni passo al prossimo triangolo
|
||||
if ( nIntType == ILTT_NO)
|
||||
continue ;
|
||||
// se altrimenti c'è una sola intersezione
|
||||
else if ( nIntType == ILTT_VERT ||
|
||||
nIntType == ILTT_EDGE ||
|
||||
nIntType == ILTT_IN) {
|
||||
vInt.emplace_back( ( ptLineTria1 - ptOutP) * vtOutD, vtOutD * CurrTria.GetN()) ;
|
||||
}
|
||||
// altrimenti ci sono due intersezioni
|
||||
else {
|
||||
double dP1 = ( ptLineTria1 - ptOutP) * vtOutD ;
|
||||
double dP2 = ( ptLineTria2 - ptOutP) * vtOutD ;
|
||||
double dD = vtOutD * CurrTria.GetN() ;
|
||||
vInt.emplace_back( ( dP1 < dP2 ? dP1 : dP2), ( dP1 < dP2 ? dP2 : dP1), dD) ;
|
||||
}
|
||||
}
|
||||
nPrevBlockN = nCurBlockN ;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ciclo sui triangoli dei voxel
|
||||
//for ( auto it = lstTria.begin() ; it != lstTria.end() ; ++it ) {
|
||||
// // Triangolo corrente e suoi punti di intersezione con la retta
|
||||
// const Triangle3d& CurrTria = *it ;
|
||||
// Point3d ptLineTria1, ptLineTria2 ;
|
||||
// // Studio dell'intersezione della retta con il triangolo corrente
|
||||
// int nIntType = IntersLineTria( ptP, vtD, 1.5 * dU2, CurrTria, ptLineTria1, ptLineTria2) ;
|
||||
// // Se non ci sono intersezioni passo al prossimo triangolo
|
||||
// if ( nIntType == ILTT_NO)
|
||||
// continue ;
|
||||
// // se altrimenti c'è una sola intersezione
|
||||
// else if ( nIntType == ILTT_VERT ||
|
||||
// nIntType == ILTT_EDGE ||
|
||||
// nIntType == ILTT_IN) {
|
||||
// vInt.emplace_back( ( ptLineTria1 - ptP) * vtD, vtD * CurrTria.GetN()) ;
|
||||
// }
|
||||
// // altrimenti ci sono due intersezioni
|
||||
// else {
|
||||
// double dP1 = ( ptLineTria1 - ptP) * vtD ;
|
||||
// double dP2 = ( ptLineTria2 - ptP) * vtD ;
|
||||
// double dD = vtD * CurrTria.GetN() ;
|
||||
// vInt.emplace_back( ( dP1 < dP2 ? dP1 : dP2), ( dP1 < dP2 ? dP2 : dP1), dD) ;
|
||||
// }
|
||||
//}
|
||||
|
||||
// Ordino le intersezioni in base al parametro distanza con segno da ptP
|
||||
sort( vInt.begin(), vInt.end(),
|
||||
@@ -734,7 +875,7 @@ VolZmap::IntersLineCylinder( const Point3d& ptLineSt, const Vector3d& vtLineDir,
|
||||
}
|
||||
|
||||
// Determino le intersezioni con la superficie laterale del cilindro
|
||||
DBLVECTOR vdCoef( 3) ;
|
||||
DBLVECTOR vdCoef(3) ;
|
||||
double dSqRad = dRad * dRad ;
|
||||
vdCoef[0] = ptP.x * ptP.x + ptP.y * ptP.y - dSqRad ;
|
||||
vdCoef[1] = 2 * ( ptP.x * vtV.x + ptP.y * vtV.y) ;
|
||||
|
||||
+73
-52
@@ -46,16 +46,16 @@ VolZmap::Create( const Point3d& ptO, double dLengthX, double dLengthY, double dL
|
||||
m_MapFrame.Set( ptO, X_AX, Y_AX, Z_AX) ;
|
||||
|
||||
// Definisco i vettori dei limiti su indici
|
||||
m_nNx[0] = unsigned int( ( dLengthX + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[0] = unsigned int( ( dLengthY + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNx[0] = int( ( dLengthX + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[0] = int( ( dLengthY + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
|
||||
// Calcolo il numero di voxel lungo X e Y
|
||||
unsigned int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
|
||||
// Definisco il numero di blocchi lungo x e y
|
||||
m_nFracLin[0] = max( 1u, unsigned int( nVoxNumX * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[1] = max( 1u, unsigned int( nVoxNumY * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[0] = max( 1, int( nVoxNumX * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[1] = max( 1, int( nVoxNumY * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
|
||||
// Numero di componenti connesse
|
||||
m_nConnectedCompoCount = 1 ;
|
||||
@@ -63,13 +63,13 @@ VolZmap::Create( const Point3d& ptO, double dLengthX, double dLengthY, double dL
|
||||
// Se tridexel
|
||||
if ( bTriDex) {
|
||||
m_nNx[1] = m_nNy[0] ;
|
||||
m_nNy[1] = unsigned int( ( dLengthZ + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[1] = int( ( dLengthZ + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNx[2] = m_nNy[1] ;
|
||||
m_nNy[2] = m_nNx[0] ;
|
||||
// Calcolo il numero di voxel lungo Z
|
||||
unsigned int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
// Definisco il numero di blocchi lungo z
|
||||
m_nFracLin[2] = max( 1u, unsigned int( nVoxNumZ * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[2] = max( 1, int( nVoxNumZ * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
}
|
||||
|
||||
// altrimenti mono dexel
|
||||
@@ -86,16 +86,16 @@ VolZmap::Create( const Point3d& ptO, double dLengthX, double dLengthY, double dL
|
||||
|
||||
// Creazione delle mappe
|
||||
// Calcolo del numero di celle per ogni mappa
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
m_nDim[i] = m_nNx[i] * m_nNy[i] ;
|
||||
|
||||
// Creazione delle celle per ogni mappa
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
m_Values[i].resize( m_nDim[i]) ;
|
||||
|
||||
// Riempimento delle celle
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
for ( unsigned int j = 0 ; j < m_nDim[i] ; ++ j) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i)
|
||||
for ( int j = 0 ; j < m_nDim[i] ; ++ j) {
|
||||
|
||||
// Aggiungo il tratto al dexel vuoto
|
||||
m_Values[i][j].resize( 1) ;
|
||||
@@ -133,17 +133,24 @@ VolZmap::Create( const Point3d& ptO, double dLengthX, double dLengthY, double dL
|
||||
m_dMinZ[2] = 0 ;
|
||||
m_dMaxZ[2] = ( bTriDex ? dLengthY : 0) ;
|
||||
|
||||
// Dimensiono e setto il vettore dei blocchi a da ricalcolare
|
||||
// Dimensiono e setto il vettore dei blocchi a da ricalcolare e il vettore di contatori di aggiornamenti della grafica
|
||||
m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ;
|
||||
m_BlockToUpdate.clear() ;
|
||||
m_BlockToUpdate.resize( m_nNumBlock, true) ;
|
||||
m_BlockUpGradingCounter.clear() ;
|
||||
m_BlockUpGradingCounter.resize( m_nNumBlock + ( m_nMapNum == 1 ? 0 : 1), 0) ;
|
||||
|
||||
// Tipologia
|
||||
m_nShape = BOX ;
|
||||
|
||||
// Dimensiono raccolta di voxel, triangoli di feature tra blocchi e di segnalatori di materiale fra voxel
|
||||
m_InterBlockVox.resize( m_nNumBlock) ;
|
||||
m_InterBlockTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockOriginalSharpTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockToBeFlippedSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSmoothTria.resize( m_nNumBlock) ;
|
||||
m_BlockBigTria.resize( m_nNumBlock) ;
|
||||
m_SingleMapTria.resize( m_nNumBlock) ;
|
||||
m_SliceXY.resize( m_nNumBlock) ;
|
||||
m_SliceXZ.resize( m_nNumBlock) ;
|
||||
m_SliceYZ.resize( m_nNumBlock) ;
|
||||
@@ -182,19 +189,19 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
|
||||
// A partire dalle dimensioni di xy del grezzo determino il numero di colonne e righe
|
||||
// della griglia Zmap e da questi la dimensione del vettore di dexel
|
||||
m_nNx[0] = unsigned int( ( dLengthX + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[0] = unsigned int( ( dLengthY + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNx[0] = int( ( dLengthX + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[0] = int( ( dLengthY + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nDim[0] = m_nNx[0] * m_nNy[0] ;
|
||||
// Ridimensiono il vettore di dexel e creo lo Zmap
|
||||
m_Values[0].resize( m_nDim[0]) ;
|
||||
|
||||
// Calcolo il numero di voxel lungo X e Y
|
||||
unsigned int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
|
||||
// Definisco il numero di blocchi lungo x e y
|
||||
m_nFracLin[0] = max( 1u, unsigned int( nVoxNumX * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[1] = max( 1u, unsigned int( nVoxNumY * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[0] = max( 1, int( nVoxNumX * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[1] = max( 1, int( nVoxNumY * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
|
||||
// Numero di componenti connesse
|
||||
m_nConnectedCompoCount = Surf.GetChunkCount() ;
|
||||
@@ -202,7 +209,7 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
// Se Tridexel ridimensiono anche gli altri vettori
|
||||
if ( bTriDex) {
|
||||
m_nNx[1] = m_nNy[0] ;
|
||||
m_nNy[1] = unsigned int( ( dDimZ + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[1] = int( ( dDimZ + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nDim[1] = m_nNx[1] * m_nNy[1] ;
|
||||
m_Values[1].resize( m_nDim[1]) ;
|
||||
m_nNx[2] = m_nNy[1] ;
|
||||
@@ -210,9 +217,9 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
m_nDim[2] = m_nNx[2] * m_nNy[2] ;
|
||||
m_Values[2].resize( m_nDim[2]) ;
|
||||
// Calcolo il numero di voxel lungo Z
|
||||
unsigned int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
// Definisco il numero di blocchi lungo z
|
||||
m_nFracLin[2] = max( 1u, unsigned int( nVoxNumZ * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[2] = max( 1, int( nVoxNumZ * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -242,7 +249,7 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
}
|
||||
|
||||
// Calcolo griglia 0=XY ( se tridexel anche griglia 2=ZX)
|
||||
for ( unsigned int i = 0 ; i < m_nNx[0] ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nNx[0] ; ++ i) {
|
||||
|
||||
// Definisco la retta diretta come Y da intersecare con la regione
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
@@ -274,7 +281,7 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
int nFind = 0 ;
|
||||
int nCompo = 0 ;
|
||||
Vector3d vtN1 = - Y_AX ; Vector3d vtN2 = Y_AX ;
|
||||
for ( size_t m = 0 ; m < vpCrvs.size() ; ++ m) {
|
||||
for ( int m = 0 ; m < int( vpCrvs.size()) ; ++ m) {
|
||||
// recupero la curva
|
||||
ICurve* pCurve = vpCrvs[m] ;
|
||||
// determino posizione primo punto su curva
|
||||
@@ -326,9 +333,9 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
|
||||
// Se tridexel riempio i singoli dexel della griglia 2 con gli intervalli
|
||||
if ( bTriDex) {
|
||||
for ( size_t n = 0 ; n < m_nNx[2] ; ++ n) {
|
||||
size_t nPos2 = i * m_nNx[2] + n ;
|
||||
size_t nCurrSize = m_Values[2][nPos2].size( ) ;
|
||||
for ( int n = 0 ; n < m_nNx[2] ; ++ n) {
|
||||
int nPos2 = i * m_nNx[2] + n ;
|
||||
int nCurrSize = int( m_Values[2][nPos2].size()) ;
|
||||
// Aggiungo un tratto al dexel
|
||||
m_Values[2][nPos2].resize( nCurrSize + 1) ;
|
||||
// Aggiorno i dati del tratto di dexel
|
||||
@@ -349,7 +356,7 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
if ( bTriDex) {
|
||||
|
||||
// ciclo sul lato orizzontale della griglia
|
||||
for ( unsigned int i = 0 ; i < m_nNx[1] ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nNx[1] ; ++ i) {
|
||||
|
||||
// Definisco la retta diretta come X da intersecare con la regione
|
||||
double dY = ( i + 0.5) * m_dStep ;
|
||||
@@ -381,7 +388,7 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
int nFind = 0 ;
|
||||
int nCompo = 0 ;
|
||||
Vector3d vtN1 = -X_AX ; Vector3d vtN2 = X_AX ;
|
||||
for ( size_t m = 0 ; m < vpCrvs.size() ; ++ m) {
|
||||
for ( int m = 0 ; m < int( vpCrvs.size()) ; ++ m) {
|
||||
// recupero la curva
|
||||
ICurve* pCurve = vpCrvs[m] ;
|
||||
// determino posizione primo punto su curva
|
||||
@@ -413,9 +420,9 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
LOG_ERROR( GetEGkLogger(), "Error in VolZmap::CreateFromFlatRegion : point not on baundary")
|
||||
|
||||
// aggiorno i dexel impilati
|
||||
for ( size_t j = 0 ; j < m_nNy[1] ; ++ j) {
|
||||
size_t nPos1 = j * m_nNx[1] + i ;
|
||||
size_t nCurrSize = m_Values[1][nPos1].size() ;
|
||||
for ( int j = 0 ; j < m_nNy[1] ; ++ j) {
|
||||
int nPos1 = j * m_nNx[1] + i ;
|
||||
int nCurrSize = int( m_Values[1][nPos1].size()) ;
|
||||
// Aggiungo un tratto al dexel
|
||||
m_Values[1][nPos1].resize( nCurrSize + 1) ;
|
||||
// Assegno i dati
|
||||
@@ -440,14 +447,21 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double
|
||||
m_dMinZ[2] = 0 ;
|
||||
m_dMaxZ[2] = ( bTriDex ? dLengthY : 0) ;
|
||||
|
||||
// Dimensiono e setto il vettore dei blocchi a da ricalcolare
|
||||
// Dimensiono e setto il vettore dei blocchi a da ricalcolare e il vettore di contatori di aggiornamenti della grafica
|
||||
m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ;
|
||||
m_BlockToUpdate.clear() ;
|
||||
m_BlockToUpdate.resize( m_nNumBlock, true) ;
|
||||
m_BlockUpGradingCounter.clear() ;
|
||||
m_BlockUpGradingCounter.resize( m_nNumBlock + ( m_nMapNum == 1 ? 0 : 1), 0) ;
|
||||
|
||||
// Dimensiono raccolta di voxel, triangoli di feature tra blocchi e di segnalatori di materiale fra voxel
|
||||
m_InterBlockVox.resize( m_nNumBlock) ;
|
||||
m_InterBlockTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockOriginalSharpTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockToBeFlippedSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSmoothTria.resize( m_nNumBlock) ;
|
||||
m_BlockBigTria.resize( m_nNumBlock) ;
|
||||
m_SingleMapTria.resize( m_nNumBlock) ;
|
||||
m_SliceXY.resize( m_nNumBlock) ;
|
||||
m_SliceXZ.resize( m_nNumBlock) ;
|
||||
m_SliceYZ.resize( m_nNumBlock) ;
|
||||
@@ -495,17 +509,17 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
|
||||
// A partire dalle dimensioni di xy del grezzo determino il numero di colonne e righe
|
||||
// della griglia Zmap e da questi la dimensione del vettore di dexel
|
||||
m_nNx[0] = unsigned int( ( vtLen.x + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[0] = unsigned int( ( vtLen.y + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNx[0] = int( ( vtLen.x + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[0] = int( ( vtLen.y + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nDim[0] = m_nNx[0] * m_nNy[0] ;
|
||||
// Ridimensiono il vettore di dexel e creo lo Zmap
|
||||
m_Values[0].resize( m_nDim[0]) ;
|
||||
// Calcolo il numero di voxel lungo X e Y
|
||||
unsigned int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
unsigned int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumX = m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumY = m_nNy[0] / N_DEXVOXRATIO + ( m_nNy[0] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
// Definisco il numero di blocchi lungo x e y
|
||||
m_nFracLin[0] = max( 1u, unsigned int( nVoxNumX * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[1] = max( 1u, unsigned int( nVoxNumY * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[0] = max( 1, int( nVoxNumX * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[1] = max( 1, int( nVoxNumY * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
|
||||
// Numero di componenti connesse da calcolare
|
||||
m_nConnectedCompoCount = - 1 ;
|
||||
@@ -513,7 +527,7 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
// Se Tridexel ridimensiono anche gli altri vettori
|
||||
if ( bTriDex) {
|
||||
m_nNx[1] = m_nNy[0] ;
|
||||
m_nNy[1] = unsigned int( ( vtLen.z + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nNy[1] = int( ( vtLen.z + EPS_SMALL) / m_dStep + 0.5) ;
|
||||
m_nDim[1] = m_nNx[1] * m_nNy[1] ;
|
||||
m_Values[1].resize( m_nDim[1]) ;
|
||||
m_nNx[2] = m_nNy[1] ;
|
||||
@@ -521,9 +535,9 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
m_nDim[2] = m_nNx[2] * m_nNy[2] ;
|
||||
m_Values[2].resize( m_nDim[2]) ;
|
||||
// Calcolo il numero di voxel lungo Z
|
||||
unsigned int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
int nVoxNumZ = m_nNy[1] / N_DEXVOXRATIO + ( m_nNy[1] % N_DEXVOXRATIO == 0 ? 1 : 2) ;
|
||||
// Definisco il numero di blocchi lungo z
|
||||
m_nFracLin[2] = max( 1u, unsigned int( nVoxNumZ * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
m_nFracLin[2] = max( 1, int( nVoxNumZ * 1.0 / m_nVoxNumPerBlock + 0.7)) ;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -538,7 +552,7 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
}
|
||||
|
||||
// ciclo sulle griglie
|
||||
for ( unsigned int g = 0 ; g < m_nMapNum ; ++ g) {
|
||||
for ( int g = 0 ; g < m_nMapNum ; ++ g) {
|
||||
|
||||
// Definisco dei sistemi di riferimento ausiliari
|
||||
Frame3d frMapFrame ;
|
||||
@@ -553,8 +567,8 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
IntersParLinesSurfTm intPLSTM( frMapFrame, Surf) ;
|
||||
|
||||
// Determinazione e ridimensionamento dei dexel interni alla trimesh
|
||||
for ( unsigned int i = 0 ; i < m_nNx[g] ; ++ i) {
|
||||
for ( unsigned int j = 0 ; j < m_nNy[g] ; ++ j) {
|
||||
for ( int i = 0 ; i < m_nNx[g] ; ++ i) {
|
||||
for ( int j = 0 ; j < m_nNy[g] ; ++ j) {
|
||||
|
||||
// Definisco la retta da intersecare con la trimesh
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
@@ -567,7 +581,7 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
|
||||
int nInt = int( IntersectionResults.size()) ;
|
||||
|
||||
unsigned int nPos = j * m_nNx[g] + i ;
|
||||
int nPos = j * m_nNx[g] + i ;
|
||||
|
||||
bool bInside = false ;
|
||||
Point3d ptIn ;
|
||||
@@ -606,7 +620,7 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
Vector3d vtOutN ;
|
||||
Surf.GetFacetNormal( nF, vtOutN) ;
|
||||
|
||||
unsigned int nCurrentSize = unsigned int( m_Values[g][nPos].size()) ;
|
||||
int nCurrentSize = int( m_Values[g][nPos].size()) ;
|
||||
|
||||
// Aggiungo un tratto al dexel
|
||||
m_Values[g][nPos].resize( nCurrentSize + 1) ;
|
||||
@@ -636,14 +650,21 @@ VolZmap::CreateFromTriMesh( const ISurfTriMesh& Surf, double dStep, bool bTriDex
|
||||
m_dMinZ[2] = 0 ;
|
||||
m_dMaxZ[2] = ( bTriDex ? vtLen.y : 0) ;
|
||||
|
||||
// Dimensiono e setto il vettore dei blocchi a da ricalcolare
|
||||
// Dimensiono e setto il vettore dei blocchi a da ricalcolare e il vettore di contatori di aggiornamenti della grafica
|
||||
m_nNumBlock = m_nFracLin[0] * m_nFracLin[1] * m_nFracLin[2] ;
|
||||
m_BlockToUpdate.clear() ;
|
||||
m_BlockToUpdate.resize( m_nNumBlock, true) ;
|
||||
m_BlockUpGradingCounter.clear() ;
|
||||
m_BlockUpGradingCounter.resize( m_nNumBlock + ( m_nMapNum == 1 ? 0 : 1), 0) ;
|
||||
|
||||
// Dimensiono raccolta di voxel, triangoli di feature tra blocchi e di segnalatori di materiale fra voxel
|
||||
m_InterBlockVox.resize( m_nNumBlock) ;
|
||||
m_InterBlockTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockOriginalSharpTria.resize( m_nNumBlock) ;
|
||||
m_InterBlockToBeFlippedSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSharpTria.resize( m_nNumBlock) ;
|
||||
m_BlockSmoothTria.resize( m_nNumBlock) ;
|
||||
m_BlockBigTria.resize( m_nNumBlock) ;
|
||||
m_SingleMapTria.resize( m_nNumBlock) ;
|
||||
m_SliceXY.resize( m_nNumBlock) ;
|
||||
m_SliceXZ.resize( m_nNumBlock) ;
|
||||
m_SliceYZ.resize( m_nNumBlock) ;
|
||||
|
||||
+954
-977
File diff suppressed because it is too large
Load Diff
+135
-137
@@ -27,7 +27,7 @@ using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
VolZmap::SubtractIntervals( int nGrid, int nI, int nJ,
|
||||
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax)
|
||||
{
|
||||
// Controllo che dMin e dMax non siano quasi coincidenti
|
||||
@@ -66,7 +66,7 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
|
||||
}
|
||||
|
||||
// Recupero dexel da modificare
|
||||
unsigned int nPos = nJ * m_nNx[nGrid] + nI ;
|
||||
int nPos = nJ * m_nNx[nGrid] + nI ;
|
||||
vector<Data>& vDexel = m_Values[nGrid][nPos] ;
|
||||
|
||||
// Ciclo sugli intervalli del dexel (ordinati in senso crescente)
|
||||
@@ -237,7 +237,7 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::AddIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
|
||||
VolZmap::AddIntervals( int nGrid, int nI, int nJ,
|
||||
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax)
|
||||
{
|
||||
// // Controllo che dMin e dMax non siano quasi coincidenti
|
||||
@@ -550,7 +550,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
}
|
||||
|
||||
// Ciclo sulle mappe
|
||||
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
// Direzione utensile costante: pura traslazione
|
||||
if ( AreSameVectorApprox( vtLs[i], vtLe[i])) {
|
||||
|
||||
@@ -761,10 +761,10 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
// ---------- Cilindro e sfera -----------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::CylBall_ZDrilling( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -783,8 +783,8 @@ VolZmap::CylBall_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point
|
||||
double dMinStemZ = min( min( ptS.z, ptTStemS.z), min( ptE.z, ptTStemE.z)) ;
|
||||
double dMaxStemZ = max( max( ptS.z, ptTStemS.z), max( ptE.z, ptTStemE.z)) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
|
||||
Point3d ptC( dX, dY, 0) ; Vector3d vtC = ptC - ptSxy ;
|
||||
@@ -816,10 +816,10 @@ VolZmap::CylBall_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::CylBall_ZPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -848,8 +848,8 @@ VolZmap::CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& p
|
||||
Vector3d vtV2 = vtV1 ;
|
||||
vtV2.Rotate( Z_AX, 0, 1) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
|
||||
|
||||
@@ -942,10 +942,10 @@ VolZmap::CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& p
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::CylBall_ZMilling( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -1004,8 +1004,8 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
|
||||
double dMin, dMax ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -1075,10 +1075,10 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
// ---------- Coni -----------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::Conus_ZDrilling( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -1107,8 +1107,8 @@ VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d
|
||||
if ( m_Tool.GetTipRadius() < m_Tool.GetRadius()) {
|
||||
|
||||
// Ciclo sui punti
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -1162,8 +1162,8 @@ VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d
|
||||
else {
|
||||
|
||||
// Ciclo sui punti
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -1216,10 +1216,10 @@ VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::Conus_ZPerp( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -1262,8 +1262,8 @@ VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & p
|
||||
Point3d ptVS = ptS - vtToolDir * ( dStemHeigth + dL) ;
|
||||
Point3d ptVE = ptE - vtToolDir * ( dStemHeigth + dL) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -1389,8 +1389,8 @@ VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & p
|
||||
Point3d ptVS = ptS - vtToolDir * ( m_Tool.GetHeigth() - dL) ;
|
||||
Point3d ptVE = ptE - vtToolDir * ( m_Tool.GetHeigth() - dL) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -1506,7 +1506,7 @@ VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & p
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::Conus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
double dStemH = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
|
||||
|
||||
@@ -1531,7 +1531,7 @@ VolZmap::Conus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Mrt_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Mrt_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sul piano dei movimenti possibili
|
||||
Vector3d vtMoveOnP = ( ptE - ptS) * vtToolDir * vtToolDir ;
|
||||
@@ -1584,7 +1584,7 @@ VolZmap::Mrt_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& p
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Mrt_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Mrt_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sul piano di movimento
|
||||
Vector3d vtPlV = vtToolDir ^ vtAux ;
|
||||
@@ -1637,7 +1637,7 @@ VolZmap::Mrt_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Chs_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Chs_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
CompPar_ZDrilling( nGrid, m_Tool.GetMrtChsWidth(), m_Tool.GetMrtChsThickness(), m_Tool.GetHeigth(),
|
||||
ptS, ptE, vtToolDir, vtAux) ;
|
||||
@@ -1646,7 +1646,7 @@ VolZmap::Chs_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& p
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Chs_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Chs_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sul piano dei moti possibili
|
||||
Point3d ptSp = ptS ;
|
||||
@@ -1662,7 +1662,7 @@ VolZmap::Chs_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::GenTool_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Descrizione geometrica del moto
|
||||
Point3d ptI = ptS ;
|
||||
@@ -1738,7 +1738,7 @@ VolZmap::GenTool_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::GenTool_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Descrizione geometrica del moto
|
||||
Point3d ptI = ptS ;
|
||||
@@ -1817,10 +1817,10 @@ VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
// --------- Cilindro e sfera ------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::CylBall_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -1843,8 +1843,8 @@ VolZmap::CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point
|
||||
Vector3d vtV2 = vtV1 ;
|
||||
vtV2.Rotate( Z_AX, 0, 1) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
|
||||
|
||||
@@ -1899,10 +1899,10 @@ VolZmap::CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::CylBall_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d & vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -1963,8 +1963,8 @@ VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
|
||||
if ( dLenXY < EPS_SMALL) {
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -2020,8 +2020,8 @@ VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
}
|
||||
|
||||
else {
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -2163,7 +2163,7 @@ VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::CylBall_XYMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
if ( m_Tool.GetType() == Tool::CYLMILL)
|
||||
return CompCyl_Milling( nGrid, ptS, ptE, vtToolDir, m_Tool.GetHeigth(), m_Tool.GetRadius(), false, false) ;
|
||||
@@ -2183,10 +2183,10 @@ VolZmap::CylBall_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
// --------- Coni ------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::Conus_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -2230,8 +2230,8 @@ VolZmap::Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
Point3d ptIxy( ptI.x, ptI.y, 0) ;
|
||||
|
||||
// Ciclo sui punti
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -2312,10 +2312,10 @@ VolZmap::Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::Conus_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -2361,8 +2361,8 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
Vector3d vtV1 = - vtToolDir ;
|
||||
Vector3d vtV2( - vtV1.y, vtV1.x, 0) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -2466,8 +2466,8 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
Vector3d vtNmin, vtNmax ;
|
||||
Point3d ptInt ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -2614,7 +2614,7 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::Conus_XYMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
|
||||
|
||||
@@ -2640,7 +2640,7 @@ VolZmap::Conus_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
// ---------- Cilindro e sfera -----------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::CylBall_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Altezza cilindro
|
||||
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
|
||||
@@ -2657,7 +2657,7 @@ VolZmap::CylBall_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CylBall_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::CylBall_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Altezza cilindro
|
||||
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
|
||||
@@ -2675,7 +2675,7 @@ VolZmap::CylBall_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
// ---------- Coni -----------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::Conus_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
|
||||
|
||||
@@ -2699,7 +2699,7 @@ VolZmap::Conus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Conus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::Conus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
|
||||
|
||||
@@ -2726,7 +2726,7 @@ VolZmap::Conus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& p
|
||||
// ---------- Mortasatrice ---------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Mrt_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Mrt_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sul piano dei movimenti possibili
|
||||
Point3d ptEOnP = ptS + ( ptE - ptS) * vtToolDir * vtToolDir ;
|
||||
@@ -2776,7 +2776,7 @@ VolZmap::Mrt_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Mrt_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Mrt_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sul piano dei movimenti possibili
|
||||
Point3d ptSp = ptS ;
|
||||
@@ -2828,7 +2828,7 @@ VolZmap::Mrt_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE
|
||||
// ---------- Chisel ---------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Chs_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Chs_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sulla varietà del movimento
|
||||
Point3d ptProjE = ptS + ( ptE - ptS) * vtToolDir * vtToolDir ;
|
||||
@@ -2840,7 +2840,7 @@ VolZmap::Chs_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::Chs_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
VolZmap::Chs_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
// Proiezione della traiettoria sul piano dei movimenti possibili
|
||||
Vector3d vtMoveOnP = ( ptE - ptS) - ( ptE - ptS) * vtToolDir * vtToolDir ;
|
||||
@@ -2854,7 +2854,7 @@ VolZmap::Chs_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE
|
||||
// ---------- Utensile generico ----------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Descrizione geometrica del moto
|
||||
Point3d ptI = ptS ;
|
||||
@@ -2958,7 +2958,7 @@ VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Descrizione geometrica del moto
|
||||
Point3d ptI = ptS ;
|
||||
@@ -3065,10 +3065,10 @@ VolZmap::GenTool_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
|
||||
VolZmap::CompCyl_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
|
||||
{
|
||||
// Verifica sull'interferenza con lo Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3087,8 +3087,8 @@ VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
double dMaxStemZ = max( max( ptS.z, ptTStemS.z), max( ptE.z, ptTStemE.z)) ;
|
||||
|
||||
// Ciclo sui punti
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -3108,10 +3108,10 @@ VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
|
||||
VolZmap::CompConus_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
|
||||
{
|
||||
// Verifica sull'interferenza con lo Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3143,8 +3143,8 @@ VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Poin
|
||||
Vector3d vtMin, vtMax ;
|
||||
|
||||
// Ciclo sui punti
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
|
||||
|
||||
@@ -3200,7 +3200,7 @@ VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Poin
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
VolZmap::CompPar_ZDrilling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
@@ -3212,7 +3212,7 @@ VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, doub
|
||||
dLenZ -= ( 2 * EPS_SMALL) ;
|
||||
|
||||
// Controllo sull'interferenza utensile-solido
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3225,8 +3225,8 @@ VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, doub
|
||||
double dMinZ = min( min( ptMyS.z, ptMyS.z - vtToolDir.z * dLenZ), min( ptMyE.z, ptMyE.z - vtToolDir.z * dLenZ)) ;
|
||||
double dMaxZ = max( max( ptMyS.z, ptMyS.z - vtToolDir.z * dLenZ), max( ptMyE.z, ptMyE.z - vtToolDir.z * dLenZ)) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -3249,10 +3249,10 @@ VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, doub
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
|
||||
VolZmap::CompCyl_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
|
||||
{
|
||||
// Verifica sull'interferenza con lo Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3311,8 +3311,8 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
double dMin, dMax ;
|
||||
Vector3d vtMin, vtMax ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -3377,9 +3377,9 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
|
||||
VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
|
||||
{
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3436,9 +3436,9 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point
|
||||
|
||||
Point3d ptInt ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
|
||||
|
||||
@@ -3646,7 +3646,7 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool // E' in realtà MillingPerp
|
||||
VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
VolZmap::CompPar_ZMilling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
@@ -3658,7 +3658,7 @@ VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, doubl
|
||||
dLenZ -= ( 2 * EPS_SMALL) ;
|
||||
|
||||
// Controllo sull'interferenza utensile-solido
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3689,8 +3689,8 @@ VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, doubl
|
||||
double dLenW2 = vtW2.Len() ;
|
||||
vtW2 /= dLenW2 ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -3726,16 +3726,14 @@ VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, doubl
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
// Asse di simmetria con orientazione generica: FORATURA
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
VolZmap::CompCyl_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
// Verifico che il cilindro con il suo movimento intersechi la griglia
|
||||
unsigned int nStartI, nEndI, nStartJ, nEndJ ;
|
||||
int nStartI, nEndI, nStartJ, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3749,8 +3747,8 @@ VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
// Sistema di riferimento del cilindro
|
||||
Frame3d CylFrame ; CylFrame.Set( ptF, vtToolDir) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
|
||||
Point3d ptInt1, ptInt2 ;
|
||||
Vector3d vtN1, vtN2 ;
|
||||
@@ -3764,10 +3762,10 @@ VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
VolZmap::CompConus_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3788,8 +3786,8 @@ VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point
|
||||
// L'altezza del cilindro è il movimento
|
||||
double dH = ( ptE - ptS).Len() ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -3817,7 +3815,7 @@ VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
VolZmap::CompPar_Drilling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
@@ -3829,7 +3827,7 @@ VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, doubl
|
||||
dLenZ -= ( 2 * EPS_SMALL) ;
|
||||
|
||||
// Controllo sull'interferenza utensile-solido
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3843,8 +3841,8 @@ VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, doubl
|
||||
Point3d ptO = ptMyS - ( ( ptMyE - ptMyS) * vtV1 > 0 ? dLenZ : dLenZ + dLenMove) * vtV1 - ( 0.5 * dLenX) * vtV2 ;
|
||||
Frame3d ParaFrame ; ParaFrame.Set( ptO, vtV2, vtV3, vtV1) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -3866,11 +3864,11 @@ VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, doubl
|
||||
// Asse di simmetria con orientazione generica: FRESATURA
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE,
|
||||
VolZmap::CompCyl_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, double dHei, double dRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -3901,8 +3899,8 @@ VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
bool bElpsB = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapB) ;
|
||||
bool bElpsT = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapT) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
|
||||
|
||||
@@ -3952,11 +3950,11 @@ VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
VolZmap::CompConus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
|
||||
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
// Verifico interferenza
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -4040,8 +4038,8 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
|
||||
if ( dRatio * dTan <= 1) {
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
|
||||
|
||||
@@ -4212,8 +4210,8 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
}
|
||||
|
||||
else {
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
|
||||
|
||||
@@ -4240,7 +4238,7 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
VolZmap::CompPar_Milling( int nGrid, double dLenX, double dLenY, double dLenZ,
|
||||
const Point3d& ptS, const Point3d& ptE,
|
||||
const Vector3d& vtToolDir, const Vector3d& vtAux)
|
||||
{
|
||||
@@ -4252,7 +4250,7 @@ VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double
|
||||
dLenZ -= ( 2 * EPS_SMALL) ;
|
||||
|
||||
// Controllo sull'interferenza utensile-solido
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
|
||||
@@ -4283,8 +4281,8 @@ VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double
|
||||
Vector3d vtW2 = vtW3 ^ vtW1 ;
|
||||
MotionFrame.Set( ptOrig, vtW1, vtW2, vtW3) ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
|
||||
|
||||
@@ -4317,10 +4315,10 @@ VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CompBall_Milling( unsigned int nGrid, const Point3d& ptLs, const Point3d& ptLe, double dRad)
|
||||
VolZmap::CompBall_Milling( int nGrid, const Point3d& ptLs, const Point3d& ptLe, double dRad)
|
||||
{
|
||||
// Verifico interferisca
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
if ( ! TestCompoBBox( nGrid, ptLs, ptLe, V_NULL, dRad, 0, 0, nStartI, nStartJ, nEndI, nEndJ))
|
||||
return true ;
|
||||
// Vettore modivemnto
|
||||
@@ -4334,8 +4332,8 @@ VolZmap::CompBall_Milling( unsigned int nGrid, const Point3d& ptLs, const Point3
|
||||
|
||||
double dSqRad = dRad * dRad ;
|
||||
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
for ( int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
@@ -4425,8 +4423,8 @@ GetSphereMoveBBox( const Point3d& ptP1, const Point3d& ptP2, double dRad)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline bool
|
||||
VolZmap::TestToolBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ)
|
||||
VolZmap::TestToolBBox( int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
int& nStI, int& nStJ, int& nEnI, int& nEnJ)
|
||||
{
|
||||
return TestCompoBBox( nGrid, ptP1, ptP2, vtV, m_Tool.GetRadius(), m_Tool.GetTipRadius(), m_Tool.GetHeigth(),
|
||||
nStI, nStJ, nEnI, nEnJ) ;
|
||||
@@ -4434,9 +4432,9 @@ VolZmap::TestToolBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& p
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline bool
|
||||
VolZmap::TestCompoBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
VolZmap::TestCompoBBox( int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
|
||||
double dRad, double dTipRad, double dHei,
|
||||
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ)
|
||||
int& nStI, int& nStJ, int& nEnI, int& nEnJ)
|
||||
{
|
||||
// I punti e i vettori devono essere nel sistema di riferimento opportuno
|
||||
|
||||
@@ -4457,18 +4455,18 @@ VolZmap::TestCompoBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d&
|
||||
|
||||
// Limiti su indici
|
||||
nStI = max( 0, int( b3Box.GetMin().x / m_dStep)) ;
|
||||
nEnI = min( m_nNx[nGrid] - 1, unsigned int( b3Box.GetMax().x / m_dStep)) ;
|
||||
nEnI = min( m_nNx[nGrid] - 1, int( b3Box.GetMax().x / m_dStep)) ;
|
||||
nStJ = max( 0, int( b3Box.GetMin().y / m_dStep)) ;
|
||||
nEnJ = min( m_nNy[nGrid] - 1, unsigned int( b3Box.GetMax().y / m_dStep)) ;
|
||||
nEnJ = min( m_nNy[nGrid] - 1, int( b3Box.GetMax().y / m_dStep)) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline bool
|
||||
VolZmap::TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtD, const Vector3d& vtA,
|
||||
VolZmap::TestParaBBox( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtD, const Vector3d& vtA,
|
||||
double dLenX, double dLenY, double dLenZ,
|
||||
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ)
|
||||
int& nStI, int& nStJ, int& nEnI, int& nEnJ)
|
||||
{
|
||||
// I punti e i vettori devono essere nel sistema di riferimento opportuno
|
||||
|
||||
@@ -4487,8 +4485,8 @@ VolZmap::TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
double dMaxY = max( max( ptS.y, ptSTip.y), max( ptE.y, ptETip.y)) + dSemiDiag ;
|
||||
double dMaxZ = max( max( ptS.z, ptSTip.z), max( ptE.z, ptETip.z)) + dSemiDiag ;
|
||||
|
||||
unsigned int nMaxNx = m_nNx[nGrid] ;
|
||||
unsigned int nMaxNy = m_nNy[nGrid] ;
|
||||
int nMaxNx = m_nNx[nGrid] ;
|
||||
int nMaxNy = m_nNy[nGrid] ;
|
||||
|
||||
double dMaxXValue = nMaxNx * m_dStep ;
|
||||
double dMaxYValue = nMaxNy * m_dStep ;
|
||||
@@ -4504,10 +4502,10 @@ VolZmap::TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
return false ;
|
||||
|
||||
// Limiti su indici
|
||||
nStI = ( dMinX < EPS_SMALL ? 0 : static_cast <unsigned int> ( dMinX / m_dStep)) ;
|
||||
nEnI = ( dMaxX > dMaxXValue - EPS_SMALL ? nMaxNx - 1 : static_cast <unsigned int> ( dMaxX / m_dStep)) ;
|
||||
nStJ = ( dMinY < EPS_SMALL ? 0 : static_cast <unsigned int> ( dMinY / m_dStep)) ;
|
||||
nEnJ = ( dMaxY > dMaxYValue - EPS_SMALL ? nMaxNy - 1 : static_cast <unsigned int> ( dMaxY / m_dStep)) ;
|
||||
nStI = ( dMinX < EPS_SMALL ? 0 : static_cast<int> ( dMinX / m_dStep)) ;
|
||||
nEnI = ( dMaxX > dMaxXValue - EPS_SMALL ? nMaxNx - 1 : static_cast<int> ( dMaxX / m_dStep)) ;
|
||||
nStJ = ( dMinY < EPS_SMALL ? 0 : static_cast<int> ( dMinY / m_dStep)) ;
|
||||
nEnJ = ( dMaxY > dMaxYValue - EPS_SMALL ? nMaxNy - 1 : static_cast<int> ( dMaxY / m_dStep)) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user