diff --git a/EGkIntersLineSurfTm.h b/EGkIntersLineSurfTm.h index 1aa857a..0367fea 100644 --- a/EGkIntersLineSurfTm.h +++ b/EGkIntersLineSurfTm.h @@ -31,19 +31,20 @@ struct IntLinStmInfo { int nILTT ; //!< tipo di intersezione linea-triangolo double dU ; //!< distanza sulla linea double dU2 ; //!< seconda distanza sulla linea + int nStm ; //!< indice della superficie TriMesh di intersezione int nT ; //!< indice del triangolo della superficie trimesh double dCosDN ; //!< coseno dell'angolo tra la direzione della linea e la normale del triangolo Point3d ptI ; //!< punto di intersezione Point3d ptI2 ; //!< secondo punto di intersezione (termine di tratto sovrapposto) // costruttori - IntLinStmInfo( void) : nILTT( ILTT_NO), dU( 0), dU2( 0), nT( 0), dCosDN( 0), ptI(), ptI2() {} - IntLinStmInfo( int nIL, double dUU, int nTT, double dCos, const Point3d& ptP) - : nILTT( nIL), dU( dUU), dU2( 0), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2() {} - IntLinStmInfo( int nIL, double dUU, double dUU2, int nTT, double dCos, const Point3d& ptP, const Point3d& ptP2) - : nILTT( nIL), dU( dUU), dU2( dUU2), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2( ptP2) {} + IntLinStmInfo( void) : nILTT( ILTT_NO), dU( 0), dU2( 0), nStm( 0), nT( 0), dCosDN( 0), ptI(), ptI2() {} + IntLinStmInfo( int nIL, double dUU, int nSurfTm, int nTT, double dCos, const Point3d& ptP) + : nILTT( nIL), dU( dUU), dU2( 0), nStm( nSurfTm), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2() {} + IntLinStmInfo( int nIL, double dUU, double dUU2, int nSurfTm, int nTT, double dCos, const Point3d& ptP, const Point3d& ptP2) + : nILTT( nIL), dU( dUU), dU2( dUU2), nStm( nSurfTm), nT( nTT), dCosDN( dCos), ptI( ptP), ptI2( ptP2) {} } ; //! vettore di IntLinStmInfo -typedef std::vector ILSIVECTOR ; +typedef std::vector ILSIVECTOR ; //----------------------------------------------------------------------------- // Costanti tipo intersezione Linea SurfTriMesh dopo filtraggio @@ -63,13 +64,18 @@ class IntersParLinesSurfTm { public : EGK_EXPORT IntersParLinesSurfTm( const Frame3d& frLines, const ISurfTriMesh& Stm) ; + EGK_EXPORT IntersParLinesSurfTm( const Frame3d& frLines, const CISURFTMPVECTOR& vStm) ; EGK_EXPORT bool GetInters( const Point3d& ptL, double dLen, ILSIVECTOR& vInfo, bool bFinite = true) const ; + private : + int GetSurfInd( int nT) const ; + private : bool m_bOk ; - const Frame3d m_frLines ; - const ISurfTriMesh* m_pSTm ; - HashGrids2d m_HGrids ; + const Frame3d m_frLines ; // direzione della linea come versore Z + CISURFTMPVECTOR m_vpSTm ; // vettore delle superfici con cui calcolare le intersezioni con le linee + INTVECTOR m_vBaseInd ; // [0, nTriaStm0, nTriaStm0 + nTriaStm1, nTriaStm0 + nTriaStm1 + nTriaStm2, ...] + HashGrids2d m_HGrids ; // HasGrid di ottimizzazione per ricerca triangoli } ; //-----------------------------------------------------------------------------