EgtExchange 2.4e1 :
- in import BTL migliorata gestione FreeContour e OutLine per angoli di fianco - in import BTL migliorata gestione cancellazione pezzo con assemblato.
This commit is contained in:
+11
@@ -247,6 +247,17 @@ BtlGeom::ErasePart( void)
|
||||
// se non c'è il DB geometrico o il pezzo corrente, errore
|
||||
if ( m_pGDB == nullptr || m_nPartId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// rimuovo eventuali riferimenti e copie nell'assemblato
|
||||
int nAsseBaseRefId = GDB_ID_NULL ;
|
||||
if ( m_pGDB->GetInfo( m_nPartId, GDB_SI_LIST, nAsseBaseRefId)) {
|
||||
m_pGDB->Erase( nAsseBaseRefId) ;
|
||||
int nInd = 1 ;
|
||||
int nSouPartId = GDB_ID_NULL ;
|
||||
while ( m_pGDB->GetInfo( nAsseBaseRefId + nInd, GDB_SI_SOURCE, nSouPartId) && nSouPartId == m_nPartId) {
|
||||
m_pGDB->Erase( nAsseBaseRefId + nInd) ;
|
||||
++ nInd ;
|
||||
}
|
||||
}
|
||||
// cancello il pezzo
|
||||
m_pGDB->Erase( m_nPartId) ;
|
||||
// annullo tutti gli identificativi del pezzo
|
||||
|
||||
@@ -217,6 +217,7 @@ class BtlGeom
|
||||
ISurfTriMesh* CreateOneCurveFreeContour( const ICurveComposite* pCrvCompo) ;
|
||||
bool AdjustFreeContourCurve( ICurve* pCrv, int nSide, bool& bClosed, bool& bEndsOnCont) ;
|
||||
bool VerifyFreeContourCurveSideAng( const ICurveComposite* pCrvCompo) ;
|
||||
bool GetFreeContourCurveSideAngles( const ICurveComposite* pCrvCompo, DBLVECTOR& vSideAng) ;
|
||||
bool CreatePolygonInBox( const Point3d& ptP, const Vector3d& vtN, int nSide, Polygon3d& Polyg,
|
||||
double dMatMin = FACE_MIN_BACK_MAT, double dAreaMin = FACE_MIN_BACK_AREA) ;
|
||||
double GetPlaneElevation( const Plane3d& plPlane) ;
|
||||
|
||||
@@ -67,6 +67,7 @@ static const std::string IKEY_AUXID = "AUXID" ;
|
||||
static const std::string IKEY_ORIGID = "ORIGID" ;
|
||||
static const std::string IKEY_START_FACE = "FCS" ;
|
||||
static const std::string IKEY_END_FACE = "FCE" ;
|
||||
static const std::string IKEY_SIDEANGS = "SideAngs" ;
|
||||
static const std::string IKEY_DEPTH = "DEPTH" ;
|
||||
static const std::string IKEY_POCKET = "PCKT" ;
|
||||
static const std::string IKEY_RULED = "RULED" ;
|
||||
|
||||
+39
-1
@@ -77,8 +77,14 @@ BtlGeom::AddPartOutline( int nSide, const FCEDEQUE& dqFce, int nContType, int nC
|
||||
int nId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pStm)) ;
|
||||
if ( nId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero eventuali angoli di fianco
|
||||
DBLVECTOR vSideAng ;
|
||||
if ( VerifyFreeContourCurveSideAng( pCrvCompo))
|
||||
GetFreeContourCurveSideAngles( pCrvCompo, vSideAng) ;
|
||||
// inserisco la curva nel DB geometrico
|
||||
int nTId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pCrvCompo)) ;
|
||||
if ( nTId != GDB_ID_NULL && vSideAng.size() > 0)
|
||||
m_pGDB->SetInfo( nTId, IKEY_SIDEANGS, vSideAng) ;
|
||||
// colore
|
||||
Color cCol = m_ProcsCol ;
|
||||
m_pGDB->SetMaterial( nId, cCol) ;
|
||||
@@ -152,6 +158,13 @@ BtlGeom::AddPartOutline( int nSide, int nCrvId, const DBLVECTOR& vdPar, const ST
|
||||
// verifico che sia chiuso
|
||||
if ( ! pCrvCompo->IsClosed())
|
||||
return false ;
|
||||
// assegno eventuali angoli di fianco
|
||||
{ DBLVECTOR vSideAng ;
|
||||
if ( m_pGDB->GetInfo( nCrvId, IKEY_SIDEANGS, vSideAng)) {
|
||||
for ( int i = 0 ; i < int( vSideAng.size()) ; ++ i)
|
||||
pCrvCompo->SetCurveTempProp( i, int( vSideAng[i] * 1000)) ;
|
||||
}
|
||||
}
|
||||
// Lo porto nel riferimento del lato e ve lo appiattisco
|
||||
Frame3d frRef = GetSideFrame( nSide) ;
|
||||
pCrvCompo->ToLoc( frRef) ;
|
||||
@@ -164,7 +177,7 @@ BtlGeom::AddPartOutline( int nSide, int nCrvId, const DBLVECTOR& vdPar, const ST
|
||||
for ( int i = 0 ; i < pCrvCompo->GetCurveCount() ; ++ i) {
|
||||
int nAng ;
|
||||
if ( pCrvCompo->GetCurveTempProp( i, nAng) && abs( nAng) > 10)
|
||||
pCrvCompo->SetCurveTempProp( i, - nAng) ;
|
||||
pCrvCompo->SetCurveTempProp( i, -nAng) ;
|
||||
}
|
||||
}
|
||||
// Porto il percorso sul piano corretto
|
||||
@@ -181,8 +194,14 @@ BtlGeom::AddPartOutline( int nSide, int nCrvId, const DBLVECTOR& vdPar, const ST
|
||||
int nId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pStm)) ;
|
||||
if ( nId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero eventuali angoli di fianco
|
||||
DBLVECTOR vSideAng ;
|
||||
if ( VerifyFreeContourCurveSideAng( pCrvCompo))
|
||||
GetFreeContourCurveSideAngles( pCrvCompo, vSideAng) ;
|
||||
// inserisco la curva nel DB geometrico
|
||||
int nTId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pCrvCompo)) ;
|
||||
if ( nTId != GDB_ID_NULL && vSideAng.size() > 0)
|
||||
m_pGDB->SetInfo( nTId, IKEY_SIDEANGS, vSideAng) ;
|
||||
// colore
|
||||
Color cCol = m_ProcsCol ;
|
||||
m_pGDB->SetMaterial( nId, cCol) ;
|
||||
@@ -253,8 +272,14 @@ BtlGeom::AddPartAperture( int nSide, const FCEDEQUE& dqFce, int nContType, int n
|
||||
int nId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pStm)) ;
|
||||
if ( nId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero eventuali angoli di fianco
|
||||
DBLVECTOR vSideAng ;
|
||||
if ( VerifyFreeContourCurveSideAng( pCrvCompo))
|
||||
GetFreeContourCurveSideAngles( pCrvCompo, vSideAng) ;
|
||||
// inserisco la curva nel DB geometrico
|
||||
int nTId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pCrvCompo)) ;
|
||||
if ( nTId != GDB_ID_NULL && vSideAng.size() > 0)
|
||||
m_pGDB->SetInfo( nTId, IKEY_SIDEANGS, vSideAng) ;
|
||||
// colore
|
||||
Color cCol = m_ProcsCol ;
|
||||
m_pGDB->SetMaterial( nId, cCol) ;
|
||||
@@ -312,6 +337,13 @@ BtlGeom::AddPartAperture( int nSide, int nCrvId, const DBLVECTOR& vdPar, const S
|
||||
// verifico che sia chiuso
|
||||
if ( ! pCrvCompo->IsClosed())
|
||||
return false ;
|
||||
// assegno eventuali angoli di fianco
|
||||
{ DBLVECTOR vSideAng ;
|
||||
if ( m_pGDB->GetInfo( nCrvId, IKEY_SIDEANGS, vSideAng)) {
|
||||
for ( int i = 0 ; i < int( vSideAng.size()) ; ++ i)
|
||||
pCrvCompo->SetCurveTempProp( i, int( vSideAng[i] * 1000)) ;
|
||||
}
|
||||
}
|
||||
// Lo porto nel riferimento del lato e ve lo appiattisco
|
||||
Frame3d frRef = GetSideFrame( nSide) ;
|
||||
pCrvCompo->ToLoc( frRef) ;
|
||||
@@ -335,8 +367,14 @@ BtlGeom::AddPartAperture( int nSide, int nCrvId, const DBLVECTOR& vdPar, const S
|
||||
int nId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pStm)) ;
|
||||
if ( nId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// recupero eventuali angoli di fianco
|
||||
DBLVECTOR vSideAng ;
|
||||
if ( VerifyFreeContourCurveSideAng( pCrvCompo))
|
||||
GetFreeContourCurveSideAngles( pCrvCompo, vSideAng) ;
|
||||
// inserisco la curva nel DB geometrico
|
||||
int nTId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nOutsId, Release( pCrvCompo)) ;
|
||||
if ( nTId != GDB_ID_NULL && vSideAng.size() > 0)
|
||||
m_pGDB->SetInfo( nTId, IKEY_SIDEANGS, vSideAng) ;
|
||||
// colore
|
||||
Color cCol = m_ProcsCol ;
|
||||
m_pGDB->SetMaterial( nId, cCol) ;
|
||||
|
||||
@@ -6700,6 +6700,8 @@ BtlGeom::AdjustFreeContourCurve( ICurve* pCrv, int nSide, bool& bClosed, bool& b
|
||||
bool
|
||||
BtlGeom::VerifyFreeContourCurveSideAng( const ICurveComposite* pCrvCompo)
|
||||
{
|
||||
if ( pCrvCompo == nullptr)
|
||||
return false ;
|
||||
bool bSideAng = false ;
|
||||
for ( int i = 0 ; i < pCrvCompo->GetCurveCount() ; ++ i) {
|
||||
int nAng ;
|
||||
@@ -6711,6 +6713,20 @@ BtlGeom::VerifyFreeContourCurveSideAng( const ICurveComposite* pCrvCompo)
|
||||
return bSideAng ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
BtlGeom::GetFreeContourCurveSideAngles( const ICurveComposite* pCrvCompo, DBLVECTOR& vSideAng)
|
||||
{
|
||||
if ( pCrvCompo == nullptr)
|
||||
return false ;
|
||||
for ( int i = 0 ; i < pCrvCompo->GetCurveCount() ; ++ i) {
|
||||
int nAng = 0 ;
|
||||
pCrvCompo->GetCurveTempProp( i, nAng) ;
|
||||
vSideAng.emplace_back( nAng / 1000.) ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static ISurfTriMesh*
|
||||
MyCreateSubSurfTm( const ISurfTriMesh* pStm, const INTVECTOR& vTria)
|
||||
@@ -7075,8 +7091,14 @@ BtlGeom::CreateFreeContours( void)
|
||||
continue ;
|
||||
// eseguo trim con le facce della trave
|
||||
TrimFlatCurveWithBox( pCrvCompo, FC_OUT_CRV_TOL) ;
|
||||
// recupero eventuali angoli di fianco
|
||||
DBLVECTOR vSideAng ;
|
||||
if ( bOneCurve && VerifyFreeContourCurveSideAng( pCrvCompo))
|
||||
GetFreeContourCurveSideAngles( pCrvCompo, vSideAng) ;
|
||||
// inserisco la curva nel DB geometrico
|
||||
int nTId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nProcsId, Release( pCrvCompo)) ;
|
||||
if ( nTId != GDB_ID_NULL && vSideAng.size() > 0)
|
||||
m_pGDB->SetInfo( nTId, IKEY_SIDEANGS, vSideAng) ;
|
||||
// inserisco eventuale seconda curva
|
||||
int nT2Id = GDB_ID_NULL ;
|
||||
if ( ! bOneCurve) {
|
||||
@@ -7177,6 +7199,13 @@ BtlGeom::AddOneFreeContour( int nGroup, int nProc, int nSide, const string& sDes
|
||||
else if ( nCrvCnt == 1) {
|
||||
// se previsto, imposto spessore
|
||||
pCrvCompo->SetThickness( -dDepth) ;
|
||||
// assegno eventuali angoli di fianco
|
||||
{ DBLVECTOR vSideAng ;
|
||||
if ( m_pGDB->GetInfo( nCrvId, IKEY_SIDEANGS, vSideAng)) {
|
||||
for ( int i = 0 ; i < int( vSideAng.size()) ; ++ i)
|
||||
pCrvCompo->SetCurveTempProp( i, int( vSideAng[i] * 1000)) ;
|
||||
}
|
||||
}
|
||||
// porto la curva nel riferimento della faccia
|
||||
Frame3d frSide = GetSideFrame( nSide) ;
|
||||
pCrvCompo->ToLoc( frSide) ;
|
||||
@@ -7334,8 +7363,14 @@ BtlGeom::AddOneFreeContour( int nGroup, int nProc, int nSide, const string& sDes
|
||||
return false ;
|
||||
// eseguo trim con le facce della trave
|
||||
TrimFlatCurveWithBox( pCrvCompo, FC_OUT_CRV_TOL) ;
|
||||
// recupero eventuali angoli di fianco
|
||||
DBLVECTOR vSideAng ;
|
||||
if ( nCrvCnt == 1 && VerifyFreeContourCurveSideAng( pCrvCompo))
|
||||
GetFreeContourCurveSideAngles( pCrvCompo, vSideAng) ;
|
||||
// inserisco la curva nel DB geometrico
|
||||
int nTId = m_pGDB->AddGeoObj( GDB_ID_NULL, m_nProcsId, Release( pCrvCompo)) ;
|
||||
if ( nTId != GDB_ID_NULL && vSideAng.size() > 0)
|
||||
m_pGDB->SetInfo( nTId, IKEY_SIDEANGS, vSideAng) ;
|
||||
// inserisco eventuale seconda curva
|
||||
int nT2Id = GDB_ID_NULL ;
|
||||
if ( nCrvCnt == 2)
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user