EgtGeomKernel 1.5a6 : prima versione di scalatura non uniforme,

aggiunto comando COUNTER in tsc.
This commit is contained in:
Dario Sassi
2014-01-19 11:19:56 +00:00
parent adfa66cbb0
commit 4ebb43bf1e
27 changed files with 124 additions and 64 deletions
+2 -2
View File
@@ -533,7 +533,7 @@ CurveArc::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, dou
//----------------------------------------------------------------------------
bool
CurveArc::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
CurveArc::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
// la curva deve essere validata
if ( m_nStatus != OK)
@@ -548,7 +548,7 @@ CurveArc::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dC
return false ;
// scalo il centro e le dimensioni lineari
m_PtCen.Scale( ptCen, dCoeffX, dCoeffX, dCoeffX) ;
m_PtCen.Scale( frRef, dCoeffX, dCoeffX, dCoeffX) ;
m_dRad *= fabs( dCoeffX) ;
m_dDeltaN *= dCoeffX ;
if ( dCoeffX < 0)
+1 -1
View File
@@ -33,7 +33,7 @@ class CurveArc : public ICurveArc
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
virtual bool ToGlob( const Frame3d& frRef) ;
virtual bool ToLoc( const Frame3d& frRef) ;
+2 -2
View File
@@ -1239,7 +1239,7 @@ CurveBezier::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng,
//----------------------------------------------------------------------------
bool
CurveBezier::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
CurveBezier::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
int i ;
@@ -1254,7 +1254,7 @@ CurveBezier::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double
// scalo i punti di controllo
for ( i = 0 ; i <= m_nDeg ; ++ i)
m_aPtCtrl[i].Scale( ptCen, dCoeffX, dCoeffY, dCoeffZ) ;
m_aPtCtrl[i].Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
return true ;
}
+1 -1
View File
@@ -35,7 +35,7 @@ class CurveBezier : public ICurveBezier
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
virtual bool ToGlob( const Frame3d& frRef) ;
virtual bool ToLoc( const Frame3d& frRef) ;
+4 -4
View File
@@ -759,7 +759,7 @@ CurveComposite::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAn
//----------------------------------------------------------------------------
bool
CurveComposite::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
CurveComposite::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
PCRVSMPL_LIST::iterator Iter ;
@@ -774,11 +774,11 @@ CurveComposite::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, dou
// scalo le singole curve
for ( Iter = m_CrvSmplS.begin() ; Iter != m_CrvSmplS.end() ; ++Iter)
(*Iter)->Scale( ptCen, dCoeffX, dCoeffX, dCoeffX) ;
(*Iter)->Scale( frRef, dCoeffX, dCoeffX, dCoeffX) ;
// scalo i punti estremi
m_PtStart.Scale( ptCen, dCoeffX, dCoeffX, dCoeffX) ;
m_PtEnd.Scale( ptCen, dCoeffX, dCoeffX, dCoeffX) ;
m_PtStart.Scale( frRef, dCoeffX, dCoeffX, dCoeffX) ;
m_PtEnd.Scale( frRef, dCoeffX, dCoeffX, dCoeffX) ;
return Validate() ;
}
+1 -1
View File
@@ -37,7 +37,7 @@ class CurveComposite : public ICurveComposite
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
virtual bool ToGlob( const Frame3d& frRef) ;
virtual bool ToLoc( const Frame3d& frRef) ;
+3 -3
View File
@@ -359,15 +359,15 @@ CurveLine::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, do
//----------------------------------------------------------------------------
bool
CurveLine::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
CurveLine::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
// verifico non sia nulla
if ( fabs( dCoeffX) < EPS_ZERO && fabs( dCoeffY) < EPS_ZERO && fabs( dCoeffZ) < EPS_ZERO)
return false ;
// scalo i punti estremi
m_PtStart.Scale( ptCen, dCoeffX, dCoeffY, dCoeffZ) ;
m_PtEnd.Scale( ptCen, dCoeffX, dCoeffY, dCoeffZ) ;
m_PtStart.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
m_PtEnd.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
m_nStatus = TO_VERIFY ;
return Validate() ;
+1 -1
View File
@@ -33,7 +33,7 @@ class CurveLine : public ICurveLine
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
virtual bool ToGlob( const Frame3d& frRef) ;
virtual bool ToLoc( const Frame3d& frRef) ;
BIN
View File
Binary file not shown.
+1
View File
@@ -287,6 +287,7 @@ copy $(TargetPath) \EgtProg\Dll</Command>
<ClInclude Include="..\Include\EGnStringUtils.h" />
<ClInclude Include="..\Include\EgtILogger.h" />
<ClInclude Include="..\Include\EgtLogger.h" />
<ClInclude Include="..\Include\EgtPerfCounter.h" />
<ClInclude Include="..\Include\EgtPointerOwner.h" />
<ClInclude Include="..\Include\EgtTargetVer.h" />
<ClInclude Include="..\Include\EgtTrace.h" />
+3
View File
@@ -299,6 +299,9 @@
<ClInclude Include="DistPointCrvComposite.h">
<Filter>File di intestazione</Filter>
</ClInclude>
<ClInclude Include="..\Include\EgtPerfCounter.h">
<Filter>File di intestazione</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="EgtGeomKernel.rc">
+49 -9
View File
@@ -1,13 +1,13 @@
//----------------------------------------------------------------------------
// EgalTech 2013-2013
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : GdbExecutor.cpp Data : 25.11.13 Versione : 1.3a5
// File : GdbExecutor.cpp Data : 19.01.14 Versione : 1.5a6
// Contenuto : Implementazione della classe GdbExecutor.
//
//
//
// Modifiche : 27.03.13 DS Creazione modulo.
//
// 19.01.14 DS Agg. COUNTER.
//
//----------------------------------------------------------------------------
@@ -126,6 +126,8 @@ GdbExecutor::Execute( const string& sCmd1, const string& sCmd2, const STRVECTOR&
return ExecuteSave( vsParams) ;
else if ( sCmd1 == "OUTSCL")
return ExecuteOutScl( sCmd2, vsParams) ;
else if ( sCmd1 == "COUNTER")
return ExecuteCounter( sCmd2, vsParams) ;
return false ;
}
@@ -749,6 +751,18 @@ GdbExecutor::GetPointWParam( const std::string& sParam, Point3d& ptP, double& dW
return false ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::GetFrameParam( const std::string& sParam, Frame3d& frF)
{
// deve essere nome di frame già nel DB
const IGeoFrame3d* pFr ;
if ( ( pFr = GetGeoFrame3d( m_pGDB->GetGeoObj( GetIdParam( sParam)))) == nullptr)
return false ;
frF = pFr->GetFrame() ;
return true ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::ExecuteCopy( const STRVECTOR& vsParams)
@@ -858,19 +872,26 @@ GdbExecutor::ExecuteScale( const STRVECTOR& vsParams)
STRVECTOR vsNames ;
STRVECTOR::iterator Iter ;
Point3d ptPC ;
Frame3d frRef ;
double dCoeffX ;
double dCoeffY ;
double dCoeffZ ;
// 5 parametri ( Nome, Punto, CoeffX, CoeffY, CoeffZ)
// 5 parametri ( Nome, Punto o Frame, CoeffX, CoeffY, CoeffZ)
if ( vsParams.size() != 5)
return false ;
// recupero lista nomi
if ( ! GetNamesParam( vsParams[0], vsNames))
return false ;
// recupero il punto
if ( ! GetPointParam( vsParams[1], ptPC))
// provo a recuperare un punto
if ( GetPointParam( vsParams[1], ptPC))
frRef.Set( ptPC, Frame3d::TOP) ;
// provo a recuperare un frame
else if ( GetFrameParam( vsParams[1], frRef))
;
// altrimenti errore
else
return false ;
// recupero i coefficienti
if ( ! FromString( vsParams[2], dCoeffX) ||
@@ -879,7 +900,7 @@ GdbExecutor::ExecuteScale( const STRVECTOR& vsParams)
return false ;
// esecuzione scalature
for ( Iter = vsNames.begin() ; Iter != vsNames.end() ; ++Iter) {
if ( ! m_pGDB->Scale( GetIdParam( *Iter), ptPC, dCoeffX, dCoeffY, dCoeffZ))
if ( ! m_pGDB->Scale( GetIdParam( *Iter), frRef, dCoeffX, dCoeffY, dCoeffZ))
return false ;
}
@@ -1116,7 +1137,7 @@ GdbExecutor::ExecuteOutScl( const string& sCmd2, const STRVECTOR& vsParams)
for ( Iter = vsNames.begin() ; Iter != vsNames.end() ; ++Iter) {
// recupero l'oggetto ed eseguo l'output
nId = GetIdParam( *Iter) ;
if ( ! m_OutScl.PutCurve( m_pGDB->GetGeoObj( nId), nFlag))
if ( ! m_OutScl.PutGeoObj( m_pGDB->GetGeoObj( nId), nFlag))
return false ;
}
return true ;
@@ -1160,7 +1181,7 @@ GdbExecutor::OutGroupScl( int nId, int nFlag)
while ( bNext) {
nGdbType = Iter.GetGdbType() ;
if ( nGdbType == GDB_GEO) {
if ( ! m_OutScl.PutCurve( Iter.GetGeoObj(), nFlag))
if ( ! m_OutScl.PutGeoObj( Iter.GetGeoObj(), nFlag))
return false ;
}
else if ( nGdbType == GDB_GROUP) {
@@ -1173,3 +1194,22 @@ GdbExecutor::OutGroupScl( int nId, int nFlag)
return true ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::ExecuteCounter( const string& sCmd2, const STRVECTOR& vsParams)
{
// avvio il counter
if ( sCmd2 == "START") {
m_Counter.Start() ;
}
// fermo il counter ed emetto i risultati
else if ( sCmd2 == "STOP") {
m_Counter.Stop() ;
string sOut = " " + ( ( vsParams.size() >= 1) ? vsParams[0] : "ExecTime =") ;
sOut += " " + ToString( m_Counter.GetTime(), 2) + " ms" ;
LOG_INFO( GetEGkLogger(), sOut.c_str())
}
return true ;
}
+4
View File
@@ -14,6 +14,7 @@
#pragma once
#include "/EgtDev/Include/EgkGdbExecutor.h"
#include "/EgtDev/Include/EgtPerfCounter.h"
#include "GeomDB.h"
#include "OutScl.h"
@@ -35,6 +36,7 @@ class GdbExecutor : public IGdbExecutor
bool GetVectorParam( const std::string& sParam, Vector3d& vtV) ;
bool GetPointParam( const std::string& sParam, Point3d& ptP) ;
bool GetPointWParam( const std::string& sParam, Point3d& ptP, double& dW) ;
bool GetFrameParam( const std::string& sParam, Frame3d& frF) ;
bool ExecuteGroup( const std::string& sCmd2, const STRVECTOR& vsParams) ;
bool ExecutePoint( const std::string& sCmd2, const STRVECTOR& vsParams) ;
bool ExecuteVector( const std::string& sCmd2, const STRVECTOR& vsParams) ;
@@ -55,10 +57,12 @@ class GdbExecutor : public IGdbExecutor
bool ExecuteSave( const STRVECTOR& vsParams) ;
bool ExecuteOutScl( const std::string& sCmd2, const STRVECTOR& vsParams) ;
bool OutGroupScl( int nId, int nFlag) ;
bool ExecuteCounter( const std::string& sCmd2, const STRVECTOR& vsParams) ;
private :
IGeomDB* m_pGDB ;
OutScl m_OutScl ;
typedef std::unordered_map<std::string, int> NameMap ;
NameMap m_NameMap ;
PerformanceCounter m_Counter ;
} ;
+6 -11
View File
@@ -197,11 +197,11 @@ GdbGroup::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, dou
//----------------------------------------------------------------------------
bool
GdbGroup::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
GdbGroup::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
bool bOk ;
bool bUniform ;
Point3d ptCenLoc ;
Frame3d frRefLoc ;
GdbNode* pGdbNode ;
@@ -210,20 +210,15 @@ GdbGroup::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dC
// determino se la scalatura è uniforme
bUniform = fabs( dCoeffX - dCoeffY) < EPS_SMALL && fabs( dCoeffX - dCoeffZ) < EPS_SMALL ;
// se la scalatura è uniforme, basta portare il centro nel riferimento del gruppo
//if ( bUniform) {
ptCenLoc = ptCen ;
ptCenLoc.ToLoc( m_gfrFrame.m_frF) ;
// }
//// altrimenti si deve propagare il riferimento rispetto al centro
// else
// return false ; // !!!!! TODO !!!!!
// basta portare il riferimento di scalatura nel riferimento del gruppo
frRefLoc = frRef ;
frRefLoc.ToLoc( m_gfrFrame.m_frF) ;
// ciclo sui nodi
bOk = true ;
pGdbNode = GetFirstNode() ;
while ( pGdbNode != nullptr) {
if ( ! pGdbNode->Scale( ptCenLoc, dCoeffX, dCoeffY, dCoeffZ))
if ( ! pGdbNode->Scale( frRefLoc, dCoeffX, dCoeffY, dCoeffZ))
bOk = false ;
pGdbNode = pGdbNode->GetNext() ;
}
+1 -1
View File
@@ -36,7 +36,7 @@ class GdbGroup : public GdbNode
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
public :
GdbGroup( void) ;
+1 -1
View File
@@ -35,7 +35,7 @@ class GdbNode
virtual bool Translate( const Vector3d& vtMove) = 0 ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) = 0 ;
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad) = 0 ;
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) = 0 ;
//virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) = 0 ;
public :
+2 -2
View File
@@ -162,7 +162,7 @@ GdbObj::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, doubl
//----------------------------------------------------------------------------
bool
GdbObj::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
GdbObj::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
if ( m_pGeoObj != nullptr) {
// se scalatura non omogenea e arco, devo trasformare in curva di Bezier
@@ -179,7 +179,7 @@ GdbObj::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoe
m_pGeoObj = Release( pCrvBez) ;
}
// eseguo scalatura
return m_pGeoObj->Scale( ptCen, dCoeffX, dCoeffY, dCoeffZ) ;
return m_pGeoObj->Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
}
else
return false ;
+1 -1
View File
@@ -33,7 +33,7 @@ class GdbObj : public GdbNode
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
public :
GdbObj( void) ;
+1 -1
View File
@@ -37,7 +37,7 @@ class GeoFrame3d : public IGeoFrame3d
{ return m_frF.Rotate( ptAx, vtAx, dCosAng, dSinAng) ; }
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{ return false ; }
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
{ return false ; }
+2 -2
View File
@@ -37,8 +37,8 @@ class GeoPoint3d : public IGeoPoint3d
{ return m_ptP.Rotate( ptAx, vtAx, dCosAng, dSinAng) ; }
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
{ return m_ptP.Scale( ptCen, dCoeffX, dCoeffY, dCoeffZ) ;}
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{ return m_ptP.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;}
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
{ return m_ptP.Mirror( ptOn, vtNorm) ;}
virtual bool ToGlob( const Frame3d& frRef)
+2 -2
View File
@@ -37,8 +37,8 @@ class GeoVector3d : public IGeoVector3d
{ return m_vtV.Rotate( vtAx, dCosAng, dSinAng) ; }
virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngRad)
{ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
{ return m_vtV.Scale( dCoeffX, dCoeffY, dCoeffZ) ;}
virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{ return m_vtV.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;}
virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
{ return m_vtV.Mirror( vtNorm) ;}
virtual bool ToGlob( const Frame3d& frRef)
+2 -2
View File
@@ -527,7 +527,7 @@ GeomDB::Rotate( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dCosA
//----------------------------------------------------------------------------
bool
GeomDB::Scale( int nId, const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
GeomDB::Scale( int nId, const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
GdbNode* pGdbNode ;
@@ -537,7 +537,7 @@ GeomDB::Scale( int nId, const Point3d& ptCen, double dCoeffX, double dCoeffY, do
return false ;
// eseguo la scalatura
return pGdbNode->Scale( ptCen, dCoeffX, dCoeffY, dCoeffZ) ;
return pGdbNode->Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
}
//----------------------------------------------------------------------------
+1 -1
View File
@@ -53,7 +53,7 @@ class GeomDB : public IGeomDB
virtual bool Rotate( int nId, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
{ double dAngRad = dAngDeg * DEGTORAD ;
return Rotate( nId, ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
virtual bool Scale( int nId, const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Scale( int nId, const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
virtual bool Mirror( int nId, const Point3d& ptOn, const Vector3d& vtNorm) ;
public :
+17 -6
View File
@@ -335,17 +335,28 @@ OutScl::NormalOrNone( const CrvPointDiffGeom& oDiffG)
//----------------------------------------------------------------------------
bool
OutScl::PutCurve( const IGeoObj* pGeoObj, int nFlag)
OutScl::PutGeoObj( const IGeoObj* pGeoObj, int nFlag)
{
if (( pGeoObj->GetType() & GEO_CURVE) != 0) {
const ICurve* pCurve ;
// recupero e controllo la curva
if ( ( pCurve = GetCurve( pGeoObj)) == nullptr)
return false ;
// eseguo output
return PutCurve( pCurve, nFlag) ;
}
else
return true ;
}
//----------------------------------------------------------------------------
bool
OutScl::PutCurve( const ICurve* pCurve, int nFlag)
{
bool bFound ;
PolyLine PL ;
const ICurve* pCurve ;
// recupero e controllo la curva
if ( ( pCurve = GetCurve( pGeoObj)) == nullptr)
return false ;
// ciclo per disegnare i segmenti
Remark( "Curve") ;
Point3d ptIni ;
+3 -2
View File
@@ -34,8 +34,7 @@ class OutScl
bool SetMaterial( double dRed, double dGreen, double dBlue) ;
bool SetPartLay( std::string sPart, std::string sLay) ;
bool SetPartLayRef( std::string sPart, std::string sLay, const Frame3d& frFrame) ;
bool PutCurve( const IGeoObj* pCurve, int nFlag) ;
bool PutPolygBez( const ICurveBezier& CrvBez) ;
bool PutGeoObj( const IGeoObj* pGeoObj, int nFlag) ;
bool PutBBox( const BBox3d& b3B) ;
private :
@@ -49,6 +48,8 @@ class OutScl
bool CircleCR( const Point3d& ptCen, double dRad) ;
bool ArcCurvOrTgOrNone( const CrvPointDiffGeom& oDiffG) ;
bool NormalOrNone( const CrvPointDiffGeom& oDiffG) ;
bool PutCurve( const ICurve* pCurve, int nFlag) ;
bool PutPolygBez( const ICurveBezier& CrvBez) ;
private :
std::ofstream m_ofFile ;
+4 -4
View File
@@ -63,22 +63,22 @@ Point3d::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, doub
// Scalatura non uniforme
//----------------------------------------------------------------------------
bool
Point3d::Scale( const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ)
Point3d::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
Vector3d vtDiff ;
// vettore dal centro al punto
vtDiff = *this - ptCen ;
vtDiff = *this - frRef.Orig() ;
if ( vtDiff.IsZero())
return true ;
// scalatura del vettore
if ( ! vtDiff.Scale( dCoeffX, dCoeffY, dCoeffZ))
if ( ! vtDiff.Scale( frRef, dCoeffX, dCoeffY, dCoeffZ))
return false ;
// ricostruisco il punto
*this = ptCen + vtDiff ;
*this = frRef.Orig() + vtDiff ;
return true ;
}
+9 -4
View File
@@ -204,11 +204,16 @@ Vector3d::Rotate( const Vector3d& vtAx, double dCosAng, double dSinAng)
// Scalatura non uniforme
//----------------------------------------------------------------------------
bool
Vector3d::Scale( double dCoeffX, double dCoeffY, double dCoeffZ)
Vector3d::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
{
x *= dCoeffX ;
y *= dCoeffY ;
z *= dCoeffZ ;
// verifico validità del frame
if ( frRef.GetType() == Frame3d::ERR)
return false ;
// ricavo le componenti sugli assi di scalatura, le scalo e riassemblo il vettore completo
*this = ( (*this) * frRef.VersX() * dCoeffX) * frRef.VersX() +
( (*this) * frRef.VersY() * dCoeffY) * frRef.VersY() +
( (*this) * frRef.VersZ() * dCoeffZ) * frRef.VersZ() ;
return true ;
}