EgtGeomKernel :

- altre piccole ottimizzazioni nel cambio sistema di riferimento.
This commit is contained in:
DarioS
2023-07-27 10:23:03 +02:00
parent 6e34ab6169
commit 2ba32eb93c
7 changed files with 165 additions and 18 deletions
+31
View File
@@ -399,8 +399,11 @@ ExtText::GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag) const
bool
ExtText::Translate( const Vector3d& vtMove)
{
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
// eseguo
m_ptP.Translate( vtMove) ;
return true ;
}
@@ -409,8 +412,15 @@ ExtText::Translate( const Vector3d& vtMove)
bool
ExtText::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
{
// verifico validità dell'asse di rotazione
if ( vtAx.IsSmall())
return false ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
// eseguo
return ( m_ptP.Rotate( ptAx, vtAx, dCosAng, dSinAng) &&
m_vtN.Rotate( vtAx, dCosAng, dSinAng) &&
m_vtD.Rotate( vtAx, dCosAng, dSinAng)) ;
@@ -532,9 +542,18 @@ ExtText::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtD
bool
ExtText::ToGlob( const Frame3d& frRef)
{
// verifico validità del frame
if ( frRef.GetType() == Frame3d::ERR)
return false ;
// se frame identità, non devo fare alcunché
if ( IsGlobFrame( frRef))
return true ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
// trasformo punto e versori
return ( m_ptP.ToGlob( frRef) &&
m_vtN.ToGlob( frRef) &&
@@ -545,9 +564,18 @@ ExtText::ToGlob( const Frame3d& frRef)
bool
ExtText::ToLoc( const Frame3d& frRef)
{
// verifico validità del frame
if ( frRef.GetType() == Frame3d::ERR)
return false ;
// se frame identità, non devo fare alcunché
if ( IsGlobFrame( frRef))
return true ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
// trasformo punto e versori
return ( m_ptP.ToLoc( frRef) &&
m_vtN.ToLoc( frRef) &&
@@ -561,12 +589,15 @@ ExtText::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
// verifico validità dei frame
if ( frOri.GetType() == Frame3d::ERR || frDest.GetType() == Frame3d::ERR)
return false ;
// se i due riferimenti coincidono, non devo fare alcunché
if ( AreSameFrame( frOri, frDest))
return true ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
// trasformo punto e versori
return ( m_ptP.ToGlob( frOri) && m_ptP.ToLoc( frDest) &&
m_vtN.ToGlob( frOri) && m_vtN.ToLoc( frDest) &&