EgtExecutor :

- aggiunto text dimensioni a FlatParts.
This commit is contained in:
Dario Sassi
2015-09-21 10:40:39 +00:00
parent fda3f6aa19
commit 2ca704432a
+21
View File
@@ -20,6 +20,7 @@
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EGkIntersCurves.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
#include "/EgtDev/Include/EGkExtText.h"
#include "/EgtDev/Include/EGkGdbIterator.h"
#include "/EgtDev/Include/EGkIntervals.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
@@ -390,10 +391,30 @@ VerifyAndAdjustFlatParts( void)
}
// inserisco la superficie nel DB
int nNewId = ( bOk ? pGeomDB->AddGeoObj( GDB_ID_NULL, nRegId, pSfr) : GDB_ID_NULL) ;
bOk = bOk && nNewId != GDB_ID_NULL ;
// assegno il colore
Color cCol = AQUA ;
cCol.SetAlpha( 0.3) ;
bOk = bOk && pGeomDB->SetMaterial( nNewId, cCol) ;
// scrittura delle dimensioni nel layer della regione
if ( bOk) {
BBox3d b3Reg ;
pGeomDB->GetGlobalBBox( nNewId, b3Reg) ;
Point3d ptMin, ptMax ;
b3Reg.GetMinMax( ptMin, ptMax) ;
double dDimX = ptMax.x - ptMin.x ;
double dDimY = ptMax.y - ptMin.y ;
string sOut = ToString( ExeToUiUnits( dDimX), 2) + "x" + ToString( ExeToUiUnits( dDimY), 2) ;
Point3d ptCen = Media( ptMin, ptMax, 0.5) ;
Vector3d vtDir = ( dDimX >= dDimY ? X_AX : Y_AX) ;
double dDimT = min( 0.05 * max( dDimX, dDimY), 0.5 * min( dDimX, dDimY)) ;
PtrOwner<IExtText> pText( CreateExtText()) ;
if ( ! IsNull( pText) &&
pText->Set( ptCen, Z_AX, vtDir, sOut, "", 100, false, dDimT, 1, 0, ETXT_IPMC)) {
int nTextId = pGeomDB->AddGeoObj( GDB_ID_NULL, nRegId, Release( pText)) ;
pGeomDB->SetMaterial( nTextId, BLACK) ;
}
}
// taglio le curve aperte con la regione
for ( int i = 0 ; bOk && i < int( vOpenIds.size()) ; ++i) {
ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( vOpenIds[i])) ;