EgtInterface 1.5l2 :

- migliorie e modifiche in generale, specie su Lua.
This commit is contained in:
Dario Sassi
2014-12-30 17:36:43 +00:00
parent 517a36a009
commit bebcf1ecfe
23 changed files with 1528 additions and 402 deletions
+238 -71
View File
@@ -26,13 +26,97 @@
#include "/EgtDev/Include/EgtPointerOwner.h"
//----------------------------------------------------------------------------
static bool
TrasformPoint( IGeomDB* pGeomDB, int nId, int nRefId, Point3d& ptP)
{
// se non va trasformato, esco
if ( nRefId == nId)
return true ;
// recupero il riferimento in cui è espresso il punto (quello dell'entità da cui deriva)
Frame3d frSou ;
if ( ! pGeomDB->GetGlobFrame( nId, frSou))
return false ;
// se va portato in globale, trasformo ed esco
if ( nRefId == GDB_ID_ROOT)
return ptP.ToGlob( frSou) ;
// recupero il riferimento destinazione
Frame3d frDest ;
if ( nRefId == GDB_ID_GRID)
frDest = pGeomDB->GetGridFrame() ;
else {
// nRefId può essere un gruppo o una entità
if ( ! pGeomDB->GetGroupGlobFrame( nRefId, frDest) &&
! pGeomDB->GetGlobFrame( nRefId, frDest))
return false ;
}
// eseguo la trasformazione
return ptP.LocToLoc( frSou, frDest) ;
}
//----------------------------------------------------------------------------
static bool
TrasformVector( IGeomDB* pGeomDB, int nId, int nRefId, Vector3d& vtV)
{
// se non va trasformato, esco
if ( nRefId == nId)
return true ;
// recupero il riferimento in cui è espresso il punto (quello dell'entità da cui deriva)
Frame3d frSou ;
if ( ! pGeomDB->GetGlobFrame( nId, frSou))
return false ;
// se va portato in globale, trasformo ed esco
if ( nRefId == GDB_ID_ROOT)
return vtV.ToGlob( frSou) ;
// recupero il riferimento destinazione
Frame3d frDest ;
if ( nRefId == GDB_ID_GRID)
frDest = pGeomDB->GetGridFrame() ;
else {
// nRefId può essere un gruppo o una entità
if ( ! pGeomDB->GetGroupGlobFrame( nRefId, frDest) &&
! pGeomDB->GetGlobFrame( nRefId, frDest))
return false ;
}
// eseguo la trasformazione
return vtV.LocToLoc( frSou, frDest) ;
}
//----------------------------------------------------------------------------
static bool
TrasformFrame( IGeomDB* pGeomDB, int nId, int nRefId, Frame3d& frF)
{
// se non va trasformato, esco
if ( nRefId == nId)
return true ;
// recupero il riferimento in cui è espresso il punto (quello dell'entità da cui deriva)
Frame3d frSou ;
if ( ! pGeomDB->GetGlobFrame( nId, frSou))
return false ;
// se va portato in globale, trasformo ed esco
if ( nRefId == GDB_ID_ROOT)
return frF.ToGlob( frSou) ;
// recupero il riferimento destinazione
Frame3d frDest ;
if ( nRefId == GDB_ID_GRID)
frDest = pGeomDB->GetGridFrame() ;
else {
// nRefId può essere un gruppo o una entità
if ( ! pGeomDB->GetGroupGlobFrame( nRefId, frDest) &&
! pGeomDB->GetGlobFrame( nRefId, frDest))
return false ;
}
// eseguo la trasformazione
return frF.LocToLoc( frSou, frDest) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtStartPoint( int nId, double ptP[3])
{
// recupero il punto
Point3d ptStart ;
if ( ! EgtStartPoint( nId, ptStart))
if ( ! EgtStartPoint( nId, nId, ptStart))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptStart)
@@ -41,7 +125,7 @@ __stdcall EgtStartPoint( int nId, double ptP[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtStartPoint( int nId, Point3d& ptP)
__stdcall EgtStartPoint( int nId, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -55,7 +139,6 @@ __stdcall EgtStartPoint( int nId, Point3d& ptP)
const IGeoPoint3d* pGP = GetGeoPoint3d( pGObj) ;
// assegno il punto
ptP = pGP->GetPoint() ;
return true ;
}
// se vettore
else if ( pGObj->GetType() == GEO_VECT3D) {
@@ -63,7 +146,6 @@ __stdcall EgtStartPoint( int nId, Point3d& ptP)
const IGeoVector3d* pGV = GetGeoVector3d( pGObj) ;
// assegno il punto
ptP = pGV->GetBase() ;
return true ;
}
// se frame
else if ( pGObj->GetType() == GEO_FRAME3D) {
@@ -71,23 +153,27 @@ __stdcall EgtStartPoint( int nId, Point3d& ptP)
const IGeoFrame3d* pGF = GetGeoFrame3d( pGObj) ;
// assegno il punto
ptP = pGF->GetFrame().Orig() ;
return true ;
}
// se curva
else if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// assegno il punto
return pCrv->GetStartPoint( ptP) ;
if ( pCrv == nullptr || ! pCrv->GetStartPoint( ptP))
return false ;
}
// se testo
else if ( pGObj->GetType() == EXT_TEXT) {
// recupero il testo
const IExtText* pTxt = GetExtText( pGObj) ;
// assegno il punto
return pTxt->GetStartPoint( ptP) ;
if ( pTxt == nullptr || ! pTxt->GetStartPoint( ptP))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
@@ -96,7 +182,7 @@ __stdcall EgtEndPoint( int nId, double ptP[3])
{
// recupero il punto
Point3d ptEnd ;
if ( ! EgtEndPoint( nId, ptEnd))
if ( ! EgtEndPoint( nId, nId, ptEnd))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptEnd)
@@ -105,7 +191,7 @@ __stdcall EgtEndPoint( int nId, double ptP[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtEndPoint( int nId, Point3d& ptP)
__stdcall EgtEndPoint( int nId, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
@@ -117,15 +203,20 @@ __stdcall EgtEndPoint( int nId, Point3d& ptP)
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
return pCrv->GetEndPoint( ptP) ;
if ( pCrv == nullptr || ! pCrv->GetEndPoint( ptP))
return false ;
}
// se testo
else if ( pGObj->GetType() == EXT_TEXT) {
// recupero il testo
const IExtText* pTxt = GetExtText( pGObj) ;
return pTxt->GetEndPoint( ptP) ;
if ( pTxt == nullptr || ! pTxt->GetEndPoint( ptP))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
@@ -134,7 +225,7 @@ __stdcall EgtMidPoint( int nId, double ptP[3])
{
// recupero il punto
Point3d ptMid ;
if ( ! EgtMidPoint( nId, ptMid))
if ( ! EgtMidPoint( nId, nId, ptMid))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptMid)
@@ -143,7 +234,7 @@ __stdcall EgtMidPoint( int nId, double ptP[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtMidPoint( int nId, Point3d& ptP)
__stdcall EgtMidPoint( int nId, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -156,16 +247,21 @@ __stdcall EgtMidPoint( int nId, Point3d& ptP)
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// assegno il punto
return pCrv->GetMidPoint( ptP) ;
if ( pCrv == nullptr || ! pCrv->GetMidPoint( ptP))
return false ;
}
// se testo
else if ( pGObj->GetType() == EXT_TEXT) {
// recupero il testo
const IExtText* pTxt = GetExtText( pGObj) ;
// assegno il punto
return pTxt->GetMidPoint( ptP) ;
if ( pTxt == nullptr || ! pTxt->GetMidPoint( ptP))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
@@ -174,7 +270,7 @@ __stdcall EgtCenterPoint( int nId, double ptP[3])
{
// recupero il punto
Point3d ptCent ;
if ( ! EgtCenterPoint( nId, ptCent))
if ( ! EgtCenterPoint( nId, nId, ptCent))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptCent)
@@ -183,7 +279,7 @@ __stdcall EgtCenterPoint( int nId, double ptP[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtCenterPoint( int nId, Point3d& ptP)
__stdcall EgtCenterPoint( int nId, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -196,16 +292,21 @@ __stdcall EgtCenterPoint( int nId, Point3d& ptP)
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// assegno il punto
return pCrv->GetCenterPoint( ptP) ;
if ( pCrv == nullptr || ! pCrv->GetCenterPoint( ptP))
return false ;
}
// se testo
else if ( pGObj->GetType() == EXT_TEXT) {
// recupero il testo
const IExtText* pTxt = GetExtText( pGObj) ;
// assegno il punto
return pTxt->GetCenterPoint( ptP) ;
if ( pTxt == nullptr || ! pTxt->GetCenterPoint( ptP))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
@@ -214,7 +315,7 @@ __stdcall EgtAtParamPoint( int nId, double dU, double ptP[3])
{
// recupero il punto
Point3d ptAtPar ;
if ( ! EgtAtParamPoint( nId, dU, ptAtPar))
if ( ! EgtAtParamPoint( nId, dU, nId, ptAtPar))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptAtPar)
@@ -223,7 +324,7 @@ __stdcall EgtAtParamPoint( int nId, double dU, double ptP[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtAtParamPoint( int nId, double dU, Point3d& ptP)
__stdcall EgtAtParamPoint( int nId, double dU, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -235,18 +336,22 @@ __stdcall EgtAtParamPoint( int nId, double dU, Point3d& ptP)
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
return pCrv->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP) ;
if ( pCrv == nullptr || ! pCrv->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtIntersectionPoint( int nId1, int nId2, const double ptNear[3], double ptP[3])
__stdcall EgtNearPoint( int nId, const double ptNear[3], double ptP[3])
{
// recupero il punto
Point3d ptInt ;
if ( ! EgtIntersectionPoint( nId1, nId2, ptNear, ptInt))
if ( ! EgtNearPoint( nId, ptNear, nId, ptInt))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptInt)
@@ -255,7 +360,46 @@ __stdcall EgtIntersectionPoint( int nId1, int nId2, const double ptNear[3], doub
//----------------------------------------------------------------------------
bool
__stdcall EgtIntersectionPoint( int nId1, int nId2, const Point3d& ptNear, Point3d& ptP)
__stdcall EgtNearPoint( int nId, const Point3d& ptNear, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// se non è entità geometrica
const IGeoObj* pGObj = pGeomDB->GetGeoObj( nId) ;
if ( pGObj == nullptr)
return false ;
// se curva
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// calcolo il punto della curva più vicino al punto di riferimento
DistPointCurve dstPC( ptNear, *pCrv) ;
int nFlag ;
if ( ! dstPC.GetMinDistPoint( 0, ptP, nFlag))
return false ;
}
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
BOOL
__stdcall EgtIntersectionPoint( int nId1, int nId2, const double ptNear[3], double ptP[3])
{
// recupero il punto
Point3d ptInt ;
if ( ! EgtIntersectionPoint( nId1, nId2, ptNear, nId1, ptInt))
return FALSE ;
// ritorno il punto
VEC_FROM_3D( ptP, ptInt)
return TRUE ;
}
//----------------------------------------------------------------------------
bool
__stdcall EgtIntersectionPoint( int nId1, int nId2, const Point3d& ptNear, int nRefId, Point3d& ptP)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -292,9 +436,13 @@ __stdcall EgtIntersectionPoint( int nId1, int nId2, const Point3d& ptNear, Point
ptNearLoc.ToLoc( frEnt1) ;
// calcolo il punto di intersezione sulla prima curva più vicino al punto di riferimento
IntersCurveCurve intCC( *pCrv1, *pCrv2, true) ;
return intCC.GetIntersPointNearTo( 0, ptNearLoc, ptP) ;
if ( ! intCC.GetIntersPointNearTo( 0, ptNearLoc, ptP))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformPoint( pGeomDB, nId1, nRefId, ptP) ;
}
//----------------------------------------------------------------------------
@@ -303,7 +451,7 @@ __stdcall EgtStartVector( int nId, double vtV[3])
{
// recupero il vettore
Vector3d vtStart ;
if ( ! EgtStartVector( nId, vtStart))
if ( ! EgtStartVector( nId, nId, vtStart))
return FALSE ;
// ritorno il vettore
VEC_FROM_3D( vtV, vtStart)
@@ -312,13 +460,13 @@ __stdcall EgtStartVector( int nId, double vtV[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtStartVector( int nId, Vector3d& vtV)
__stdcall EgtStartVector( int nId, int nRefId, Vector3d& vtV)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// se non è entità geometrica
const IGeoObj* pGObj ;
if ( ( pGObj = pGeomDB->GetGeoObj( nId)) == nullptr)
const IGeoObj* pGObj = pGeomDB->GetGeoObj( nId) ;
if ( pGObj == nullptr)
return false ;
// se vettore
if ( pGObj->GetType() == GEO_VECT3D) {
@@ -326,14 +474,14 @@ __stdcall EgtStartVector( int nId, Vector3d& vtV)
const IGeoVector3d* pGV = GetGeoVector3d( pGObj) ;
// assegno il vettore
vtV = pGV->GetVector() ;
return true ;
}
// se curva
else if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// assegno il vettore
return pCrv->GetStartDir( vtV) ;
if ( ! pCrv->GetStartDir( vtV))
return false ;
}
// se testo
else if ( pGObj->GetType() == EXT_TEXT) {
@@ -341,9 +489,11 @@ __stdcall EgtStartVector( int nId, Vector3d& vtV)
const IExtText* pTxt = GetExtText( pGObj) ;
// assegno il vettore
vtV = pTxt->GetDirVersor() ;
return true ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtV) ;
}
//----------------------------------------------------------------------------
@@ -352,7 +502,7 @@ __stdcall EgtEndVector( int nId, double vtV[3])
{
// recupero il vettore
Vector3d vtEnd ;
if ( ! EgtEndVector( nId, vtEnd))
if ( ! EgtEndVector( nId, nId, vtEnd))
return FALSE ;
// ritorno il vettore
VEC_FROM_3D( vtV, vtEnd)
@@ -361,22 +511,26 @@ __stdcall EgtEndVector( int nId, double vtV[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtEndVector( int nId, Vector3d& vtV)
__stdcall EgtEndVector( int nId, int nRefId, Vector3d& vtV)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// se non è entità geometrica
const IGeoObj* pGObj ;
if ( ( pGObj = pGeomDB->GetGeoObj( nId)) == nullptr)
const IGeoObj* pGObj = pGeomDB->GetGeoObj( nId) ;
if ( pGObj == nullptr)
return false ;
// se curva
if ( ( pGObj->GetType() & GEO_CURVE) != 0) {
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// assegno il vettore
return pCrv->GetEndDir( vtV) ;
if ( ! pCrv->GetEndDir( vtV))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtV) ;
}
//----------------------------------------------------------------------------
@@ -385,7 +539,7 @@ __stdcall EgtMidVector( int nId, double vtV[3])
{
// recupero il vettore
Vector3d vtMid ;
if ( ! EgtMidVector( nId, vtMid))
if ( ! EgtMidVector( nId, nId, vtMid))
return FALSE ;
// ritorno il vettore
VEC_FROM_3D( vtV, vtMid)
@@ -394,7 +548,7 @@ __stdcall EgtMidVector( int nId, double vtV[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtMidVector( int nId, Vector3d& vtV)
__stdcall EgtMidVector( int nId, int nRefId, Vector3d& vtV)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -407,9 +561,13 @@ __stdcall EgtMidVector( int nId, Vector3d& vtV)
// recupero la curva
const ICurve* pCrv = GetCurve( pGObj) ;
// assegno il vettore
return pCrv->GetMidDir( vtV) ;
if ( ! pCrv->GetMidDir( vtV))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtV) ;
}
//----------------------------------------------------------------------------
@@ -418,7 +576,7 @@ __stdcall EgtAtParamVector( int nId, double dU, int nSide, double vtV[3])
{
// recupero il vettore
Vector3d vtAtPar ;
if ( ! EgtAtParamVector( nId, dU, nSide, vtAtPar))
if ( ! EgtAtParamVector( nId, dU, nSide, nId, vtAtPar))
return FALSE ;
// ritorno il vettore
VEC_FROM_3D( vtV, vtAtPar)
@@ -427,7 +585,7 @@ __stdcall EgtAtParamVector( int nId, double dU, int nSide, double vtV[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtAtParamVector( int nId, double dU, int nSide, Vector3d& vtV)
__stdcall EgtAtParamVector( int nId, double dU, int nSide, int nRefId, Vector3d& vtV)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -445,9 +603,13 @@ __stdcall EgtAtParamVector( int nId, double dU, int nSide, Vector3d& vtV)
nSide = ICurve::FROM_PLUS ;
// recupero la direzione
Point3d ptP ;
return pCrv->GetPointTang( dU, nSide, ptP, vtV) ;
if ( ! pCrv->GetPointTang( dU, nSide, ptP, vtV))
return false ;
}
return false ;
else
return false ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtV) ;
}
//----------------------------------------------------------------------------
@@ -456,7 +618,7 @@ __stdcall EgtFrame( int nId, double ptOrig[3], double vtX[3], double vtY[3], dou
{
// recupero il frame
Frame3d frFrame ;
if ( ! EgtFrame( nId, frFrame))
if ( ! EgtFrame( nId, nId, frFrame))
return FALSE ;
// assegno l'origine
VEC_FROM_3D( ptOrig, frFrame.Orig())
@@ -471,21 +633,23 @@ __stdcall EgtFrame( int nId, double ptOrig[3], double vtX[3], double vtY[3], dou
//----------------------------------------------------------------------------
bool
__stdcall EgtFrame( int nId, Frame3d& frFrame)
__stdcall EgtFrame( int nId, int nRefId, Frame3d& frFrame)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// se gruppo
if ( pGeomDB->GetGroupFrame( nId, frFrame))
return true ;
// gestione trasformazione ( eventuale)
return TrasformFrame( pGeomDB, nId, nRefId, frFrame) ;
// se geo frame
const IGeoObj* pGObj ;
if ( ( pGObj = pGeomDB->GetGeoObj( nId)) != nullptr &&
pGObj->GetType() == GEO_FRAME3D) {
pGObj->GetType() == GEO_FRAME3D) {
frFrame = GetGeoFrame3d( pGObj)->GetFrame() ;
return true ;
// gestione trasformazione ( eventuale)
return TrasformFrame( pGeomDB, nId, nRefId, frFrame) ;
}
// altrimenti errore
// errore
return false ;
}
@@ -534,7 +698,7 @@ __stdcall EgtCurveExtrusion( int nId, double vtExtr[3])
{
// recupero il vettore estrusione
Vector3d vtTmp ;
if ( ! EgtCurveExtrusion( nId, vtTmp))
if ( ! EgtCurveExtrusion( nId, nId, vtTmp))
return FALSE ;
// lo assegno
VEC_FROM_3D( vtExtr, vtTmp)
@@ -543,16 +707,17 @@ __stdcall EgtCurveExtrusion( int nId, double vtExtr[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtCurveExtrusion( int nId, Vector3d& vtExtr)
__stdcall EgtCurveExtrusion( int nId, int nRefId, Vector3d& vtExtr)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la curva
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve == nullptr)
return false ;
// ne ricavo il vettore estrusione
return pCurve->GetExtrusion( vtExtr) ;
if ( pCurve == nullptr || ! pCurve->GetExtrusion( vtExtr))
return false ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtExtr) ;
}
//----------------------------------------------------------------------------
@@ -625,7 +790,7 @@ __stdcall EgtCurveArcNormVersor( int nId, double vtNorm[3])
{
// recupero il vettore normale
Vector3d vtTmp ;
if ( ! EgtCurveArcNormVersor( nId, vtTmp))
if ( ! EgtCurveArcNormVersor( nId, nId, vtTmp))
return FALSE ;
// lo assegno
VEC_FROM_3D( vtNorm, vtTmp)
@@ -634,7 +799,7 @@ __stdcall EgtCurveArcNormVersor( int nId, double vtNorm[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtCurveArcNormVersor( int nId, Vector3d& vtNorm)
__stdcall EgtCurveArcNormVersor( int nId, int nRefId, Vector3d& vtNorm)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
@@ -644,7 +809,8 @@ __stdcall EgtCurveArcNormVersor( int nId, Vector3d& vtNorm)
return false ;
// recupero la normale
vtNorm = pArc->GetNormVersor() ;
return true ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtNorm) ;
}
//----------------------------------------------------------------------------
@@ -653,7 +819,7 @@ __stdcall EgtExtTextNormVersor( int nId, double vtNorm[3])
{
// recupero il vettore normale
Vector3d vtTmp ;
if ( ! EgtExtTextNormVersor( nId, vtTmp))
if ( ! EgtExtTextNormVersor( nId, nId, vtTmp))
return FALSE ;
// lo assegno
VEC_FROM_3D( vtNorm, vtTmp)
@@ -662,7 +828,7 @@ __stdcall EgtExtTextNormVersor( int nId, double vtNorm[3])
//----------------------------------------------------------------------------
bool
__stdcall EgtExtTextNormVersor( int nId, Vector3d& vtNorm)
__stdcall EgtExtTextNormVersor( int nId, int nRefId, Vector3d& vtNorm)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
@@ -672,7 +838,8 @@ __stdcall EgtExtTextNormVersor( int nId, Vector3d& vtNorm)
return false ;
// recupero la normale
vtNorm = pTxt->GetNormVersor() ;
return true ;
// gestione trasformazione ( eventuale)
return TrasformVector( pGeomDB, nId, nRefId, vtNorm) ;
}