From d851fe15aba81616ff24e8938bda5c1b1634a68b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 1 Sep 2015 07:26:22 +0000 Subject: [PATCH] =?UTF-8?q?EgtGeomKernel=201.6h5=20:=20-=20corretta=20enti?= =?UTF-8?q?t=C3=A0=20testo=20per=20posizione=20inserimento=20Middle=20Cent?= =?UTF-8?q?er=20-=20corretta=20scalatura=20regioni=20per=20eventuale=20mir?= =?UTF-8?q?ror=20intrinseco=20con=20coeff.=20egativi.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtGeomKernel.rc | Bin 11710 -> 11710 bytes FontAux.cpp | 6 +++--- Frame3d.cpp | 2 +- StmStandard.cpp | 22 +++++++++++----------- SurfFlatRegion.cpp | 9 +++++++++ 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc index ec3523f0d493d888648dcf0cb697ddeff0e7d02b..9c416bb98341d7da7f7be1f4f7c6087f9376611e 100644 GIT binary patch delta 94 zcmdlNy)SyhFE&Qg&A-_cnHfzdD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-X4V@L delta 94 zcmdlNy)SyhFE&P#&A-_cnHfzcD{|{@_Trkr0u;H;XNwSVW8B;$>;>dw2zN+>g;Df- LFmBFL4&ed-WjGrO diff --git a/FontAux.cpp b/FontAux.cpp index 07b4969..906e1f8 100644 --- a/FontAux.cpp +++ b/FontAux.cpp @@ -43,11 +43,11 @@ GetTextInsertPointMove( double dMaxW, double dAscent, double dMinH, int nInsPos) case ETXT_IPTR : return Vector3d( - dMaxW, - dAscent, 0) ; case ETXT_IPML : - return Vector3d( 0, 0.5 * ( dMinH - dAscent), 0) ; + return Vector3d( 0, - 0.5 * ( dMinH + dAscent), 0) ; case ETXT_IPMC : - return Vector3d( - 0.5 * dMaxW, 0.5 * ( dMinH - dAscent), 0) ; + return Vector3d( - 0.5 * dMaxW, - 0.5 * ( dMinH + dAscent), 0) ; case ETXT_IPMR : - return Vector3d( - dMaxW, 0.5 * ( dMinH - dAscent), 0) ; + return Vector3d( - dMaxW, - 0.5 * ( dMinH + dAscent), 0) ; default : case ETXT_IPBL : return Vector3d( 0, - dMinH, 0) ; diff --git a/Frame3d.cpp b/Frame3d.cpp index d1e7fd5..83bfa89 100644 --- a/Frame3d.cpp +++ b/Frame3d.cpp @@ -306,7 +306,7 @@ Frame3d::PseudoScale( const Frame3d& frRef, double dCoeffX, double dCoeffY, doub return true ; } - // altrimenti, devo scalare anche i versori X e Y + // altrimenti, devo scalare i versori X e Y e ricavare Z di conseguenza Point3d ptDirXS = m_ptOrig + AXIS_LEN * m_vtVersX ; ptDirXS.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ; Point3d ptDirYS = m_ptOrig + AXIS_LEN * m_vtVersY ; diff --git a/StmStandard.cpp b/StmStandard.cpp index 1daf8c3..db80fb1 100644 --- a/StmStandard.cpp +++ b/StmStandard.cpp @@ -22,17 +22,17 @@ using namespace std ; //------------------------------------------------------------------------------- ISurfTriMesh* -GetSurfTriMeshBox( double dWidth, double dLen, double dHeight) +GetSurfTriMeshBox( double dDimX, double dDimY, double dHeight) { // le dimensioni devono essere significative - if ( dWidth < EPS_SMALL || dLen < EPS_SMALL || fabs( dHeight) < EPS_SMALL) + if ( dDimX < EPS_SMALL || dDimY < EPS_SMALL || fabs( dHeight) < EPS_SMALL) return nullptr ; // creo la polilinea del contorno della base PolyLine PL ; PL.AddUPoint( 0, ORIG) ; - PL.AddUPoint( 1, Point3d( dWidth, 0, 0)) ; - PL.AddUPoint( 2, Point3d( dWidth, dLen, 0)) ; - PL.AddUPoint( 3, Point3d( 0, dLen, 0)) ; + PL.AddUPoint( 1, Point3d( dDimX, 0, 0)) ; + PL.AddUPoint( 2, Point3d( dDimX, dDimY, 0)) ; + PL.AddUPoint( 3, Point3d( 0, dDimY, 0)) ; PL.AddUPoint( 4, ORIG) ; if ( dHeight < 0) PL.Invert() ; @@ -63,22 +63,22 @@ GetSurfTriMeshBox( double dWidth, double dLen, double dHeight) //------------------------------------------------------------------------------- ISurfTriMesh* -GetSurfTriMeshPyramid( double dWidth, double dLen, double dHeight) +GetSurfTriMeshPyramid( double dDimX, double dDimY, double dHeight) { // le dimensioni devono essere significative - if ( dWidth < EPS_SMALL || dLen < EPS_SMALL || fabs( dHeight) < EPS_SMALL) + if ( dDimX < EPS_SMALL || dDimY < EPS_SMALL || fabs( dHeight) < EPS_SMALL) return nullptr ; // creo la polilinea del contorno della base PolyLine PL ; PL.AddUPoint( 0, ORIG) ; - PL.AddUPoint( 1, Point3d( dWidth, 0, 0)) ; - PL.AddUPoint( 2, Point3d( dWidth, dLen, 0)) ; - PL.AddUPoint( 3, Point3d( 0, dLen, 0)) ; + PL.AddUPoint( 1, Point3d( dDimX, 0, 0)) ; + PL.AddUPoint( 2, Point3d( dDimX, dDimY, 0)) ; + PL.AddUPoint( 3, Point3d( 0, dDimY, 0)) ; PL.AddUPoint( 4, ORIG) ; if ( dHeight < 0) PL.Invert() ; // punto di vertice - Point3d ptTip( 0.5 * dWidth, 0.5 * dLen, dHeight) ; + Point3d ptTip( 0.5 * dDimX, 0.5 * dDimY, dHeight) ; // creo e setto la superficie trimesh laterale PtrOwner pSTM( CreateSurfTriMesh()) ; if ( IsNull( pSTM) || ! pSTM->CreateByPointCurve( ptTip, PL)) diff --git a/SurfFlatRegion.cpp b/SurfFlatRegion.cpp index 4cce55e..cc1a91d 100644 --- a/SurfFlatRegion.cpp +++ b/SurfFlatRegion.cpp @@ -539,11 +539,20 @@ SurfFlatRegion::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, dou Frame3d frRefLoc = frRef ; frRefLoc.ToLoc( m_frF) ; + // determino se contiene anche un mirror (numero dispari di coefficienti negativi) + bool bMirror = ( dCoeffX < 0) ; + bMirror = ( bMirror ? ( dCoeffY > 0) : ( dCoeffY < 0)) ; + bMirror = ( bMirror ? ( dCoeffZ > 0) : ( dCoeffZ < 0)) ; + // ciclo sui loop bool bOk = true ; for ( auto& pLoop : m_vpLoop) { if ( ! pLoop->Scale( frRefLoc, dCoeffX, dCoeffY, dCoeffZ)) bOk = false ; + if ( bMirror) { + if ( ! pLoop->Invert()) + bOk = false ; + } } return bOk ;