EgtGeomKernel :

- piccole mdofiche poco più che estetiche.
This commit is contained in:
Dario Sassi
2025-01-20 08:30:39 +01:00
parent b5a2490fd4
commit b709776f5f
31 changed files with 131 additions and 130 deletions
+21 -20
View File
@@ -94,7 +94,7 @@ Tree::LimitLoop( PolyLine& pl, POLYLINEVECTOR& vPl, BOOLVECTOR& vbOrientation) c
for ( int i = 0 ; i < int( vCrvClass.size()) ; ++i) {
if ( vCrvClass[i].nClass != CRVC_OUT) {
// se continua la curva precedente allora la giunta
if ( vCC.size() != 0 && vCrvClass[i].dParS == vCrvClass[nLast].dParE)
if ( ! vCC.empty() && vCrvClass[i].dParS == vCrvClass[nLast].dParE)
vCC.back()->AddCurve( (*itCrv)->CopyParamRange( vCrvClass[i].dParS, vCrvClass[i].dParE)) ;
// sennò creo una nuova curva
else
@@ -1589,7 +1589,7 @@ Tree::GetPolygons( POLYLINEMATRIX& vvPolygons, POLYLINEMATRIX& vPolygonsBasic3d)
bool
Tree::GetPolygons( POLYLINEMATRIX& vvPolygons, bool bForTriangulation, POLYLINEMATRIX& vvPolygons3d)
{
if ( (int) m_vPolygons.size() == 0) {
if ( m_vPolygons.empty()) {
if ( ! m_bTrimmed) {
vvPolygons.clear() ;
POLYLINEVECTOR vPolygonsBasic ;
@@ -1673,17 +1673,17 @@ Tree::GetPolygons( POLYLINEMATRIX& vvPolygons, bool bForTriangulation, POLYLINEM
// vettore in cui salvo i loop che non appartengono al poligono che sto cotruendo nel ciclo attuale e da cui ripasserò dopo
INTVECTOR vToCheck( (int) m_mTree[nId].m_vInters.size()) ;
//generate_n( vToCheck.begin(), (int) m_mTree[nId].m_vInters.size(), generator()) ;
iota (vToCheck.begin(), vToCheck.end(), 0) ;
iota( vToCheck.begin(), vToCheck.end(), 0) ;
// numero di poligoni aggiunti
int nPoly = 0 ;
// scorro sui vettori intersezione della cella nId e sui suoi vertici
// in questo for analizzo solo i loop che tagliano la cella
while( (int)vToCheck.size() != 0) {
while ( ! vToCheck.empty()) {
int nPolyBefore = nPoly ;
PolyLine pl3d ;
if( bForTriangulation)
if ( bForTriangulation)
pl3d = vPolygonsBasic3d[i] ;
if( bForTriangulation)
if ( bForTriangulation)
CreateCellPolygons( i, vvPolygons, vvPolygons3d, vToCheck, nPoly, vnParentChunk, vPolygonsCorrected[i], pl3d) ;
else
CreateCellPolygons( i, vvPolygons, vvPolygons3d, vToCheck, nPoly, vnParentChunk, vPolygonsBasic[i], pl3d) ;
@@ -1691,7 +1691,7 @@ Tree::GetPolygons( POLYLINEMATRIX& vvPolygons, bool bForTriangulation, POLYLINEM
break ;
}
// ora analizzo anche i loop che sono contenuti nella cella
if( bForTriangulation)
if ( bForTriangulation)
CreateIslandAndHoles( i, vvPolygons, vvPolygons3d, nPoly, vnParentChunk, bForTriangulation, vPolygonsCorrected[i], vPolygonsBasic3d[i]) ;
else
CreateIslandAndHoles( i, vvPolygons, vvPolygons3d, nPoly, vnParentChunk, bForTriangulation, vPolygonsBasic[i], vPolygonsBasic3d[i]) ;
@@ -1772,7 +1772,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
vnVert.push_back( int(vVertices.size()) - 1) ;
GetBottomNeigh( nId, vNeigh) ;
// aggiungo i vertici che sono sul lato bottom, solo se ho più di un vicino bottom
if ( (int) vNeigh.size() != 0 && (int) vNeigh.size() != 1){
if ( vNeigh.size() > 1){
// se la superficie è chiusa lungo il parametro V e le celle vicine bottom sono sul lato Top
// devo aggiungere i vertici tenendo conto della periodicità dello spazio parametrico.
if ( m_bClosedV && m_mTree.at(vNeigh[0]).m_bOnTopEdge) {
@@ -1796,7 +1796,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
vNeigh.clear() ;
GetRightNeigh ( nId, vNeigh) ;
// aggiungo i vertici che sono sul lato right, solo se ho più di un vicino right
if ( (int) vNeigh.size() != 0 && (int) vNeigh.size() != 1){
if ( vNeigh.size() > 1){
// se la superficie è chiusa lungo il parametro U e le celle vicine right sono sul lato Left
// devo aggiungere i vertici tenendo conto della periodicità dello spazio parametrico.
vnVert.push_back( int(vVertices.size())) ;
@@ -1855,7 +1855,7 @@ Tree::GetPolygonsBasic( POLYLINEVECTOR& vPolygonsBasic, POLYLINEVECTOR& vPolygon
GetLeftNeigh ( nId, vNeigh) ;
std::reverse( vNeigh.begin(), vNeigh.end()) ;
// aggiungo i vertici che sono sul lato left, solo se ho più di un vicino left
if ( (int) vNeigh.size() != 0 && (int) vNeigh.size() != 1) {
if ( vNeigh.size() > 1) {
// se la superficie è chiusa lungo il parametro U e la cella è sul lato left
// devo aggiungere i vertici tenendo conto della periodicità dello spazio parametrico.
vnVert.push_back( int(vVertices.size())) ;
@@ -2182,7 +2182,7 @@ Tree::FindCell( const Point3d& ptToAssign, const CurveLine& cl, INTVECTOR vCells
}
}
// se non ho trovato nulla vuol dire che sono su un vertice o su un lato
if ( (int)nCells.size() == 0 && ! bRecurs) {
if ( nCells.empty() && ! bRecurs) {
int nEdge = -1 ;
for ( int nCell : vCells) {
OnWhichEdge( nCell,ptToAssign, nEdge) ;
@@ -2335,7 +2335,7 @@ Tree::TraceLoopLabelCell( const POLYLINEVECTOR& vplPolygons)
// qui devo mettere una tolleranza negativa per poter tener conto anche dei punti che sono SULLA curva
while ( ! IsPointInsidePolyLine( ptCurr, vplPolygons[nIdPolygon], dLinTol)) {
// sto uscendo dalla cella, quindi cerco l'intersezione
if ( bEraseNextPoint && vptInters.size() != 0) {
if ( bEraseNextPoint && ! vptInters.empty()) {
vptInters.pop_back() ;
bEraseNextPoint = false ;
}
@@ -2345,7 +2345,7 @@ Tree::TraceLoopLabelCell( const POLYLINEVECTOR& vplPolygons)
// al precedente FindInters avrei dovuto passare di cella
if ( ! FindInters( nId, clTrim, vplPolygons[nIdPolygon], vptInters, true)) {
// scarterò il punto molto vicino al lato e tengo solo l'intersezione del trim col lato
if( vptInters.size() != 0)
if ( ! vptInters.empty())
vptInters.pop_back() ;
plLoop.GetPrevPoint( ptTEnd) ;
plLoop.GetPrevPoint( ptTStart) ;
@@ -2646,7 +2646,7 @@ Tree::FindInters( int& nId, const CurveLine& clTrim, const PolyLine& plPolygon,
else if ( nEdge == 7)
ptInters = ptTR ;
// aggiungo il nuovo punto al vettore delle intersezioni
if ( (int)vptInters.size() == 0 || ! AreSamePointXYEpsilon( ptInters , vptInters.back(), 10 * EPS_SMALL))
if ( vptInters.empty() || ! AreSamePointXYEpsilon( ptInters , vptInters.back(), 10 * EPS_SMALL))
vptInters.push_back( ptInters) ;
else {
// se l'ultimo punto del vettore delle intersezioni è quasi uguale al punto che devo aggiungere allora lo sostituisco con quest'ultimo
@@ -4122,7 +4122,7 @@ Tree::CheckIfBetween( const Inters& inA, const Inters& inB) const
else if ( nEdgeIn == 7)
nEdgeIn = 0 ;
// creo la sequenza di Edges da scorrere per trovare i possibili validNextStart
while ( ! AreSameEdge( nEdge, nEdgeIn) || (int) vEdges.size() == 0) {
while ( ! AreSameEdge( nEdge, nEdgeIn) || vEdges.empty()) {
vEdges.push_back( nEdge) ;
if ( nEdge == 3)
nEdge = 0 ;
@@ -4524,11 +4524,12 @@ Tree::CreateCellContour( POLYLINEMATRIX& vPolygons)
pl3d.Close() ;
// ora posso creare il poligono della cella con i tagli
POLYLINEMATRIX vPolygons3d ;
while( (int)vToCheck.size() != 0) {
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.
// sarà da valutare quando si aggiungerà la funzione per aggiungere tagli aperti
// e se si vuole usare la funzione su uno spazio 2D ideale non collegato ad una sup di Bezier
CreateCellPolygons( 0, vPolygons, vPolygons3d, vToCheck, nPoly, vnParentChunk, pl, pl3d) ;
// l'aggiunta di vPolygons3d forse è un problema in questo punto.
// sarà da valutare quando si aggiungerà la funzione per aggiungere tagli aperti
// e se si vuole usare la funzione su uno spazio 2D ideale non collegato ad una sup di Bezier
if ( nPolyBefore == nPoly)
break ;
}
@@ -4674,7 +4675,7 @@ Tree::CloseOpenCuts( void)
//// A MANO
//// chiudo le curve aperte e se necessario le giunto tra loro
//if ( vInters.size() != 0) {
//if ( ! vInters.empty()) {
// ICurveComposite* pCCOpen ( CreateBasicCurveComposite()) ;
// pCCOpen->FromPolyLine( get<0>(m_vPlApprox[vInters[0].first])) ;
// //sort( vInters.begin(), vInters.end()) ;