EgtGeomKernel :

- varie correzioni ortografiche.
This commit is contained in:
Dario Sassi
2025-11-15 11:00:21 +01:00
parent 8f43efe282
commit cd48e2de3b
15 changed files with 284 additions and 287 deletions
+57 -59
View File
@@ -728,7 +728,7 @@ Tree::BuildTree( double dLinTol, double dSideMin, double dSideMax)
// ( dSideMinVal è zero se entrambi i lati da splittare sono collassati in un punto, controllo dLengMinVal)
bool bSplit = false ;
bool bParamDimOk = false ;
if( bVert)
if ( bVert)
bParamDimOk = ( pcToSplit->GetTopRight().x - pcToSplit->GetBottomLeft().x) / 2 > 100 * EPS_PARAM ;
else
bParamDimOk = ( pcToSplit->GetTopRight().y - pcToSplit->GetBottomLeft().y) / 2 > 100 * EPS_PARAM ;
@@ -755,9 +755,9 @@ Tree::BuildTree( double dLinTol, double dSideMin, double dSideMax)
// sono arrivato ad una cella Leaf, quindi salvo la cella
m_vnLeaves.push_back( nCToSplit) ;
pcToSplit->SetProcessed() ;
if( AreSamePointApprox( ptP00, ptP01) && AreSamePointApprox( ptP10, ptP11))
if ( AreSamePointApprox( ptP00, ptP01) && AreSamePointApprox( ptP10, ptP11))
pcToSplit->m_nCollapsed = Cell::Collapsed::VERT_EDGES ;
else if( AreSamePointApprox( ptP00, ptP10) && AreSamePointApprox( ptP01, ptP11))
else if ( AreSamePointApprox( ptP00, ptP10) && AreSamePointApprox( ptP01, ptP11))
pcToSplit->m_nCollapsed = Cell::Collapsed::HORIZ_EDGES ;
else
pcToSplit->m_nCollapsed = Cell::Collapsed::NO_COLLAPSE ;
@@ -868,9 +868,9 @@ Tree::BuildTree( double dLinTol, double dSideMin, double dSideMax)
// sono arrivato ad una cella Leaf, quindi salvo la cella
m_vnLeaves.push_back( nCToSplit) ;
pcToSplit->SetProcessed() ;
if( AreSamePointApprox( ptP00, ptP01) && AreSamePointApprox( ptP10, ptP11))
if ( AreSamePointApprox( ptP00, ptP01) && AreSamePointApprox( ptP10, ptP11))
pcToSplit->m_nCollapsed = Cell::Collapsed::VERT_EDGES ;
else if( AreSamePointApprox( ptP00, ptP10) && AreSamePointApprox( ptP01, ptP11))
else if ( AreSamePointApprox( ptP00, ptP10) && AreSamePointApprox( ptP01, ptP11))
pcToSplit->m_nCollapsed = Cell::Collapsed::HORIZ_EDGES ;
else
pcToSplit->m_nCollapsed = Cell::Collapsed::NO_COLLAPSE ;
@@ -1473,7 +1473,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
int c = 0 ;
for ( int nId : m_vnLeaves) {
Cell& cell = m_mTree.at( nId) ;
if( cell.m_nCollapsed != Cell::Collapsed::NO_COLLAPSE)
if ( cell.m_nCollapsed != Cell::Collapsed::NO_COLLAPSE)
continue ;
vVertices.clear() ;
vVertices3d.clear() ;
@@ -1486,7 +1486,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
std::fill( vbBonusVert.begin(), vbBonusVert.end(), false) ;
vnVert.push_back( int(vVertices.size()) - 1) ;
GetBottomNeigh( nId, vNeigh) ;
if( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::VERT_EDGES)
if ( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::VERT_EDGES)
GetBottomNeigh( vNeigh[0], vNeigh, DBLDBL( cell.GetBottomLeft().x, cell.GetTopRight().x)) ;
Point3d ptP00, ptP10, ptP11, ptP01 ;
GetPoint( cell.GetBottomLeft().x, cell.GetBottomLeft().y, ptP00) ;
@@ -1522,7 +1522,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
bBottomRight = false ;
vNeigh.clear() ;
GetRightNeigh ( nId, vNeigh) ;
if( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::HORIZ_EDGES)
if ( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::HORIZ_EDGES)
GetRightNeigh( vNeigh[0], vNeigh, DBLDBL( cell.GetBottomLeft().y, cell.GetTopRight().y)) ;
// aggiungo i vertici che sono sul lato right, solo se ho più di un vicino right
if ( vNeigh.size() > 1){
@@ -1564,7 +1564,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
vVertices3d.push_back( pt3d) ;
vnVert.push_back( int(vVertices.size()) - 1) ;
GetTopNeigh ( nId, vNeigh) ;
if( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::VERT_EDGES)
if ( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::VERT_EDGES)
GetTopNeigh( vNeigh[0], vNeigh, DBLDBL( cell.GetBottomLeft().x, cell.GetTopRight().x)) ;
std::reverse( vNeigh.begin(), vNeigh.end()) ;
// aggiungo i vertici che sono sul lato top, solo se ho più di un vicino top
@@ -1596,7 +1596,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
bTopLeft = false ;
vNeigh.clear() ;
GetLeftNeigh ( nId, vNeigh) ;
if( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::HORIZ_EDGES)
if ( ! vNeigh.empty() && m_mTree.at(vNeigh[0]).m_nCollapsed == Cell::Collapsed::HORIZ_EDGES)
GetLeftNeigh( vNeigh[0], vNeigh, DBLDBL( cell.GetBottomLeft().y, cell.GetTopRight().y)) ;
std::reverse( vNeigh.begin(), vNeigh.end()) ;
// aggiungo i vertici che sono sul lato left, solo se ho più di un vicino left
@@ -1679,7 +1679,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
bAlreadyCropped = true ;
}
if ( AreSamePointApprox(ptP10, ptP11)) {
if( bAlreadyCropped)
if ( bAlreadyCropped)
continue ;
// sennò devo togliere l'estremo del lato su cui NON ho punti bonus
if ( vbBonusVert[0] && ! vbBonusVert[2]){ // lati contati a partire da quello sopra in senso CCW
@@ -1707,7 +1707,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
bAlreadyCropped = true ;
}
if ( AreSamePointApprox(ptP11, ptP01)) {
if( bAlreadyCropped)
if ( bAlreadyCropped)
continue ;
// sennò devo togliere l'estremo del lato su cui NON ho punti bonus
if ( vbBonusVert[1] && ! vbBonusVert[3]){ // lati contati a partire da quello sopra in senso CCW
@@ -1735,7 +1735,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
bAlreadyCropped = true ;
}
if ( AreSamePointApprox(ptP01, ptP00)) {
if( bAlreadyCropped)
if ( bAlreadyCropped)
continue ;
// sennò devo togliere l'estremo del lato su cui NON ho punti bonus
if ( vbBonusVert[0] && ! vbBonusVert[2]) { // lati contati a partire da quello sopra in senso CCW
@@ -1801,10 +1801,10 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
int nVertCorr = int(vVerticesCorr.size());
for ( int i = 0 ; i < (int) vVertices.size() ; ++i) {
int dPar = i ;
if( ! vbKeepPoint[i])
if ( ! vbKeepPoint[i])
dPar = -1 ;
vPolygonsBasic.back().AddUPoint( dPar, vVertices.at( i)) ;
if( i < nVertCorr){
if ( i < nVertCorr){
vPolygonsCorrected.back().AddUPoint( dPar, vVerticesCorr.at( i)) ;
vPolygons3d.back().AddUPoint( dPar, vVertices3d.at( i)) ;
}
@@ -2000,7 +2000,7 @@ Tree::UpdateSplitLoop( ICurveComposite* pCC, Point3d& pt)
}
bAdded = true ;
}
if( pCC->IsValid()) {
if ( pCC->IsValid()) {
if ( ! bAdded)
pCC->AddLine( pt) ;
Vector3d vtDir = pt - ptLast ;
@@ -2131,7 +2131,7 @@ Tree::TraceLoopLabelCell( const POLYLINEVECTOR& vplPolygons)
UpdateSplitLoop( pCCLoopSplit, vptInters.back()) ;
}
// controllo di aggiungere un punto abbastanza distante dal precedente
if( ! AreSamePointXYEpsilon( vptInters.back(), ptCurr, 10 * EPS_SMALL)) {
if ( ! AreSamePointXYEpsilon( vptInters.back(), ptCurr, 10 * EPS_SMALL)) {
// aggiungo la fine del segmento nel vettore delle intersezioni
vptInters.push_back( ptCurr) ;
// aggiorno la compo splittata
@@ -2370,7 +2370,7 @@ Tree::FindInters( int& nId, const CurveLine& clTrim, const PolyLine& plPolygon,
if ( icc.GetOverlaps()) {
for ( int i = 0 ; i < icc.GetIntersCount() ; ++i) {
icc.GetIntCrvCrvInfo( i, iccInfo) ;
if( iccInfo.bOverlap){
if ( iccInfo.bOverlap){
ptInters = iccInfo.IciA[1].ptI ;
break ;
}
@@ -2378,14 +2378,14 @@ Tree::FindInters( int& nId, const CurveLine& clTrim, const PolyLine& plPolygon,
}
else {
int nLastInters = icc.GetIntersCount() -1 ;
if( nLastInters < 0)
if ( nLastInters < 0)
return false ;
icc.GetIntCrvCrvInfo( nLastInters, iccInfo) ;
ptInters = iccInfo.IciA[0].ptI ;
}
// determino il lato/vertice di uscita
if( ! OnWhichEdge( nId, ptInters, nEdge))
if ( ! OnWhichEdge( nId, ptInters, nEdge))
return false ;
pCell->m_vInters.back().nOut = nEdge ;
// se è risultato che sono abbastanza vicino( di EPS_SMALL) ad un vertice allora il punto aggiunto sarà il vertice vero e proprio
@@ -2746,10 +2746,10 @@ Tree::FindInters( int& nId, const CurveLine& clTrim, const PolyLine& plPolygon,
//----------------------------------------------------------------------------
bool
Tree::CreateCellPolygons( int nLeafId, POLYLINEMATRIX& vPolygons, POLYLINEMATRIX& vPolygons3d, INTVECTOR& vToCheck, int& nPoly, INTVECTOR& vnParentChunk,
const PolyLine& plCell, const PolyLine& plCell3d)
Tree::CreateCellPolygons( int nLeafId, POLYLINEMATRIX& vPolygons, POLYLINEMATRIX& vPolygons3d, INTVECTOR& vToCheck, int& nPoly,
INTVECTOR& vnParentChunk, const PolyLine& plCell, const PolyLine& plCell3d)
{
// conto quanti vertici in più ho per lato e creo un vettore dei vertici per lato
// conto quanti vertici in più ho per lato e creo un vettore dei vertici per lato
int nId = m_vnLeaves[nLeafId] ;
Cell& cCell = m_mTree[nId] ;
PNTMATRIX vEdgeVertex(4) ;
@@ -2759,38 +2759,36 @@ Tree::CreateCellPolygons( int nLeafId, POLYLINEMATRIX& vPolygons, POLYLINEMATRIX
Point3d ptTl = cCell.GetTopLeft() ;
Point3d ptBr = cCell.GetBottomRight() ;
int nVertToErase = m_mTree.at(nId).m_nVertToErase ;
if( nVertToErase != 2)
if ( nVertToErase != 2)
vEdgeVertex[0].push_back( ptTR) ;
if( nVertToErase != 3)
if ( nVertToErase != 3)
vEdgeVertex[1].push_back( ptTl) ;
if( nVertToErase != 0)
if ( nVertToErase != 0)
vEdgeVertex[2].push_back( ptBL) ;
if( nVertToErase != 1)
if ( nVertToErase != 1)
vEdgeVertex[3].push_back( ptBr) ;
// capisco se sono in modalità ForTriangulation
bool bForTriangulation = plCell3d.GetPointNbr() != 0 ;
if ( bForTriangulation) {
if( nVertToErase != 2) {
if ( nVertToErase != 2) {
Point3d pt3d ; GetPoint( cCell.GetTopRight().x, cCell.GetTopRight().y, pt3d) ;
vEdgeVertex3d[0].push_back( pt3d) ;
}
if( nVertToErase != 3){
if ( nVertToErase != 3) {
Point3d pt3d ; GetPoint( cCell.GetBottomLeft().x, cCell.GetTopRight().y, pt3d) ;
vEdgeVertex3d[1].push_back( pt3d) ;
}
if( nVertToErase != 0) {
if ( nVertToErase != 0) {
Point3d pt3d ; GetPoint( cCell.GetBottomLeft().x, cCell.GetBottomLeft().y, pt3d) ;
vEdgeVertex3d[2].push_back( pt3d) ;
}
if( nVertToErase != 1) {
if ( nVertToErase != 1) {
Point3d pt3d ; GetPoint( cCell.GetTopRight().x, cCell.GetBottomLeft().y, pt3d) ;
vEdgeVertex3d[3].push_back( pt3d) ;
}
}
// la PolyLine è riempita a partire dal lato bottom
// la PolyLine è riempita a partire dal lato bottom
Point3d ptStart, pt3d ;
plCell.GetFirstPoint( ptStart) ;
if ( bForTriangulation)
@@ -3052,7 +3050,7 @@ Tree::CreateCellPolygons( int nLeafId, POLYLINEMATRIX& vPolygons, POLYLINEMATRIX
if ( dArea > 0) {
vPolygons.emplace_back() ;
vPolygons.back().push_back(std::move(plTrimmedPoly)) ;
if( bForTriangulation) {
if ( bForTriangulation) {
vPolygons3d.emplace_back() ;
vPolygons3d.back().push_back(std::move(plTrimmedPoly3d)) ;
}
@@ -3108,7 +3106,7 @@ Tree::CreateIslandAndHoles( int nLeafId, POLYLINEMATRIX& vPolygons, POLYLINEMATR
nChunkBiggestCW = inA.nChunk ;
bContained = false ;
Inters inB = cCell.m_vInters[0] ;
for( int c = 0 ; c < nInters ; ++ c){
for ( int c = 0 ; c < nInters ; ++ c){
inB = cCell.m_vInters[c] ;
if ( inB.nIn == -1) {
if ( inB != inA && inB.nChunk == inA.nChunk && inB.bCCW) {
@@ -3367,12 +3365,12 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
int nVertToSkip = m_mTree.at(nId).m_nVertToErase ;
// se è il primo punto della PolyLine lo aggiungo
if ( plTrimmedPoly.GetPointNbr() == 0) {
// se cerco di aggiungere il vertice che devo saltare, non faccio nulla
if( ( nVertToSkip == 0 && AreSamePointXYApprox( ptToAdd, ptBL)) ||
// se cerco di aggiungere il vertice che devo saltare, non faccio nulla
if (( nVertToSkip == 0 && AreSamePointXYApprox( ptToAdd, ptBL)) ||
( nVertToSkip == 1 && AreSamePointXYApprox( ptToAdd, ptBr)) ||
( nVertToSkip == 2 && AreSamePointXYApprox( ptToAdd, ptTR)) ||
( nVertToSkip == 3 && AreSamePointXYApprox( ptToAdd, ptTl))) {
// aggiorno l'ultimo punto aggiunto
// aggiorno l'ultimo punto aggiunto
ptLast.Set( ptToAdd.x, ptToAdd.y, 0) ;
return true ;
}
@@ -3421,7 +3419,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
ptVert = ptToAdd ;
if ( nVert != nVertToSkip) {
plTrimmedPoly.AddUPoint( c, ptVert) ;
if( bForTriangulation){
if ( bForTriangulation){
Point3d pt3d ; GetPoint( ptVert.x, ptVert.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -3439,7 +3437,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
Point3d ptIntermed = vEdgeVertex[0][t] ;
if ( ptIntermed.x > ptToAdd.x && ptIntermed.x < ptLast.x) {
plTrimmedPoly.AddUPoint( c, ptIntermed) ;
if( bForTriangulation)
if ( bForTriangulation)
plTrimmedPoly3d.AddUPoint( c, vEdgeVertex3d[0][t]) ;
++ c ;
}
@@ -3447,7 +3445,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
bool bVert = AreSamePointXYApprox( ptToAdd, ptTl) ;
if ( ! ( nVertToSkip == 3 && bVert)) {
plTrimmedPoly.AddUPoint( c, ptToAdd) ;
if( bForTriangulation){
if ( bForTriangulation){
Point3d pt3d ; GetPoint( ptToAdd.x, ptToAdd.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -3460,7 +3458,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
Point3d ptIntermed = vEdgeVertex[1][t] ;
if ( ptIntermed.y > ptToAdd.y && ptIntermed.y < ptLast.y) {
plTrimmedPoly.AddUPoint( c, ptIntermed) ;
if( bForTriangulation)
if ( bForTriangulation)
plTrimmedPoly3d.AddUPoint( c, vEdgeVertex3d[1][t]) ;
++ c ;
}
@@ -3468,7 +3466,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
bool bVert = AreSamePointXYApprox( ptToAdd, ptBL) ;
if ( ! ( nVertToSkip == 0 && bVert)) {
plTrimmedPoly.AddUPoint( c, ptToAdd) ;
if( bForTriangulation) {
if ( bForTriangulation) {
Point3d pt3d ; GetPoint( ptToAdd.x, ptToAdd.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -3481,7 +3479,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
Point3d ptIntermed = vEdgeVertex[2][t] ;
if ( ptIntermed.x < ptToAdd.x && ptIntermed.x > ptLast.x) {
plTrimmedPoly.AddUPoint( c, ptIntermed) ;
if( bForTriangulation)
if ( bForTriangulation)
plTrimmedPoly3d.AddUPoint( c, vEdgeVertex3d[2][t]) ;
++ c ;
}
@@ -3489,7 +3487,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
bool bVert = AreSamePointXYApprox( ptToAdd, ptBr) ;
if ( ! ( nVertToSkip == 1 && bVert)) {
plTrimmedPoly.AddUPoint( c, ptToAdd) ;
if( bForTriangulation){
if ( bForTriangulation){
Point3d pt3d ; GetPoint( ptToAdd.x, ptToAdd.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -3502,7 +3500,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
Point3d ptIntermed = vEdgeVertex[3][t] ;
if ( ptIntermed.y < ptToAdd.y && ptIntermed.y > ptLast.y) {
plTrimmedPoly.AddUPoint( c, ptIntermed) ;
if( bForTriangulation)
if ( bForTriangulation)
plTrimmedPoly3d.AddUPoint( c, vEdgeVertex3d[3][t]) ;
++ c ;
}
@@ -3510,7 +3508,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
bool bVert = AreSamePointXYApprox( ptToAdd, ptTR) ;
if ( ! ( nVertToSkip == 2 && bVert)) {
plTrimmedPoly.AddUPoint( c, ptToAdd) ;
if( bForTriangulation) {
if ( bForTriangulation) {
Point3d pt3d ; GetPoint( ptToAdd.x, ptToAdd.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -3521,7 +3519,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
// aggiungo e basta
else {
plTrimmedPoly.AddUPoint( c, ptToAdd) ;
if( bForTriangulation) {
if ( bForTriangulation) {
Point3d pt3d ; GetPoint( ptToAdd.x, ptToAdd.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -3531,7 +3529,7 @@ Tree::AddVertex( int nId, const PNTMATRIX& vEdgeVertex, const PNTMATRIX& vEdgeVe
// non su un edge, quindi aggiungo e basta
else {
plTrimmedPoly.AddUPoint( c, ptToAdd) ;
if( bForTriangulation) {
if ( bForTriangulation) {
Point3d pt3d ; GetPoint( ptToAdd.x, ptToAdd.y, pt3d) ;
plTrimmedPoly3d.AddUPoint( c, pt3d) ;
}
@@ -4010,14 +4008,14 @@ Tree::GetEdges3D( vector<ICRVCOMPOPOVECTOR>& mCCEdges, POLYLINEVECTOR& vPolygons
// scorro sui poligoni delle celle di un lato
for ( int c = 0 ; c < int( vEdges[i].size()) ; ++c) {
Cell& cNeigh = m_mTree.at(vEdges[i][c]) ;
if( cNeigh.m_vnPolyId.empty())
if ( cNeigh.m_vnPolyId.empty())
continue ;
PolyLine& plCell = vPolygons[cNeigh.m_vnPolyId[0]] ;
Point3d pt ; plCell.GetFirstPoint( pt) ;
Point3d pt3d ;
// a seconda del lato controllo di stare scorrendo il poligono prendendo solo i punti su quel lato
if ( i == 0) {
while ( ! AreSamePointXYApprox(pt, cNeigh.GetTopRight()) && plCell.GetNextPoint(pt) ) {
while ( ! AreSamePointXYApprox(pt, cNeigh.GetTopRight()) && plCell.GetNextPoint(pt)) {
continue ;
}
Point3d pt3d ; GetPoint( cNeigh.GetTopRight().x, cNeigh.GetTopRight().y, pt3d) ;
@@ -4090,13 +4088,13 @@ Tree::GetEdges3D( vector<ICRVCOMPOPOVECTOR>& mCCEdges, POLYLINEVECTOR& vPolygons
mCCEdges.emplace_back() ;
INTVECTOR vId ;
Point3d ptNear = m_mTree.at(-1).GetBottomLeft() ;
while( m_vCEdge2D[i].second.GetChainFromNear(ptNear, false, vId) ) {
while ( m_vCEdge2D[i].second.GetChainFromNear(ptNear, false, vId)) {
PtrOwner<ICurveComposite> pCC3D( CreateCurveComposite()) ;
int nInd = abs( vId[0]) - 1 ;
Point3d pt2D = m_vCEdge2D[i].first[nInd].first ;
Point3d pt3D ; GetPoint( pt2D.x, pt2D.y, pt3D) ;
pCC3D->AddPoint( pt3D) ;
for ( int j = 1 ; j < int( vId.size()) ; ++j) {
for ( int j = 1 ; j < ssize( vId) ; ++j) {
nInd = abs( vId[j]) - 1 ;
pt2D = m_vCEdge2D[i].first[nInd].second ;
GetPoint( pt2D.x, pt2D.y, pt3D) ;
@@ -4105,7 +4103,7 @@ Tree::GetEdges3D( vector<ICRVCOMPOPOVECTOR>& mCCEdges, POLYLINEVECTOR& vPolygons
if ( ! pCC3D->IsValid())
pCC3D->AddPoint( pt3D) ;
// qui devo fare dei controlli prima di aggiungere questa polyline?
mCCEdges[i].emplace_back( Release(pCC3D)) ;
mCCEdges[i].emplace_back( Release( pCC3D)) ;
}
}
}
@@ -4225,11 +4223,11 @@ Tree::AdjustCuts( void)
bool
Tree::CreateCellContour( POLYLINEMATRIX& vPolygons)
{
// questa funzione è pensata per essere chiamata dopo la AddCutsToRoot, per creare il poligono di un'unica cella a cui sono stati aggiunti dei tagli
// questa funzione è pensata per essere chiamata dopo la AddCutsToRoot, per creare il poligono di un'unica cella a cui sono stati aggiunti dei tagli
if ( m_mTree.size() > 1)
return false ;
int nRoot = -1 ;
// preparo tutto per poter chiamare la createCellPolygon
// preparo tutto per poter chiamare la createCellPolygon
m_vnLeaves.push_back( nRoot) ;
INTVECTOR vToCheck( m_mTree.at(nRoot).m_vInters.size()) ;
iota( vToCheck.begin(), vToCheck.end(), 0) ;
@@ -4254,7 +4252,7 @@ Tree::CreateCellContour( POLYLINEMATRIX& vPolygons)
pl3d.Close() ;
// ora posso creare il poligono della cella con i tagli
POLYLINEMATRIX vPolygons3d ;
while( ! vToCheck.empty()) {
while ( ! vToCheck.empty()) {
int nPolyBefore = nPoly ;
CreateCellPolygons( 0, vPolygons, vPolygons3d, vToCheck, nPoly, vnParentChunk, pl, pl3d) ;
// l'aggiunta di vPolygons3d forse è un problema in questo punto.
@@ -4264,4 +4262,4 @@ Tree::CreateCellContour( POLYLINEMATRIX& vPolygons)
break ;
}
return true ;
}
}