EgtGraphics 2.4h1 :

- in curve composite aggiunti punti intermedi su giunzioni interne tra componenti elementari.
This commit is contained in:
DarioS
2022-08-21 19:26:34 +02:00
parent 68434fba6f
commit 5e317faba6
9 changed files with 101 additions and 4 deletions
+26 -4
View File
@@ -43,7 +43,8 @@ using namespace std ;
static ObjEGrGraphics* CreateObjEGrGraphics( int nCount, bool bNewWay) ;
static bool CalcCurveTailMark( const Vector3d& vtRef, const PolyLine& plCrv, PolyLine& plMark) ;
static bool CalcCurveTipArrow( const Vector3d& vtRef, const PolyLine& plCrv, PolyLine& plArr) ;
static bool CalcConnectingLines( const PolyLine& plCrv, const Vector3d& vtTh, bool bDense, PNTVECTOR& vPnt) ;
static bool CalcCurveConnectingLines( const PolyLine& plCrv, const Vector3d& vtTh, bool bDense, PNTVECTOR& vPnt) ;
static bool CalcCurveJoints( const ICurve* pCurve, PNTVECTOR& vPnt) ;
//----------------------------------------------------------------------------
bool
@@ -331,6 +332,9 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
PolyLine PLA ;
if ( CalcCurveTipArrow( vtRef, PL, PLA))
pGraphics->AddPolyLine( PLA, true) ;
PNTVECTOR vPnt ;
if ( CalcCurveJoints( pCurve, vPnt))
pGraphics->AddPoints( vPnt, true) ;
// eventuale spessore
double dTh ;
Vector3d vtExtr ;
@@ -339,7 +343,7 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
// segmenti di raccordo
PNTVECTOR vPnt ;
bool bDense = ( nGeoType == CRV_ARC || nGeoType == CRV_BEZIER) ;
if ( CalcConnectingLines( PL, dTh * vtExtr, bDense, vPnt))
if ( CalcCurveConnectingLines( PL, dTh * vtExtr, bDense, vPnt))
pGraphics->AddLines( vPnt) ;
// percorso traslato
PL.Translate( dTh * vtExtr) ;
@@ -966,7 +970,7 @@ CalcCurveTipArrow( const Vector3d& vtRef, const PolyLine& plCrv, PolyLine& plArr
//----------------------------------------------------------------------------
static bool
CalcConnectingLines( const PolyLine& plCrv, const Vector3d& vtTh, bool bDense, PNTVECTOR& vPnt)
CalcCurveConnectingLines( const PolyLine& plCrv, const Vector3d& vtTh, bool bDense, PNTVECTOR& vPnt)
{
// assegno coefficiente
double dDelta = ( bDense ? 0.25 : 1) ;
@@ -984,4 +988,22 @@ CalcConnectingLines( const PolyLine& plCrv, const Vector3d& vtTh, bool bDense, P
}
}
return true ;
}
}
//----------------------------------------------------------------------------
static bool
CalcCurveJoints( const ICurve* pCurve, PNTVECTOR& vPnt)
{
// pulisco il vettore dei punti
vPnt.clear() ;
// recupero il dominio della curva
double dParS = 0, dParE = 1 ;
pCurve->GetDomain( dParS, dParE) ;
// recupero i punti intermedi
for ( double dPar = dParS + 1 ; dPar < dParE - EPS_PARAM ; dPar += 1) {
Point3d ptP ;
if ( pCurve->GetPointD1D2( dPar, ICurve::FROM_MINUS, ptP))
vPnt.push_back( ptP) ;
}
return true ;
}