EgtGeomKernel 1.4a3 : Migliorata gestione gruppi, aggiunti GdbIterator, GeoFrame3d e IdManager.
This commit is contained in:
+126
@@ -0,0 +1,126 @@
|
||||
//----------------------------------------------------------------------------
|
||||
// EgalTech 2013-2013
|
||||
//----------------------------------------------------------------------------
|
||||
// File : GeoFrame3d.cpp Data : 02.12.13 Versione : 1.4a3
|
||||
// Contenuto : Implementazione della classe Riferimento geometrico.
|
||||
//
|
||||
//
|
||||
//
|
||||
// Modifiche : 10.10.13 DS Creazione modulo.
|
||||
//
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//--------------------------- Include ----------------------------------------
|
||||
#include "stdafx.h"
|
||||
#include <new>
|
||||
#include "\EgtDev\Include\EGnStringUtils.h"
|
||||
#include "GeoFrame3d.h"
|
||||
#include "GeoObjFactory.h"
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GEOOBJ_REGISTER( GEO_FRAME3D, "G_FRM", GeoFrame3d) ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GeoFrame3d::GeoFrame3d( void)
|
||||
{
|
||||
m_frF.Set( ORIG, Frame3d::TOP) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GeoFrame3d::~GeoFrame3d( void)
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoFrame3d::Set( const Point3d& ptOrig, const Vector3d& vtDirX,
|
||||
const Vector3d& vtDirY, const Vector3d& vtDirZ)
|
||||
{
|
||||
return m_frF.Set( ptOrig, vtDirX, vtDirY, vtDirZ) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoFrame3d::Set( const Frame3d& frF)
|
||||
{
|
||||
m_frF = frF ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
GeoFrame3d*
|
||||
GeoFrame3d::Clone( void) const
|
||||
{
|
||||
GeoFrame3d* pGFr ;
|
||||
|
||||
|
||||
// alloco oggetto
|
||||
pGFr = new(nothrow) GeoFrame3d ;
|
||||
if ( pGFr != nullptr)
|
||||
*pGFr = *(const_cast<GeoFrame3d*>(this)) ;
|
||||
|
||||
return pGFr ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const string&
|
||||
GeoFrame3d::GetKey( void) const
|
||||
{
|
||||
return GEOOBJ_GETKEY( GeoFrame3d) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoFrame3d::Save( ostream& osOut) const
|
||||
{
|
||||
// Origine
|
||||
osOut << ToString( m_frF.Orig()) << ";" ;
|
||||
// VersoreX
|
||||
osOut << ToString( m_frF.VersX()) << ";" ;
|
||||
// VersoreY
|
||||
osOut << ToString( m_frF.VersY()) << ";" ;
|
||||
// VersoreZ
|
||||
osOut << ToString( m_frF.VersZ()) << ";" << endl ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeoFrame3d::Load( CScan& TheScanner)
|
||||
{
|
||||
Point3d ptOrig ;
|
||||
Vector3d vtDirX ;
|
||||
Vector3d vtDirY ;
|
||||
Vector3d vtDirZ ;
|
||||
string sLine ;
|
||||
STRVECTOR vsParams ;
|
||||
|
||||
|
||||
// leggo la prossima linea
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
return false ;
|
||||
// la divido in parametri
|
||||
Tokenize( sLine, ";", vsParams) ;
|
||||
// 4 parametri : origine, versore X, versore Y, versore Z
|
||||
if ( vsParams.size() != 4)
|
||||
return false ;
|
||||
// recupero l'origine
|
||||
if ( ! FromString( vsParams[0], ptOrig))
|
||||
return false ;
|
||||
// recupero il versore X
|
||||
if ( ! FromString( vsParams[1], vtDirX))
|
||||
return false ;
|
||||
// recupero il versore Y
|
||||
if ( ! FromString( vsParams[2], vtDirY))
|
||||
return false ;
|
||||
// recupero il versore Z
|
||||
if ( ! FromString( vsParams[3], vtDirZ))
|
||||
return false ;
|
||||
// imposto il riferimento
|
||||
return m_frF.Set( ptOrig, vtDirX, vtDirY, vtDirZ) ;
|
||||
}
|
||||
Reference in New Issue
Block a user