EgtGeomKernel 1.6d2 :

- BBox3d aggiunta LocToLoc e migliorati i controlli per validità
- aggiunta gestione estrusione nell'ingombro delle curve
- a CurveComposite aggiunta funzione che la chiude
- in GdbIterator aggiunte GoTo con nome
- in GeomDB aggiunte Get con nome
- in GeomDB aggiunto swap tra gruppi con gestione di base, sorgente e lista referenti
- migliorata gestione materiale ereditato in Relocate
- aggiunte SetInfo e GetInfo con INTVECTOR e DBLVECTOR
- aggiunte FromString e ToString con BBox3d.
This commit is contained in:
Dario Sassi
2015-04-16 06:47:52 +00:00
parent 0f7b78fea7
commit 08831a6849
24 changed files with 1082 additions and 92 deletions
+176 -11
View File
@@ -18,7 +18,7 @@
#include "GdbGroup.h"
#include "Attribs.h"
#include "/EgtDev/Include/EGkGdbFunct.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include <new>
using namespace std ;
@@ -214,6 +214,42 @@ GdbObj::InsertBefore( GdbObj* pRef)
return true ;
}
/*-------------------------------------------------------------------------*/
bool
GdbObj::Swap( GdbObj* pOther)
{
// verifico esistenza dell'altro
if ( pOther == nullptr)
return false ;
// sistemazione degli eventuali padri
if ( m_pParent != nullptr) {
if ( m_pParent->m_pFirstObj == this)
m_pParent->m_pFirstObj = pOther ;
if ( m_pParent->m_pLastObj == this)
m_pParent->m_pLastObj = pOther ;
}
if ( pOther->m_pParent != nullptr) {
if ( pOther->m_pParent->m_pFirstObj == pOther)
pOther->m_pParent->m_pFirstObj = this ;
if ( pOther->m_pParent->m_pLastObj == pOther)
pOther->m_pParent->m_pLastObj = this ;
}
swap( m_pParent, pOther->m_pParent) ;
// sistemazione dei precedenti
if ( m_pPrev != nullptr)
m_pPrev->m_pNext = pOther ;
if ( pOther->m_pPrev != nullptr)
pOther->m_pPrev->m_pNext = this ;
swap( m_pPrev, pOther->m_pPrev) ;
// sistemazione dei successivi
if ( m_pNext != nullptr)
m_pNext->m_pPrev = pOther ;
if ( pOther->m_pNext != nullptr)
pOther->m_pNext->m_pPrev = this ;
swap( m_pNext, pOther->m_pNext) ;
return true ;
}
/*-------------------------------------------------------------------------*/
bool
GdbObj::Remove( void)
@@ -682,7 +718,6 @@ GdbObj::SetName( const string& sName)
// verifico esistenza (con eventuale creazione) degli attributi
if ( GetSafeAttribs() == nullptr)
return false ;
// assegno il nome
return m_pAttribs->SetName( sName) ;
}
@@ -694,7 +729,6 @@ GdbObj::GetName( string& sName) const
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
// restituisco il nome
return m_pAttribs->GetName( sName) ;
}
@@ -706,7 +740,6 @@ GdbObj::ExistsName( void) const
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
// restituisco il nome
return m_pAttribs->ExistsName() ;
}
@@ -717,8 +750,7 @@ GdbObj::RemoveName( void)
{
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
return true ;
// cancello il nome
return m_pAttribs->RemoveName() ;
}
@@ -730,11 +762,73 @@ GdbObj::SetInfo( const string& sKey, const string& sInfo)
// verifico esistenza (con eventuale creazione) degli attributi
if ( GetSafeAttribs() == nullptr)
return false ;
// assegno l'Info
return m_pAttribs->SetInfo( sKey, sInfo) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, bool bInfo)
{
return SetInfo( sKey, ToString( bInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, int nInfo)
{
return SetInfo( sKey, ToString( nInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, double dInfo)
{
return SetInfo( sKey, ToString( dInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, const Vector3d& vtInfo)
{
return SetInfo( sKey, ToString( vtInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, const Point3d& ptInfo)
{
return SetInfo( sKey, ToString( ptInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, const BBox3d& b3Info)
{
return SetInfo( sKey, ToString( b3Info)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, const Frame3d& frInfo)
{
return SetInfo( sKey, ToString( frInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, const INTVECTOR& vnInfo)
{
return SetInfo( sKey, ToString( vnInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::SetInfo( const string& sKey, const DBLVECTOR& vdInfo)
{
return SetInfo( sKey, ToString( vdInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, string& sInfo) const
@@ -742,11 +836,84 @@ GdbObj::GetInfo( const string& sKey, string& sInfo) const
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
// restituisco l'Info
return m_pAttribs->GetInfo( sKey, sInfo) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, bool& bInfo) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, bInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, int& nInfo) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, nInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, double& dInfo) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, dInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, Vector3d& vtInfo) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, vtInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, Point3d& ptInfo) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, ptInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, BBox3d& b3Info) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, b3Info)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, Frame3d& frInfo) const
{
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, frInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, INTVECTOR& vnInfo) const
{
vnInfo.clear() ;
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, vnInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetInfo( const string& sKey, DBLVECTOR& vdInfo) const
{
vdInfo.clear() ;
string sInfo ;
return ( GetInfo( sKey, sInfo) && FromString( sInfo, vdInfo)) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::ExistsInfo( const string& sKey) const
@@ -754,7 +921,6 @@ GdbObj::ExistsInfo( const string& sKey) const
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
// verifico l'esistenza dell'Info
return m_pAttribs->ExistsInfo( sKey) ;
}
@@ -765,8 +931,7 @@ GdbObj::RemoveInfo( const string& sKey)
{
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
return true ;
// cancello l'Info
return m_pAttribs->RemoveInfo( sKey) ;
}