EgtGeomKernel :
- modifiche per Copy di oggetti Geo.
This commit is contained in:
+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
|
||||
|
||||
Reference in New Issue
Block a user