EgtGeomKernel 1.9a3 :
- modifiche per Triangle3dEx in Zmap.
This commit is contained in:
+36
-36
@@ -583,10 +583,10 @@ VolZmap::GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) con
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GetAllTriangles( TRIA3DLIST& lstTria) const
|
||||
VolZmap::GetAllTriangles( TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
INTVECTOR nModifiedBlocks ;
|
||||
TRIA3DLISTVECTOR vLstTria ;
|
||||
TRIA3DEXLISTVECTOR vLstTria ;
|
||||
if ( ! GetTriangles( true, nModifiedBlocks, vLstTria))
|
||||
return false ;
|
||||
lstTria.clear() ;
|
||||
@@ -599,7 +599,7 @@ VolZmap::GetAllTriangles( TRIA3DLIST& lstTria) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GetTriangles( bool bAllBlocks, INTVECTOR& nModifiedBlocks, TRIA3DLISTVECTOR& vLstTria) const
|
||||
VolZmap::GetTriangles( bool bAllBlocks, INTVECTOR& nModifiedBlocks, TRIA3DEXLISTVECTOR& vLstTria) const
|
||||
{
|
||||
// Se nessun blocco modificato, è richiesta esterna e li considero tutti modificati
|
||||
bool bSomeModif = false ;
|
||||
@@ -758,7 +758,7 @@ VolZmap::GetBlockCount( void) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GetChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nDimChk, TRIA3DLIST& lstTria) const
|
||||
VolZmap::GetChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nDimChk, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
// determino se è un semplice parallelepipedo
|
||||
bool bIsSimple = true ;
|
||||
@@ -809,7 +809,7 @@ VolZmap::GetChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, int nDimChk
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CalcChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, TRIA3DLIST& lstTria) const
|
||||
VolZmap::CalcChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
// verifiche sugli indici
|
||||
if ( nPos1 < 0 || nPos1 + nDim1 > int( m_nNx[0]) || nPos2 < 0 || nPos2 + nDim2 > int( m_nNy[0]))
|
||||
@@ -875,7 +875,7 @@ VolZmap::CalcChunkPrisms( int nPos1, int nPos2, int nDim1, int nDim2, TRIA3DLIST
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::CalcDexelPrisms( int nPos1, int nPos2, TRIA3DLIST& lstTria) const
|
||||
VolZmap::CalcDexelPrisms( int nPos1, int nPos2, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
// verifiche sugli indici
|
||||
if ( nPos1 < 0 || nPos1 >= int( m_nNx[0]) || nPos2 < 0 || nPos2 >= int( m_nNy[0]))
|
||||
@@ -924,7 +924,7 @@ VolZmap::CalcDexelPrisms( int nPos1, int nPos2, TRIA3DLIST& lstTria) const
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::AddDexelSideFace( int nPos, int nPosAdj, const Point3d& ptP, const Point3d& ptQ,
|
||||
const Vector3d& vtZ, const Vector3d& vtNorm, TRIA3DLIST& lstTria) const
|
||||
const Vector3d& vtZ, const Vector3d& vtNorm, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
Intervals intFace ;
|
||||
for ( int i = 0 ; i < int( m_Values[0][nPos].size()) ; i += 1)
|
||||
@@ -952,7 +952,7 @@ VolZmap::AddDexelSideFace( int nPos, int nPosAdj, const Point3d& ptP, const Poin
|
||||
// il riconoscimento delle sharp-feature bEnh deve valere true.
|
||||
// I triangoli formanti sharp-feature vengono messi nel TriHolder, gli altri nella lista.
|
||||
bool
|
||||
VolZmap::ProcessCube( int nVoxI, int nVoxJ, int nVoxK, TRIA3DLIST& lstTria, TriHolder& triHold, bool bEnh) const
|
||||
VolZmap::ProcessCube( int nVoxI, int nVoxJ, int nVoxK, TRIA3DEXLIST& lstTria, TriHolder& triHold, bool bEnh) const
|
||||
{
|
||||
// Calcolo il numero di voxel lungo X,Y e Z
|
||||
int nVoxNumX = int( m_nNx[0] / N_DEXVOXRATIO + ( m_nNx[0] % N_DEXVOXRATIO == 0 ? 1 : 2)) ;
|
||||
@@ -1633,7 +1633,7 @@ VolZmap::ProcessCube( int nVoxI, int nVoxJ, int nVoxK, TRIA3DLIST& lstTria, TriH
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold) const
|
||||
VolZmap::ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold) const
|
||||
{
|
||||
// Controllo sulla validità del blocco
|
||||
if ( nBlock < 0 || nBlock >= int( m_nNumBlock))
|
||||
@@ -2110,12 +2110,12 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold)
|
||||
CurrentTriangle.SetAttrib( 2, CompoVert[nCompCount - 1][ni].nToolFlag) ;
|
||||
if ( CurrentTriangle.GetAttrib( 1) < 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) < 0)
|
||||
CurrentTriangle.SetFlag( - 1) ;
|
||||
CurrentTriangle.SetGrade( - 1) ;
|
||||
else if ( CurrentTriangle.GetAttrib( 1) > 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) > 0)
|
||||
CurrentTriangle.SetFlag( 1) ;
|
||||
CurrentTriangle.SetGrade( 1) ;
|
||||
else
|
||||
CurrentTriangle.SetFlag( 0) ;
|
||||
CurrentTriangle.SetGrade( 0) ;
|
||||
CurrentTriangle.Validate( true) ;
|
||||
// Aggiungo triangolo al vettore temporaneo
|
||||
triContainer.emplace_back( CurrentTriangle) ;
|
||||
@@ -2204,12 +2204,12 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold)
|
||||
CurrentTriangle.SetAttrib( 2, CompoVert[nCompCount - 1][ni].nToolFlag) ;
|
||||
if ( CurrentTriangle.GetAttrib( 1) < 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) < 0)
|
||||
CurrentTriangle.SetFlag( - 1) ;
|
||||
CurrentTriangle.SetGrade( - 1) ;
|
||||
else if ( CurrentTriangle.GetAttrib( 1) > 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) > 0)
|
||||
CurrentTriangle.SetFlag( 1) ;
|
||||
CurrentTriangle.SetGrade( 1) ;
|
||||
else
|
||||
CurrentTriangle.SetFlag( 0) ;
|
||||
CurrentTriangle.SetGrade( 0) ;
|
||||
CurrentTriangle.Validate( true) ;
|
||||
// Aggiungo triangolo al vettore temporaneo
|
||||
triContainer.emplace_back( CurrentTriangle) ;
|
||||
@@ -2287,12 +2287,12 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold)
|
||||
CurrentTriangle.SetAttrib( 2, CompoVert[nCompCount - 1][ni].nToolFlag) ;
|
||||
if ( CurrentTriangle.GetAttrib( 1) < 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) < 0)
|
||||
CurrentTriangle.SetFlag( - 1) ;
|
||||
CurrentTriangle.SetGrade( - 1) ;
|
||||
else if ( CurrentTriangle.GetAttrib( 1) > 0 ||
|
||||
CurrentTriangle.GetAttrib( 2) > 0)
|
||||
CurrentTriangle.SetFlag( 1) ;
|
||||
CurrentTriangle.SetGrade( 1) ;
|
||||
else
|
||||
CurrentTriangle.SetFlag( 0) ;
|
||||
CurrentTriangle.SetGrade( 0) ;
|
||||
CurrentTriangle.Validate( true) ;
|
||||
// Aggiungo triangolo al vettore temporaneo
|
||||
triContainer.emplace_back( CurrentTriangle) ;
|
||||
@@ -2450,9 +2450,9 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold)
|
||||
int nTool1 = CompoTriVert[nCompCount - 1][TriIndex+1].nToolFlag ;
|
||||
int nTool2 = CompoTriVert[nCompCount - 1][TriIndex+2].nToolFlag ;
|
||||
if ( nTool0 == nTool1 || nTool0 == nTool2)
|
||||
CurrentTriangle.SetFlag( nTool0) ;
|
||||
CurrentTriangle.SetGrade( nTool0) ;
|
||||
else if ( nTool1 == nTool2)
|
||||
CurrentTriangle.SetFlag( nTool1) ;
|
||||
CurrentTriangle.SetGrade( nTool1) ;
|
||||
//
|
||||
bool bV = CurrentTriangle.Validate( true) ;
|
||||
// Riporto le coordinate nel sistema in cui è immerso lo Zmap
|
||||
@@ -2477,9 +2477,9 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold)
|
||||
int nTool1 = CompoTriVert[nCompCount - 1][TriIndex+1].nToolFlag ;
|
||||
int nTool2 = CompoTriVert[nCompCount - 1][TriIndex+2].nToolFlag ;
|
||||
if ( nTool0 == nTool1 || nTool0 == nTool2)
|
||||
CurrentTriangle.SetFlag( nTool0) ;
|
||||
CurrentTriangle.SetGrade( nTool0) ;
|
||||
else if ( nTool1 == nTool2)
|
||||
CurrentTriangle.SetFlag( nTool1) ;
|
||||
CurrentTriangle.SetGrade( nTool1) ;
|
||||
//
|
||||
bool bV = CurrentTriangle.Validate( true) ;
|
||||
// Riporto le coordinate nel sistema in cui è immerso lo Zmap
|
||||
@@ -2509,7 +2509,7 @@ VolZmap::ExtMarchingCubes( int nBlock, TRIA3DLIST& lstTria, TriHolder& triHold)
|
||||
// delle sharp-feature passare true in bEhn. In questo caso vengono analizzai anche i
|
||||
// voxel adiacenti a quelli contenenti sharp-feature, e viene eseguito il flipping.
|
||||
bool
|
||||
VolZmap::ExtMarchingCubes( vector<Voxel>& vVox, TRIA3DLIST& lstTria, bool bEnh) const
|
||||
VolZmap::ExtMarchingCubes( vector<Voxel>& vVox, TRIA3DEXLIST& lstTria, bool bEnh) const
|
||||
{
|
||||
// Contenitore dei triangoli costituenti sharp-feaure
|
||||
TriHolder triHold ;
|
||||
@@ -2718,8 +2718,8 @@ VolZmap::FlipEdgesII( TriHolder& TriHold, bool bGraph) const
|
||||
TriHold[n2].ptCompoVert[nCompo2]) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetP( SharedIndex[3],
|
||||
TriHold[n1].ptCompoVert[nCompo1]) ;
|
||||
TriHold[n1].vCompoTria[nCompo1][nTri1].SetFlag( nCol1) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetFlag( nCol2) ;
|
||||
TriHold[n1].vCompoTria[nCompo1][nTri1].SetGrade( nCol1) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].SetGrade( nCol2) ;
|
||||
|
||||
TriHold[n1].vCompoTria[nCompo1][nTri1].Validate( true) ;
|
||||
TriHold[n2].vCompoTria[nCompo2][nTri2].Validate( true) ;
|
||||
@@ -2877,8 +2877,8 @@ VolZmap::FlipEdgesBB( TriaMatrix& InterTria) const
|
||||
InterTria[tLB][tVLB].ptCompoVert[tCmpL]) ;
|
||||
InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].SetP( SharedIndex[3],
|
||||
InterTria[tFB][tVFB].ptCompoVert[tCmpF]) ;
|
||||
InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].SetFlag( nColF) ;
|
||||
InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].SetFlag( nColL) ;
|
||||
InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].SetGrade( nColF) ;
|
||||
InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].SetGrade( nColL) ;
|
||||
|
||||
InterTria[tFB][tVFB].vCompoTria[tCmpF][tTriFB].Validate( true) ;
|
||||
InterTria[tLB][tVLB].vCompoTria[tCmpL][tTriLB].Validate( true) ;
|
||||
@@ -3492,7 +3492,7 @@ VolZmap::IsATriangleOnBorder( const Triangle3d& trTria, const Point3d& ptVert,
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::ProcessVoxContXY( VoxelContainer& VoxContXY, bool bPlus, TRIA3DLIST& lstTria) const
|
||||
VolZmap::ProcessVoxContXY( VoxelContainer& VoxContXY, bool bPlus, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
VoxelContainer::iterator it = VoxContXY.begin() ;
|
||||
while ( it != VoxContXY.end()) {
|
||||
@@ -3594,8 +3594,8 @@ VolZmap::ProcessVoxContXY( VoxelContainer& VoxContXY, bool bPlus, TRIA3DLIST& ls
|
||||
Tria0.Set( ptT0, ptT3, ptT1) ;
|
||||
Tria1.Set( ptT1, ptT3, ptT2) ;
|
||||
}
|
||||
Tria0.SetFlag( nToolNum) ;
|
||||
Tria1.SetFlag( nToolNum) ;
|
||||
Tria0.SetGrade( nToolNum) ;
|
||||
Tria1.SetGrade( nToolNum) ;
|
||||
bool bV0 = Tria0.Validate( true) ;
|
||||
bool bV1 = Tria1.Validate( true) ;
|
||||
// Aggiungo alla lista
|
||||
@@ -3614,7 +3614,7 @@ VolZmap::ProcessVoxContXY( VoxelContainer& VoxContXY, bool bPlus, TRIA3DLIST& ls
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::ProcessVoxContYZ( VoxelContainer& VoxContYZ, bool bPlus, TRIA3DLIST& lstTria) const
|
||||
VolZmap::ProcessVoxContYZ( VoxelContainer& VoxContYZ, bool bPlus, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
VoxelContainer::iterator it = VoxContYZ.begin() ;
|
||||
while ( it != VoxContYZ.end()) {
|
||||
@@ -3716,8 +3716,8 @@ VolZmap::ProcessVoxContYZ( VoxelContainer& VoxContYZ, bool bPlus, TRIA3DLIST& ls
|
||||
Tria0.Set( ptT0, ptT3, ptT1) ;
|
||||
Tria1.Set( ptT1, ptT3, ptT2) ;
|
||||
}
|
||||
Tria0.SetFlag( nToolNum) ;
|
||||
Tria1.SetFlag( nToolNum) ;
|
||||
Tria0.SetGrade( nToolNum) ;
|
||||
Tria1.SetGrade( nToolNum) ;
|
||||
bool bV0 = Tria0.Validate( true) ;
|
||||
bool bV1 = Tria1.Validate( true) ;
|
||||
// Aggiungo alla lista
|
||||
@@ -3736,7 +3736,7 @@ VolZmap::ProcessVoxContYZ( VoxelContainer& VoxContYZ, bool bPlus, TRIA3DLIST& ls
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::ProcessVoxContXZ( VoxelContainer& VoxContXZ, bool bPlus, TRIA3DLIST& lstTria) const
|
||||
VolZmap::ProcessVoxContXZ( VoxelContainer& VoxContXZ, bool bPlus, TRIA3DEXLIST& lstTria) const
|
||||
{
|
||||
VoxelContainer::iterator it = VoxContXZ.begin() ;
|
||||
while ( it != VoxContXZ.end()) {
|
||||
@@ -3838,8 +3838,8 @@ VolZmap::ProcessVoxContXZ( VoxelContainer& VoxContXZ, bool bPlus, TRIA3DLIST& ls
|
||||
Tria0.Set( ptT0, ptT1, ptT3) ;
|
||||
Tria1.Set( ptT1, ptT2, ptT3) ;
|
||||
}
|
||||
Tria0.SetFlag( nToolNum) ;
|
||||
Tria1.SetFlag( nToolNum) ;
|
||||
Tria0.SetGrade( nToolNum) ;
|
||||
Tria1.SetGrade( nToolNum) ;
|
||||
bool bV0 = Tria0.Validate( true) ;
|
||||
bool bV1 = Tria1.Validate( true) ;
|
||||
// Aggiungo alla lista
|
||||
|
||||
Reference in New Issue
Block a user