EgtGeomKernel 2.4c2 :

- aggiunto a CurveComposite metodo AddLineTg.
This commit is contained in:
DarioS
2022-03-24 10:50:38 +01:00
parent b11de227f3
commit b107596f84
3 changed files with 38 additions and 2 deletions
+34
View File
@@ -1626,6 +1626,40 @@ CurveComposite::AddPoint( const Point3d& ptStart)
return true ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::AddLineTg( double dLen, bool bEndOrStart)
{
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// costruisco la linea
PtrOwner<CurveLine> pLine( CreateBasicCurveLine()) ;
if ( IsNull( pLine))
return false ;
// se da aggiungere alla fine
if ( bEndOrStart) {
Point3d ptEnd ;
Vector3d vtEnd ;
if ( ! GetEndPoint( ptEnd) || ! GetEndDir( vtEnd))
return false ;
Point3d ptNew = ptEnd + vtEnd * dLen ;
if ( ! pLine->Set( ptEnd, ptNew))
return false ;
}
// altrimenti da aggiungere all'inizio
else {
Point3d ptStart ;
Vector3d vtStart ;
if ( ! GetStartPoint( ptStart) || ! GetStartDir( vtStart))
return false ;
Point3d ptNew = ptStart - vtStart * dLen ;
if ( ! pLine->Set( ptNew, ptStart))
return false ;
}
return AddCurve( Release( pLine), bEndOrStart) ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::AddLine( const Point3d& ptNew, bool bEndOrStart)
+4 -2
View File
@@ -1,12 +1,13 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2022
//----------------------------------------------------------------------------
// File : CurveComposite.h Data : 23.01.22 Versione : 2.4a4
// File : CurveComposite.h Data : 24.03.22 Versione : 2.4c2
// Contenuto : Dichiarazione della classe Curva composita.
//
//
//
// Modifiche : 16.04.13 DS Creazione modulo.
// 24.03.22 DS Aggiunto metodo AddLineTg.
//
//
//----------------------------------------------------------------------------
@@ -144,8 +145,9 @@ class CurveComposite : public ICurveComposite, public IGeoObjRW
bool ChangeStartPoint( double dU) override ;
bool AddPoint( const Point3d& ptStart) override ;
bool AddLine( const Point3d& ptNew, bool bEndOrStart = true) override ;
bool AddArcTg( const Point3d& ptNew, bool bEndOrStart = true) override ;
bool AddLineTg( double dLen, bool bEndOrStart = true) override ;
bool AddArc2P( const Point3d& ptOther, const Point3d& ptNew, bool bEndOrStart = true) override ;
bool AddArcTg( const Point3d& ptNew, bool bEndOrStart = true) override ;
bool AddJoint( double dU) override ;
bool ModifyJoint( int nU, const Point3d& ptNewJoint) override ;
bool RemoveJoint( int nU) override ;
BIN
View File
Binary file not shown.