EgtGeomKernel :
- modifiche per Copy di oggetti Geo.
This commit is contained in:
+34
-6
@@ -16,7 +16,7 @@
|
||||
#include "CurveArc.h"
|
||||
#include "GeoConst.h"
|
||||
#include "GeoObjFactory.h"
|
||||
#include "\EgtDev\Include\EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include <new>
|
||||
|
||||
using namespace std ;
|
||||
@@ -78,6 +78,9 @@ CurveArc::Set( const Point3d& ptCen, const Vector3d& vtN, double dRad,
|
||||
m_VtN.Normalize() ;
|
||||
m_VtS.Normalize() ;
|
||||
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
|
||||
return Validate() ;
|
||||
}
|
||||
|
||||
@@ -96,6 +99,9 @@ CurveArc::Set( const Point3d& ptCen, double dRad, double dAngIniDeg, double dAng
|
||||
m_dDeltaN = dDeltaZ ;
|
||||
m_nStatus = TO_VERIFY ;
|
||||
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
|
||||
return Validate() ;
|
||||
}
|
||||
|
||||
@@ -124,16 +130,38 @@ CurveArc::Set( const Point3d& ptCen, double dRad)
|
||||
CurveArc*
|
||||
CurveArc::Clone( void) const
|
||||
{
|
||||
CurveArc* pCrv ;
|
||||
|
||||
// alloco oggetto
|
||||
pCrv = new(nothrow) CurveArc ;
|
||||
if ( pCrv != nullptr)
|
||||
*pCrv = *(const_cast<CurveArc*>(this)) ;
|
||||
CurveArc* pCrv = new(nothrow) CurveArc ;
|
||||
if ( pCrv != nullptr) {
|
||||
if ( ! pCrv->Copy( *this)) {
|
||||
delete pCrv ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pCrv ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const CurveArc* pCA = dynamic_cast<const CurveArc*>( pGObjSrc) ;
|
||||
if ( pCA == nullptr)
|
||||
return false ;
|
||||
return Copy( *pCA) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::Copy( const CurveArc& caSrc)
|
||||
{
|
||||
if ( &caSrc == this)
|
||||
return true ;
|
||||
return Set( caSrc.m_PtCen, caSrc.m_VtN, caSrc.m_dRad,
|
||||
caSrc.m_VtS, caSrc.m_dAngCenDeg, caSrc.m_dDeltaN) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
CurveArc::GetTitle( void) const
|
||||
|
||||
+6
-4
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "CurveAux.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -74,6 +75,7 @@ class CurveArc : public ICurveArc
|
||||
virtual bool TrimEndAtLen( double dLenTrim) ;
|
||||
|
||||
public : // ICurveArc
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Set( const Point3d& ptCen, const Vector3d& vtN, double dRad,
|
||||
const Vector3d& vtS, double dAngCenDeg, double dDeltaN) ;
|
||||
virtual bool Set( const Point3d& ptCen, double dRad, double dAngIniDeg, double dAngCenDeg, double dDeltaZ) ;
|
||||
@@ -101,12 +103,12 @@ class CurveArc : public ICurveArc
|
||||
public :
|
||||
CurveArc( void) ;
|
||||
const CurveArc& operator =( const CurveArc& caSrc)
|
||||
{ if ( &caSrc != this)
|
||||
Set( caSrc.m_PtCen, caSrc.m_VtN, caSrc.m_dRad,
|
||||
caSrc.m_VtS, caSrc.m_dAngCenDeg, caSrc.m_dDeltaN) ;
|
||||
return *this ; }
|
||||
{ if ( ! Copy( caSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "CurveArc : copy error")
|
||||
return *this ; }
|
||||
|
||||
private :
|
||||
bool Copy( const CurveArc& caSrc) ;
|
||||
bool Validate( void) ;
|
||||
|
||||
private :
|
||||
|
||||
+36
-10
@@ -13,15 +13,14 @@
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include "DllMain.h"
|
||||
#include "CurveBezier.h"
|
||||
#include "GeoConst.h"
|
||||
#include "DistPointLine.h"
|
||||
#include "GeoObjFactory.h"
|
||||
#include "PolynomialPoint3d.h"
|
||||
#include "\EgtDev\Include\EGkCurveArc.h"
|
||||
#include "\EgtDev\Include\ENkPolynomial.h"
|
||||
#include "\EgtDev\Include\EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EGkCurveArc.h"
|
||||
#include "/EgtDev/Include/ENkPolynomial.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include <new>
|
||||
|
||||
using namespace std ;
|
||||
@@ -266,17 +265,44 @@ CurveBezier::GetControlWeight( int nInd, bool* pbOk) const
|
||||
CurveBezier*
|
||||
CurveBezier::Clone( void) const
|
||||
{
|
||||
CurveBezier* pCrv ;
|
||||
|
||||
|
||||
// alloco oggetto
|
||||
pCrv = new(nothrow) CurveBezier ;
|
||||
if ( pCrv != nullptr)
|
||||
*pCrv = *(const_cast<CurveBezier*>(this)) ;
|
||||
CurveBezier* pCrv = new(nothrow) CurveBezier ;
|
||||
if ( pCrv != nullptr) {
|
||||
if ( ! pCrv->Copy( *this)) {
|
||||
delete pCrv ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pCrv ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveBezier::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const CurveBezier* pCB = dynamic_cast<const CurveBezier*>( pGObjSrc) ;
|
||||
if ( pCB == nullptr)
|
||||
return false ;
|
||||
return Copy( *pCB) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveBezier::Copy( const CurveBezier& cbSrc)
|
||||
{
|
||||
if ( &cbSrc == this)
|
||||
return true ;
|
||||
if ( ! Init( cbSrc.m_nDeg, cbSrc.m_bRat))
|
||||
return false ;
|
||||
for ( int i = 0 ; i <= m_nDeg ; ++ i) {
|
||||
m_aPtCtrl[i] = cbSrc.m_aPtCtrl[i] ;
|
||||
if ( cbSrc.m_bRat)
|
||||
m_aWeCtrl[i] = cbSrc.m_aWeCtrl[i] ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
CurveBezier::GetTitle( void) const
|
||||
|
||||
+5
-7
@@ -16,6 +16,7 @@
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "CurveAux.h"
|
||||
#include "PolynomialPoint3d.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkCurveBezier.h"
|
||||
#include "/EgtDev/Include/ENkNumCollection.h"
|
||||
|
||||
@@ -77,6 +78,7 @@ class CurveBezier : public ICurveBezier
|
||||
virtual bool TrimEndAtLen( double dLenTrim) ;
|
||||
|
||||
public : // ICurveBezier
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Init( int nDeg, bool bIsRational) ;
|
||||
virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl) ;
|
||||
virtual bool SetControlPoint( int nInd, const Point3d& ptCtrl, double dW) ;
|
||||
@@ -93,16 +95,12 @@ class CurveBezier : public ICurveBezier
|
||||
public :
|
||||
CurveBezier( void) ;
|
||||
const CurveBezier& operator =( const CurveBezier& cbSrc)
|
||||
{ if ( &cbSrc != this && Init( cbSrc.m_nDeg, cbSrc.m_bRat)) {
|
||||
for ( int i = 0 ; i <= m_nDeg ; ++ i) {
|
||||
m_aPtCtrl[i] = cbSrc.m_aPtCtrl[i] ;
|
||||
if ( cbSrc.m_bRat)
|
||||
m_aWeCtrl[i] = cbSrc.m_aWeCtrl[i] ;
|
||||
}
|
||||
}
|
||||
{ if ( ! Copy( cbSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "CurveBezier : copy error")
|
||||
return *this ; }
|
||||
|
||||
private :
|
||||
bool Copy( const CurveBezier& cbSrc) ;
|
||||
bool Validate( void) ;
|
||||
void IncreaseBernsteinOneDegree( double dU, int nDeg, double dBern[]) const ;
|
||||
bool CalcSingularParam( void) const ;
|
||||
|
||||
+33
-8
@@ -43,10 +43,8 @@ CurveComposite::~CurveComposite( void)
|
||||
bool
|
||||
CurveComposite::Clear( void)
|
||||
{
|
||||
PCRVSMPL_LIST::iterator Iter ;
|
||||
|
||||
|
||||
// ciclo di pulizia
|
||||
PCRVSMPL_LIST::iterator Iter ;
|
||||
for ( Iter = m_CrvSmplS.begin() ; Iter != m_CrvSmplS.end() ; ++Iter)
|
||||
delete (*Iter) ;
|
||||
|
||||
@@ -200,16 +198,43 @@ CurveComposite::FromSplit( const ICurve& cCrv, int nParts)
|
||||
CurveComposite*
|
||||
CurveComposite::Clone( void) const
|
||||
{
|
||||
CurveComposite* pCrv ;
|
||||
|
||||
// alloco oggetto
|
||||
pCrv = new(nothrow) CurveComposite ;
|
||||
if ( pCrv != nullptr)
|
||||
*pCrv = *(const_cast<CurveComposite*>(this)) ;
|
||||
CurveComposite* pCrv = new(nothrow) CurveComposite ;
|
||||
if ( pCrv != nullptr) {
|
||||
if ( ! pCrv->Copy( *this)) {
|
||||
delete pCrv ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pCrv ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveComposite::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const CurveComposite* pCC = dynamic_cast<const CurveComposite*>( pGObjSrc) ;
|
||||
if ( pCC == nullptr)
|
||||
return false ;
|
||||
return Copy( *pCC) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveComposite::Copy( const CurveComposite& ccSrc)
|
||||
{
|
||||
if ( &ccSrc == this)
|
||||
return true ;
|
||||
Clear() ;
|
||||
PCRVSMPL_LIST::const_iterator Iter ;
|
||||
for ( Iter = ccSrc.m_CrvSmplS.begin() ; Iter != ccSrc.m_CrvSmplS.end() ; ++Iter) {
|
||||
if ( ! AddCurve( **Iter))
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
CurveComposite::GetTitle( void) const
|
||||
|
||||
+9
-9
@@ -15,12 +15,11 @@
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "CurveAux.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EgtLogger.h"
|
||||
#include <list>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
typedef std::list< ICurve*> PCRVSMPL_LIST ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class CurveComposite : public ICurveComposite
|
||||
{
|
||||
@@ -76,6 +75,7 @@ class CurveComposite : public ICurveComposite
|
||||
virtual bool TrimEndAtLen( double dLenTrim) ;
|
||||
|
||||
public : // ICurveComposite
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Clear( void) ;
|
||||
virtual bool AddCurve( const ICurve& cCrv) ;
|
||||
virtual bool FromSplit( const ICurve& cCrv, int nParts) ;
|
||||
@@ -88,21 +88,21 @@ class CurveComposite : public ICurveComposite
|
||||
public :
|
||||
CurveComposite( void) ;
|
||||
const CurveComposite& operator =( const CurveComposite& ccSrc)
|
||||
{ if ( &ccSrc != this) {
|
||||
Clear() ;
|
||||
PCRVSMPL_LIST::const_iterator Iter ;
|
||||
for ( Iter = ccSrc.m_CrvSmplS.begin() ; Iter != ccSrc.m_CrvSmplS.end() ; ++Iter)
|
||||
AddCurve( **Iter) ;
|
||||
}
|
||||
{ if ( ! Copy( ccSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "CurveComposite : copy error")
|
||||
return *this ; }
|
||||
|
||||
private :
|
||||
bool Copy( const CurveComposite& ccSrc) ;
|
||||
bool Validate( void) ;
|
||||
bool AddSimpleCurve( ICurve* pSmplCrv) ;
|
||||
|
||||
private :
|
||||
enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ;
|
||||
|
||||
private :
|
||||
typedef std::list< ICurve*> PCRVSMPL_LIST ;
|
||||
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
Status m_nStatus ; // stato
|
||||
|
||||
+27
-6
@@ -15,7 +15,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "CurveLine.h"
|
||||
#include "GeoObjFactory.h"
|
||||
#include "\EgtDev\Include\EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include <new>
|
||||
|
||||
using namespace std ;
|
||||
@@ -53,16 +53,37 @@ CurveLine::Set( const Point3d& ptStart, const Point3d& ptEnd)
|
||||
CurveLine*
|
||||
CurveLine::Clone( void) const
|
||||
{
|
||||
CurveLine* pCrv ;
|
||||
|
||||
// alloco oggetto
|
||||
pCrv = new(nothrow) CurveLine ;
|
||||
if ( pCrv != nullptr)
|
||||
*pCrv = *(const_cast<CurveLine*>(this)) ;
|
||||
CurveLine* pCrv = new(nothrow) CurveLine ;
|
||||
if ( pCrv != nullptr) {
|
||||
if ( ! pCrv->Copy( *this)) {
|
||||
delete pCrv ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pCrv ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveLine::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const CurveLine* pCL = dynamic_cast<const CurveLine*>( pGObjSrc) ;
|
||||
if ( pCL == nullptr)
|
||||
return false ;
|
||||
return Copy( *pCL) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveLine::Copy( const CurveLine& clSrc)
|
||||
{
|
||||
if ( &clSrc == this)
|
||||
return true ;
|
||||
return Set( clSrc.m_PtStart, clSrc.m_PtEnd) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
CurveLine::GetTitle( void) const
|
||||
|
||||
+6
-3
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "CurveAux.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -74,6 +75,7 @@ class CurveLine : public ICurveLine
|
||||
virtual bool TrimEndAtLen( double dLenTrim) ;
|
||||
|
||||
public : // ICurveLine
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Set( const Point3d& ptStart, const Point3d& ptEnd) ;
|
||||
virtual const Point3d& GetStart( void) const
|
||||
{ return m_PtStart ; }
|
||||
@@ -83,11 +85,12 @@ class CurveLine : public ICurveLine
|
||||
public :
|
||||
CurveLine( void) ;
|
||||
const CurveLine& operator =( const CurveLine& clSrc)
|
||||
{ if ( &clSrc != this)
|
||||
Set( clSrc.m_PtStart, clSrc.m_PtEnd) ;
|
||||
return *this ; }
|
||||
{ if ( ! Copy( clSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "CurveLine : copy error")
|
||||
return *this ; }
|
||||
|
||||
private :
|
||||
bool Copy( const CurveLine& clSrc) ;
|
||||
bool Validate( void) ;
|
||||
|
||||
private :
|
||||
|
||||
@@ -263,6 +263,12 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StringUtils3d.cpp" />
|
||||
<ClCompile Include="SurfTriMesh.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Vector3d.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -334,6 +340,7 @@ copy $(TargetPath) \EgtProg\Dll64</Command>
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="SelManager.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="SurfTriMesh.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="EgtGeomKernel.rc" />
|
||||
|
||||
@@ -135,6 +135,9 @@
|
||||
<ClCompile Include="OutTsc.cpp">
|
||||
<Filter>File di origine\Script</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="SurfTriMesh.cpp">
|
||||
<Filter>File di origine\Geo</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
@@ -341,6 +344,9 @@
|
||||
<ClInclude Include="OutTsc.h">
|
||||
<Filter>File di intestazione</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SurfTriMesh.h">
|
||||
<Filter>File di intestazione</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="EgtGeomKernel.rc">
|
||||
|
||||
+12
-12
@@ -233,7 +233,7 @@ GdbGroup::GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag, int nLev) con
|
||||
return true ;
|
||||
}
|
||||
// ciclo sui figli
|
||||
Frame3d frCurr = m_gfrFrame.m_frF * frRef ;
|
||||
Frame3d frCurr = m_gfrFrame.GetFrame() * frRef ;
|
||||
const GdbObj* pGdbObj = GetFirstObj() ;
|
||||
while ( pGdbObj != nullptr) {
|
||||
BBox3d b3B ;
|
||||
@@ -266,11 +266,11 @@ GdbGroup::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dC
|
||||
|
||||
|
||||
// parziale scalatura del riferimento (non può essere completa)
|
||||
Frame3d frFrameS = m_gfrFrame.m_frF ;
|
||||
Frame3d frFrameS = m_gfrFrame.GetFrame() ;
|
||||
frFrameS.PseudoScale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
|
||||
|
||||
// porto gli oggetti nel nuovo riferimento, senza modificarne la geometria in globale
|
||||
Frame3d frTrasf = m_gfrFrame.m_frF ;
|
||||
Frame3d frTrasf = m_gfrFrame.GetFrame() ;
|
||||
frTrasf.ToLoc( frFrameS) ;
|
||||
pGdbObj = GetFirstObj() ;
|
||||
while ( pGdbObj != nullptr) {
|
||||
@@ -279,11 +279,11 @@ GdbGroup::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dC
|
||||
}
|
||||
|
||||
// assegno il nuovo riferimento
|
||||
m_gfrFrame.m_frF = frFrameS ;
|
||||
m_gfrFrame.Set( frFrameS) ;
|
||||
|
||||
// porto il riferimento di scalatura nel riferimento del gruppo
|
||||
Frame3d frRefLoc = frRef ;
|
||||
frRefLoc.ToLoc( m_gfrFrame.m_frF) ;
|
||||
frRefLoc.ToLoc( m_gfrFrame.GetFrame()) ;
|
||||
|
||||
// ciclo sugli oggetti
|
||||
bool bOk = true ;
|
||||
@@ -305,11 +305,11 @@ GdbGroup::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
|
||||
|
||||
|
||||
// parziale mirror del riferimento (non può essere completa)
|
||||
Frame3d frFrameS = m_gfrFrame.m_frF ;
|
||||
Frame3d frFrameS = m_gfrFrame.GetFrame() ;
|
||||
frFrameS.PseudoMirror( ptOn, vtNorm) ;
|
||||
|
||||
// porto i nodi nel nuovo riferimento, senza modificarne la geometria in globale
|
||||
Frame3d frTrasf = m_gfrFrame.m_frF ;
|
||||
Frame3d frTrasf = m_gfrFrame.GetFrame() ;
|
||||
frTrasf.ToLoc( frFrameS) ;
|
||||
pGdbObj = GetFirstObj() ;
|
||||
while ( pGdbObj != nullptr) {
|
||||
@@ -318,13 +318,13 @@ GdbGroup::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
|
||||
}
|
||||
|
||||
// assegno il nuovo riferimento
|
||||
m_gfrFrame.m_frF = frFrameS ;
|
||||
m_gfrFrame.Set( frFrameS) ;
|
||||
|
||||
// porto i dati del piano di mirror nel riferimento del gruppo
|
||||
Point3d ptOnLoc = ptOn ;
|
||||
ptOnLoc.ToLoc( m_gfrFrame.m_frF) ;
|
||||
ptOnLoc.ToLoc( m_gfrFrame.GetFrame()) ;
|
||||
Vector3d vtNormLoc = vtNorm ;
|
||||
vtNormLoc.ToLoc( m_gfrFrame.m_frF) ;
|
||||
vtNormLoc.ToLoc( m_gfrFrame.GetFrame()) ;
|
||||
|
||||
// ciclo sugli oggetti
|
||||
bool bOk = true ;
|
||||
@@ -364,14 +364,14 @@ bool
|
||||
GdbGroup::GetGlobFrame( Frame3d& frGlob) const
|
||||
{
|
||||
// assegno il proprio frame
|
||||
frGlob = m_gfrFrame.m_frF ;
|
||||
frGlob = m_gfrFrame.GetFrame() ;
|
||||
|
||||
// mentre ci sono padri
|
||||
const GdbGroup* pParent ;
|
||||
pParent = GetParent() ;
|
||||
while ( pParent != nullptr) {
|
||||
// porto il riferimento corrente sopra il padre
|
||||
frGlob.ToGlob( pParent->m_gfrFrame.m_frF) ;
|
||||
frGlob.ToGlob( pParent->m_gfrFrame.GetFrame()) ;
|
||||
// passo al successivo
|
||||
pParent = pParent->GetParent() ;
|
||||
}
|
||||
|
||||
+4
-2
@@ -38,9 +38,11 @@ class GdbGroup : public GdbObj
|
||||
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)
|
||||
{ return m_gfrFrame.m_frF.ToGlob( frRef) ; }
|
||||
{ Frame3d frF = m_gfrFrame.GetFrame() ;
|
||||
return ( frF.ToGlob( frRef) && m_gfrFrame.Set( frF)) ; }
|
||||
virtual bool ToLoc( const Frame3d& frRef)
|
||||
{ return m_gfrFrame.m_frF.ToLoc( frRef) ; }
|
||||
{ Frame3d frF = m_gfrFrame.GetFrame() ;
|
||||
return ( frF.ToLoc( frRef) && m_gfrFrame.Set( frF)) ; }
|
||||
virtual bool OnSetMaterial( void) ;
|
||||
|
||||
public :
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ GdbIterator::GetGroupFrame( Frame3d& frGlob) const
|
||||
return false ;
|
||||
|
||||
// copio il riferimento
|
||||
frGlob = pGdbGroup->m_gfrFrame.m_frF ;
|
||||
frGlob = pGdbGroup->m_gfrFrame.GetFrame() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
+28
-10
@@ -50,12 +50,10 @@ GeoFrame3d::Set( const Point3d& ptOrig, const Vector3d& vtDirX,
|
||||
bool
|
||||
GeoFrame3d::Set( const Frame3d& frF)
|
||||
{
|
||||
// assegno i dati
|
||||
m_frF = frF ;
|
||||
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
|
||||
// assegno i dati
|
||||
m_frF = frF ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -63,17 +61,37 @@ GeoFrame3d::Set( const Frame3d& frF)
|
||||
GeoFrame3d*
|
||||
GeoFrame3d::Clone( void) const
|
||||
{
|
||||
GeoFrame3d* pGFr ;
|
||||
|
||||
|
||||
// alloco oggetto
|
||||
pGFr = new(nothrow) GeoFrame3d ;
|
||||
if ( pGFr != nullptr)
|
||||
*pGFr = *(const_cast<GeoFrame3d*>(this)) ;
|
||||
GeoFrame3d* pGFr = new(nothrow) GeoFrame3d ;
|
||||
if ( pGFr != nullptr) {
|
||||
if ( ! pGFr->Copy( *this)) {
|
||||
delete pGFr ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pGFr ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoFrame3d::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const GeoFrame3d* pGFr = dynamic_cast<const GeoFrame3d*>( pGObjSrc) ;
|
||||
if ( pGFr == nullptr)
|
||||
return false ;
|
||||
return Copy( *pGFr) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoFrame3d::Copy( const GeoFrame3d& gfSrc)
|
||||
{
|
||||
if ( &gfSrc == this)
|
||||
return true ;
|
||||
return Set( gfSrc.m_frF) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
GeoFrame3d::GetTitle( void) const
|
||||
|
||||
+11
-6
@@ -14,6 +14,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkGeoFrame3d.h"
|
||||
|
||||
|
||||
@@ -58,6 +59,7 @@ class GeoFrame3d : public IGeoFrame3d
|
||||
{ return m_OGrMgr.GetObjGraphics() ; }
|
||||
|
||||
public : // IGeoFrame3d
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Set( const Point3d& ptOrig, const Vector3d& vtDirX,
|
||||
const Vector3d& vtDirY, const Vector3d& vtDirZ) ;
|
||||
virtual bool Set( const Frame3d& frF) ;
|
||||
@@ -68,12 +70,15 @@ class GeoFrame3d : public IGeoFrame3d
|
||||
|
||||
public :
|
||||
GeoFrame3d( void) ;
|
||||
inline const GeoFrame3d& operator =( const GeoFrame3d& gvSrc)
|
||||
{ if ( &gvSrc != this)
|
||||
Set( gvSrc.m_frF) ;
|
||||
return *this ; }
|
||||
inline const GeoFrame3d& operator =( const GeoFrame3d& gfSrc)
|
||||
{ if ( ! Copy( gfSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "GeoFrame3d : copy error")
|
||||
return *this ; }
|
||||
|
||||
public :
|
||||
private :
|
||||
bool Copy( const GeoFrame3d& gfSrc) ;
|
||||
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
Frame3d m_frF ; // oggetto
|
||||
Frame3d m_frF ; // oggetto
|
||||
} ;
|
||||
|
||||
+28
-8
@@ -13,10 +13,10 @@
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include <new>
|
||||
#include "\EgtDev\Include\EGkStringUtils3d.h"
|
||||
#include "GeoPoint3d.h"
|
||||
#include "GeoObjFactory.h"
|
||||
#include "\EgtDev\Include\EGkStringUtils3d.h"
|
||||
#include <new>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -51,17 +51,37 @@ GeoPoint3d::Set( const Point3d& ptP)
|
||||
GeoPoint3d*
|
||||
GeoPoint3d::Clone( void) const
|
||||
{
|
||||
GeoPoint3d* pGPt ;
|
||||
|
||||
|
||||
// alloco oggetto
|
||||
pGPt = new(nothrow) GeoPoint3d ;
|
||||
if ( pGPt != nullptr)
|
||||
*pGPt = *(const_cast<GeoPoint3d*>(this)) ;
|
||||
GeoPoint3d* pGPt = new(nothrow) GeoPoint3d ;
|
||||
if ( pGPt != nullptr) {
|
||||
if ( ! pGPt->Copy( *this)) {
|
||||
delete pGPt ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pGPt ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoPoint3d::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const GeoPoint3d* pGP = dynamic_cast<const GeoPoint3d*>( pGObjSrc) ;
|
||||
if ( pGP == nullptr)
|
||||
return false ;
|
||||
return Copy( *pGP) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoPoint3d::Copy( const GeoPoint3d& clSrc)
|
||||
{
|
||||
if ( &clSrc == this)
|
||||
return true ;
|
||||
return Set( clSrc.m_ptP) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
GeoPoint3d::GetTitle( void) const
|
||||
|
||||
+12
-7
@@ -14,13 +14,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkGeoPoint3d.h"
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class GeoPoint3d : public IGeoPoint3d
|
||||
{
|
||||
public :
|
||||
public : // IGeoObj
|
||||
virtual ~GeoPoint3d( void) ;
|
||||
virtual GeoPoint3d* Clone( void) const ;
|
||||
virtual GeoObjType GetType( void) const
|
||||
@@ -57,7 +58,8 @@ class GeoPoint3d : public IGeoPoint3d
|
||||
virtual const IObjGraphics* GetObjGraphics( void) const
|
||||
{ return m_OGrMgr.GetObjGraphics() ; }
|
||||
|
||||
public :
|
||||
public : // IGeoPoint3d
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Set( const Point3d& ptP) ;
|
||||
virtual const Point3d& GetPoint( void) const
|
||||
{ return m_ptP ; }
|
||||
@@ -65,11 +67,14 @@ class GeoPoint3d : public IGeoPoint3d
|
||||
public :
|
||||
GeoPoint3d( void) ;
|
||||
const GeoPoint3d& operator =( const GeoPoint3d& gpSrc)
|
||||
{ if ( &gpSrc != this)
|
||||
Set( gpSrc.m_ptP) ;
|
||||
return *this ; }
|
||||
{ if ( ! Copy( gpSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "GeoPoint3d : copy error")
|
||||
return *this ; }
|
||||
|
||||
public :
|
||||
private :
|
||||
bool Copy( const GeoPoint3d& gpSrc) ;
|
||||
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
Point3d m_ptP ; // oggetto
|
||||
Point3d m_ptP ; // oggetto
|
||||
} ;
|
||||
|
||||
+26
-5
@@ -52,16 +52,37 @@ GeoVector3d::Set( const Vector3d& vtV)
|
||||
GeoVector3d*
|
||||
GeoVector3d::Clone( void) const
|
||||
{
|
||||
GeoVector3d* pGVt ;
|
||||
|
||||
// alloco oggetto
|
||||
pGVt = new(nothrow) GeoVector3d ;
|
||||
if ( pGVt != nullptr)
|
||||
*pGVt = *(const_cast<GeoVector3d*>(this)) ;
|
||||
GeoVector3d* pGVt = new(nothrow) GeoVector3d ;
|
||||
if ( pGVt != nullptr) {
|
||||
if ( ! pGVt->Copy( *this)) {
|
||||
delete pGVt ;
|
||||
return nullptr ;
|
||||
}
|
||||
}
|
||||
|
||||
return pGVt ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoVector3d::Copy( const IGeoObj* pGObjSrc)
|
||||
{
|
||||
const GeoVector3d* pGV = dynamic_cast<const GeoVector3d*>( pGObjSrc) ;
|
||||
if ( pGV == nullptr)
|
||||
return false ;
|
||||
return Copy( *pGV) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoVector3d::Copy( const GeoVector3d& clSrc)
|
||||
{
|
||||
if ( &clSrc == this)
|
||||
return true ;
|
||||
return Set( clSrc.m_vtV) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
GeoVector3d::GetTitle( void) const
|
||||
|
||||
+11
-6
@@ -14,12 +14,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "DllMain.h"
|
||||
#include "/EgtDev/Include/EGkGeoVector3d.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class GeoVector3d : public IGeoVector3d
|
||||
{
|
||||
public :
|
||||
public : // IGeoObj
|
||||
virtual ~GeoVector3d( void) ;
|
||||
virtual GeoVector3d* Clone( void) const ;
|
||||
virtual GeoObjType GetType( void) const
|
||||
@@ -56,7 +57,8 @@ class GeoVector3d : public IGeoVector3d
|
||||
virtual const IObjGraphics* GetObjGraphics( void) const
|
||||
{ return m_OGrMgr.GetObjGraphics() ; }
|
||||
|
||||
public :
|
||||
public : // IGeoVector3d
|
||||
virtual bool Copy( const IGeoObj* pGObjSrc) ;
|
||||
virtual bool Set( const Vector3d& vtV) ;
|
||||
virtual const Vector3d& GetVector( void) const
|
||||
{ return m_vtV ; }
|
||||
@@ -65,11 +67,14 @@ class GeoVector3d : public IGeoVector3d
|
||||
public :
|
||||
GeoVector3d( void) ;
|
||||
inline const GeoVector3d& operator =( const GeoVector3d& gvSrc)
|
||||
{ if ( &gvSrc != this)
|
||||
Set( gvSrc.m_vtV) ;
|
||||
{ if ( ! Copy( gvSrc))
|
||||
LOG_ERROR( GetEGkLogger(), "GeoVector3d : copy error")
|
||||
return *this ; }
|
||||
|
||||
public :
|
||||
private :
|
||||
bool Copy( const GeoVector3d& gvSrc) ;
|
||||
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
Vector3d m_vtV ; // oggetto
|
||||
Vector3d m_vtV ; // oggetto
|
||||
} ;
|
||||
|
||||
+2
-2
@@ -335,7 +335,7 @@ GeomDB::AddGroup( int nId, int nParentId, const Frame3d& frFrame)
|
||||
// assegno identificativo
|
||||
pGdbGroup->m_nId = nId ;
|
||||
// assegno riferimento
|
||||
pGdbGroup->m_gfrFrame.m_frF = frFrame ;
|
||||
pGdbGroup->m_gfrFrame.Set( frFrame) ;
|
||||
// inserisco nel DB
|
||||
if ( ! AddToGeomDB( pGdbGroup, nParentId)) {
|
||||
delete pGdbGroup ;
|
||||
@@ -437,7 +437,7 @@ GeomDB::GetGroupFrame( int nId, Frame3d& frGrp) const
|
||||
return false ;
|
||||
|
||||
// copio il riferimento
|
||||
frGrp = pGdbGroup->m_gfrFrame.m_frF ;
|
||||
frGrp = pGdbGroup->m_gfrFrame.GetFrame() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
+1386
File diff suppressed because it is too large
Load Diff
+113
@@ -0,0 +1,113 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2014-2014
|
||||
//----------------------------------------------------------------------------
|
||||
// File : SurfTriMesh.h Data : 26.03.14 Versione : 1.5c9
|
||||
// Contenuto : Dichiarazione della classe Superfici TriMesh.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 26.03.14 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ObjGraphicsMgr.h"
|
||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||
#include <vector>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class SurfTriMesh : public ISurfTriMesh
|
||||
{
|
||||
public : // IGeoObj
|
||||
virtual ~SurfTriMesh( void) ;
|
||||
virtual SurfTriMesh* Clone( void) const ;
|
||||
virtual GeoObjType GetType( void) const
|
||||
{ return SRF_TRIMESH ; }
|
||||
virtual bool IsValid( void) const
|
||||
{ return ( m_nStatus == OK) ; }
|
||||
virtual const std::string& GetTitle( void) const ;
|
||||
virtual bool Dump( std::string& sOut, const char* szNewLine = "\n") const ;
|
||||
virtual const std::string& GetKey( void) const ;
|
||||
virtual bool Save( std::ostream& osOut) const ;
|
||||
virtual bool Load( Scanner& TheScanner) ;
|
||||
virtual bool GetLocalBBox( BBox3d& b3Loc) const ;
|
||||
virtual bool GetBBox( const Frame3d& frRef, BBox3d& b3Ref) const ;
|
||||
virtual bool Translate( const Vector3d& vtMove) ;
|
||||
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 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) ;
|
||||
virtual void SetObjGraphics( IObjGraphics* pOGr)
|
||||
{ m_OGrMgr.SetObjGraphics( pOGr) ; }
|
||||
virtual IObjGraphics* GetObjGraphics( void)
|
||||
{ return m_OGrMgr.GetObjGraphics() ; }
|
||||
virtual const IObjGraphics* GetObjGraphics( void) const
|
||||
{ return m_OGrMgr.GetObjGraphics() ; }
|
||||
|
||||
public : // ISurf
|
||||
virtual bool IsSimple( void) const
|
||||
{ return true ; }
|
||||
virtual bool IsClosed( void) const
|
||||
{ return m_bClosed ; }
|
||||
|
||||
public : // ISurfTriMesh
|
||||
virtual bool Init( int nNumVert, int nNumTria) ;
|
||||
virtual bool AddVertex( const Point3d& ptVert) ;
|
||||
virtual bool AddVertex( const Point3d& ptVert, int nTria, int nFlag) ;
|
||||
virtual bool AddTriangle(
|
||||
|
||||
virtual const Point3d& GetControlPoint( int nInd, bool* pbOk = NULL) const ;
|
||||
virtual double GetControlWeight( int nInd, bool* pbOk = NULL) const ;
|
||||
virtual bool GetControlPolygonLength( double& dLen) const ;
|
||||
virtual int GetSingularParam( double& dPar) const ;
|
||||
|
||||
public :
|
||||
SurfTriMesh( void) ;
|
||||
const SurfTriMesh& operator =( const SurfTriMesh& stSrc)
|
||||
{ if ( &stSrc != this && Init( m_vVert.size(), m_vTria.size())) {
|
||||
m_nStatus = stSrc.m_nStatus ;
|
||||
m_bClosed = stSrc.m_bClosed ;
|
||||
m_vVert = stSrc.m_vVert ;
|
||||
m_vTria = stSrc.m_vTria ;
|
||||
}
|
||||
return *this ; }
|
||||
|
||||
private :
|
||||
bool Validate( void) ;
|
||||
|
||||
private :
|
||||
enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ;
|
||||
|
||||
private :
|
||||
class Vertex {
|
||||
public :
|
||||
Vertex( void) : ptP(), nIdTria( 0), nFlag( 0) {}
|
||||
Vertex( const Point3d& ptQ, int nIdT, int nF) : ptP( ptQ), nIdTria( nIdT), nFlag( nF) {}
|
||||
public :
|
||||
Point3d ptP ;
|
||||
int nIdTria ;
|
||||
int nFlag ;
|
||||
} ;
|
||||
class Tria {
|
||||
public :
|
||||
int nIdVert[3] ;
|
||||
int nIdAdjac[3] ;
|
||||
Vector3d vtN ;
|
||||
int nFlag ;
|
||||
int nAux ;
|
||||
} ;
|
||||
typedef std::vector<Vertex> VERTVECTOR ;
|
||||
typedef std::vector<Tria> TRIAVECTOR ;
|
||||
|
||||
private :
|
||||
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto
|
||||
Status m_nStatus ; // stato
|
||||
bool m_bClosed ; // la superficie racchiude un volume
|
||||
VERTVECTOR m_vVert ; // vettore dei vertici
|
||||
TRIAVECTOR m_vTria ; // vettore dei triangoli
|
||||
} ;
|
||||
Reference in New Issue
Block a user