Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 824e6e3ba1 | |||
| 88fa7ef54c | |||
| 82633bf725 | |||
| a27dfd2b54 | |||
| 2a106c4263 |
+4
-60
@@ -583,7 +583,7 @@ ExeCreateDiametralDimension( int nParentId, int nCrvId, const Point3d& ptDim,
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
MyCreateAngularDimension( int nParentId, const Point3d& ptV, const Point3d& ptP1, const Point3d& ptP2,
|
||||
MyCreateAngularDimension( int nParentId, const Point3d& ptP1, const Point3d& ptV, const Point3d& ptP2,
|
||||
const Point3d& ptDim, const string& sText, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
@@ -603,7 +603,7 @@ MyCreateAngularDimension( int nParentId, const Point3d& ptV, const Point3d& ptP1
|
||||
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||
if ( IsNull( pDim) ||
|
||||
! MySetDimensionStyle( pDim ) ||
|
||||
! pDim->SetAngular( ptVL, ptP1L, ptP2L, ptDimL, vtNL, sText))
|
||||
! pDim->SetAngular( ptP1L, ptVL, ptP2L, ptDimL, vtNL, sText))
|
||||
return GDB_ID_NULL ;
|
||||
// inserisco la quota nel DB
|
||||
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||
@@ -611,11 +611,11 @@ MyCreateAngularDimension( int nParentId, const Point3d& ptV, const Point3d& ptP1
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateAngularDimension( int nParentId, const Point3d& ptV, const Point3d& ptP1, const Point3d& ptP2,
|
||||
ExeCreateAngularDimension( int nParentId, const Point3d& ptP1, const Point3d& ptV, const Point3d& ptP2,
|
||||
const Point3d& ptDim, const string& sText, int nRefType)
|
||||
{
|
||||
// eseguo
|
||||
int nId = MyCreateAngularDimension( nParentId, ptV, ptP1, ptP2, ptDim, sText, nRefType) ;
|
||||
int nId = MyCreateAngularDimension( nParentId, ptP1, ptV, ptP2, ptDim, sText, nRefType) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -633,62 +633,6 @@ ExeCreateAngularDimension( int nParentId, const Point3d& ptV, const Point3d& ptP
|
||||
return nId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
MyCreateAngularDimensionEx( int nParentId, const Point3d& ptV1, const Point3d& ptP1,
|
||||
const Point3d& ptV2,const Point3d& ptP2, const Point3d& ptDim,
|
||||
const string& sText, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
nParentId = AdjustId( nParentId) ;
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
if ( ! pGeomDB->GetGroupGlobFrame( nParentId, frLoc))
|
||||
return GDB_ID_NULL ;
|
||||
// porto in locale i punti e assegno i versori
|
||||
Point3d ptV1L = GetPointLocal( pGeomDB, ptV1, nRefType, frLoc) ;
|
||||
Point3d ptP1L = GetPointLocal( pGeomDB, ptP1, nRefType, frLoc) ;
|
||||
Point3d ptV2L = GetPointLocal( pGeomDB, ptV2, nRefType, frLoc) ;
|
||||
Point3d ptP2L = GetPointLocal( pGeomDB, ptP2, nRefType, frLoc) ;
|
||||
Point3d ptDimL = GetPointLocal( pGeomDB, ptDim, nRefType, frLoc) ;
|
||||
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||
// creo la quota
|
||||
PtrOwner<IExtDimension> pDim( CreateExtDimension()) ;
|
||||
if ( IsNull( pDim) ||
|
||||
! MySetDimensionStyle( pDim ) ||
|
||||
! pDim->SetAngularEx( ptV1L, ptP1L, ptV2L, ptP2L, ptDimL, vtNL, sText))
|
||||
return GDB_ID_NULL ;
|
||||
// inserisco la quota nel DB
|
||||
return pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pDim)) ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateAngularDimensionEx( int nParentId, const Point3d& ptV1, const Point3d& ptP1,
|
||||
const Point3d& ptV2, const Point3d& ptP2, const Point3d& ptDim,
|
||||
const string& sText, int nRefType)
|
||||
{
|
||||
// eseguo
|
||||
int nId = MyCreateAngularDimensionEx( nParentId, ptV1, ptP1, ptV2, ptP2, ptDim, sText, nRefType) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAngularDimensionEx(" + IdToString( nParentId) + ",{" +
|
||||
ToString( ptV1) + "},{" +
|
||||
ToString( ptP1) + "},{" +
|
||||
ToString( ptV2) + "},{" +
|
||||
ToString( ptP2) + "},{" +
|
||||
ToString( ptDim) + "},'" +
|
||||
StringToLuaString( sText) + "'," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Id=" + ToString( nId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo del oggetto
|
||||
return nId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
MyCreateAngularDimensionFromLines( int nParentId, INTVECTOR vLineIds, const Point3d& ptDim,
|
||||
|
||||
+66
-146
@@ -1,4 +1,4 @@
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2014-2015
|
||||
//----------------------------------------------------------------------------
|
||||
// File : EXE_GdbCreateSurf.cpp Data : 04.05.15 Versione : 1.6e1
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "/EgtDev/Include/EGkCurveLocal.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include "/EgtDev/Include/EGkExtText.h"
|
||||
#include "/EgtDev/Include/EGkSbzStandard.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -81,7 +80,7 @@ ExeCreateSurfFrRectangle( int nParentId, const Point3d& ptIni, const Point3d& pt
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -132,7 +131,7 @@ ExeCreateSurfFrRectangle3P( int nParentId, const Point3d& ptIni,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -181,7 +180,7 @@ ExeCreateSurfFrStadium( int nParentId, const Point3d& ptIni, const Point3d& ptCr
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -198,7 +197,7 @@ ExeCreateSurfFrDisk( int nParentId, const Point3d& ptOrig, double dRad, int nRef
|
||||
// porto in locale il punto e calcolo la normale in locale
|
||||
Point3d ptOrigL = GetPointLocal( pGeomDB, ptOrig, nRefType, frLoc) ;
|
||||
Vector3d vtNL = GetVectorLocal( pGeomDB, Z_AX, nRefType, frLoc) ;
|
||||
// calcolo riferimento per l'entità
|
||||
// calcolo riferimento per l'entità
|
||||
Frame3d frEnt ;
|
||||
bOk = bOk && frEnt.Set( ptOrigL, vtNL) ;
|
||||
// creo il disco nel suo riferimento intrinseco
|
||||
@@ -218,7 +217,7 @@ ExeCreateSurfFrDisk( int nParentId, const Point3d& ptOrig, double dRad, int nRef
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -262,7 +261,7 @@ ExeCreateSurfFrFatCurve( int nParentId, int nCrvId, double dRad, bool bSquaredEn
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -318,7 +317,7 @@ MyCreateSurfFlatRegion( int nParentId, const INTVECTOR& vCrvIds, int* pnCount)
|
||||
// recupero la prossima superficie
|
||||
pSfr = SfrCntr.GetSurf() ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
@@ -341,7 +340,7 @@ ExeCreateSurfFlatRegion( int nParentId, const INTVECTOR& vCrvIds, int* pnCount)
|
||||
" -- Id=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -390,7 +389,7 @@ ExeCreateSurfTmPlaneInBBox( int nParentId, const Point3d& ptP, const Vector3d& v
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -451,7 +450,7 @@ MyCreateSewPolygon( ISurfTriMesh* pStm, const Polygon3d& Polyg)
|
||||
// verifico esistenza superficie
|
||||
if ( pStm == nullptr)
|
||||
return false ;
|
||||
// se poligono vuoto, non devo fare alcunché
|
||||
// se poligono vuoto, non devo fare alcunché
|
||||
if ( Polyg.GetSideCount() == 0)
|
||||
return true ;
|
||||
// creo la superficie trimesh del poligono
|
||||
@@ -581,7 +580,7 @@ ExeCreateSurfTmConvexHullInBBox( int nParentId, int nId, const BBox3d& b3Box, in
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -629,7 +628,7 @@ ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, bool bRegular, int nRef
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -684,7 +683,7 @@ ExeCreateSurfTmBox( int nParentId, const Point3d& ptIni, const Point3d& ptCross,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -741,7 +740,7 @@ ExeCreateSurfTmPyramid( int nParentId, const Point3d& ptIni, const Point3d& ptCr
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -783,7 +782,7 @@ ExeCreateSurfTmCylinder( int nParentId, const Point3d& ptOrig, const Vector3d& v
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -825,7 +824,7 @@ ExeCreateSurfTmCone( int nParentId, const Point3d& ptOrig, const Vector3d& vtN,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -861,7 +860,7 @@ ExeCreateSurfTmSphere( int nParentId, const Point3d& ptOrig,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -903,7 +902,7 @@ ExeCreateSurfTmTriangle( int nParentId, const Point3d& ptP1, const Point3d& ptP2
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -952,7 +951,7 @@ ExeCreateSurfTmRectangle( int nParentId, const Point3d& ptO, const Point3d& ptL,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -983,7 +982,7 @@ ExeCreateSurfTmByFlatContour( int nParentId, int nCrvId, double dLinTol)
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1029,7 +1028,7 @@ ExeCreateSurfTmByRegion( int nParentId, const INTVECTOR& vCrvIds, double dLinTol
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1084,7 +1083,7 @@ ExeCreateSurfTmByExtrusion( int nParentId, const INTVECTOR& vCrvIds, const Vecto
|
||||
" -- Id=" + ToString( nFirstId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -1128,7 +1127,7 @@ ExeCreateSurfTmByRegionExtrusion( int nParentId, const INTVECTOR& vCrvIds, const
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1168,7 +1167,7 @@ ExeCreateSurfTmByRevolve( int nParentId, int nCrvId,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1210,7 +1209,7 @@ ExeCreateSurfTmByScrewing( int nParentId, int nCrvId,
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1247,13 +1246,13 @@ ExeCreateSurfTmRectSwept( int nParentId, double dDimH, double dDimV, double dBev
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, double dLinTol)
|
||||
ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, double dLinTol, Vector3d* vtStatic)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -1262,17 +1261,40 @@ ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, d
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
||||
// recupero la sezione in locale
|
||||
CurveLocal CrvSect( pGeomDB, nSectId, frLoc) ;
|
||||
bOk = bOk && ( CrvSect.Get() != nullptr) ;
|
||||
// recupero la guida in locale
|
||||
CurveLocal CrvGuide( pGeomDB, nGuideId, frLoc) ;
|
||||
bOk = bOk && ( CrvGuide.Get() != nullptr) ;
|
||||
// creo la superficie trimesh
|
||||
// inizializzazione superficie e suo Id
|
||||
ISurfTriMesh* pSTM = nullptr ;
|
||||
pSTM = ( bOk ? GetSurfTriMeshSwept( CrvSect, CrvGuide, bCapEnds, dLinTol) : nullptr) ;
|
||||
// inserisco la superficie trimesh nel DB
|
||||
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pSTM) : GDB_ID_NULL) ;
|
||||
int nNewId = GDB_ID_NULL ;
|
||||
// recupero il tipo di entità della sezione
|
||||
int nSecType = pGeomDB->GetGeoType( nSectId) ;
|
||||
|
||||
// controllo se la sezione è definita da una curva
|
||||
if ( nSecType == CRV_LINE || nSecType == CRV_ARC ||
|
||||
nSecType == CRV_BEZIER || nSecType == CRV_COMPO) {
|
||||
// recupero la sezione in locale
|
||||
CurveLocal CrvSect( pGeomDB, nSectId, frLoc) ;
|
||||
bOk = bOk && ( CrvSect.Get() != nullptr) ;
|
||||
// calcolo la Swept
|
||||
pSTM = ( bOk ? GetSurfTriMeshSwept( CrvSect, CrvGuide, bCapEnds, dLinTol, vtStatic) : nullptr) ;
|
||||
// inserisco la superficie trimesh nel DB
|
||||
nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pSTM) : GDB_ID_NULL) ;
|
||||
}
|
||||
// controllo se la sezione è definita da una regione piana
|
||||
else if ( nSecType == SRF_FLATRGN) {
|
||||
// recupero la sezione e la porto nel frame corrente
|
||||
PtrOwner<ISurfFlatRegion> pSfrSec( CloneSurfFlatRegion( pGeomDB->GetGeoObj( nSectId))) ;
|
||||
Frame3d frSec ;
|
||||
if ( ! IsNull( pSfrSec) && pGeomDB->GetGlobFrame( nSectId, frSec) &&
|
||||
pSfrSec->LocToLoc( frSec, frLoc)) {
|
||||
// calcolo la Swept
|
||||
pSTM = ( bOk ? GetSurfTriMeshSwept( pSfrSec, CrvGuide, bCapEnds, dLinTol, vtStatic) : nullptr) ;
|
||||
// inserisco la superficie trimesh nel DB
|
||||
nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, pSTM) : GDB_ID_NULL) ;
|
||||
}
|
||||
}
|
||||
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -1284,7 +1306,7 @@ ExeCreateSurfTmSwept( int nParentId, int nSectId, int nGuideId, bool bCapEnds, d
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1321,7 +1343,7 @@ ExeCreateSurfTmTransSwept( int nParentId, int nSectId, int nGuideId, bool bCapEn
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1338,7 +1360,7 @@ ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, int nType
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
||||
// creo la superficie trimesh
|
||||
ISurfTriMesh* pSTM = nullptr ;
|
||||
// se la prima entità è un punto e la seconda una curva
|
||||
// se la prima entità è un punto e la seconda una curva
|
||||
if ( pGeomDB->GetGeoType( nPtOrCrvId1) == GEO_PNT3D &&
|
||||
( pGeomDB->GetGeoType( nPtOrCrvId2) & GEO_CURVE) != 0) {
|
||||
// recupero il punto in locale
|
||||
@@ -1354,7 +1376,7 @@ ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, int nType
|
||||
// calcolo la superficie
|
||||
pSTM = ( bOk ? GetSurfTriMeshRuled( ptP, CrvLoc, dLinTol) : nullptr) ;
|
||||
}
|
||||
// se la prima entità è una curva e la seconda un punto
|
||||
// se la prima entità è una curva e la seconda un punto
|
||||
else if ( ( pGeomDB->GetGeoType( nPtOrCrvId1) & GEO_CURVE) != 0 &&
|
||||
pGeomDB->GetGeoType( nPtOrCrvId2) == GEO_PNT3D) {
|
||||
// recupero la curva in locale
|
||||
@@ -1398,7 +1420,7 @@ ExeCreateSurfTmRuled( int nParentId, int nPtOrCrvId1, int nPtOrCrvId2, int nType
|
||||
" -- Id=" + ToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
@@ -1509,7 +1531,7 @@ ExeCreateSurfTmBySewing( int nParentId, const INTVECTOR& vIds, bool bErase)
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frStmS) ;
|
||||
// lo esprimo rispetto a quello della prima superficie
|
||||
frStmS.ToLoc( frLoc) ;
|
||||
// se è la prima, copio
|
||||
// se è la prima, copio
|
||||
if ( bFirst) {
|
||||
bOk = bOk && pStm->CopyFrom( pStmS) ;
|
||||
bOk = bOk && pStm->ToGlob( frStmS) ;
|
||||
@@ -1677,8 +1699,6 @@ ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV
|
||||
if ( ! pSurfBez->SetControlPoint( i, ptCtrl))
|
||||
bOk = false ;
|
||||
}
|
||||
// calcolo eventuali poli
|
||||
pSurfBez->CalcPoles() ;
|
||||
// se superficie nulla (ovvero ridotta a punto), errore
|
||||
bOk = bOk && ! pSurfBez->IsAPoint() ;
|
||||
// inserisco la superficie nel DB
|
||||
@@ -1700,7 +1720,7 @@ ExeCreateSurfBezier( int nParentId, int nDegU, int nDegV, int nSpanU, int nSpanV
|
||||
" -- Id=" + ToString( nId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nId ;
|
||||
}
|
||||
|
||||
@@ -1731,8 +1751,6 @@ ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, int nSpanU, in
|
||||
if ( ! pSurfBez->SetControlPoint( i, ptCtrl, vPntW[i].second))
|
||||
bOk = false ;
|
||||
}
|
||||
// calcolo eventuali poli
|
||||
pSurfBez->CalcPoles() ;
|
||||
// se superficie nulla (ovvero ridotta a punto), errore
|
||||
bOk = bOk && ! pSurfBez->IsAPoint() ;
|
||||
// inserisco la superficie nel DB
|
||||
@@ -1754,7 +1772,7 @@ ExeCreateSurfBezierRational( int nParentId, int nDegU, int nDegV, int nSpanU, in
|
||||
" -- Id=" + ToString( nId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return nId ;
|
||||
}
|
||||
|
||||
@@ -1825,101 +1843,3 @@ ExeCreateSurfBezierLeaves( int nParentId, int nSurfBzId, int nTextHeight, bool b
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateSurfBezierTria2D( int nParentId, int nSurfBzId, int nTextHeight, bool bShowTrim, int* pnCount)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
nParentId = AdjustId( nParentId) ;
|
||||
// recupero la superficie
|
||||
const ISurfBezier* pSurfBez = GetSurfBezier( pGeomDB->GetGeoObj( nSurfBzId)) ;
|
||||
if ( pSurfBez == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
// disegno i triangoli
|
||||
vector<tuple<int,Point3d,Point3d,Point3d>> vTria2D ;
|
||||
pSurfBez->GetTriangles2D( vTria2D) ;
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
int nCount = 0 ;
|
||||
bool bOk = true ;
|
||||
for ( int k = 0 ; k < (int)vTria2D.size() ; ++ k) {
|
||||
PtrOwner<ISurfTriMesh> pStm( CreateSurfTriMesh()) ;
|
||||
bOk = bOk && ! IsNull( pStm) ;
|
||||
Point3d ptP1L = get<1>(vTria2D[k]) ;
|
||||
Point3d ptP2L = get<2>(vTria2D[k]) ;
|
||||
Point3d ptP3L = get<3>(vTria2D[k]) ;
|
||||
// assegno il triangolo
|
||||
if ( bOk) {
|
||||
pStm->Init( 3, 1, 1) ;
|
||||
int vV[3]{ pStm->AddVertex( ptP1L),
|
||||
pStm->AddVertex( ptP2L),
|
||||
pStm->AddVertex( ptP3L)} ;
|
||||
bOk = ( pStm->AddTriangle( vV) != SVT_NULL) && pStm->AdjustTopology() ;
|
||||
}
|
||||
// inserisco la superficie nel DB
|
||||
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pStm)) : GDB_ID_NULL) ;
|
||||
if ( nNewId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
if ( nFirstId == GDB_ID_NULL)
|
||||
nFirstId = nNewId ;
|
||||
++ nCount ;
|
||||
|
||||
// creo il testo e lo riempio
|
||||
string sText = ToString( get<0>( vTria2D[k])) ;
|
||||
Point3d ptCenter( ( ptP1L + ptP2L + ptP3L) / 3) ;
|
||||
PtrOwner<IExtText> pTXT( CreateExtText()) ;
|
||||
if ( IsNull( pTXT) || ! pTXT->Set( ptCenter, Z_AX, X_AX, sText, "", false, nTextHeight))
|
||||
return GDB_ID_NULL ;
|
||||
// inserisco il testo nel DB
|
||||
int nTxtId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTXT)) ;
|
||||
if ( nTxtId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
++ nCount ;
|
||||
}
|
||||
// se richiesto disegno la regione di trim
|
||||
const ISurfFlatRegion* pSfr = pSurfBez->GetTrimRegion() ;
|
||||
if ( bShowTrim && pSfr != nullptr) {
|
||||
PtrOwner<ISurfFlatRegion> pTrimReg( pSfr->Clone()) ;
|
||||
if ( ! IsNull( pTrimReg)) {
|
||||
int nTrimId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pTrimReg)) ;
|
||||
if ( nTrimId == GDB_ID_NULL)
|
||||
return GDB_ID_NULL ;
|
||||
++ nCount ;
|
||||
}
|
||||
}
|
||||
// restituisco i risultati
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
ExeCreateBezierSphere( int nParentId, const Point3d& ptCenter, double dR, int nRefType) {
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
nParentId = AdjustId( nParentId) ;
|
||||
bool bOk = true ;
|
||||
// recupero il riferimento di immersione della superficie
|
||||
Frame3d frLoc ;
|
||||
bOk = bOk && pGeomDB->GetGroupGlobFrame( nParentId, frLoc) ;
|
||||
// reucpero il punto in locale
|
||||
Point3d ptCenterLoc = GetPointLocal( pGeomDB, ptCenter, nRefType, frLoc) ;
|
||||
// Creo la superficie
|
||||
PtrOwner<ISurfBezier> pSurfBez( CreateBezierSphere( ptCenterLoc, dR)) ;
|
||||
pSurfBez->CalcPoles() ;
|
||||
int nId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pSurfBez)) : GDB_ID_NULL) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtCreateBezierSphere(" + IdToString( nParentId) + "," +
|
||||
ToString( ptCenter) + "," +
|
||||
ToString( dR) + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Id=" + ToString( nId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// resituisco l'identificativo dell'entità creata
|
||||
return nId ;
|
||||
}
|
||||
|
||||
+13
-14
@@ -1462,26 +1462,25 @@ ExeExtractSurfBezierLoops( int nId, int nDestGrpId, int* pnCount)
|
||||
// richiedo i contorni della superficie e li inserisco nel DB
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
int nCount = 0 ;
|
||||
ICRVCOMPOPOVECTOR vCC ;
|
||||
pSbz->GetLoops( vCC , true) ;
|
||||
for ( int i = 0 ; i < int( vCC.size()) ; ++i) {
|
||||
if ( IsNull( vCC[i]) || ! vCC[i]->IsValid())
|
||||
continue ;
|
||||
// porto la curva nel riferimento destinazione
|
||||
bOk = bOk && vCC[i]->LocToLoc(frSurf, frDest) ;
|
||||
// la inserisco nel DB geometrico
|
||||
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( vCC[i])) : GDB_ID_NULL) ;
|
||||
int nL = 0 ;
|
||||
PtrOwner<ICurve> pCrv( bOk ? pSbz->GetLoop( nL) : nullptr) ;
|
||||
while ( ! IsNull( pCrv)) {
|
||||
// porto la curva nel riferimento destinazione
|
||||
bOk = bOk && pCrv->LocToLoc( frSurf, frDest) ;
|
||||
// la inserisco nel DB geometrico
|
||||
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( pCrv)) : GDB_ID_NULL) ;
|
||||
bOk = bOk && ( nNewId != GDB_ID_NULL) ;
|
||||
// copio il materiale
|
||||
if ( ! pGeomDB->CopyMaterial( nId, nNewId))
|
||||
// copio il materiale
|
||||
if ( ! pGeomDB->CopyMaterial( nId, nNewId))
|
||||
return GDB_ID_NULL ;
|
||||
// aggiorno contatori
|
||||
// aggiorno contatori
|
||||
if ( bOk && nFirstId == GDB_ID_NULL)
|
||||
nFirstId = nNewId ;
|
||||
if ( bOk)
|
||||
++ nCount ;
|
||||
// passo alla prossima curva
|
||||
pCrv.Set( bOk ? pSbz->GetLoop( ++nL) : nullptr) ;
|
||||
}
|
||||
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -1494,4 +1493,4 @@ ExeExtractSurfBezierLoops( int nId, int nDestGrpId, int* pnCount)
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
}
|
||||
}
|
||||
|
||||
+32
-133
@@ -77,7 +77,7 @@ MyExplodeSurfTriMesh( int nId, int& nCount)
|
||||
return GDB_ID_NULL ;
|
||||
// recupero il numero di componenti connesse
|
||||
int nParts = pStm->GetPartCount() ;
|
||||
// se ci sono più parti, separo queste
|
||||
// se ci sono pi� parti, separo queste
|
||||
if ( nParts > 1) {
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
nCount = 0 ;
|
||||
@@ -104,7 +104,7 @@ MyExplodeSurfTriMesh( int nId, int& nCount)
|
||||
}
|
||||
// recupero il numero di facce
|
||||
int nFacets = pStm->GetFacetCount() ;
|
||||
// se ci sono più facce, separo queste
|
||||
// se ci sono pi� facce, separo queste
|
||||
if ( nFacets > 1) {
|
||||
// copio tutte le facce
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
@@ -130,7 +130,7 @@ MyExplodeSurfTriMesh( int nId, int& nCount)
|
||||
// restituisco risultati
|
||||
return nFirstId ;
|
||||
}
|
||||
// non devo fare alcunché
|
||||
// non devo fare alcunch�
|
||||
nCount = 1 ;
|
||||
return nId ;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ MyExplodeSurfFlatRegion( int nId, int& nCount)
|
||||
return GDB_ID_NULL ;
|
||||
// recupero il numero di componenti connessi (chunk)
|
||||
int nChunk = pSfr->GetChunkCount() ;
|
||||
// se c'è un solo componente, non devo fare alcunché
|
||||
// se c'� un solo componente, non devo fare alcunch�
|
||||
if ( nChunk == 1) {
|
||||
nCount = 1 ;
|
||||
return nId ;
|
||||
@@ -296,7 +296,7 @@ ExeSurfFrSubtract( int nId1, int nId2)
|
||||
bOk = bOk && ( pSfr2L != nullptr) ;
|
||||
// eseguo la sottrazione della seconda superficie dalla prima
|
||||
bOk = bOk && pSfr1->Subtract( *pSfr2L) ;
|
||||
// se il risultato è vuoto, cancello la FlatRegion
|
||||
// se il risultato � vuoto, cancello la FlatRegion
|
||||
if ( bOk && ! pSfr1->IsValid())
|
||||
pGeomDB->Erase( nId1) ;
|
||||
ExeSetModified() ;
|
||||
@@ -328,7 +328,7 @@ ExeSurfFrIntersect( int nId1, int nId2)
|
||||
bOk = bOk && ( pSfr2L != nullptr) ;
|
||||
// eseguo l'intersezione tra le due superfici
|
||||
bOk = bOk && pSfr1->Intersect( *pSfr2L) ;
|
||||
// se il risultato è vuoto, cancello la FlatRegion
|
||||
// se il risultato � vuoto, cancello la FlatRegion
|
||||
if ( bOk && ! pSfr1->IsValid())
|
||||
pGeomDB->Erase( nId1) ;
|
||||
ExeSetModified() ;
|
||||
@@ -353,7 +353,7 @@ ExeSurfFrOffset( int nId, double dDist, int nType)
|
||||
bool bOk = ( pSfr != nullptr) ;
|
||||
// eseguo l'offset
|
||||
bOk = bOk && pSfr->Offset( dDist, nType) ;
|
||||
// se il risultato è vuoto, cancello la FlatRegion
|
||||
// se il risultato � vuoto, cancello la FlatRegion
|
||||
if ( bOk && ! pSfr->IsValid())
|
||||
pGeomDB->Erase( nId) ;
|
||||
ExeSetModified() ;
|
||||
@@ -443,11 +443,11 @@ bool
|
||||
ExeSurfTmMoveVertex( int nId, int nVert, const Point3d& ptNewVert, int nRefType, bool bUpdate)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero la superficie
|
||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pStm != nullptr) ;
|
||||
// recupero il riferimento in cui è immersa la superficie
|
||||
// recupero il riferimento in cui � immersa la superficie
|
||||
Frame3d frStm ;
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frStm) ;
|
||||
// eseguo la modifica
|
||||
@@ -475,50 +475,6 @@ ExeSurfTmMoveVertex( int nId, int nVert, const Point3d& ptNewVert, int nRefType,
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSurfTmMoveFacet( int nId, int nFacet, const Vector3d& vtMove, int nRefType, bool bUpdate)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la superficie
|
||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pStm != nullptr) ;
|
||||
// recupero il riferimento in cui è immersa la superficie
|
||||
Frame3d frStm ;
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frStm) ;
|
||||
// porto in locale il movimento
|
||||
Vector3d vtMoveL = GetVectorLocal( pGeomDB, vtMove, nRefType, frStm) ;
|
||||
// recupero tutti i vertici della faccia
|
||||
INTVECTOR vVert ;
|
||||
bOk = bOk && pStm->GetAllVertInFacet( nFacet, vVert) ;
|
||||
// sposto tutti i vertici della faccia della quantità desiderata
|
||||
if ( bOk) {
|
||||
for ( const auto nVert : vVert) {
|
||||
// recupero la posizione originale del vertice
|
||||
Point3d ptV ;
|
||||
if ( pStm->GetVertex( nVert, ptV))
|
||||
pStm->MoveVertex( nVert, ptV + vtMoveL) ;
|
||||
}
|
||||
}
|
||||
// se richiesto, semplificazione della trimesh
|
||||
if ( bUpdate)
|
||||
bOk = bOk && pStm->DoCompacting() ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtSurfTmMoveFacet(" + IdToString( nId) + "," +
|
||||
ToString( nFacet) + ",{" +
|
||||
ToString( vtMove) + "}," +
|
||||
RefTypeToString( nRefType) + "," +
|
||||
( bUpdate ? "true" : "false") + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
MySurfTmToTriangles( int nId, int& nCount)
|
||||
@@ -531,7 +487,7 @@ MySurfTmToTriangles( int nId, int& nCount)
|
||||
return GDB_ID_NULL ;
|
||||
// recupero il numero di triangoli
|
||||
int nTria = pStm->GetTriangleCount() ;
|
||||
// se ci sono più triangoli, li separo
|
||||
// se ci sono pi� triangoli, li separo
|
||||
if ( nTria > 1) {
|
||||
// copio tutti triangoli
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
@@ -557,7 +513,7 @@ MySurfTmToTriangles( int nId, int& nCount)
|
||||
// restituisco risultati
|
||||
return nFirstId ;
|
||||
}
|
||||
// non devo fare alcunché
|
||||
// non devo fare alcunch�
|
||||
nCount = 1 ;
|
||||
return nId ;
|
||||
}
|
||||
@@ -692,41 +648,6 @@ ExeCutSurfTmPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSave
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeCutSurfBzPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, bool bSaveOnEq, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la superficie TriMesh
|
||||
ISurfBezier* pSbz = GetSurfBezier( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pSbz != nullptr) ;
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
bOk = bOk && pGeomDB->GetGlobFrame( nId, frLoc) ;
|
||||
// porto in locale il punto e la normale del piano
|
||||
Point3d ptOnL = GetPointLocal( pGeomDB, ptOn, nRefType, frLoc) ;
|
||||
Vector3d vtNL = GetVectorLocal( pGeomDB, vtN, nRefType, frLoc) ;
|
||||
// calcolo il piano di taglio
|
||||
Plane3d plPlane ;
|
||||
bOk = bOk && plPlane.Set( ptOnL, vtNL) ;
|
||||
// eseguo il taglio
|
||||
bOk = bOk && pSbz->Cut( plPlane, bSaveOnEq) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtCutSurfBzPlane(" + IdToString( nId) + ",{" +
|
||||
ToString( ptOn) + "},{" +
|
||||
ToString( vtN) + "}," +
|
||||
( bSaveOnEq ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeCutSurfTmClosedCurve( int nSurfId, int nCurveId, bool bSaveOnEq)
|
||||
@@ -863,6 +784,27 @@ ExeSurfTmIntersect( int nId1, int nId2, bool bTwoColors)
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSurfTmResetTwoColors( int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la superficie TriMesh
|
||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pStm != nullptr) ;
|
||||
// reset dei flag sui triangoli per i due colori
|
||||
bOk = bOk && pStm->ResetTFlags() ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtSurfTmResetTwoColors(" + ToString( nId) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static ISurfTriMesh*
|
||||
MyCreateSubSurfTm( const ISurfTriMesh* pStm, const INTVECTOR& vTria, const INTVECTOR& vTria2)
|
||||
@@ -1074,49 +1016,6 @@ ExeSurfTmSubtractProjectedFacesOnFace( int nSurfId, int nFaceInd, int nDestGrpId
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSurfTmResetTwoColors( int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la superficie TriMesh
|
||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pStm != nullptr) ;
|
||||
// reset dei flag sui triangoli per i due colori
|
||||
bOk = bOk && pStm->ResetTFlags() ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtSurfTmResetTwoColors(" + ToString( nId) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeSurfTmSetShowEdges( int nId, bool bShow)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la superficie trimesh
|
||||
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pStm != nullptr) ;
|
||||
// imposto lo stato di visualizzazione degli spigoli vivi
|
||||
if ( bOk)
|
||||
pStm->SetShowEdges( bShow) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtSurfTmSetShowEdges(" + ToString( nId) + "," +
|
||||
ToString( bShow) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static bool
|
||||
|
||||
+3
-25
@@ -104,9 +104,10 @@ ExeVolZmapChangeResolution( int nId, int nNewRes)
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero lo Zmap
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr) ;
|
||||
if ( pVZM == nullptr)
|
||||
return false ;
|
||||
// cambio la risoluzione (rapporto Voxel/Dexel, valori ammessi 1 e 2)
|
||||
bOk = bOk && pVZM->ChangeResolution( nNewRes) ;
|
||||
bool bOk = pVZM->ChangeResolution( nNewRes) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -119,29 +120,6 @@ ExeVolZmapChangeResolution( int nId, int nNewRes)
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapSetShowEdges( int nId, bool bShow)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero lo Zmap
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bool bOk = ( pVZM != nullptr) ;
|
||||
// imposto lo stato di visualizzazione degli spigoli vivi
|
||||
if ( bOk)
|
||||
pVZM->SetShowEdges( bShow) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapSetShowEdges(" + ToString( nId) + "," +
|
||||
ToString( bShow) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeRemoveVolZmapPart( int nId, int nPart)
|
||||
|
||||
+23
-79
@@ -34,7 +34,6 @@
|
||||
#include "/EgtDev/Include/EGkIntersLineSurfTm.h"
|
||||
#include "/EgtDev/Include/EGkIntersLineVolZmap.h"
|
||||
#include "/EgtDev/Include/EGkIntersPlaneBox.h"
|
||||
#include "/EgtDev/Include/EGkIntersLineSurfBez.h"
|
||||
#include "/EgtDev/Include/EGkIntersPlaneSurfTm.h"
|
||||
#include "/EgtDev/Include/EGkIntersPlaneVolZmap.h"
|
||||
#include "/EgtDev/Include/EGkIntersCurves.h"
|
||||
@@ -71,7 +70,7 @@ MyLineCurveInters( const Point3d& ptP, const Vector3d& vtDir, const int nId, con
|
||||
if ( ! CrvLoc->GetLocalBBox( b3Crv))
|
||||
return false ;
|
||||
b3Crv.Expand( 100 * EPS_SMALL) ;
|
||||
// definisco la linea (punto e direzione sono gi� nel riferimento di calcolo)
|
||||
// definisco la linea (punto e direzione sono già nel riferimento di calcolo)
|
||||
double dLen = 2 * floor( b3Crv.MaxDistFromPoint( ptP)) ;
|
||||
double dOffs = -dLen / 2 ;
|
||||
PtrOwner<ICurveLine> pLine( CreateCurveLine()) ;
|
||||
@@ -161,7 +160,7 @@ ExeLineBoxInters( const Point3d& ptP, const Vector3d& vtDir, const BBox3d& b3Box
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
@@ -194,8 +193,8 @@ MyLineSurfTmInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRef
|
||||
ILSIVECTOR vInfo ;
|
||||
if ( ! IntersLineSurfTm( ptPL, vtDirL, dLen, *pStm, vInfo, false))
|
||||
return false ;
|
||||
|
||||
// filtro le intersezioni
|
||||
|
||||
// filtro le intersezioni
|
||||
FilterLineSurfTmInters( vInfo, vInters) ;
|
||||
|
||||
return true ;
|
||||
@@ -204,75 +203,20 @@ MyLineSurfTmInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRef
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeLineSurfTmInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType,
|
||||
INTDBLVECTOR& vInters)
|
||||
INTDBLVECTOR& vInters)
|
||||
{
|
||||
// eseguo
|
||||
// eseguo
|
||||
bool bOk = MyLineSurfTmInters( ptP, vtDir, nId, nRefType, vInters) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtLineSurfTmInters({" + ToString( ptP) + "},{" +
|
||||
ToString( vtDir) + "}," +
|
||||
ToString( nId) + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static bool
|
||||
MyLineSurfBzInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType, INTDBLVECTOR& vInters)
|
||||
{
|
||||
vInters.clear() ;
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la superficie Bezier
|
||||
const ISurfBezier* pSbz = GetSurfBezier( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pSbz == nullptr)
|
||||
return false ;
|
||||
// recupero il suo riferimento globale
|
||||
Frame3d frSurf ;
|
||||
if ( ! pGeomDB->GetGlobFrame( nId, frSurf))
|
||||
return false ;
|
||||
// porto in locale il punto e la direzione della linea
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frSurf) ;
|
||||
Vector3d vtDirL = GetVectorLocal( pGeomDB, vtDir, nRefType, frSurf) ;
|
||||
vtDirL.Normalize() ;
|
||||
// calcolo l'ingombro della Bezier
|
||||
BBox3d b3Surf ;
|
||||
if ( ! pSbz->GetLocalBBox( b3Surf))
|
||||
return false ;
|
||||
// calcolo l'intersezione
|
||||
double dLen = b3Surf.MaxDistFromPoint( ptPL) ;
|
||||
ILSBIVECTOR vInfo ;
|
||||
if ( ! IntersLineSurfBz( ptPL, vtDirL, dLen, pSbz, vInfo, false))
|
||||
return false ;
|
||||
|
||||
// filtro le intersezioni
|
||||
FilterLineSurfBzInters( vInfo, vInters) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeLineSurfBzInters( const Point3d& ptP, const Vector3d& vtDir, int nId, int nRefType,
|
||||
INTDBLVECTOR& vInters)
|
||||
{
|
||||
// eseguo
|
||||
bool bOk = MyLineSurfBzInters( ptP, vtDir, nId, nRefType, vInters) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtLineSurfBzInters({" + ToString( ptP) + "},{" +
|
||||
ToString( vtDir) + "}," +
|
||||
ToString( nId) + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
@@ -546,7 +490,7 @@ MyPlaneCurveInters( const Point3d& ptOn, const Vector3d& vtN, const int nId, con
|
||||
EPS_SMALL, nPntCount, nCrvCount, nTmp) ;
|
||||
nCount = nPntCount + nCrvCount ;
|
||||
|
||||
// restituisco l'identificativo della prima entit� creata
|
||||
// restituisco l'identificativo della prima entità creata
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -575,7 +519,7 @@ ExePlaneCurveInters( const Point3d& ptOn, const Vector3d& vtN, const int nId, co
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -746,7 +690,7 @@ MyPlaneBoxInters( const Point3d& ptOn, const Vector3d& vtN, const BBox3d& b3Box,
|
||||
nFirstId = nNewId ;
|
||||
++ nSrfCount ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -779,7 +723,7 @@ ExePlaneBoxInters( const Point3d& ptOn, const Vector3d& vtN, const BBox3d& b3Box
|
||||
", CrvNbr=" + ToString( nCrvCount) + ", SrfNbr=" + ToString( nSrfCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -818,7 +762,7 @@ MyPlaneSurfTmInters( const Point3d& ptOn, const Vector3d& vtN, int nId, int nDes
|
||||
// inserisco il risultato dell'intersezione nel DB
|
||||
int nFirstId = MyAddPlaneIntersResultToGeomDB( pGeomDB, vPnt, vBpt, vTria, frSurf, frDest, nId, nDestGrpId, plPlane.GetVersN(), dToler,
|
||||
nPntCount, nCrvCount, nSrfCount) ;
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -852,7 +796,7 @@ ExePlaneSurfTmInters( const Point3d& ptOn, const Vector3d& vtN, int nId, int nDe
|
||||
", CrvNbr=" + ToString( nCrvCount) + ", SrfNbr=" + ToString( nSrfCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -941,7 +885,7 @@ ExeParPlanesSurfTmInters( const Point3d& ptOn, const Vector3d& vtN, const DBLVEC
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -986,7 +930,7 @@ MyPlaneVolZmapInters( const Point3d& ptOn, const Vector3d& vtN, int nId, int nDe
|
||||
nFirstId = nNewId ;
|
||||
++ nCount ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -1010,7 +954,7 @@ ExePlaneVolZmapInters( const Point3d& ptOn, const Vector3d& vtN, int nId, int nD
|
||||
" -- Id=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -1104,7 +1048,7 @@ ExeCurveCurveInters( const int nId1, const int nId2, const int nDestGrpId, int*
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -1231,7 +1175,7 @@ ExeCurveSurfTmInters( const int nCrvId, const int nStmId, const int nDestGrpId,
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -1364,7 +1308,7 @@ MySurfTmSurfTmInters( int nId1, int nId2, int nDestGrpId, double dToler,
|
||||
const ISurfTriMesh* pStm2L = GetSurfTriMesh( Surf2Loc) ;
|
||||
if ( pStm2L == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
// eseguo l'intersezione (gi� espressa nel riferimento destinazione)
|
||||
// eseguo l'intersezione (già espressa nel riferimento destinazione)
|
||||
PNTVECTOR vPnt ;
|
||||
BIPNTVECTOR vBpt ;
|
||||
TRIA3DVECTOR vTria ;
|
||||
@@ -1420,7 +1364,7 @@ MySurfTmSurfTmInters( int nId1, int nId2, int nDestGrpId, double dToler,
|
||||
nFirstId = nNewId ;
|
||||
++ nSrfCount ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
@@ -1452,6 +1396,6 @@ ExeSurfTmSurfTmInters( int nId1, int nId2, int nDestGrpId, double dToler,
|
||||
", CrvNbr=" + ToString( nCrvCount) + ", SrfNbr=" + ToString( nSrfCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entit�
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
Binary file not shown.
+6
-39
@@ -400,13 +400,13 @@ LuaCreateDiametralDimension( lua_State* L )
|
||||
static int
|
||||
LuaCreateAngularDimension(lua_State* L)
|
||||
{
|
||||
// 6 o 7 parametri : ParentId, ptV, ptP1, ptP2, ptDim, Text [, nRefType]
|
||||
// 6 o 7 parametri : ParentId, ptP1, ptV, ptP2, ptDim, Text [, nRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptV ;
|
||||
LuaCheckParam( L, 2, ptV) ;
|
||||
Point3d ptP1 ;
|
||||
LuaCheckParam( L, 3, ptP1) ;
|
||||
LuaCheckParam( L, 2, ptP1) ;
|
||||
Point3d ptV ;
|
||||
LuaCheckParam( L, 3, ptV) ;
|
||||
Point3d ptP2 ;
|
||||
LuaCheckParam( L, 4, ptP2) ;
|
||||
Point3d ptDim ;
|
||||
@@ -417,39 +417,7 @@ LuaCreateAngularDimension(lua_State* L)
|
||||
LuaGetParam( L, 7, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo la quota angolare
|
||||
int nId = ExeCreateAngularDimension( nParentId, ptV, ptP1, ptP2, ptDim, sText, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateAngularDimensionEx(lua_State* L)
|
||||
{
|
||||
// 7 o 8 parametri : ParentId, ptV1, ptP1, ptV2, ptP2, ptDim, Text [, nRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptV1 ;
|
||||
LuaCheckParam( L, 2, ptV1) ;
|
||||
Point3d ptP1 ;
|
||||
LuaCheckParam( L, 3, ptP1) ;
|
||||
Point3d ptV2 ;
|
||||
LuaCheckParam( L, 4, ptV2) ;
|
||||
Point3d ptP2 ;
|
||||
LuaCheckParam( L, 5, ptP2) ;
|
||||
Point3d ptDim ;
|
||||
LuaCheckParam( L, 6, ptDim) ;
|
||||
string sText ;
|
||||
LuaCheckParam( L, 7, sText) ;
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 8, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo la quota angolare
|
||||
int nId = ExeCreateAngularDimensionEx( nParentId, ptV1, ptP1, ptV2, ptP2, ptDim, sText, nRefType) ;
|
||||
int nId = ExeCreateAngularDimension( nParentId, ptP1, ptV, ptP2, ptDim, sText, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
@@ -529,8 +497,7 @@ LuaInstallGdbCreate( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAlignedDimension", LuaCreateAlignedDimension) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtRadialDimension", LuaCreateRadialDimension) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtDiametralDimension", LuaCreateDiametralDimension) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimension", LuaCreateAngularDimension) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimensionEx", LuaCreateAngularDimensionEx) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimension", LuaCreateAngularDimension);
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimensionFromLines", LuaCreateAngularDimensionFromLines) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtAngularDimensionFromArc", LuaCreateAngularDimensionFromArc) ;
|
||||
return bOk ;
|
||||
|
||||
+7
-66
@@ -660,7 +660,7 @@ LuaCreateSurfTmRectSwept( lua_State* L)
|
||||
static int
|
||||
LuaCreateSurfTmSwept( lua_State* L)
|
||||
{
|
||||
// 4 o 5 parametri : ParentId, SectId, GuideId, bCapEnds [, dTol]
|
||||
// 4, 5 o 6 parametri : ParentId, SectId, GuideId, bCapEnds [, dTol] [, vtStatic]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
int nSectId ;
|
||||
@@ -670,10 +670,14 @@ LuaCreateSurfTmSwept( lua_State* L)
|
||||
bool bCapEnds ;
|
||||
LuaCheckParam( L, 4, bCapEnds)
|
||||
double dLinTol = LIN_TOL_SRF ;
|
||||
LuaGetParam( L, 5, dLinTol) ;
|
||||
Vector3d vtStatic = V_INVALID ;
|
||||
if ( LuaGetParam( L, 5, dLinTol)) {
|
||||
LuaGetParam( L, 6, vtStatic) ;
|
||||
}
|
||||
LuaClearStack( L) ;
|
||||
// creo STM swept
|
||||
int nId = ExeCreateSurfTmSwept( nParentId, nSectId, nGuideId, bCapEnds, dLinTol) ;
|
||||
int nId = ExeCreateSurfTmSwept( nParentId, nSectId, nGuideId, bCapEnds, dLinTol,
|
||||
vtStatic.IsValid() ? &vtStatic : nullptr) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nId) ;
|
||||
@@ -929,67 +933,6 @@ LuaCreateSurfBezierLeaves( lua_State* L)
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateSurfBezierTria2D( lua_State* L)
|
||||
{
|
||||
// 2, 3 o 4 parametri : ParentId, nId [, nTextHeight] [, bShowTrim]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
int nSurfBzId ;
|
||||
LuaCheckParam( L, 2, nSurfBzId)
|
||||
int nTextHeight = 50 ;
|
||||
bool bShowTrim = false ;
|
||||
if ( LuaGetParam( L, 3, nTextHeight))
|
||||
LuaGetParam( L, 4, bShowTrim) ;
|
||||
else
|
||||
LuaGetParam( L, 3, bShowTrim) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo la superficie
|
||||
int nCount = 0 ;
|
||||
int nId = ExeCreateSurfBezierTria2D( nParentId, nSurfBzId, nTextHeight, bShowTrim, &nCount) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL) {
|
||||
LuaSetParam( L, nId) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
}
|
||||
else {
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateBezierSphere( lua_State* L)
|
||||
{
|
||||
// 3 o 4 parametri : ParentId, ptCenter, dRad [, nRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptCenter ;
|
||||
LuaCheckParam( L, 2, ptCenter)
|
||||
double dRad ;
|
||||
LuaCheckParam( L, 3, dRad)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 4, nRefType) ;
|
||||
// creo la superficie
|
||||
int nCount = 0 ;
|
||||
int nId = ExeCreateBezierSphere( nParentId, ptCenter, dRad, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL) {
|
||||
LuaSetParam( L, nId) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
}
|
||||
else {
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
LuaInstallGdbCreateSurf( LuaMgr& luaMgr)
|
||||
@@ -1028,7 +971,5 @@ LuaInstallGdbCreateSurf( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezier", LuaCreateSurfBezier) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierRat", LuaCreateSurfBezierRational) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierLeaves", LuaCreateSurfBezierLeaves) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBezierTria2D", LuaCreateSurfBezierTria2D) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCreateBezierSphere", LuaCreateBezierSphere) ;
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
+19
-84
@@ -23,6 +23,7 @@
|
||||
|
||||
using namespace std ;
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaInvertSurf( lua_State* L)
|
||||
@@ -187,30 +188,6 @@ LuaSurfTmMoveVertex( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmMoveFacet( lua_State* L)
|
||||
{
|
||||
// 3 o 4 o 5 parametri : nId, nFacet, vtMove [, nRefId] [, bUpdate]
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nFacet ;
|
||||
LuaCheckParam( L, 2, nFacet)
|
||||
Vector3d vtMove ;
|
||||
LuaCheckParam( L, 3, vtMove)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
bool bUpdate = true ;
|
||||
if ( LuaGetParam( L, 4, nRefType))
|
||||
LuaGetParam( L, 5, bUpdate) ;
|
||||
else
|
||||
LuaGetParam( L, 4, bUpdate) ;
|
||||
LuaClearStack( L) ;
|
||||
// sposto la faccia di indice dato della trimesh
|
||||
bool bOk = ExeSurfTmMoveFacet( nId, nFacet, vtMove, nRefType, bUpdate) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmToTriangles( lua_State* L)
|
||||
@@ -306,29 +283,6 @@ LuaCutSurfTmPlane( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCutSurfBzPlane( lua_State* L)
|
||||
{
|
||||
// 4 o 5 parametri : Id, ptOn, vtN, bSaveOnEq [, nRefType]
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
Point3d ptOn ;
|
||||
LuaCheckParam( L, 2, ptOn)
|
||||
Vector3d vtN ;
|
||||
LuaCheckParam( L, 3, vtN)
|
||||
bool bSaveOnEq ;
|
||||
LuaGetParam( L, 4, bSaveOnEq) ;
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetParam( L, 5, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// taglio la superficie con ilpiano
|
||||
bool bOk = ExeCutSurfBzPlane( nId, ptOn, vtN, bSaveOnEq, nRefType) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCutSurfTmClosedCurve( lua_State* L)
|
||||
@@ -402,6 +356,20 @@ LuaSurfTmIntersect( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmResetTwoColors( lua_State* L)
|
||||
{
|
||||
// 1 parametro : Id
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
LuaClearStack( L) ;
|
||||
// eseguo reset TFlag per annullare due colori
|
||||
bool bOk = ExeSurfTmResetTwoColors( nId) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmSplit( lua_State* L)
|
||||
@@ -477,48 +445,18 @@ LuaSurfTmSubtractProjectedFacesOnFace( lua_State* L)
|
||||
return 4 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmResetTwoColors( lua_State* L)
|
||||
{
|
||||
// 1 parametro : Id
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
LuaClearStack( L) ;
|
||||
// eseguo reset TFlag per annullare due colori
|
||||
bool bOk = ExeSurfTmResetTwoColors( nId) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmSetShowEdges( lua_State* L)
|
||||
{
|
||||
// 2 parametri : Id, bShow
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
bool bShow ;
|
||||
LuaCheckParam( L, 2, bShow) ;
|
||||
LuaClearStack( L) ;
|
||||
// imposto flag visualizzazione spigoli vivi
|
||||
bool bOk = ExeSurfTmSetShowEdges( nId, bShow) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfBzTrim( lua_State* L)
|
||||
{
|
||||
// 2 parametri : nId, nCutterId
|
||||
// 2 parametri : nId, nCutterId
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nCutterId ;
|
||||
LuaCheckParam( L, 2, nCutterId)
|
||||
LuaClearStack( L) ;
|
||||
// taglio la prima superficie in base alla seconda
|
||||
// taglio la prima superficie in base alla seconda
|
||||
//bool bOk = ExeSurfTmCut( nId, nCutterId, bInVsOut, bOn) ;
|
||||
bool bOk = ExeSurfBzTrim( nId, nCutterId) ;
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
@@ -538,22 +476,19 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrOffset", LuaSurfFrOffset) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfFrOffsetAdv", LuaSurfFrOffsetAdv) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmMoveVertex", LuaSurfTmMoveVertex) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmMoveFacet", LuaSurfTmMoveFacet) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmToTriangles", LuaSurfTmToTriangles) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRemoveFacet", LuaSurfTmRemoveFacet) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSwapFacets", LuaSurfTmSwapFacets) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmRemovePart", LuaSurfTmRemovePart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfTmPlane", LuaCutSurfTmPlane) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfBzPlane", LuaCutSurfBzPlane) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfTmClosedCurve", LuaCutSurfTmClosedCurve) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmAdd", LuaSurfTmAdd) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSubtract", LuaSurfTmSubtract) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmIntersect", LuaSurfTmIntersect) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmResetTwoColors", LuaSurfTmResetTwoColors) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSplit", LuaSurfTmSplit) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmCut", LuaSurfTmCut) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSubtractProjectedFacesOnFace", LuaSurfTmSubtractProjectedFacesOnFace) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmResetTwoColors", LuaSurfTmResetTwoColors) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetShowEdges", LuaSurfTmSetShowEdges) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfBzTrim", LuaSurfBzTrim) ;
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
@@ -56,23 +56,6 @@ LuaVolZmapChangeResolution( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaVolZmapSetShowEdges( lua_State* L)
|
||||
{
|
||||
// 2 parametri : Id, bShow
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
bool bShow ;
|
||||
LuaCheckParam( L, 2, bShow) ;
|
||||
LuaClearStack( L) ;
|
||||
// imposto flag visualizzazione spigoli vivi
|
||||
bool bOk = ExeVolZmapSetShowEdges( nId, bShow) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaRemoveVolZmapPart( lua_State* L)
|
||||
@@ -367,7 +350,6 @@ LuaInstallGdbModifyVol( LuaMgr& luaMgr)
|
||||
bool bOk = ( &luaMgr != nullptr) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeVolume", LuaExplodeVolume) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapChangeResolution", LuaVolZmapChangeResolution) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetShowEdges", LuaVolZmapSetShowEdges) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveVolZmapPart", LuaRemoveVolZmapPart) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetAdvTool", LuaVolZmapSetAdvTool) ;
|
||||
|
||||
@@ -123,41 +123,6 @@ LuaLineSurfTmInters( lua_State* L)
|
||||
return 3 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaLineSurfBzInters( lua_State* L)
|
||||
{
|
||||
// 3 o 4 parametri : ptP, vtDir, Id, [, nRefId]
|
||||
Point3d ptP ;
|
||||
LuaCheckParam( L, 1, ptP)
|
||||
Vector3d vtDir ;
|
||||
LuaCheckParam( L, 2, vtDir)
|
||||
int nId ;
|
||||
LuaCheckParam( L, 3, nId)
|
||||
int nRefType = nId ;
|
||||
LuaGetParam( L, 4, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// recupero i punti di intersezione tra linea e superficie trimesh
|
||||
INTDBLVECTOR vInters ;
|
||||
if ( ExeLineSurfBzInters( ptP, vtDir, nId, nRefType, vInters)) {
|
||||
LuaSetParam( L, true) ;
|
||||
INTVECTOR vType( vInters.size()) ;
|
||||
DBLVECTOR vPar( vInters.size()) ;
|
||||
for ( size_t i = 0 ; i < vInters.size() ; ++ i) {
|
||||
vType[i] = vInters[i].first ;
|
||||
vPar[i] = vInters[i].second ;
|
||||
}
|
||||
LuaSetParam( L, vType) ;
|
||||
LuaSetParam( L, vPar) ;
|
||||
}
|
||||
else {
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L) ;
|
||||
}
|
||||
return 3 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaLineVolZmapInters( lua_State* L)
|
||||
@@ -440,7 +405,6 @@ LuaInstallGeoInters( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtLineCurveInters", LuaLineCurveInters) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtLineBoxInters", LuaLineBoxInters) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtLineSurfTmInters", LuaLineSurfTmInters) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtLineSurfBzInters", LuaLineSurfBzInters) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtLineVolZmapInters", LuaLineVolZmapInters) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtPlaneCurveInters", LuaPlaneCurveInters) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtPlaneBoxInters", LuaPlaneBoxInters) ;
|
||||
|
||||
Reference in New Issue
Block a user