EgtGeomKernel :

- modifiche per Copy di oggetti Geo.
This commit is contained in:
Dario Sassi
2014-03-26 18:28:52 +00:00
parent 0a1c571048
commit 7d64584eba
22 changed files with 1803 additions and 112 deletions
+27 -6
View File
@@ -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