EgtExecutor 1.9c6 :

- correzioni a PictureObj per scalatura dimensioni.
This commit is contained in:
Dario Sassi
2018-03-26 06:04:06 +00:00
parent 443b31c15c
commit 1296bb9ae6
3 changed files with 12 additions and 7 deletions
BIN
View File
Binary file not shown.
+11 -6
View File
@@ -57,7 +57,10 @@ PictureObj::Clone( void) const
try {
pImage->m_nOwnerId = GDB_ID_NULL ;
pImage->m_pGeomDB = nullptr ;
pImage->m_sName = m_sName ;
pImage->m_sPath = m_sPath ;
pImage->m_dDimX = m_dDimX ;
pImage->m_dDimY = m_dDimY ;
}
catch( ...) {
delete pImage ;
@@ -253,17 +256,19 @@ PictureObj::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double
Frame3d frTxt ;
m_pGeomDB->GetTextureFrame( m_nOwnerId, frTxt) ;
// determino i vettori dimensioni della texture
double dDimX, dDimY ;
pScene->GetTextureDimensions( m_sName, dDimX, dDimY) ;
Vector3d vtDimX = frTxt.VersX() * dDimX ;
Vector3d vtDimY = frTxt.VersY() * dDimY ;
//double dDimX, dDimY ;
//pScene->GetTextureDimensions( m_sName, dDimX, dDimY) ;
Vector3d vtDimX = frTxt.VersX() * m_dDimX ;
Vector3d vtDimY = frTxt.VersY() * m_dDimY ;
// pseudoscalo il riferimento della texture
frTxt.PseudoScale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
m_pGeomDB->SetTextureFrame( m_nOwnerId, frTxt) ;
// scalo le dimensioni della texture
vtDimX.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
vtDimY.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
pScene->ChangeTextureDimensions( m_sName, vtDimX.Len(), vtDimY.Len()) ;
m_dDimX = vtDimX.Len() ;
m_dDimY = vtDimY.Len() ;
pScene->ChangeTextureDimensions( m_sName, m_dDimX, m_dDimY) ;
return true ;
}
@@ -312,7 +317,7 @@ PictureObj::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
PictureObj::PictureObj( void)
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr)
: m_nOwnerId( GDB_ID_NULL), m_pGeomDB( nullptr), m_dDimX( 0), m_dDimY( 0)
{
}
+1 -1
View File
@@ -29,6 +29,7 @@ class PictureObj : public IUserObj
bool SetOwner( int nId, IGeomDB* pGDB) override ;
int GetOwner( void) const override ;
IGeomDB* GetGeomDB( void) const override ;
bool GetDimensions( double& dDimX, double& dDimY) const override ;
bool Translate( const Vector3d& vtMove) override ;
bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) override
{ double dAngRad = dAngDeg * DEGTORAD ;
@@ -47,7 +48,6 @@ class PictureObj : public IUserObj
bool GetName( std::string& sName) const ;
bool GetPath( std::string& sPath) const ;
bool ChangePath( const std::string& sPath) ;
bool GetDimensions( double& dDimX, double& dDimY) const ;
private :
int m_nOwnerId ;