Include : aggiunti EGkCurveBezier.h e EGkCurveComposite.h per interfaccia.

This commit is contained in:
Dario Sassi
2013-11-23 21:43:18 +00:00
parent 06ab4af496
commit c8b31a1eb3
5 changed files with 132 additions and 0 deletions
+10
View File
@@ -31,3 +31,13 @@ class _declspec( novtable) ICurve : public IGeoObj
virtual bool GetPointTangNormCurv( double dU, Point3d& ptPos, Vector3d& vtT, Vector3d& vtN, double& dCurv) const = 0 ;
virtual bool Reverse( void) = 0 ;
} ;
//----------------------------------------------------------------------------
inline const ICurve* GetCurve( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || ( pGObj->GetType() & GEO_CURVE) == 0)
return nullptr ;
return (static_cast<const ICurve*>(pGObj)) ; }
inline ICurve* GetCurve( IGeoObj* pGObj)
{ if ( pGObj == nullptr || ( pGObj->GetType() & GEO_CURVE) == 0)
return nullptr ;
return (static_cast<ICurve*>(pGObj)) ; }
+2
View File
@@ -42,6 +42,8 @@ inline ICurveArc* CloneCurveArc( const IGeoObj* pGObj)
inline bool CopyCurveArc( const ICurveArc* pCASou, ICurveArc* pCADest)
{ if ( pCASou == nullptr || pCADest == nullptr || ! pCASou->IsValid())
return false ;
if ( pCASou == pCADest)
return true ;
return pCADest->Set( pCASou->GetCenter(), pCASou->GetNormVersor(), pCASou->GetRadius(),
pCASou->GetStartVersor(), pCASou->GetAngCenter(), pCASou->GetDeltaN()) ; }
inline const ICurveArc* GetCurveArc( const IGeoObj* pGObj)
+63
View File
@@ -0,0 +1,63 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EgkCurveBezier.h Data : 22.11.13 Versione : 1.3a1
// Contenuto : Dichiarazione della interfaccia ICurveBezier.
//
//
//
// Modifiche : 22.11.13 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkCurve.h"
//----------------------------------------------------------------------------
class _declspec( novtable) ICurveBezier : public ICurve
{
public :
virtual bool Init( int nDeg, bool bIsRational) = 0 ;
virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl) = 0 ;
virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl, double dW) = 0 ;
virtual int GetDegree( void) const = 0 ;
virtual bool IsRational( void) const = 0 ;
virtual const Point3d& GetControlPoint( int nInd, bool* pbOk = NULL) const = 0 ;
virtual double GetControlWeight( int nInd, bool* pbOk = NULL) const = 0 ;
} ;
//-----------------------------------------------------------------------------
inline ICurveBezier* CreateCurveBezier( void)
{ return (static_cast<ICurveBezier*>( CreateGeoObj( KEY_CRV_BEZ))) ; }
inline ICurveBezier* CloneCurveBezier( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ)
return nullptr ;
return (static_cast<ICurveBezier*>(pGObj->Clone())) ; }
inline bool CopyCurveBezier( const ICurveBezier* pCBSou, ICurveBezier* pCBDest)
{ if ( pCBSou == nullptr || pCBDest == nullptr || ! pCBSou->IsValid())
return false ;
if ( pCBSou == pCBDest)
return true ;
int nDeg = pCBSou->GetDegree() ;
bool bRat = pCBSou->IsRational() ;
if ( ! pCBDest->Init( nDeg, bRat))
return false ;
if ( bRat) {
for ( int i = 0 ; i <= nDeg ; i ++)
pCBDest->SetControlPoint( i, pCBSou->GetControlPoint( i), pCBSou->GetControlWeight( i)) ;
}
else {
for ( int i = 0 ; i <= nDeg ; i ++)
pCBDest->SetControlPoint( i, pCBSou->GetControlPoint( i)) ;
}
return true ; }
inline const ICurveBezier* GetCurveBezier( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ)
return nullptr ;
return (static_cast<const ICurveBezier*>(pGObj)) ; }
inline ICurveBezier* GetCurveBezier( IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_BEZ)
return nullptr ;
return (static_cast<ICurveBezier*>(pGObj)) ; }
+55
View File
@@ -0,0 +1,55 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
//----------------------------------------------------------------------------
// File : EgkCurveComposite.h Data : 22.11.13 Versione : 1.3a1
// Contenuto : Dichiarazione della interfaccia ICurveComposite.
//
//
//
// Modifiche : 22.11.13 DS Creazione modulo.
//
//
//----------------------------------------------------------------------------
#pragma once
#include "/EgtDev/Include/EGkCurve.h"
//----------------------------------------------------------------------------
class _declspec( novtable) ICurveComposite : public ICurve
{
public :
virtual bool Clear( void) = 0 ;
virtual bool AddCurve( const ICurve& cCrv) = 0 ;
virtual int GetCurveNumber( void) const = 0 ;
virtual const ICurve* GetFirstCurve( void) const = 0 ;
virtual const ICurve* GetNextCurve( void) const = 0 ;
} ;
//-----------------------------------------------------------------------------
inline ICurveComposite* CreateCurveComposite( void)
{ return (static_cast<ICurveComposite*>( CreateGeoObj( KEY_CRV_COMPO))) ; }
inline ICurveComposite* CloneCurveComposite( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO)
return nullptr ;
return (static_cast<ICurveComposite*>(pGObj->Clone())) ; }
inline bool CopyCurveComposite( const ICurveComposite* pCCSou, ICurveComposite* pCCDest)
{ if ( pCCSou == nullptr || pCCDest == nullptr || ! pCCSou->IsValid())
return false ;
if ( pCCSou == pCCDest)
return true ;
pCCDest->Clear() ;
const ICurve* pCrv = pCCSou->GetFirstCurve() ;
while ( pCrv != nullptr) {
pCCDest->AddCurve( *pCrv) ;
pCrv = pCCSou->GetNextCurve() ;
}
return true ; }
inline const ICurveComposite* GetCurveComposite( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO)
return nullptr ;
return (static_cast<const ICurveComposite*>(pGObj)) ; }
inline ICurveComposite* GetCurveComposite( IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_COMPO)
return nullptr ;
return (static_cast<ICurveComposite*>(pGObj)) ; }
+2
View File
@@ -34,6 +34,8 @@ inline ICurveLine* CloneCurveLine( const IGeoObj* pGObj)
inline bool CopyCurveLine( const ICurveLine* pCLSou, ICurveLine* pCLDest)
{ if ( pCLSou == nullptr || pCLDest == nullptr || ! pCLSou->IsValid())
return false ;
if ( pCLSou == pCLDest)
return true ;
return pCLDest->Set( pCLSou->GetStart(), pCLSou->GetEnd()) ; }
inline const ICurveLine* GetCurveLine( const IGeoObj* pGObj)
{ if ( pGObj == nullptr || pGObj->GetType() != CRV_LINE)