EgtGeomKernel : prime modifiche per interfacce.
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalS
|
||||
//----------------------------------------------------------------------------
|
||||
// File : GeoPoint3d.cpp Data : 10.10.13 Versione : 1.2a3
|
||||
// Contenuto : Implementazione della classe Punto geometrico.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 10.10.13 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include <new>
|
||||
#include "\EgtDev\Include\EGnStringUtils.h"
|
||||
#include "GeoPoint3d.h"
|
||||
#include "GeoObjFactory.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GEOOBJ_REGISTER( KEY_GEO_PNT3D, GeoPoint3d) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GeoPoint3d::GeoPoint3d( void)
|
||||
{
|
||||
m_ptP.Set( 0, 0, 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GeoPoint3d::~GeoPoint3d( void)
|
||||
{
|
||||
m_ptP.Set( 50, 100, 200) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoPoint3d::Set( const Point3d& ptP)
|
||||
{
|
||||
m_ptP = ptP ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GeoPoint3d*
|
||||
GeoPoint3d::Clone( void) const
|
||||
{
|
||||
GeoPoint3d* pGPt ;
|
||||
|
||||
// alloco oggetto
|
||||
pGPt = new(nothrow) GeoPoint3d ;
|
||||
if ( pGPt != nullptr)
|
||||
*pGPt = *(const_cast<GeoPoint3d*>(this)) ;
|
||||
|
||||
return pGPt ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoPoint3d::Save( ostream& osOut) const
|
||||
{
|
||||
// parametri : punto
|
||||
osOut << ToString( m_ptP) << endl ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoPoint3d::Load( CScan& TheScanner)
|
||||
{
|
||||
string sLine ;
|
||||
STRVECTOR vsParams ;
|
||||
|
||||
|
||||
// leggo la prossima linea
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
return false ;
|
||||
// la divido in parametri
|
||||
Tokenize( sLine, ",", vsParams) ;
|
||||
// 3 parametri : le coordinate
|
||||
if ( vsParams.size() != 3)
|
||||
return false ;
|
||||
// recupero le tre coordinate
|
||||
if ( ! FromString( vsParams[0], m_ptP.x) ||
|
||||
! FromString( vsParams[1], m_ptP.y) ||
|
||||
! FromString( vsParams[2], m_ptP.z))
|
||||
return false ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
Reference in New Issue
Block a user