EgtExecutor 2.2h2 :

- adattamenti e modifiche per superfici di Bezier estese.
This commit is contained in:
Dario Sassi
2020-08-12 08:31:03 +00:00
parent 402349a113
commit d71d932772
7 changed files with 81 additions and 40 deletions
+14 -10
View File
@@ -1444,14 +1444,14 @@ ExeCreateSurfTmByVolZmap( int nParentId, int nZmapId, int nPart)
//-------------------------------------------------------------------------------
int
ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, const PNTVECTOR& vPnt, int nRefType)
ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV, const PNTVECTOR& vPnt, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// il numero dei punti deve essere pari al prodotto dei gradi + 1
int nDim = ( nDegU + 1) * ( nDegV + 1) ;
// il numero dei punti deve essere pari al prodotto dei gradi per gli span + 1
int nDim = ( nDegU * nSpanU + 1) * ( nDegV * nSpanV + 1) ;
bOk = bOk && ( vPnt.size() == nDim) ;
// recupero il riferimento di immersione della superficie
Frame3d frLoc ;
@@ -1460,7 +1460,7 @@ ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, const PNTVECTOR& vPnt,
PtrOwner<ISurfBezier> pSurfBez( CreateSurfBezier()) ;
bOk = bOk && ! IsNull( pSurfBez) ;
// inizializzo la superficie di Bezier
bOk = bOk && pSurfBez->Init( nDegU, nDegV, false) ;
bOk = bOk && pSurfBez->Init( nDegU, nDegV, nSpanU, nSpanV, false) ;
// setto i punti di controllo
for ( int i = 0 ; i < nDim && bOk ; ++ i) {
// eventuale trasformazione del punto nel riferimento locale
@@ -1482,7 +1482,9 @@ ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, const PNTVECTOR& vPnt,
}
string sLua = "EgtSurfBezier(" + IdToString( nParentId) + "," +
ToString( nDegU) + "," +
ToString( nDegV) + ",{" +
ToString( nDegV) + "," +
ToString( nSpanU) + "," +
ToString( nSpanV) + ",{" +
sPC + "}," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;
@@ -1494,14 +1496,14 @@ ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, const PNTVECTOR& vPnt,
//-------------------------------------------------------------------------------
int
ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, const PNTUVECTOR& vPntW, int nRefType)
ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV, const PNTUVECTOR& vPntW, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
nParentId = AdjustId( nParentId) ;
bool bOk = true ;
// il numero dei punti deve essere pari al prodotto dei gradi + 1
int nDim = ( nDegU + 1) * ( nDegV + 1) ;
// il numero dei punti deve essere pari al prodotto dei gradi per gli span + 1
int nDim = ( nDegU * nSpanU + 1) * ( nDegV * nSpanV + 1) ;
bOk = bOk && ( vPntW.size() == nDim) ;
// recupero il riferimento di immersione della superficie
Frame3d frLoc ;
@@ -1510,7 +1512,7 @@ ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, const PNTUVECT
PtrOwner<ISurfBezier> pSurfBez( CreateSurfBezier()) ;
bOk = bOk && ! IsNull( pSurfBez) ;
// inizializzo la superficie di Bezier
bOk = bOk && pSurfBez->Init( nDegU, nDegV, true) ;
bOk = bOk && pSurfBez->Init( nDegU, nDegV, nSpanU, nSpanV, true) ;
// setto i punti di controllo
for ( int i = 0 ; i < nDim && bOk ; ++ i) {
// eventuale trasformazione del punto nel riferimento locale
@@ -1532,7 +1534,9 @@ ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, const PNTUVECT
}
string sLua = "EgtSurfBezierRat(" + IdToString( nParentId) + "," +
ToString( nDegU) + "," +
ToString( nDegV) + ",{" +
ToString( nDegV) + "," +
ToString( nSpanU) + "," +
ToString( nSpanV) + ",{" +
sPC + "}," +
RefTypeToString( nRefType) + ")" +
" -- Id=" + ToString( nId) ;