EgtGeomKernel 2.2h4 :
- migliorata gestione GetAuxSurf di ExtText per evitare inutili lungaggini con testi monofilari (rallentamenti notevoli e continui con molti testi).
This commit is contained in:
+21
-11
@@ -34,7 +34,7 @@ GEOOBJ_REGISTER( EXT_TEXT, NGE_E_TXT, ExtText) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
ExtText::ExtText( void)
|
||||
: m_pSTM( nullptr), m_ptP(), m_vtN( 0, 0, 1), m_vtD( 1, 0, 0), m_sFont(),
|
||||
: m_pSTM( nullptr), m_bNoSTM( false), m_ptP(), m_vtN( 0, 0, 1), m_vtD( 1, 0, 0), m_sFont(),
|
||||
m_nWeight( 400), m_bItalic( false), m_dHeight( 10), m_dRatio( 1), m_dAddAdvance( 0), m_nTempProp()
|
||||
{
|
||||
}
|
||||
@@ -813,34 +813,43 @@ ExtText::ApproxWithArcs( double dLinTol, double dAngTolDeg, POLYARCLIST& lstPA)
|
||||
const ISurfTriMesh*
|
||||
ExtText::GetAuxSurf( void) const
|
||||
{
|
||||
// imposto il font corrente e i suoi dati
|
||||
FontManager& fntMgr = FontManager::GetFontManager() ;
|
||||
if ( ! fntMgr.SetCurrFont( m_sFont, m_nWeight, m_bItalic, m_dHeight, m_dRatio, m_dAddAdvance))
|
||||
// se impossibile (font unifilare), esco subito
|
||||
if ( m_bNoSTM)
|
||||
return nullptr ;
|
||||
|
||||
// se già calcolata, la restituisco
|
||||
if ( m_pSTM != nullptr)
|
||||
return m_pSTM ;
|
||||
|
||||
// imposto il font corrente e i suoi dati
|
||||
FontManager& fntMgr = FontManager::GetFontManager() ;
|
||||
if ( ! fntMgr.SetCurrFont( m_sFont, m_nWeight, m_bItalic, m_dHeight, m_dRatio, m_dAddAdvance))
|
||||
return nullptr ;
|
||||
|
||||
// calcolo la trasformazione
|
||||
Frame3d frRef ;
|
||||
if ( ! frRef.Set( m_ptP, m_vtN, m_vtD))
|
||||
return nullptr ;
|
||||
|
||||
// preparo il generatore della superficie
|
||||
StmFromTriangleSoup StmFts ;
|
||||
if ( ! StmFts.Start())
|
||||
return nullptr ;
|
||||
|
||||
// richiedo la lista delle regioni
|
||||
ISURFFRPLIST lstSfr ;
|
||||
if ( ! fntMgr.GetRegion( m_sText, m_nInsPos, lstSfr))
|
||||
if ( ! fntMgr.GetRegion( m_sText, m_nInsPos, lstSfr)) {
|
||||
m_bNoSTM = true ;
|
||||
return nullptr ;
|
||||
}
|
||||
|
||||
// preparo il generatore della superficie
|
||||
StmFromTriangleSoup StmFts ;
|
||||
if ( ! StmFts.Start()) {
|
||||
for ( const auto& pSfr : lstSfr)
|
||||
delete pSfr ;
|
||||
return nullptr ;
|
||||
}
|
||||
|
||||
// per ogni regione richiedo la superficie ausiliaria e la aggiungo a quella generale
|
||||
for ( const auto& pSfr : lstSfr) {
|
||||
// recupero la superficie trimesh
|
||||
const ISurfTriMesh* pStm = pSfr->GetAuxSurf() ;
|
||||
PtrOwner<ISurfTriMesh> pStm( GetBasicSurfFlatRegion( pSfr)->CalcAuxSurf( LIN_TOL_STD, ANG_TOL_STD_DEG)) ;
|
||||
if ( pStm != nullptr) {
|
||||
Triangle3d Tria ;
|
||||
int nT = pStm->GetFirstTriangle( Tria) ;
|
||||
@@ -871,6 +880,7 @@ ExtText::ResetAuxSurf( void) const
|
||||
if ( m_pSTM != nullptr)
|
||||
delete( m_pSTM) ;
|
||||
m_pSTM = nullptr ;
|
||||
m_bNoSTM = false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user