EgtInterface 1.6b5 :
- in CurveCompoByChain si cancellano gli originali solo se ok - in EgtModifyCurveThickness gestito vettore di Id - aggiunto Snap Point Baricentro (Gravity Center) - aggiunte EgtCurveArcRadius, EgtCurveCompoCenter - aggiunte funzioni lua EgtGP, EgtET, EgtCurveLength, EgtCurveArcRadius e EgtCurveCompoCenter.
This commit is contained in:
+100
-3
@@ -20,6 +20,7 @@
|
||||
#include "/EgtDev/Include/EgkGeoVector3d.h"
|
||||
#include "/EgtDev/Include/EgkCurve.h"
|
||||
#include "/EgtDev/Include/EgkCurveArc.h"
|
||||
#include "/EgtDev/Include/EgkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EgkExtText.h"
|
||||
#include "/EgtDev/Include/EgkDistPointCurve.h"
|
||||
#include "/EgtDev/Include/EgkIntersCurveCurve.h"
|
||||
@@ -309,6 +310,51 @@ EgtCenterPoint( int nId, int nRefId, Point3d& ptP)
|
||||
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtCentroid( int nId, int nRefId, double ptP[3])
|
||||
{
|
||||
// recupero il punto
|
||||
Point3d ptCent ;
|
||||
if ( ! EgtCentroid( nId, nRefId, ptCent))
|
||||
return FALSE ;
|
||||
// ritorno il punto
|
||||
VEC_FROM_3D( ptP, ptCent)
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
EgtCentroid( int nId, int nRefId, Point3d& ptP)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// se non è entità geometrica
|
||||
const IGeoObj* pGObj ;
|
||||
if ( ( pGObj = pGeomDB->GetGeoObj( nId)) == nullptr)
|
||||
return false ;
|
||||
// se curva
|
||||
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
|
||||
// recupero la curva
|
||||
const ICurve* pCrv = GetCurve( pGObj) ;
|
||||
// assegno il punto
|
||||
if ( pCrv == nullptr || ! pCrv->GetCentroid( ptP))
|
||||
return false ;
|
||||
}
|
||||
// se testo
|
||||
else if ( pGObj->GetType() == EXT_TEXT) {
|
||||
// recupero il testo
|
||||
const IExtText* pTxt = GetExtText( pGObj) ;
|
||||
// assegno il punto
|
||||
if ( pTxt == nullptr || ! pTxt->GetCenterPoint( ptP))
|
||||
return false ;
|
||||
}
|
||||
else
|
||||
return false ;
|
||||
// gestione trasformazione ( eventuale)
|
||||
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtAtParamPoint( int nId, double dU, int nRefId, double ptP[3])
|
||||
@@ -784,6 +830,23 @@ __stdcall EgtGetMinDistPntSidePointCurve( const double ptP[3], int nId, double v
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtCurveArcRadius( int nId, double* pdRad)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero l'arco
|
||||
const ICurveArc* pArc = GetCurveArc( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pArc == nullptr)
|
||||
return FALSE ;
|
||||
// recupero il raggio
|
||||
if ( pdRad == nullptr)
|
||||
return FALSE ;
|
||||
*pdRad = pArc->GetRadius() ;
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtCurveArcNormVersor( int nId, int nRefId, double vtNorm[3])
|
||||
@@ -802,9 +865,9 @@ bool
|
||||
EgtCurveArcNormVersor( int nId, int nRefId, Vector3d& vtNorm)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero l'arco
|
||||
ICurveArc* pArc = GetCurveArc( pGeomDB->GetGeoObj( nId)) ;
|
||||
const ICurveArc* pArc = GetCurveArc( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pArc == nullptr)
|
||||
return false ;
|
||||
// recupero la normale
|
||||
@@ -813,6 +876,40 @@ EgtCurveArcNormVersor( int nId, int nRefId, Vector3d& vtNorm)
|
||||
return TrasformVector( pGeomDB, nId, nRefId, vtNorm) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtCurveCompoCenter( int nId, int nSimpCrv, int nRefId, double ptCen[3])
|
||||
{
|
||||
// recupero il vettore normale
|
||||
Point3d ptTmp ;
|
||||
if ( ! EgtCurveCompoCenter( nId, nSimpCrv, nRefId, ptTmp))
|
||||
return FALSE ;
|
||||
// lo assegno
|
||||
VEC_FROM_3D( ptCen, ptTmp)
|
||||
return TRUE ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
EgtCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d& ptCen)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la curva composita
|
||||
const ICurveComposite* pCompoCrv = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pCompoCrv == nullptr)
|
||||
return false ;
|
||||
// recupero la curva semplice di indice richiesto
|
||||
const ICurve* pSimpCrv = pCompoCrv->GetCurve( nSimpCrv) ;
|
||||
if ( pSimpCrv == nullptr)
|
||||
return false ;
|
||||
// recupero il centro
|
||||
if ( ! pSimpCrv->GetCenterPoint( ptCen))
|
||||
return false ;
|
||||
// gestione trasformazione ( eventuale)
|
||||
return TrasformPoint( pGeomDB, nId, nRefId, ptCen) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtExtTextNormVersor( int nId, int nRefId, double vtNorm[3])
|
||||
@@ -831,7 +928,7 @@ bool
|
||||
EgtExtTextNormVersor( int nId, int nRefId, Vector3d& vtNorm)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero il testo
|
||||
const IExtText* pTxt = GetExtText( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pTxt == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user