EgtInterface 1.6b1 :

- gestione estrusione con facce di chiusura
- gestione rivoluzione con facce di chiusura
- razionalizzazione passaggio a locale.
This commit is contained in:
Dario Sassi
2015-02-02 08:18:35 +00:00
parent 0c41c8c631
commit 4e1dddee86
18 changed files with 531 additions and 731 deletions
+44 -106
View File
@@ -16,6 +16,7 @@
#include "API.h"
#include "API_Macro.h"
#include "AuxTools.h"
#include "GeoTools.h"
#include "/EgtDev/Include/EInAPI.h"
#include "/EgtDev/Include/EInConst.h"
#include "/EgtDev/Include/EgkGeoPoint3d.h"
@@ -35,18 +36,17 @@ __stdcall EgtCreateGroup( int nParentId, const double ptOrig[3],
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptOrigL = GetPointLocal( pGeomDB, ptOrig, nRefType, frLoc) ; ;
Vector3d vtXL = GetVectorLocal( pGeomDB, vX, nRefType, frLoc) ; ;
Vector3d vtYL = GetVectorLocal( pGeomDB, vY, nRefType, frLoc) ; ;
Vector3d vtZL = GetVectorLocal( pGeomDB, vZ, nRefType, frLoc) ; ;
// costruisco il riferimento
Frame3d frFrameL ;
bOk = bOk && frFrameL.Set( ptOrig, vX, vY, vZ) ;
// lo porto in locale
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB)
frFrameL.ToLoc( frLoc) ;
else /* RTY_GRID */
frFrameL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
bOk = bOk && frFrameL.Set( ptOrigL, vtXL, vtYL, vtZL) ;
// creo il gruppo
int nId = ( bOk ? pGeomDB->AddGroup( GDB_ID_NULL, nParentId, frFrameL) : GDB_ID_NULL) ;
EgtSetModified() ;
@@ -81,18 +81,11 @@ __stdcall EgtCreateGeoPoint( int nParentId, const double ptP[3], int nRefType)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale il punto
Point3d ptPL( ptP) ;
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB) {
ptPL.ToLoc( frLoc) ;
}
else /* RTY_GRID */ {
ptPL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
}
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ; ;
// creo il punto
PtrOwner<IGeoPoint3d> pGeoPnt( CreateGeoPoint3d()) ;
bOk = bOk && ! IsNull( pGeoPnt) ;
@@ -120,21 +113,12 @@ __stdcall EgtCreateGeoVector( int nParentId, const double vtV[3], const double p
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale il vettore e il punto
Vector3d vtVL( vtV) ;
Point3d ptBL( ptB) ;
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB) {
vtVL.ToLoc( frLoc) ;
ptBL.ToLoc( frLoc) ;
}
else /* RTY_GRID */ {
vtVL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
ptBL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
}
Vector3d vtVL = GetVectorLocal( pGeomDB, vtV, nRefType, frLoc) ; ;
Point3d ptBL = GetPointLocal( pGeomDB, ptB, nRefType, frLoc) ; ;
// creo il vettore
PtrOwner<IGeoVector3d> pGeoVct( CreateGeoVector3d()) ;
bOk = bOk && ! IsNull( pGeoVct) ;
@@ -171,27 +155,14 @@ __stdcall EgtCreateGeoFrame( int nParentId, const double ptOrig[3],
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptOrigL( ptOrig) ;
Vector3d vtXL( vX) ;
Vector3d vtYL( vY) ;
Vector3d vtZL( vZ) ;
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB) {
ptOrigL.ToLoc( frLoc) ;
vtXL.ToLoc( frLoc) ;
vtYL.ToLoc( frLoc) ;
vtZL.ToLoc( frLoc) ;
}
else /* RTY_GRID */ {
ptOrigL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtXL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtYL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtZL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
}
Point3d ptOrigL = GetPointLocal( pGeomDB, ptOrig, nRefType, frLoc) ; ;
Vector3d vtXL = GetVectorLocal( pGeomDB, vX, nRefType, frLoc) ; ;
Vector3d vtYL = GetVectorLocal( pGeomDB, vY, nRefType, frLoc) ; ;
Vector3d vtZL = GetVectorLocal( pGeomDB, vZ, nRefType, frLoc) ; ;
// creo e setto il riferimento
PtrOwner<IGeoFrame3d> pGeoFrm( CreateGeoFrame3d()) ;
bOk = bOk & ! IsNull( pGeoFrm) ;
@@ -230,24 +201,13 @@ EgtCreateText( int nParentId, const Point3d& ptP, double dAngRotDeg,
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL( ptP) ;
Vector3d vtNL = Z_AX ;
Vector3d vtDL = X_AX ;
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB) {
ptPL.ToLoc( frLoc) ;
vtNL.ToLoc( frLoc) ;
vtDL.ToLoc( frLoc) ;
}
else /* RTY_GRID */ {
ptPL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtNL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtDL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
}
Point3d ptPL = GetPointLocal( pGeomDB, ptP.v, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX.v, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, X_AX.v, nRefType, frLoc) ; ;
// creo il testo e lo riempio
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -287,24 +247,13 @@ EgtCreateTextEx( int nParentId, const Point3d& ptP, const Vector3d& vtN, const V
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL( ptP) ;
Vector3d vtNL( vtN) ;
Vector3d vtDL( vtD) ;
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB) {
ptPL.ToLoc( frLoc) ;
vtNL.ToLoc( frLoc) ;
vtDL.ToLoc( frLoc) ;
}
else /* RTY_GRID */ {
ptPL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtNL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtDL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
}
Point3d ptPL = GetPointLocal( pGeomDB, ptP.v, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN.v, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, vtD.v, nRefType, frLoc) ; ;
// creo il testo e lo riempio
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;
@@ -350,24 +299,13 @@ EgtCreateTextAdv( int nParentId, const Point3d& ptP, const Vector3d& vtN, const
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
bool bOk = true ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
// porto in locale l'origine e i versori
Point3d ptPL( ptP) ;
Vector3d vtNL( vtN) ;
Vector3d vtDL( vtD) ;
if ( nRefType != RTY_LOC) {
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
if ( nRefType == RTY_GLOB) {
ptPL.ToLoc( frLoc) ;
vtNL.ToLoc( frLoc) ;
vtDL.ToLoc( frLoc) ;
}
else /* RTY_GRID */ {
ptPL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtNL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
vtDL.LocToLoc( pGeomDB->GetGridFrame(), frLoc) ;
}
}
Point3d ptPL = GetPointLocal( pGeomDB, ptP.v, nRefType, frLoc) ; ;
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN.v, nRefType, frLoc) ; ;
Vector3d vtDL = GetVectorLocal( pGeomDB, vtD.v, nRefType, frLoc) ; ;
// creo il testo e lo imposto
PtrOwner<IExtText> pTXT( CreateExtText()) ;
bOk = bOk && ! IsNull( pTXT) ;