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
+1
View File
@@ -785,6 +785,7 @@ CurveLine::Translate( const Vector3d& vtMove)
// la curva deve essere validata
if ( m_nStatus != OK)
return false ;
// imposto ricalcolo della grafica
m_OGrMgr.Reset() ;
+27 -6
View File
@@ -666,6 +666,7 @@ ExtDimension::Translate( const Vector3d& vtMove)
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
m_ptP1.Translate( vtMove) ;
@@ -685,9 +686,14 @@ ExtDimension::Translate( const Vector3d& vtMove)
bool
ExtDimension::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
{
// verifico validità dell'asse di rotazione
if ( vtAx.IsSmall())
return false ;
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
return ( m_vtN.Rotate( vtAx, dCosAng, dSinAng) &&
@@ -711,9 +717,11 @@ ExtDimension::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, doubl
// verifico non sia nulla
if ( abs( dCoeffX) < EPS_ZERO && abs( dCoeffY) < EPS_ZERO && abs( dCoeffZ) < EPS_ZERO)
return false ;
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
// sistemo i vettori
@@ -757,9 +765,11 @@ ExtDimension::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
// verifico validità del piano di specchiatura
if ( vtNorm.IsSmall())
return false ;
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
// eseguo il mirror dei versori
@@ -795,9 +805,11 @@ ExtDimension::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d
// verifico validità dei parametri
if ( vtNorm.IsSmall() || vtDir.IsSmall())
return false ;
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
// sistemo i vettori
@@ -841,12 +853,15 @@ ExtDimension::ToGlob( const Frame3d& frRef)
// verifico validità del frame
if ( frRef.GetType() == Frame3d::ERR)
return false ;
// se riferimento globale, non devo fare alcunch
if ( AreSameFrame( frRef, GLOB_FRM))
// se frame identità, non devo fare alcunché
if ( IsGlobFrame( frRef))
return true ;
// imposto ricalcolo
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
// trasformo punto e versori
@@ -871,12 +886,15 @@ ExtDimension::ToLoc( const Frame3d& frRef)
// verifico validità del frame
if ( frRef.GetType() == Frame3d::ERR)
return false ;
// se riferimento globale, non devo fare alcunch
if ( AreSameFrame( frRef, GLOB_FRM))
// se frame identità, non devo fare alcunché
if ( IsGlobFrame( frRef))
return true ;
// imposto ricalcolo
// imposto ricalcolo
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
// trasformo punto e versori
@@ -901,12 +919,15 @@ ExtDimension::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
m_bToCalc = true ;
m_OGrMgr.Reset() ;
// se valido
if ( m_nType >= DT_LINEAR && m_nType <= DT_ANGULAR) {
// trasformo punto e versori
+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) &&
+8 -7
View File
@@ -822,7 +822,6 @@ SurfBezier::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, d
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità dell'asse di rotazione
if ( vtAx.IsSmall())
return false ;
@@ -845,7 +844,6 @@ SurfBezier::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico non sia nulla
if ( abs( dCoeffX) < EPS_ZERO && abs( dCoeffY) < EPS_ZERO && abs( dCoeffZ) < EPS_ZERO)
return false ;
@@ -880,7 +878,6 @@ SurfBezier::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità del piano di specchiatura
if ( vtNorm.IsSmall())
return false ;
@@ -904,7 +901,6 @@ SurfBezier::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d&
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità dei parametri
if ( vtNorm.IsSmall() || vtDir.IsSmall())
return false ;
@@ -927,11 +923,14 @@ SurfBezier::ToGlob( const Frame3d& frRef)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// 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() ;
@@ -950,11 +949,14 @@ SurfBezier::ToLoc( const Frame3d& frRef)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// 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() ;
@@ -973,7 +975,6 @@ SurfBezier::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità dei frame
if ( frOri.GetType() == Frame3d::ERR || frDest.GetType() == Frame3d::ERR)
return false ;
+44
View File
@@ -625,9 +625,14 @@ SurfFlatRegion::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAn
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// verifico validità dell'asse di rotazione
if ( vtAx.IsSmall())
return false ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
// ruoto il riferimento
return m_frF.Rotate( ptAx, vtAx, dCosAng, dSinAng) ;
}
@@ -639,6 +644,10 @@ SurfFlatRegion::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, dou
// verifico lo stato
if ( m_nStatus != OK || m_vpLoop.empty())
return false ;
// verifico non sia nulla
if ( abs( dCoeffX) < EPS_ZERO && abs( dCoeffY) < EPS_ZERO && abs( dCoeffZ) < EPS_ZERO)
return false ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
@@ -688,6 +697,10 @@ SurfFlatRegion::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
// verifico lo stato
if ( m_nStatus != OK || m_vpLoop.empty())
return false ;
// verifico validità del piano di specchiatura
if ( vtNorm.IsSmall())
return false ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
@@ -732,6 +745,10 @@ SurfFlatRegion::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector
// verifico lo stato
if ( m_nStatus != OK || m_vpLoop.empty())
return false ;
// verifico validità dei parametri
if ( vtNorm.IsSmall() || vtDir.IsSmall())
return false ;
// imposto ricalcolo della grafica
ResetAuxSurf() ;
m_OGrMgr.Reset() ;
@@ -796,9 +813,18 @@ SurfFlatRegion::ToGlob( const Frame3d& frRef)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// 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 il riferimento
return m_frF.ToGlob( frRef) ; ;
}
@@ -810,9 +836,18 @@ SurfFlatRegion::ToLoc( const Frame3d& frRef)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// 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 il riferimento
return m_frF.ToLoc( frRef) ; ;
}
@@ -824,9 +859,18 @@ SurfFlatRegion::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// 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 il riferimento
return m_frF.LocToLoc( frOri, frDest) ; ;
}
+8 -5
View File
@@ -3305,7 +3305,6 @@ SurfTriMesh::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità del piano di specchiatura
if ( vtNorm.IsSmall())
return false ;
@@ -3338,7 +3337,6 @@ SurfTriMesh::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d&
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità dei parametri
if ( vtNorm.IsSmall() || vtDir.IsSmall())
return false ;
@@ -3370,11 +3368,14 @@ SurfTriMesh::ToGlob( const Frame3d& frRef)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// 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 e di hashgrids3d
m_OGrMgr.Reset() ;
ResetHashGrids3d() ;
@@ -3401,11 +3402,14 @@ SurfTriMesh::ToLoc( const Frame3d& frRef)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// 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 e di hashgrids3d
m_OGrMgr.Reset() ;
ResetHashGrids3d() ;
@@ -3432,7 +3436,6 @@ SurfTriMesh::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
// la superficie deve essere validata
if ( m_nStatus != OK)
return false ;
// verifico validità dei frame
if ( frOri.GetType() == Frame3d::ERR || frDest.GetType() == Frame3d::ERR)
return false ;
+46
View File
@@ -630,8 +630,10 @@ VolZmap::Translate( const Vector3d& vtMove)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// imposto ricalcolo della grafica
ResetGraphics() ;
// traslo il riferimento
m_MapFrame.Translate( vtMove) ;
return true ;
@@ -644,8 +646,13 @@ VolZmap::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, doub
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// verifico validità dell'asse di rotazione
if ( vtAx.IsSmall())
return false ;
// imposto ricalcolo della grafica
ResetGraphics() ;
// ruoto il riferimento
m_MapFrame.Rotate( ptAx, vtAx, dCosAng, dSinAng) ;
return true ;
@@ -658,6 +665,10 @@ VolZmap::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCo
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// verifico non sia nulla
if ( abs( dCoeffX) < EPS_ZERO && abs( dCoeffY) < EPS_ZERO && abs( dCoeffZ) < EPS_ZERO)
return false ;
return false ;
}
@@ -668,6 +679,10 @@ VolZmap::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// verifico validità del piano di specchiatura
if ( vtNorm.IsSmall())
return false ;
return false ;
}
@@ -678,6 +693,10 @@ VolZmap::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtD
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// verifico validità dei parametri
if ( vtNorm.IsSmall() || vtDir.IsSmall())
return false ;
return false ;
}
@@ -688,8 +707,17 @@ VolZmap::ToGlob( const Frame3d& frRef)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// 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
ResetGraphics() ;
// trasformo il riferimento
m_MapFrame.ToGlob( frRef) ;
return true ;
@@ -702,8 +730,17 @@ VolZmap::ToLoc( const Frame3d& frRef)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// 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
ResetGraphics() ;
// trasformo il riferimento
m_MapFrame.ToLoc( frRef) ;
return true ;
@@ -716,8 +753,17 @@ VolZmap::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// 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
ResetGraphics() ;
// trasformo il riferimento
m_MapFrame.LocToLoc( frOri, frDest) ;
return true ;