From 4a05f5f718c0e951f62d3c3470736c417cfd65cb Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 11 Apr 2018 05:56:42 +0000 Subject: [PATCH] =?UTF-8?q?EgtGeomKernel=201.9d2=20:=20-=20aggiunta=20a=20?= =?UTF-8?q?CurveComposite=20la=20possibilit=C3=A0=20di=20definire=20punto?= =?UTF-8?q?=20iniziale=20per=20poi=20usare=20AddLine=20e=20AddArc=20-=20ri?= =?UTF-8?q?nominato=20POCRVVECTOR=20in=20ICURVEPOVECTOR=20per=20uniformit?= =?UTF-8?q?=C3=A0=20di=20nomenclatura.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CurveComposite.cpp | 40 +++++++++++++++++++++++++++++----------- CurveComposite.h | 2 ++ EgtGeomKernel.rc | Bin 11710 -> 11710 bytes OffsetCurve.cpp | 2 +- VolZmap.h | 2 +- VolZmapCalculus.cpp | 2 +- VolZmapCreation.cpp | 2 +- 7 files changed, 35 insertions(+), 15 deletions(-) diff --git a/CurveComposite.cpp b/CurveComposite.cpp index f508a3c..ff9a436 100644 --- a/CurveComposite.cpp +++ b/CurveComposite.cpp @@ -40,7 +40,7 @@ GEOOBJ_REGISTER( CRV_COMPO, NGE_C_CMP, CurveComposite) ; //---------------------------------------------------------------------------- CurveComposite::CurveComposite( void) - : m_nStatus( TO_VERIFY), m_VtExtr(), m_dThick(), m_nTempProp(), m_Iter( m_CrvSmplS.end()) + : m_nStatus( TO_VERIFY), m_VtExtr(), m_dThick(), m_ptStart(), m_nTempProp(), m_Iter( m_CrvSmplS.end()) { } @@ -62,6 +62,7 @@ CurveComposite::Clear( void) m_nStatus = TO_VERIFY ; m_VtExtr = V_NULL ; m_dThick = 0 ; + m_ptStart = ORIG ; m_nTempProp = 0 ; m_Iter = m_CrvSmplS.end() ; @@ -1557,12 +1558,25 @@ CurveComposite::ModifyEnd( const Point3d& ptNewEnd) return true ; } +//---------------------------------------------------------------------------- +bool +CurveComposite::AddPoint( const Point3d& ptStart) +{ + // verifico lo stato + if ( m_nStatus != TO_VERIFY) + return false ; + // assegno il punto + m_ptStart = ptStart ; + + return true ; +} + //---------------------------------------------------------------------------- bool CurveComposite::AddLine( const Point3d& ptNew, bool bEndOrStart) { // verifico lo stato - if ( m_nStatus != OK) + if ( m_nStatus != OK && m_nStatus != TO_VERIFY) return false ; // costruisco la linea PtrOwner pLine( CreateBasicCurveLine()) ; @@ -1570,15 +1584,17 @@ CurveComposite::AddLine( const Point3d& ptNew, bool bEndOrStart) return false ; // se da aggiungere alla fine if ( bEndOrStart) { - Point3d ptEnd ; - GetEndPoint( ptEnd) ; + Point3d ptEnd = m_ptStart ; + if ( m_nStatus == OK) + GetEndPoint( ptEnd) ; if ( ! pLine->Set( ptEnd, ptNew)) return false ; } // altrimenti da aggiungere all'inizio else { - Point3d ptStart ; - GetStartPoint( ptStart) ; + Point3d ptStart = m_ptStart ; + if ( m_nStatus == OK) + GetStartPoint( ptStart) ; if ( ! pLine->Set( ptNew, ptStart)) return false ; } @@ -1625,22 +1641,24 @@ bool CurveComposite::AddArc2P( const Point3d& ptOther, const Point3d& ptNew, bool bEndOrStart) { // verifico lo stato - if ( m_nStatus != OK) + if ( m_nStatus != OK && m_nStatus != TO_VERIFY) return false ; // costruisco l'arco (in casi articolari può essere una linea) PtrOwner pCrv ; // se da aggiungere alla fine if ( bEndOrStart) { - Point3d ptEnd ; - GetEndPoint( ptEnd) ; + Point3d ptEnd = m_ptStart ; + if ( m_nStatus == OK) + GetEndPoint( ptEnd) ; pCrv.Set( GetArc3P( ptEnd, ptOther, ptNew, false)) ; if ( IsNull( pCrv)) return false ; } // altrimenti da aggiungere all'inizio else { - Point3d ptStart ; - GetStartPoint( ptStart) ; + Point3d ptStart = m_ptStart ; + if ( m_nStatus == OK) + GetStartPoint( ptStart) ; pCrv.Set( GetArc3P( ptNew, ptOther, ptStart, false)) ; if ( IsNull( pCrv)) return false ; diff --git a/CurveComposite.h b/CurveComposite.h index a9a27b8..2fc7d95 100644 --- a/CurveComposite.h +++ b/CurveComposite.h @@ -141,6 +141,7 @@ class CurveComposite : public ICurveComposite, public IGeoObjRW bool IsParamAtJoint( double dU) const override ; ICurve* RemoveFirstOrLastCurve( bool bLast = true) override ; 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 AddArc2P( const Point3d& ptOther, const Point3d& ptNew, bool bEndOrStart = true) override ; @@ -193,6 +194,7 @@ class CurveComposite : public ICurveComposite, public IGeoObjRW PCRVSMPL_DEQUE m_CrvSmplS ; // deque di curve semplici Vector3d m_VtExtr ; // vettore estrusione (normalmente coincide con m_VtN) double m_dThick ; // spessore + Point3d m_ptStart ; // punto iniziale per composita vuota per Add di linee o archi int m_nTempProp ; // proprietà temporanea mutable PCSD_CONST_ITER m_Iter ; // iteratore } ; diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index 8728d43c08934cf7715e8c91dccc80774c8e0ce9..bb000e7bfd8506a95e41ea6e5aa2918c5ca70ee3 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&P_&A-_cnHh~HD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-Vf-5U delta 94 zcmdlNy)SyhFE&QQ&A-_cnHdcyD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-U|t&X diff --git a/OffsetCurve.cpp b/OffsetCurve.cpp index a2d8b29..5ec0e76 100644 --- a/OffsetCurve.cpp +++ b/OffsetCurve.cpp @@ -369,7 +369,7 @@ OffsetCurve::Make( const ICurve* pCrv, double dDist, int nType) PtrOwner pCircE( CreateBasicCurveArc()) ; if ( IsNull( pCircE) || ! pCircE->Set( ptEnd, Z_AX, abs( dDist))) return false ; - POCRVVECTOR vpCirc ; + ICURVEPOVECTOR vpCirc ; vpCirc.emplace_back( Release( pCircS)) ; vpCirc.emplace_back( Release( pCircE)) ; // elimino le parti di offset interne a queste circonferenze diff --git a/VolZmap.h b/VolZmap.h index 5a87906..edb7b59 100644 --- a/VolZmap.h +++ b/VolZmap.h @@ -95,7 +95,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW bool GetDepth( const Point3d& ptP, const Vector3d& vtD, double& dInLength, double& dOutLength, bool bExact) const override ; bool GetDepthWithDexel( const Point3d& ptP, const Vector3d& vtDir, double& dInLength, double& dOutLength) const ; bool GetDepthWithVoxel( const Point3d& ptP, const Vector3d& vtDir, double& dInLength, double& dOutLength, bool bEnh) const ; - bool GetPlaneIntersection( const Plane3d& plPlane, POCRVVECTOR& vpLoop) const override ; + bool GetPlaneIntersection( const Plane3d& plPlane, ICURVEPOVECTOR& vpLoop) const override ; bool AvoidBox( const Frame3d& frBox, const Vector3d& vtDiag) const override ; bool AvoidSphere( const Point3d& ptCenter, double dRad) const override ; bool AvoidCylinder( const Frame3d& frCyl, double dL, double dR) const override ; diff --git a/VolZmapCalculus.cpp b/VolZmapCalculus.cpp index 87c1328..798946f 100644 --- a/VolZmapCalculus.cpp +++ b/VolZmapCalculus.cpp @@ -1398,7 +1398,7 @@ VolZmap::GetPartVolume( int nPart, double& dVol) const // standard vector vLoop passato per riferimento. // Se il processo va a buon fine viene restituito true, false altrimenti. bool -VolZmap::GetPlaneIntersection( const Plane3d& plPlane, POCRVVECTOR& vpLoop) const +VolZmap::GetPlaneIntersection( const Plane3d& plPlane, ICURVEPOVECTOR& vpLoop) const { // Verifico validità parametri if ( ! plPlane.IsValid()) diff --git a/VolZmapCreation.cpp b/VolZmapCreation.cpp index 30c97f9..4d523f6 100644 --- a/VolZmapCreation.cpp +++ b/VolZmapCreation.cpp @@ -251,7 +251,7 @@ VolZmap::CreateFromFlatRegion( const ISurfFlatRegion& Surf, double dDimZ, double } // Metto in cache le curve di contorno della regione - POCRVVECTOR vpCrvs ; + ICURVEPOVECTOR vpCrvs ; INTVECTOR vnCompo ; int nChunkNum = Surf.GetChunkCount() ; for ( int nChunk = 0 ; nChunk < nChunkNum ; ++ nChunk) {