EgtGeomKernel 1.5f3 :

- agg. a Text ModifyText e ChangeFont.
This commit is contained in:
Dario Sassi
2014-06-09 08:26:39 +00:00
parent bf2eb6648e
commit e9d45f84df
5 changed files with 74 additions and 0 deletions
BIN
View File
Binary file not shown.
+32
View File
@@ -721,6 +721,8 @@ ExtText::ApproxWithLines( double dLinTol, double dAngTolDeg, POLYLINELIST& lstPL
bool
ExtText::Flip( void)
{
// imposto ricalcolo della grafica
m_OGrMgr.Reset() ;
// recupero il centro
Point3d ptCen ;
if ( ! GetCenterPoint( ptCen))
@@ -736,6 +738,8 @@ ExtText::Flip( void)
bool
ExtText::Mir( bool bOnLen)
{
// imposto ricalcolo della grafica
m_OGrMgr.Reset() ;
// 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))
@@ -771,5 +775,33 @@ ExtText::Mir( bool bOnLen)
m_vtN *= - 1 ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
ExtText::ModifyText( const string& sText)
{
// verifico che il testo sia valido
if ( sText.empty())
return false ;
// imposto ricalcolo della grafica
m_OGrMgr.Reset() ;
// assegno nuovo test
m_sText = sText ;
return true ;
}
//----------------------------------------------------------------------------
bool
ExtText::ChangeFont( const string& sFont)
{
// imposto ricalcolo della grafica
m_OGrMgr.Reset() ;
// assegno nuovo font
m_sFont = sFont ;
return true ;
}
+2
View File
@@ -92,6 +92,8 @@ class ExtText : public IExtText, public IGeoObjRW
virtual bool ApproxWithLines( double dLinTol, double dAngTolDeg, POLYLINELIST& lstPL) const ;
virtual bool Flip( void) ;
virtual bool Mir( bool bOnLen) ;
virtual bool ModifyText( const std::string& sText) ;
virtual bool ChangeFont( const std::string& sFont) ;
public : // IGeoObjRW
virtual int GetNgeId( void) const ;
+38
View File
@@ -1922,6 +1922,14 @@ GdbExecutor::ExecuteText( const string& sCmd2, const STRVECTOR& vsParams)
else
return TextComplete( vsParams) ;
}
// modifica del testo
else if ( sCmd2 == "MT" || sCmd2 == "MODIFYTEXT") {
return TextModifyText( vsParams) ;
}
// cambio del font
else if ( sCmd2 == "CF" || sCmd2 == "CHANGEFONT") {
return TextChangeFont( vsParams) ;
}
// flip del testo
else if ( sCmd2 == "FLIP") {
return TextFlip( vsParams) ;
@@ -2042,6 +2050,36 @@ GdbExecutor::TextComplete( const STRVECTOR& vsParams)
return AddGeoObj( vsParams[0], vsParams[1], Release( pTXT)) ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::TextModifyText( const STRVECTOR& vsParams)
{
// 2 parametri : Id, NewText
if ( vsParams.size() != 2)
return false ;
// recupero il testo
IExtText* pTXT = GetExtText( m_pGDB->GetGeoObj( GetIdParam( vsParams[0]))) ;
if ( pTXT == nullptr)
return false ;
// eseguo l'operazione
return pTXT->ModifyText( vsParams[1]) ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::TextChangeFont( const STRVECTOR& vsParams)
{
// 2 parametri : Id, NewFont
if ( vsParams.size() != 2)
return false ;
// recupero il testo
IExtText* pTXT = GetExtText( m_pGDB->GetGeoObj( GetIdParam( vsParams[0]))) ;
if ( pTXT == nullptr)
return false ;
// eseguo l'operazione
return pTXT->ChangeFont( vsParams[1]) ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::TextFlip( const STRVECTOR& vsParams)
+2
View File
@@ -96,6 +96,8 @@ class GdbExecutor : public IGdbExecutor
bool ExecuteText( const std::string& sCmd2, const STRVECTOR& vsParams) ;
bool TextSimple( const STRVECTOR& vsParams) ;
bool TextComplete( const STRVECTOR& vsParams) ;
bool TextModifyText( const STRVECTOR& vsParams) ;
bool TextChangeFont( const STRVECTOR& vsParams) ;
bool TextFlip( const STRVECTOR& vsParams) ;
bool TextMir( const STRVECTOR& vsParams) ;
bool TextOutline( const STRVECTOR& vsParams) ;