EgtGeomKernel :
- pulizia del codice Problemi : - bug dovuto a problemi numerici sulle intersezione tra trim e celle
This commit is contained in:
@@ -68,19 +68,19 @@ class Cell
|
||||
public :
|
||||
~Cell( void) ;
|
||||
Cell( void) ;
|
||||
Cell( Point3d& ptBL, Point3d& ptTR) ;
|
||||
Cell( const Point3d& ptBL, const Point3d& ptTR) ;
|
||||
inline bool IsSame( const Cell& cOtherCell) const ;
|
||||
void SetBottomLeft( Point3d ptBL) { m_ptPbl = ptBL ; }
|
||||
void SetTopRight( Point3d ptTR) { m_ptPtr = ptTR ; }
|
||||
void SetSplitDirVert( bool bVert) { m_bSplitVert = bVert ; }
|
||||
void SetParent( int nParent) { m_nParent = nParent ; }
|
||||
void SetBottomLeft( const Point3d ptBL) { m_ptPbl = ptBL ; }
|
||||
void SetTopRight( const Point3d ptTR) { m_ptPtr = ptTR ; }
|
||||
void SetSplitDirVert( const bool bVert) { m_bSplitVert = bVert ; }
|
||||
void SetParent( const int& nParent) { m_nParent = nParent ; }
|
||||
Point3d GetBottomLeft( void) const { return m_ptPbl ; }
|
||||
Point3d GetTopRight( void) const { return m_ptPtr ; }
|
||||
double GetSplitValue( void) const { return m_dSplit ; }
|
||||
bool IsSplitVert( void) const { return m_bSplitVert ; } // se true la cella verrebbe splittata verticalmente, sennò orizzontalmente
|
||||
bool IsLeaf( void) const ; // flag che indica se la cella ha figli o se è una foglia
|
||||
bool IsProcessed( void) const { return m_bProcessed ; } // flag che indica se tutti i figli della cella, se ce ne sono, sono stati processati
|
||||
void SetProcessed( bool bProcessed = true) { m_bProcessed = bProcessed ; }
|
||||
void SetProcessed( const bool bProcessed = true) { m_bProcessed = bProcessed ; }
|
||||
static bool minorX ( const Cell& c1, const Cell& c2) { return c1.m_ptPbl.x < c2.m_ptPbl.x ; }
|
||||
static bool minorY ( const Cell& c1, const Cell& c2) { return c1.m_ptPbl.y < c2.m_ptPbl.y ; }
|
||||
|
||||
@@ -99,7 +99,6 @@ class Cell
|
||||
// 0 esterna, 1 intersecata, 2 contiene un loop, 3 intersecata e contenente un loop, 4 contenuta in un loop
|
||||
int m_nFlag2 ; // falg che indica se la cella è stata attraversata durante l'ultima fase del labelling
|
||||
int m_nRightEdgeIn ; // 0 right edge fuori, 1 right edge dentro, 2 metà e metà
|
||||
//INTVECTOR m_vnLoop ; // indice dei loop contenuti nella cella
|
||||
std::vector<Inters> m_vInters ; // vettore delle intersezioni della cella con i loop di trim
|
||||
// ogni elemento del vettore è l'insieme dei punti che caratterizza un atrtaversamento della cella
|
||||
|
||||
@@ -116,47 +115,46 @@ class Tree
|
||||
public :
|
||||
~Tree( void) ;
|
||||
Tree( void) ;
|
||||
Tree ( const SurfBezier* pSrfBz, bool bSplitPatches = true) ;
|
||||
void SetSurf( const SurfBezier* pSrfBz, bool bSplitPatches = true) ;
|
||||
bool BuildTree( double dLinTol = LIN_TOL_STD, double dSideMin = 5, double dSideMax = INFINITO) ; // dSideMax è il massimo per la dimensione maggiore di un triangolo della trimesh
|
||||
Tree ( const SurfBezier* pSrfBz, const bool bSplitPatches = true) ;
|
||||
void SetSurf( const SurfBezier* pSrfBz, const bool bSplitPatches = true) ;
|
||||
bool BuildTree( const double dLinTol = LIN_TOL_STD, const double dSideMin = 5, const double dSideMax = INFINITO) ; // dSideMax è il massimo per la dimensione maggiore di un triangolo della trimesh
|
||||
// dSideMin è lunghezza minima del lato di una cella nello spazio reale
|
||||
bool BuildTree_test( double dLinTol = LIN_TOL_STD, double dSideMin = 5, double dSideMax = INFINITO) ;
|
||||
bool BuildTree_test( const double dLinTol = LIN_TOL_STD, const double dSideMin = 5, const double dSideMax = INFINITO) ;
|
||||
bool GetPolygons( std::vector<POLYLINEVECTOR>& vPolygons) ;
|
||||
bool GetPolygonsBasic( POLYLINEVECTOR& vPolygons) ; // restituisce il poligono corrispondente ad ogni cella foglia dell'albero
|
||||
// ad ogni poligono sono stati aggiunti tutti i vertici dei vicini posizionati sui suoi lati
|
||||
bool GetLeaves ( std::vector<Cell>& vLeaves) const ;
|
||||
|
||||
private :
|
||||
void Split( int nId, double dSplitValue) ; // funzione di split di una cella al parametro indicato nella direzione data da bVert
|
||||
void Split( int nId) ; // funzione di split di una cella dell'albero a metà nella direzione data da bVert
|
||||
void Split( const int& nId, const double& dSplitValue) ; // funzione di split di una cella al parametro indicato nella direzione data da bVert
|
||||
void Split( const int& nId) ; // funzione di split di una cella dell'albero a metà nella direzione data da bVert
|
||||
void Balance () ; // creo rami in modo che tutte tutte le foglie abbiano come adiacenti foglie ad una profonditù di +- 1
|
||||
int GetHeightLeaves ( int nId, INTVECTOR& vnLeaves, int d = 0) const ; // altezza del subtree a partire dal nodo nId
|
||||
int GetDepth ( int nId, int nRef) const ; // livello del nodo nId
|
||||
void GetTopNeigh( int nId, INTVECTOR& vTopNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato top
|
||||
void GetBottomNeigh( int nId, INTVECTOR& vBottomNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato bottom
|
||||
void GetLeftNeigh( int nId, INTVECTOR& vLeftNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato left
|
||||
void GetRightNeigh( int nId, INTVECTOR& vRightNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato right
|
||||
void GetRootNeigh( int nEdge, INTVECTOR& vNeigh) ; // restituisce le foglie dell'albero che sono adiacenti al lato nEdge, numerato a partire dal top ( 0) in senso antiorario
|
||||
int GetHeightLeaves ( const int& nId, INTVECTOR& vnLeaves, int d = 0) const ; // altezza del subtree a partire dal nodo nId
|
||||
int GetDepth ( const int& nId, const int& nRef) const ; // livello del nodo nId
|
||||
void GetTopNeigh( const int& nId, INTVECTOR& vTopNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato top
|
||||
void GetBottomNeigh( const int& nId, INTVECTOR& vBottomNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato bottom
|
||||
void GetLeftNeigh( const int& nId, INTVECTOR& vLeftNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato left
|
||||
void GetRightNeigh( const int& nId, INTVECTOR& vRightNeighs) const ; // restituisce le celle foglie che sono adiacenti al lato right
|
||||
void GetRootNeigh( const int& nEdge, INTVECTOR& vNeigh) ; // restituisce le foglie dell'albero che sono adiacenti al lato nEdge, numerato a partire dal top ( 0) in senso antiorario
|
||||
void ResetTree ( void) ; // resetto m_bProcessed a false per tutti i nodi dell'albero
|
||||
INTVECTOR FindCell ( const Point3d& ptToAssign, CurveLine& cl) const ; // dato un punto, trova la cella foglia a cui appartiene
|
||||
INTVECTOR FindCell ( const Point3d& ptToAssign, CurveLine& cl, INTVECTOR vCells) const ; // dato un punto, trova la cella foglia a cui appartiene
|
||||
INTVECTOR FindCell ( const Point3d& ptToAssign, const CurveLine& cl) const ; // dato un punto, trova la cella foglia a cui appartiene
|
||||
INTVECTOR FindCell ( const Point3d& ptToAssign, const CurveLine& cl, INTVECTOR vCells) const ; // dato un punto, trova la cella foglia a cui appartiene
|
||||
bool TraceLoopLabelCell( void) ; // tracing dei loop e labelling delle celle
|
||||
bool FindInters( int& nId, CurveLine& clTrim, PNTVECTOR& vptInters, bool bFirstInters = true) ; // trova le intersezioni tra una cella e una linea di trim
|
||||
bool FindInters( int& nId, const CurveLine& clTrim, PNTVECTOR& vptInters, bool bFirstInters = true) ; // trova le intersezioni tra una cella e una linea di trim
|
||||
// resituisce l'id della cella verso cui la curva di trim esce e il vettore delle intersezioni per la cella successiva con il primo punto
|
||||
bool CreateCellPolygons ( int nLeafId, std::vector<POLYLINEVECTOR>& vPolygons, INTVECTOR& vToCheck, int& nPoly, INTVECTOR& vnParentChunk, PolyLine plCell) ;
|
||||
bool CreateIslandAndHoles ( int nLeafId, std::vector<POLYLINEVECTOR>& vPolygons, int& nPoly, INTVECTOR& vnParentChunk) ;
|
||||
bool CheckIfBefore( PolyLine& pl, int nEdge) const ;
|
||||
bool CheckIfBefore( Inters& inA) const ;
|
||||
bool CheckIfBefore( int& nEdge1, Point3d& ptP1, int& nEdge2, Point3d& ptP2) const ;
|
||||
bool CheckIfBefore( int& nEdge, Point3d& ptP1, Point3d& ptP2) const ;
|
||||
bool CheckIfAfter( PolyLine& pl, Point3d& ptNextStart, int nEdge) const ;
|
||||
bool AreSameEdge( int nEdge1, int nEdge2) const ;
|
||||
bool AddVertex( int nId, std::vector<PNTVECTOR>& vEdgeVertex, PolyLine& plTrimmedPoly, int& c, Point3d& ptToAdd) const ;
|
||||
bool CreateCellPolygons ( const int& nLeafId, std::vector<POLYLINEVECTOR>& vPolygons, INTVECTOR& vToCheck, int& nPoly, INTVECTOR& vnParentChunk, const PolyLine& plCell) ;
|
||||
bool CreateIslandAndHoles ( const int& nLeafId, std::vector<POLYLINEVECTOR>& vPolygons, int& nPoly, INTVECTOR& vnParentChunk) ;
|
||||
bool CheckIfBefore( const PolyLine& pl, const int& nEdge) const ;
|
||||
bool CheckIfBefore( const Inters& inA) const ;
|
||||
bool CheckIfBefore( const int& nEdge1, const Point3d& ptP1, const int& nEdge2, const Point3d& ptP2) const ;
|
||||
bool CheckIfBefore( const int& nEdge, const Point3d& ptP1, const Point3d& ptP2) const ;
|
||||
bool AreSameEdge( const int& nEdge1, const int nEdge2) const ;
|
||||
bool AddVertex( const int& nId, const std::vector<PNTVECTOR>& vEdgeVertex, PolyLine& plTrimmedPoly, int& c, const Point3d& ptToAdd) const ;
|
||||
//bool SetRightEdgeIn( int nId, std::vector<PNTVECTOR>& vEdgeVertex, PolyLine& plTrimmedPoly) ;
|
||||
bool SetRightEdgeIn( int nId) ;
|
||||
bool CategorizeCell( int& nId) ;
|
||||
bool CheckIfBetween( Inters& inA, Inters& inB) const ;
|
||||
bool OnWhichEdge( int nId, Point3d& ptToAssign, int& nEdge) const ;
|
||||
bool SetRightEdgeIn( const int& nId) ;
|
||||
bool CategorizeCell( const int& nId) ;
|
||||
bool CheckIfBetween( const Inters& inA, const Inters& inB) const ;
|
||||
bool OnWhichEdge( const int& nId, const Point3d& ptToAssign, int& nEdge) const ;
|
||||
|
||||
private :
|
||||
const SurfBezier* m_pSrfBz ; // superficie di bezier
|
||||
@@ -164,7 +162,6 @@ private :
|
||||
bool m_bTrimmed ; // superficie trimmata
|
||||
std::vector<INTVECTOR> m_vChunk ; // elenco dei loop divisi per chunk
|
||||
std::map<int,int> m_mChunk ;
|
||||
//std::vector<ICurve*> m_vLoop ;
|
||||
ICURVEPOVECTOR m_vLoop ; // curve di loop. la 0 è il bordo dello spazio parametrico, le altre sono i loop interni
|
||||
bool m_bBilinear ; // superficie bilineare
|
||||
bool m_bMulti ; // superficie multi-patch
|
||||
@@ -174,8 +171,7 @@ private :
|
||||
int m_nDegV ; // grado della superficie nel parametro V
|
||||
int m_nSpanU ;
|
||||
int m_nSpanV ;
|
||||
std::vector<POLYLINEVECTOR> m_vPolygons ; // vettore dei poligoni del tree
|
||||
//std::map<int,PolyLine> m_mPolygons ; // mappa dei poligoni
|
||||
std::vector<POLYLINEVECTOR> m_vPolygons ; // vettore dei poligoni del tree
|
||||
std::map<int,Cell> m_mTree ; // mappa che contiene tutti i nodi e le foglie dell'albero. -2 è puntatore Null e -1 è root
|
||||
std::map<int,PNTVECTOR> m_mVert ; // mappa che contiene tutti i vertici 3d delle celle del tree. L'Id è lo stesso che la cella ha in m_mTree
|
||||
INTVECTOR m_vnLeaves ; // vettore delle foglie
|
||||
|
||||
Reference in New Issue
Block a user