EgtGeomKernel :
- aggiunta dell'uniformazione delle curve in preparazione ad una superficie skinned.
This commit is contained in:
+23
-24
@@ -47,6 +47,7 @@ using namespace std ;
|
||||
GEOOBJ_REGISTER( SRF_BEZIER, NGE_S_BEZ, SurfBezier) ;
|
||||
|
||||
static bool ChangeStartForClosed( PolyLine& plU0, PolyLine& plU1, ICurveComposite* pCrvU0, ICurveComposite* pCrvU1) ;
|
||||
static bool ParametrizeByLen( const ICurveComposite* pCurve, DBLVECTOR& vParam) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
SurfBezier::SurfBezier( void)
|
||||
@@ -4529,32 +4530,29 @@ SurfBezier::FindMatchByParam( const PolyLine& pl0, const PolyLine& pl1, INTVECTO
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SurfBezier::ParametrizeByLen( const ICurveComposite* pCurve0, const ICurveComposite* pCurve1, DBLVECTOR& vParam0, DBLVECTOR& vParam1) const
|
||||
static bool
|
||||
ParametrizeByLen( const ICurveComposite* pCurve, DBLVECTOR& vParam)
|
||||
{
|
||||
int nSpanU0 = pCurve0->GetCurveCount() ;
|
||||
int nSpanU1 = pCurve1->GetCurveCount() ;
|
||||
DBLVECTOR vLen0 ;
|
||||
DBLVECTOR vLen1 ;
|
||||
double dLenTot0 = 0 ;
|
||||
double dLenTot1 = 0 ;
|
||||
for( int i = 0 ; i < nSpanU0 ; ++i) {
|
||||
const ICurve* pSubCrv0 = pCurve0->GetCurve( i) ;
|
||||
double dLen ; pSubCrv0->GetLength( dLen) ;
|
||||
dLenTot0 += dLen ;
|
||||
vLen0.push_back( dLen) ;
|
||||
}
|
||||
for( int i = 0 ; i < nSpanU1 ; ++i) {
|
||||
const ICurve* pSubCrv1 = pCurve1->GetCurve( i) ;
|
||||
double dLen ; pSubCrv1->GetLength( dLen) ;
|
||||
dLenTot1 += dLen ;
|
||||
vLen1.push_back( dLen) ;
|
||||
int nSpanU = pCurve->GetCurveCount() ;
|
||||
DBLVECTOR vLen ;
|
||||
double dLenTot = 0 ;
|
||||
for( int i = 0 ; i < nSpanU ; ++i) {
|
||||
const ICurve* pSubCrv = pCurve->GetCurve( i) ;
|
||||
double dLen ; pSubCrv->GetLength( dLen) ;
|
||||
dLenTot += dLen ;
|
||||
vLen.push_back( dLen) ;
|
||||
}
|
||||
// determino il parametro di ogni curva rispetto alla lunghezza totale
|
||||
for ( int i = 0 ; i < nSpanU0 ; ++i)
|
||||
vParam0.push_back( vLen0[i] / dLenTot0) ;
|
||||
for ( int i = 0 ; i < nSpanU1 ; ++i)
|
||||
vParam1.push_back( vLen1[i] / dLenTot1) ;
|
||||
for ( int i = 0 ; i < nSpanU ; ++i)
|
||||
vParam.push_back( vLen[i] / dLenTot) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static bool
|
||||
FindCommonParametrization( const DBLMATRIX& mParam, DBLVECTOR& vCommonParam)
|
||||
{
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -4587,7 +4585,8 @@ SurfBezier::ParametrizeByLen( const ICurveComposite* pCurve0, const ICurveCompos
|
||||
// return true ;
|
||||
//}
|
||||
|
||||
static bool ChangeStartForClosed( PolyLine& plU0, PolyLine& plU1, ICurveComposite* pCrvU0, ICurveComposite* pCrvU1) {
|
||||
static bool
|
||||
ChangeStartForClosed( PolyLine& plU0, PolyLine& plU1, ICurveComposite* pCrvU0, ICurveComposite* pCrvU1) {
|
||||
// se sono chiuse devo controllare che gli start siano il più allineati possibile, se non lo sono cambio gli start
|
||||
if ( plU0.IsClosed() && plU1.IsClosed()) {
|
||||
vector<tuple<double,int,Point3d,int,Point3d>> vDistVert ;
|
||||
|
||||
@@ -203,7 +203,6 @@ class SurfBezier : public ISurfBezier, public IGeoObjRW
|
||||
// funzione che calcola se gli edge sono collassati in poli
|
||||
bool CalcPoles( void) const ;
|
||||
bool FindMatchByParam( const PolyLine& pl0, const PolyLine& pl1, INTVECTOR& vMatch, int& nLong) const ;
|
||||
bool ParametrizeByLen( const ICurveComposite* pCurve0, const ICurveComposite* pCurve1, DBLVECTOR& vParam0, DBLVECTOR& vParam1) const ;
|
||||
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
|
||||
Reference in New Issue
Block a user