diff --git a/EgtGeomKernel.rc b/EgtGeomKernel.rc
index 0b8b393..a5b4b53 100644
Binary files a/EgtGeomKernel.rc and b/EgtGeomKernel.rc differ
diff --git a/EgtGeomKernel.vcxproj b/EgtGeomKernel.vcxproj
index f7c2544..dac07e1 100644
--- a/EgtGeomKernel.vcxproj
+++ b/EgtGeomKernel.vcxproj
@@ -316,8 +316,8 @@ copy $(TargetPath) \EgtProg\Dll64
-
-
+
+
@@ -388,8 +388,6 @@ copy $(TargetPath) \EgtProg\Dll64
-
-
@@ -400,6 +398,8 @@ copy $(TargetPath) \EgtProg\Dll64
+
+
@@ -457,7 +457,7 @@ copy $(TargetPath) \EgtProg\Dll64
-
+
diff --git a/EgtGeomKernel.vcxproj.filters b/EgtGeomKernel.vcxproj.filters
index fb211e2..4ba659c 100644
--- a/EgtGeomKernel.vcxproj.filters
+++ b/EgtGeomKernel.vcxproj.filters
@@ -279,10 +279,10 @@
File di origine\GeoCreate
-
+
File di origine\Gdb
-
+
File di origine\Gdb
@@ -650,21 +650,21 @@
File di intestazione\Include
-
- File di intestazione\Include
-
-
- File di intestazione\Include
-
-
- File di intestazione
-
File di intestazione\Include
File di intestazione\Include
+
+ File di intestazione
+
+
+ File di intestazione\Include
+
+
+ File di intestazione\Include
+
diff --git a/ExtText.cpp b/ExtText.cpp
index f65a07a..d54cd03 100644
--- a/ExtText.cpp
+++ b/ExtText.cpp
@@ -729,9 +729,8 @@ ExtText::GetOutline( ICURVEPLIST& lstPC) const
return false ;
// eseguo la trasformazione
- ICURVEPLIST::iterator Iter ;
- for ( Iter = lstPC.begin() ; Iter != lstPC.end() ; ++ Iter)
- (*Iter)->ToGlob( frRef) ;
+ for ( auto& PC : lstPC)
+ PC->ToGlob( frRef) ;
return true ;
}
@@ -755,9 +754,8 @@ ExtText::ApproxWithLines( double dLinTol, double dAngTolDeg, POLYLINELIST& lstPL
return false ;
// eseguo la trasformazione
- POLYLINELIST::iterator Iter ;
- for ( Iter = lstPL.begin() ; Iter != lstPL.end() ; ++ Iter)
- Iter->ToGlob( frRef) ;
+ for ( auto& PL : lstPL)
+ PL.ToGlob( frRef) ;
return true ;
}
@@ -781,9 +779,8 @@ ExtText::ApproxWithArcs( double dLinTol, double dAngTolDeg, POLYARCLIST& lstPA)
return false ;
// eseguo la trasformazione
- POLYARCLIST::iterator Iter ;
- for ( Iter = lstPA.begin() ; Iter != lstPA.end() ; ++ Iter)
- Iter->ToGlob( frRef) ;
+ for ( auto& PA : lstPA)
+ PA.ToGlob( frRef) ;
return true ;
}
diff --git a/GdbGeo.cpp b/GdbGeo.cpp
index 2cf40ac..e85f1b8 100644
--- a/GdbGeo.cpp
+++ b/GdbGeo.cpp
@@ -23,7 +23,7 @@
#include "GeomDB.h"
#include "/EgtDev/Include/EGkCurveArc.h"
#include "/EgtDev/Include/EGkGdbFunct.h"
-#include "/EgtDev/Include/EGkObjUser.h"
+#include "/EgtDev/Include/EGkUserObj.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include
@@ -58,9 +58,9 @@ GdbGeo::Clone( int nId) const
// assegno nuovo Id
pGdbGeo->m_nId = nId ;
// l'aggiornamento del manager di Id viene fatto all'inserimento nel DB
- // aggiorno eventuale ObjUser
- if ( pGdbGeo->m_pObjUser != nullptr)
- pGdbGeo->m_pObjUser->SetOwner( nId, m_pGDB) ;
+ // aggiorno eventuale UserObj
+ if ( pGdbGeo->m_pUserObj != nullptr)
+ pGdbGeo->m_pUserObj->SetOwner( nId, m_pGDB) ;
// assegno il riferimento al DB geometrico
pGdbGeo->SetGeomDB( m_pGDB) ;
@@ -109,8 +109,8 @@ GdbGeo::Save( NgeWriter& ngeOut) const
if ( ! GdbObj::SaveAttribs( ngeOut))
return false ;
- // ObjUser
- if ( ! GdbObj::SaveObjUser( ngeOut))
+ // UserObj
+ if ( ! GdbObj::SaveUserObj( ngeOut))
return false ;
// parametri geometrici
@@ -153,9 +153,9 @@ GdbGeo::Load( int nNgeId, NgeReader& ngeIn, int& nParentId)
return false ;
}
- // eventuale ObjUser
+ // eventuale UserObj
if ( nKey == NGE_U) {
- if ( ! GdbObj::LoadObjUser( ngeIn))
+ if ( ! GdbObj::LoadUserObj( ngeIn))
return false ;
// leggo la prossima linea
if ( ! ngeIn.ReadKey( nKey))
@@ -255,8 +255,12 @@ GdbGeo::Translate( const Vector3d& vtMove)
{
if ( m_pGeoObj == nullptr)
return false ;
-
- return m_pGeoObj->Translate( vtMove) ;
+ // eseguo traslazione
+ if ( ! m_pGeoObj->Translate( vtMove))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->Translate( vtMove))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -265,8 +269,12 @@ GdbGeo::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, doubl
{
if ( m_pGeoObj == nullptr)
return false ;
-
- return m_pGeoObj->Rotate( ptAx, vtAx, dCosAng, dSinAng) ;
+ // eseguo rotazione
+ if ( ! m_pGeoObj->Rotate( ptAx, vtAx, dCosAng, dSinAng))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->Rotate( ptAx, vtAx, dCosAng, dSinAng))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -298,7 +306,11 @@ GdbGeo::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoe
}
// eseguo scalatura
- return m_pGeoObj->Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
+ if ( ! m_pGeoObj->Scale( frRef, dCoeffX, dCoeffY, dCoeffZ))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->Scale( frRef, dCoeffX, dCoeffY, dCoeffZ))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -307,8 +319,12 @@ GdbGeo::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
{
if ( m_pGeoObj == nullptr)
return false ;
-
- return m_pGeoObj->Mirror( ptOn, vtNorm) ;
+ // eseguo mirror
+ if ( ! m_pGeoObj->Mirror( ptOn, vtNorm))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->Mirror( ptOn, vtNorm))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -343,7 +359,11 @@ GdbGeo::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDi
}
// eseguo scorrimento
- return m_pGeoObj->Shear( ptOn, vtNorm, vtDir, dCoeff) ;
+ if ( ! m_pGeoObj->Shear( ptOn, vtNorm, vtDir, dCoeff))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->Shear( ptOn, vtNorm, vtDir, dCoeff))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -353,7 +373,11 @@ GdbGeo::ToGlob( const Frame3d& frRef)
if ( m_pGeoObj == nullptr)
return false ;
- return m_pGeoObj->ToGlob( frRef) ;
+ if ( ! m_pGeoObj->ToGlob( frRef))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->ToGlob( frRef))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -363,7 +387,11 @@ GdbGeo::ToLoc( const Frame3d& frRef)
if ( m_pGeoObj == nullptr)
return false ;
- return m_pGeoObj->ToLoc( frRef) ;
+ if ( ! m_pGeoObj->ToLoc( frRef))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->ToLoc( frRef))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
@@ -373,7 +401,11 @@ GdbGeo::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
if ( m_pGeoObj == nullptr)
return false ;
- return m_pGeoObj->LocToLoc( frOri, frDest) ;
+ if ( ! m_pGeoObj->LocToLoc( frOri, frDest))
+ return false ;
+ if ( m_pUserObj != nullptr && ! m_pUserObj->LocToLoc( frOri, frDest))
+ return false ;
+ return true ;
}
//----------------------------------------------------------------------------
diff --git a/GdbGroup.cpp b/GdbGroup.cpp
index 522cf17..c5ac289 100644
--- a/GdbGroup.cpp
+++ b/GdbGroup.cpp
@@ -96,9 +96,9 @@ GdbGroup::Clone( int nId) const
// assegno nuovo Id
pGdbGroup->m_nId = nId ;
m_pGDB->m_IdManager.UpdateMaxId( nId) ;
- // aggiorno eventuale ObjUser
- if ( m_pObjUser != nullptr)
- m_pObjUser->SetOwner( nId, m_pGDB) ;
+ // aggiorno eventuale UserObj
+ if ( m_pUserObj != nullptr)
+ m_pUserObj->SetOwner( nId, m_pGDB) ;
// assegno il riferimento al DB geometrico
pGdbGroup->SetGeomDB( m_pGDB) ;
@@ -156,8 +156,8 @@ GdbGroup::SaveEmpty( NgeWriter& ngeOut) const
if ( ! GdbObj::SaveAttribs( ngeOut))
return false ;
- // ObjUser
- if ( ! GdbObj::SaveObjUser( ngeOut))
+ // UserObj
+ if ( ! GdbObj::SaveUserObj( ngeOut))
return false ;
// dati geometrici
@@ -217,9 +217,9 @@ GdbGroup::Load( int nNgeId, NgeReader& ngeIn, int& nParentId)
return false ;
}
- // eventuale ObjUser
+ // eventuale UserObj
if ( nKey == NGE_U) {
- if ( ! GdbObj::LoadObjUser( ngeIn))
+ if ( ! GdbObj::LoadUserObj( ngeIn))
return false ;
// leggo la prossima linea
if ( ! ngeIn.ReadKey( nKey))
diff --git a/GdbIterator.cpp b/GdbIterator.cpp
index f94cfd7..6ba01b8 100644
--- a/GdbIterator.cpp
+++ b/GdbIterator.cpp
@@ -847,6 +847,275 @@ GdbIterator::GetRefBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag) const
return m_pCurrObj->GetBBox( frGlob, b3Ref, nFlag) ;
}
+//----------------------------------------------------------------------------
+bool
+GdbIterator::Translate( const Vector3d& vtMove)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // eseguo la traslazione
+ return m_pCurrObj->Translate( vtMove) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::TranslateGlob( const Vector3d& vtMove)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // recupero il riferimento in cui è immerso l'oggetto
+ Frame3d frObj ;
+ if ( ! GetGlobFrame( frObj))
+ return false ;
+ // porto il movimento in locale
+ Vector3d vtMoveLoc = vtMove ;
+ if ( ! vtMoveLoc.ToLoc( frObj))
+ return false ;
+ // eseguo la traslazione
+ return m_pCurrObj->Translate( vtMoveLoc) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::TranslateGroup( const Vector3d& vtMove)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // deve essere un gruppo di cui utilizzo il riferimento proprio
+ GdbGroup* pGdbGroup = GetGdbGroup( m_pCurrObj) ;
+ if ( pGdbGroup == nullptr)
+ return false ;
+ // porto il movimento in questo nel riferimento in cui è immerso il gruppo
+ Vector3d vtMoveLoc = vtMove ;
+ if ( ! vtMoveLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ // eseguo la traslazione
+ return m_pCurrObj->Translate( vtMoveLoc) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // eseguo la rotazione
+ return m_pCurrObj->Rotate( ptAx, vtAx, dCosAng, dSinAng) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::RotateGlob( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // recupero il riferimento in cui è immerso l'oggetto
+ Frame3d frObj ;
+ if ( ! GetGlobFrame( frObj))
+ return false ;
+ // porto i parametri di rotazione in locale
+ Point3d ptAxLoc = ptAx ;
+ if ( ! ptAxLoc.ToLoc( frObj))
+ return false ;
+ Vector3d vtAxLoc = vtAx ;
+ if ( ! vtAxLoc.ToLoc( frObj))
+ return false ;
+ // eseguo la rotazione
+ return m_pCurrObj->Rotate( ptAxLoc, vtAxLoc, dCosAng, dSinAng) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::RotateGroup( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // deve essere un gruppo di cui utilizzo il riferimento proprio
+ GdbGroup* pGdbGroup = GetGdbGroup( m_pCurrObj) ;
+ if ( pGdbGroup == nullptr)
+ return false ;
+ // porto i parametri di rotazione nel riferimento in cui è immerso il gruppo
+ Point3d ptAxLoc = ptAx ;
+ if ( ! ptAxLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ Vector3d vtAxLoc = vtAx ;
+ if ( ! vtAxLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ // eseguo la rotazione
+ return m_pCurrObj->Rotate( ptAxLoc, vtAxLoc, dCosAng, dSinAng) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // eseguo la scalatura
+ return m_pCurrObj->Scale( frRef, dCoeffX, dCoeffY, dCoeffZ) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::ScaleGlob( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // recupero il riferimento in cui è immerso l'oggetto
+ Frame3d frObj ;
+ if ( ! GetGlobFrame( frObj))
+ return false ;
+ // porto il riferimento di scalatura in locale
+ Frame3d frRefLoc = frRef ;
+ if ( ! frRefLoc.ToLoc( frObj))
+ return false ;
+ // eseguo la scalatura
+ return m_pCurrObj->Scale( frRefLoc, dCoeffX, dCoeffY, dCoeffZ) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::ScaleGroup( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // deve essere un gruppo di cui utilizzo il riferimento proprio
+ GdbGroup* pGdbGroup = GetGdbGroup( m_pCurrObj) ;
+ if ( pGdbGroup == nullptr)
+ return false ;
+ // porto il riferimento di scalatura nel riferimento in cui è immerso il gruppo
+ Frame3d frRefLoc = frRef ;
+ if ( ! frRefLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ // eseguo la scalatura
+ return m_pCurrObj->Scale( frRefLoc, dCoeffX, dCoeffY, dCoeffZ) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::Mirror( const Point3d& ptOn, const Vector3d& vtNorm)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // eseguo la specchiatura
+ return m_pCurrObj->Mirror( ptOn, vtNorm) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::MirrorGlob( const Point3d& ptOn, const Vector3d& vtNorm)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // recupero il riferimento in cui è immerso l'oggetto
+ Frame3d frObj ;
+ if ( ! GetGlobFrame( frObj))
+ return false ;
+ // porto i parametri di mirror in locale
+ Point3d ptOnLoc = ptOn ;
+ if ( ! ptOnLoc.ToLoc( frObj))
+ return false ;
+ Vector3d vtNormLoc = vtNorm ;
+ if ( ! vtNormLoc.ToLoc( frObj))
+ return false ;
+ // eseguo la specchiatura
+ return m_pCurrObj->Mirror( ptOnLoc, vtNormLoc) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::MirrorGroup( const Point3d& ptOn, const Vector3d& vtNorm)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // deve essere un gruppo di cui utilizzo il riferimento proprio
+ GdbGroup* pGdbGroup = GetGdbGroup( m_pCurrObj) ;
+ if ( pGdbGroup == nullptr)
+ return false ;
+ // porto i parametri di mirror nel riferimento in cui è immerso il gruppo
+ Point3d ptOnLoc = ptOn ;
+ if ( ! ptOnLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ Vector3d vtNormLoc = vtNorm ;
+ if ( ! vtNormLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ // eseguo la specchiatura
+ return m_pCurrObj->Mirror( ptOnLoc, vtNormLoc) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // eseguo la deformazione
+ return m_pCurrObj->Shear( ptOn, vtNorm, vtDir, dCoeff) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::ShearGlob( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // recupero il riferimento in cui è immerso l'oggetto
+ Frame3d frObj ;
+ if ( ! GetGlobFrame( frObj))
+ return false ;
+ // porto i parametri di shear in locale
+ Point3d ptOnLoc = ptOn ;
+ if ( ! ptOnLoc.ToLoc( frObj))
+ return false ;
+ Vector3d vtNormLoc = vtNorm ;
+ if ( ! vtNormLoc.ToLoc( frObj))
+ return false ;
+ Vector3d vtDirLoc = vtDir ;
+ if ( ! vtDirLoc.ToLoc( frObj))
+ return false ;
+ // eseguo la deformazione
+ return m_pCurrObj->Shear( ptOnLoc, vtNormLoc, vtDirLoc, dCoeff) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::ShearGroup( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr || m_pCurrObj->m_nId == GDB_ID_ROOT)
+ return false ;
+
+ // deve essere un gruppo di cui utilizzo il riferimento proprio
+ GdbGroup* pGdbGroup = GetGdbGroup( m_pCurrObj) ;
+ if ( pGdbGroup == nullptr)
+ return false ;
+ // porto i parametri di shear nel riferimento in cui è immerso il gruppo
+ Point3d ptOnLoc = ptOn ;
+ if ( ! ptOnLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ Vector3d vtNormLoc = vtNorm ;
+ if ( ! vtNormLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ Vector3d vtDirLoc = vtDir ;
+ if ( ! vtDirLoc.ToGlob( pGdbGroup->GetFrame()))
+ return false ;
+ // eseguo la deformazione
+ return m_pCurrObj->Shear( ptOnLoc, vtNormLoc, vtDirLoc, dCoeff) ;
+}
+
//----------------------------------------------------------------------------
// Attributes
//----------------------------------------------------------------------------
@@ -1346,3 +1615,58 @@ GdbIterator::RemoveInfo( const string& sKey)
// rimuovo l'Info
return m_pCurrObj->RemoveInfo( sKey) ;
}
+
+//----------------------------------------------------------------------------
+// UserObj
+//----------------------------------------------------------------------------
+bool
+GdbIterator::SetUserObj( IUserObj* pUserObj)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
+ return false ;
+
+ // cancello eventuale precedente UserObj
+ if ( m_pCurrObj->m_pUserObj != nullptr)
+ delete m_pCurrObj->m_pUserObj ;
+
+ // assegno nuovo UserObj
+ if ( pUserObj != nullptr)
+ pUserObj->SetOwner( m_pCurrObj->m_nId, m_pGDB) ;
+ m_pCurrObj->m_pUserObj = pUserObj ;
+ return true ;
+}
+
+//----------------------------------------------------------------------------
+IUserObj*
+GdbIterator::GetUserObj( void)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
+ return nullptr ;
+ // restituisco il puntatore a IUserObj
+ return m_pCurrObj->m_pUserObj ;
+}
+
+//----------------------------------------------------------------------------
+const IUserObj*
+GdbIterator::GetUserObj( void) const
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
+ return nullptr ;
+ // restituisco il puntatore a IUserObj
+ return m_pCurrObj->m_pUserObj ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GdbIterator::RemoveUserObj( void)
+{
+ if ( m_pGDB == nullptr || m_pCurrObj == nullptr)
+ return nullptr ;
+
+ // cancello eventuale precedente UserObj
+ if ( m_pCurrObj->m_pUserObj != nullptr)
+ delete m_pCurrObj->m_pUserObj ;
+ // reset puntatore a UserObj
+ m_pCurrObj->m_pUserObj = nullptr ;
+ return true ;
+}
diff --git a/GdbIterator.h b/GdbIterator.h
index 775567f..f465c02 100644
--- a/GdbIterator.h
+++ b/GdbIterator.h
@@ -49,7 +49,7 @@ class GdbIterator : public IGdbIterator
virtual bool GoToPrevGroup( void) ;
virtual bool EraseAndGoToNextGroup( void) ;
virtual bool EraseAndGoToPrevGroup( void) ;
-
+ // Gets
virtual int GetGdbType( void) const ;
virtual int GetGeoType( void) const ;
virtual IGeoObj* GetGeoObj( void) ;
@@ -65,6 +65,32 @@ class GdbIterator : public IGdbIterator
virtual bool GetLocalBBox( BBox3d& b3Loc, int nFlag = BBF_STANDARD) const ;
virtual bool GetGlobalBBox( BBox3d& b3Glob, int nFlag = BBF_STANDARD) const ;
virtual bool GetRefBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag = BBF_STANDARD) const ;
+ // Transformations
+ virtual bool Translate( const Vector3d& vtMove) ;
+ virtual bool TranslateGlob( const Vector3d& vtMove) ;
+ virtual bool TranslateGroup( const Vector3d& vtMove) ;
+ virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
+ { double dAngRad = dAngDeg * DEGTORAD ;
+ return Rotate( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
+ virtual bool Rotate( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
+ virtual bool RotateGlob( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
+ { double dAngRad = dAngDeg * DEGTORAD ;
+ return RotateGlob( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
+ virtual bool RotateGlob( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
+ virtual bool RotateGroup( const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg)
+ { double dAngRad = dAngDeg * DEGTORAD ;
+ return RotateGroup( ptAx, vtAx, cos( dAngRad), sin( dAngRad)) ; }
+ virtual bool RotateGroup( const Point3d& ptAx, const Vector3d& vtAx, double dCosAng, double dSinAng) ;
+ virtual bool Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
+ virtual bool ScaleGlob( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
+ virtual bool ScaleGroup( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ) ;
+ virtual bool Mirror( const Point3d& ptOn, const Vector3d& vtNorm) ;
+ virtual bool MirrorGlob( const Point3d& ptOn, const Vector3d& vtNorm) ;
+ virtual bool MirrorGroup( const Point3d& ptOn, const Vector3d& vtNorm) ;
+ virtual bool Shear( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) ;
+ virtual bool ShearGlob( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) ;
+ virtual bool ShearGroup( const Point3d& ptOn, const Vector3d& vtNorm, const Vector3d& vtDir, double dCoeff) ;
+ // Attributes
virtual bool SetLevel( int nLevel) ;
virtual bool RevertLevel( void) ;
virtual bool GetLevel( int& nLevel) const ;
@@ -116,6 +142,11 @@ class GdbIterator : public IGdbIterator
virtual bool GetInfo( const std::string& sKey, STRVECTOR& vsInfo) const ;
virtual bool ExistsInfo( const std::string& sKey) const ;
virtual bool RemoveInfo( const std::string& sKey) ;
+ // UserObj
+ virtual bool SetUserObj( IUserObj* pUserObj) ;
+ virtual IUserObj* GetUserObj( void) ;
+ virtual const IUserObj* GetUserObj( void) const ;
+ virtual bool RemoveUserObj( void) ;
public :
GdbIterator( IGeomDB* pGDB = nullptr) ;
diff --git a/GdbObj.cpp b/GdbObj.cpp
index 5a187f7..8743760 100644
--- a/GdbObj.cpp
+++ b/GdbObj.cpp
@@ -17,12 +17,12 @@
#include "GdbObj.h"
#include "GdbGroup.h"
#include "Attribs.h"
-#include "ObjUserDefault.h"
+#include "UserObjDefault.h"
#include "NgeWriter.h"
#include "NgeReader.h"
#include "/EgtDev/Include/EGkGdbFunct.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
-#include "/EgtDev/Include/EGkObjUserFactory.h"
+#include "/EgtDev/Include/EGkUserObjFactory.h"
#include "/EgtDev/Include/EGnStringKeyVal.h"
#include
@@ -30,7 +30,7 @@ using namespace std ;
//----------------------------------------------------------------------------
GdbObj::GdbObj( void)
- : m_nId( GDB_ID_NULL), m_pAttribs( nullptr), m_pObjUser( nullptr), m_pSelPrev( nullptr),
+ : m_nId( GDB_ID_NULL), m_pAttribs( nullptr), m_pUserObj( nullptr), m_pSelPrev( nullptr),
m_pSelNext( nullptr), m_pGDB( nullptr), m_pNext( nullptr), m_pPrev( nullptr), m_pParent( nullptr)
{
}
@@ -42,10 +42,10 @@ GdbObj::~GdbObj( void)
if ( m_pAttribs != nullptr)
delete m_pAttribs ;
m_pAttribs = nullptr ;
- // cancello ObjUser
- if ( m_pObjUser != nullptr)
- delete m_pObjUser ;
- m_pObjUser = nullptr ;
+ // cancello UserObj
+ if ( m_pUserObj != nullptr)
+ delete m_pUserObj ;
+ m_pUserObj = nullptr ;
// aggiorno managers del Db geometrico di appartenenza
if ( m_pGDB != nullptr) {
// elimino da mappa dei nomi
@@ -66,10 +66,10 @@ GdbObj::CopyFrom( const GdbObj* pSou)
if ( m_pAttribs != nullptr)
delete m_pAttribs ;
m_pAttribs = nullptr ;
- // elimino eventuale ObjUser pre-esistente
- if ( m_pObjUser != nullptr)
- delete m_pObjUser ;
- m_pObjUser = nullptr ;
+ // elimino eventuale UserObj pre-esistente
+ if ( m_pUserObj != nullptr)
+ delete m_pUserObj ;
+ m_pUserObj = nullptr ;
// se l'oggetto sorgente non esiste
if ( pSou == nullptr) {
@@ -80,8 +80,8 @@ GdbObj::CopyFrom( const GdbObj* pSou)
// copio Id
m_nId = pSou->m_nId ;
- // copio gli attributi e ObjUser
- return ( CopyAttribsFrom( pSou) && CopyObjUserFrom( pSou)) ;
+ // copio gli attributi e UserObj
+ return ( CopyAttribsFrom( pSou) && CopyUserObjFrom( pSou)) ;
}
//----------------------------------------------------------------------------
@@ -115,23 +115,23 @@ GdbObj::CopyAttribsFrom( const GdbObj* pSou)
//----------------------------------------------------------------------------
bool
-GdbObj::CopyObjUserFrom( const GdbObj* pSou)
+GdbObj::CopyUserObjFrom( const GdbObj* pSou)
{
// se l'oggetto sorgente non esiste
if ( pSou == nullptr)
return false ;
- // copio ObjUser
- if ( pSou->m_pObjUser != nullptr) {
- m_pObjUser = pSou->m_pObjUser->Clone() ;
- if ( m_pObjUser == nullptr)
+ // copio UserObj
+ if ( pSou->m_pUserObj != nullptr) {
+ m_pUserObj = pSou->m_pUserObj->Clone() ;
+ if ( m_pUserObj == nullptr)
return false ;
- m_pObjUser->SetOwner( m_nId, m_pGDB) ;
+ m_pUserObj->SetOwner( m_nId, m_pGDB) ;
}
// altrimenti lo cancello
else {
- if ( m_pObjUser != nullptr)
- delete m_pObjUser ;
- m_pObjUser = nullptr ;
+ if ( m_pUserObj != nullptr)
+ delete m_pUserObj ;
+ m_pUserObj = nullptr ;
}
return true ;
@@ -990,26 +990,26 @@ GdbObj::RemoveInfo( const string& sKey)
}
//----------------------------------------------------------------------------
-// IObjUser
+// IUserObj
//----------------------------------------------------------------------------
bool
-GdbObj::SaveObjUser( NgeWriter& ngeOut) const
+GdbObj::SaveUserObj( NgeWriter& ngeOut) const
{
- // se definito ObjUser e da salvare
- if ( m_pObjUser != nullptr && m_pObjUser->ToSave()) {
+ // se definito UserObj e da salvare
+ if ( m_pUserObj != nullptr && m_pUserObj->ToSave()) {
// recupero il nome della sua classe
- string sName = m_pObjUser->GetClassName() ;
+ string sName = m_pUserObj->GetClassName() ;
if ( sName.empty())
return false ;
// recupero le stringhe dei dati
STRVECTOR vString ;
- if ( ! m_pObjUser->Save( vString))
+ if ( ! m_pUserObj->Save( vString))
return false ;
// eseguo validazione di queste stringhe
for ( auto iIter = vString.begin() ; iIter != vString.end() ; ++ iIter)
ValidateKeyVal( *iIter) ;
// scrivo i dati :
- // flag presenza ObjUser
+ // flag presenza UserObj
if ( ! ngeOut.WriteKey( NGE_U))
return false ;
// nome della classe dell'oggetto
@@ -1029,7 +1029,7 @@ GdbObj::SaveObjUser( NgeWriter& ngeOut) const
//----------------------------------------------------------------------------
bool
-GdbObj::LoadObjUser( NgeReader& ngeIn)
+GdbObj::LoadUserObj( NgeReader& ngeIn)
{
// leggo il nome della classe
string sName ;
@@ -1051,14 +1051,14 @@ GdbObj::LoadObjUser( NgeReader& ngeIn)
return false ;
}
// creo l'oggetto corrispondente
- m_pObjUser = OBJUSER_CREATE( sName) ;
+ m_pUserObj = USEROBJ_CREATE( sName) ;
// se non trovato uso quello di default
- if ( m_pObjUser == nullptr)
- m_pObjUser = new(nothrow) ObjUserDefault( sName) ; ;
- if ( m_pObjUser == nullptr)
+ if ( m_pUserObj == nullptr)
+ m_pUserObj = new(nothrow) UserObjDefault( sName) ; ;
+ if ( m_pUserObj == nullptr)
return false ;
// carico i dati nell'oggetto
- if ( ! m_pObjUser->Load( vString))
+ if ( ! m_pUserObj->Load( vString))
return false ;
// impostazione Id e GeomDB fatte successivamente
return true ;
diff --git a/GdbObj.h b/GdbObj.h
index 2d405af..0c961b2 100644
--- a/GdbObj.h
+++ b/GdbObj.h
@@ -24,7 +24,7 @@ class GeomDB ;
class GdbGroup ;
class IdManager ;
class Attribs ;
-class IObjUser ;
+class IUserObj ;
class NgeWriter ;
class NgeReader ;
@@ -56,7 +56,7 @@ class GdbObj
GdbObj( void) ;
bool CopyFrom( const GdbObj* pSou) ;
bool CopyAttribsFrom( const GdbObj* pSou) ;
- bool CopyObjUserFrom( const GdbObj* pSou) ;
+ bool CopyUserObjFrom( const GdbObj* pSou) ;
public :
bool SaveAttribs( NgeWriter& ngeOut) const ;
@@ -117,8 +117,8 @@ class GdbObj
bool GetInfo( const std::string& sKey, STRVECTOR& vsInfo) const ;
bool ExistsInfo( const std::string& sKey) const ;
bool RemoveInfo( const std::string& sKey) ;
- bool SaveObjUser( NgeWriter& ngeOut) const ;
- bool LoadObjUser( NgeReader& ngeIn) ;
+ bool SaveUserObj( NgeWriter& ngeOut) const ;
+ bool LoadUserObj( NgeReader& ngeIn) ;
public :
void SetGeomDB( GeomDB* pGDB)
@@ -148,7 +148,7 @@ class GdbObj
public :
int m_nId ;
Attribs* m_pAttribs ;
- IObjUser* m_pObjUser ;
+ IUserObj* m_pUserObj ;
protected :
GeomDB* m_pGDB ;
diff --git a/GeomDB.cpp b/GeomDB.cpp
index 4ef7dbc..3987588 100644
--- a/GeomDB.cpp
+++ b/GeomDB.cpp
@@ -250,8 +250,8 @@ GeomDB::LoadOneObj( NgeReader& ngeIn, int nGroupId, int nBaseGdbId, const INTVEC
}
// se inserimento nel DB va bene, ritorno con successo
if ( InsertInGeomDB( pGdbObj, nParentId, GDB_LAST_SON)) {
- if ( pGdbObj->m_pObjUser != nullptr)
- pGdbObj->m_pObjUser->SetOwner( pGdbObj->m_nId, this) ;
+ if ( pGdbObj->m_pUserObj != nullptr)
+ pGdbObj->m_pUserObj->SetOwner( pGdbObj->m_nId, this) ;
return true ;
}
}
@@ -1295,8 +1295,8 @@ GeomDB::TranslateGroup( int nId, const Vector3d& vtMove)
if ( nId <= GDB_ID_ROOT)
return false ;
// recupero il gruppo Gdb
- GdbGroup* pGdbGroup ;
- if ( ( pGdbGroup = GetGdbGroup( nId)) == nullptr)
+ GdbGroup* pGdbGroup = GetGdbGroup( nId) ;
+ if ( pGdbGroup == nullptr)
return false ;
// utilizzo il riferimento proprio
// porto il movimento nel riferimento in cui è immerso
@@ -2582,51 +2582,52 @@ GeomDB::RemoveInfo( int nId, const string& sKey)
}
//----------------------------------------------------------------------------
-// ObjUser
+// UserObj
//----------------------------------------------------------------------------
bool
-GeomDB::SetObjUser( int nId, IObjUser* pObjUser)
+GeomDB::SetUserObj( int nId, IUserObj* pUserObj)
{
// recupero l'oggetto
GdbObj* pGdbObj = GetGdbObj( nId) ;
if ( pGdbObj == nullptr)
return false ;
- // cancello eventuale precedente ObjUser
- if ( pGdbObj->m_pObjUser != nullptr)
- delete pGdbObj->m_pObjUser ;
+ // cancello eventuale precedente UserObj
+ if ( pGdbObj->m_pUserObj != nullptr)
+ delete pGdbObj->m_pUserObj ;
// assegno
- pObjUser->SetOwner( nId, this) ;
- pGdbObj->m_pObjUser = pObjUser ;
+ if ( pUserObj != nullptr)
+ pUserObj->SetOwner( nId, this) ;
+ pGdbObj->m_pUserObj = pUserObj ;
return true ;
}
//----------------------------------------------------------------------------
-IObjUser*
-GeomDB::GetObjUser( int nId)
+IUserObj*
+GeomDB::GetUserObj( int nId)
{
// recupero l'oggetto
GdbObj* pGdbObj = GetGdbObj( nId) ;
if ( pGdbObj == nullptr)
return nullptr ;
- // restituisco il puntatore a IObjUser
- return pGdbObj->m_pObjUser ;
+ // restituisco il puntatore a IUserObj
+ return pGdbObj->m_pUserObj ;
}
//----------------------------------------------------------------------------
-const IObjUser*
-GeomDB::GetObjUser( int nId) const
+const IUserObj*
+GeomDB::GetUserObj( int nId) const
{
// recupero l'oggetto
const GdbObj* pGdbObj = GetGdbObj( nId) ;
if ( pGdbObj == nullptr)
return nullptr ;
- // restituisco il puntatore a IObjUser
- return pGdbObj->m_pObjUser ;
+ // restituisco il puntatore a IUserObj
+ return pGdbObj->m_pUserObj ;
}
//----------------------------------------------------------------------------
bool
-GeomDB::DumpObjUser( int nId, string& sOut, const char* szNewLine) const
+GeomDB::DumpUserObj( int nId, string& sOut, const char* szNewLine) const
{
// recupero l'oggetto
const GdbObj* pGdbObj = GetGdbObj( nId) ;
@@ -2634,15 +2635,15 @@ GeomDB::DumpObjUser( int nId, string& sOut, const char* szNewLine) const
return false ;
// eseguo il dump
- if ( pGdbObj->m_pObjUser != nullptr)
- return pGdbObj->m_pObjUser->Dump( sOut, szNewLine) ;
+ if ( pGdbObj->m_pUserObj != nullptr)
+ return pGdbObj->m_pUserObj->Dump( sOut, szNewLine) ;
else
return true ;
}
//----------------------------------------------------------------------------
bool
-GeomDB::CopyObjUser( int nIdSou, int nIdDest)
+GeomDB::CopyUserObj( int nIdSou, int nIdDest)
{
// verifico esistenza del sorgente
GdbObj* pGdOSou = GetGdbObj( nIdSou) ;
@@ -2653,7 +2654,23 @@ GeomDB::CopyObjUser( int nIdSou, int nIdDest)
if ( pGdODest == nullptr)
return false ;
// eseguo la copia
- return pGdODest->CopyObjUserFrom( pGdOSou) ;
+ return pGdODest->CopyUserObjFrom( pGdOSou) ;
+}
+
+//----------------------------------------------------------------------------
+bool
+GeomDB::RemoveUserObj( int nId)
+{
+ // recupero l'oggetto
+ GdbObj* pGdbObj = GetGdbObj( nId) ;
+ if ( pGdbObj == nullptr)
+ return false ;
+ // cancello eventuale precedente UserObj
+ if ( pGdbObj->m_pUserObj != nullptr)
+ delete pGdbObj->m_pUserObj ;
+ // reset puntatore a UserObj
+ pGdbObj->m_pUserObj = nullptr ;
+ return true ;
}
//----------------------------------------------------------------------------
diff --git a/GeomDB.h b/GeomDB.h
index ae7752a..c5ee41d 100644
--- a/GeomDB.h
+++ b/GeomDB.h
@@ -80,6 +80,7 @@ class GeomDB : public IGeomDB
virtual bool ChangeId( int nId, int nNewId) ;
virtual bool Erase( int nId) ;
virtual bool EmptyGroup( int nId) ;
+ // transformations
virtual bool Translate( int nId, const Vector3d& vtMove) ;
virtual bool TranslateGlob( int nId, const Vector3d& vtMove) ;
virtual bool TranslateGroup( int nId, const Vector3d& vtMove) ;
@@ -174,12 +175,13 @@ class GeomDB : public IGeomDB
virtual bool GetInfo( int nId, const std::string& sKey, STRVECTOR& vsInfo) const ;
virtual bool ExistsInfo( int nId, const std::string& sKey) const ;
virtual bool RemoveInfo( int nId, const std::string& sKey) ;
- // ObjUser
- virtual bool SetObjUser( int nId, IObjUser* pObjUser) ;
- virtual IObjUser* GetObjUser( int nId) ;
- virtual const IObjUser* GetObjUser( int nId) const ;
- virtual bool DumpObjUser( int nId, std::string& sOut, const char* szNewLine) const ;
- virtual bool CopyObjUser( int nIdSou, int nIdDest) ;
+ // UserObj
+ virtual bool SetUserObj( int nId, IUserObj* pUserObj) ;
+ virtual IUserObj* GetUserObj( int nId) ;
+ virtual const IUserObj* GetUserObj( int nId) const ;
+ virtual bool DumpUserObj( int nId, std::string& sOut, const char* szNewLine) const ;
+ virtual bool CopyUserObj( int nIdSou, int nIdDest) ;
+ virtual bool RemoveUserObj( int nId) ;
// Material library
virtual int AddMaterial( const std::string& sName, const Material& matM) ;
virtual int FindMaterial( const std::string& sName) const ;
diff --git a/NgeConst.h b/NgeConst.h
index be1f06c..29bcd3b 100644
--- a/NgeConst.h
+++ b/NgeConst.h
@@ -11,7 +11,7 @@
// 23.08.14 DS 1007 -> versione con 1 solo int e cambiato nome GDB in "EgtGeomDB".
// 21.01.15 DS 1009 -> Aggiunto ZMAP, cambiato Id di TEXT.
// 11.03.15 DS 1010 -> Aggiunto flag orientata e elenco facce a SurfTm.
-// 22.05.15 DS 1011 -> Aggiunta possibilità estensione oggetti con IObjUser.
+// 22.05.15 DS 1011 -> Aggiunta possibilità estensione oggetti con IUserObj.
//
//----------------------------------------------------------------------------
@@ -34,7 +34,7 @@ const int NGE_VER_1009 = 1009 ;
const int NGE_VER_1010 = 1010 ;
// 1010 : aggiunto flag orientata e elenco facce a SurfTm
const int NGE_VER_1011 = 1011 ;
-// 1011 : aggiunta possibilità estensione oggetti con IObjUser (Keyword U)
+// 1011 : aggiunta possibilità estensione oggetti con IUserObj (Keyword U)
const int NGE_VER_LAST = NGE_VER_1011 ;
// Indici KeyWord
const int NGE_START = 0 ;
diff --git a/ObjUserDefault.cpp b/UserObjDefault.cpp
similarity index 71%
rename from ObjUserDefault.cpp
rename to UserObjDefault.cpp
index 57c06b4..7367d6d 100644
--- a/ObjUserDefault.cpp
+++ b/UserObjDefault.cpp
@@ -1,8 +1,8 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
-// File : ObjUserDefault.h Data : 22.05.15 Versione : 1.6e3
-// Contenuto : Oggetto di sostituzione per ObjUser non trovato.
+// File : UserObjDefault.h Data : 22.05.15 Versione : 1.6e3
+// Contenuto : Oggetto di sostituzione per UserObj non trovato.
//
//
//
@@ -13,18 +13,18 @@
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
-#include "ObjUserDefault.h"
+#include "UserObjDefault.h"
#include "/EgtDev/Include/EGkGdbConst.h"
-#include "/EgtDev/Include/EGkObjUserFactory.h"
+#include "/EgtDev/Include/EGkUserObjFactory.h"
#include "/EgtDev/Include/EGnStringUtils.h"
using namespace std ;
//----------------------------------------------------------------------------
-OBJUSER_REGISTER( "EGkDefault", ObjUserDefault) ;
+USEROBJ_REGISTER( "EGkDefault", UserObjDefault) ;
//----------------------------------------------------------------------------
-ObjUserDefault::ObjUserDefault( const string& sName)
+UserObjDefault::UserObjDefault( const string& sName)
{
m_sName = sName ;
m_nOwnerId = GDB_ID_NULL ;
@@ -32,11 +32,11 @@ ObjUserDefault::ObjUserDefault( const string& sName)
}
//----------------------------------------------------------------------------
-ObjUserDefault*
-ObjUserDefault::Clone( void) const
+UserObjDefault*
+UserObjDefault::Clone( void) const
{
// alloco oggetto
- ObjUserDefault* pOUD = new(nothrow) ObjUserDefault ;
+ UserObjDefault* pOUD = new(nothrow) UserObjDefault ;
// eseguo copia dei dati
if ( pOUD != nullptr) {
try { pOUD->m_sName = m_sName ;
@@ -55,16 +55,16 @@ ObjUserDefault::Clone( void) const
//----------------------------------------------------------------------------
const std::string&
-ObjUserDefault::GetClassName( void) const
+UserObjDefault::GetClassName( void) const
{
return m_sName ;
}
//----------------------------------------------------------------------------
bool
-ObjUserDefault::Dump( std::string& sOut, const char* szNewLine) const
+UserObjDefault::Dump( std::string& sOut, const char* szNewLine) const
{
- sOut += "ObjUser " + m_sName + szNewLine ;
+ sOut += "UserObj " + m_sName + szNewLine ;
sOut += "Id=" + ToString( m_nOwnerId) + szNewLine ;
for ( size_t i = 0 ; i < m_vData.size() ; ++ i)
sOut += m_vData[i] + szNewLine ;
@@ -73,7 +73,7 @@ ObjUserDefault::Dump( std::string& sOut, const char* szNewLine) const
//----------------------------------------------------------------------------
bool
-ObjUserDefault::Save( STRVECTOR& vString) const
+UserObjDefault::Save( STRVECTOR& vString) const
{
vString = m_vData ;
return true ;
@@ -81,7 +81,7 @@ ObjUserDefault::Save( STRVECTOR& vString) const
//----------------------------------------------------------------------------
bool
-ObjUserDefault::Load( const STRVECTOR& vString)
+UserObjDefault::Load( const STRVECTOR& vString)
{
m_vData = vString ;
return true ;
@@ -89,7 +89,7 @@ ObjUserDefault::Load( const STRVECTOR& vString)
//----------------------------------------------------------------------------
bool
-ObjUserDefault::SetOwner( int nId, IGeomDB* pGDB)
+UserObjDefault::SetOwner( int nId, IGeomDB* pGDB)
{
m_nOwnerId = nId ;
m_pGeomDB = pGDB ;
@@ -98,14 +98,14 @@ ObjUserDefault::SetOwner( int nId, IGeomDB* pGDB)
//----------------------------------------------------------------------------
int
-ObjUserDefault::GetOwner( void) const
+UserObjDefault::GetOwner( void) const
{
return m_nOwnerId ;
}
//----------------------------------------------------------------------------
IGeomDB*
-ObjUserDefault::GetGeomDB( void) const
+UserObjDefault::GetGeomDB( void) const
{
return m_pGeomDB ;
}
diff --git a/ObjUserDefault.h b/UserObjDefault.h
similarity index 74%
rename from ObjUserDefault.h
rename to UserObjDefault.h
index cb5e829..70a1169 100644
--- a/ObjUserDefault.h
+++ b/UserObjDefault.h
@@ -1,8 +1,8 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
-// File : ObjUserDefault.h Data : 22.05.15 Versione : 1.6e3
-// Contenuto : Dichiarazione della classe ObjUserDefault.
+// File : UserObjDefault.h Data : 22.05.15 Versione : 1.6e3
+// Contenuto : Dichiarazione della classe UserObjDefault.
//
//
//
@@ -13,13 +13,13 @@
#pragma once
-#include "/EgtDev/Include/EGkObjUser.h"
+#include "/EgtDev/Include/EGkUserObj.h"
//----------------------------------------------------------------------------
-class ObjUserDefault : public IObjUser
+class UserObjDefault : public IUserObj
{
public :
- virtual ObjUserDefault* Clone( void) const ;
+ virtual UserObjDefault* Clone( void) const ;
virtual bool IsDefault( void) const { return true ; }
virtual const std::string& GetClassName( void) const ;
virtual bool Dump( std::string& sOut, const char* szNewLine = "\n") const ;
@@ -31,8 +31,8 @@ class ObjUserDefault : public IObjUser
virtual IGeomDB* GetGeomDB( void) const ;
public :
- ObjUserDefault( void) {}
- ObjUserDefault( const std::string& sName) ;
+ UserObjDefault( void) {}
+ UserObjDefault( const std::string& sName) ;
private :
int m_nOwnerId ;
diff --git a/ObjUserFactory.cpp b/UserObjFactory.cpp
similarity index 75%
rename from ObjUserFactory.cpp
rename to UserObjFactory.cpp
index 926b57d..62300bd 100644
--- a/ObjUserFactory.cpp
+++ b/UserObjFactory.cpp
@@ -1,8 +1,8 @@
//----------------------------------------------------------------------------
// EgalTech 2015-2015
//----------------------------------------------------------------------------
-// File : ObjUserFactory.h Data : 22.05.15 Versione : 1.6e3
-// Contenuto : Factory della classe IObjUser.
+// File : UserObjFactory.h Data : 22.05.15 Versione : 1.6e3
+// Contenuto : Factory della classe IUserObj.
//
//
//
@@ -13,20 +13,20 @@
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
-#include "/EgtDev/Include/EGkObjUserFactory.h"
+#include "/EgtDev/Include/EGkUserObjFactory.h"
using namespace std ;
//----------------------------------------------------------------------------
bool
-ObjUserFactory::Register( const string& sName, ObjUserCreator Creator)
+UserObjFactory::Register( const string& sName, UserObjCreator Creator)
{
return GetCreatorMap().emplace( sName, Creator).second ;
}
//----------------------------------------------------------------------------
-IObjUser*
-ObjUserFactory::Create( const string& sName)
+IUserObj*
+UserObjFactory::Create( const string& sName)
{
auto Iter = GetCreatorMap().find( sName) ;
if ( Iter != GetCreatorMap().end()) {
@@ -38,7 +38,7 @@ ObjUserFactory::Create( const string& sName)
//----------------------------------------------------------------------------
bool
-ObjUserFactory::GetList( STRVECTOR& vsList)
+UserObjFactory::GetList( STRVECTOR& vsList)
{
// verifico parametro di ritorno
if ( &vsList == nullptr)
@@ -50,8 +50,8 @@ ObjUserFactory::GetList( STRVECTOR& vsList)
}
//----------------------------------------------------------------------------
-ObjUserFactory::CreatorMap&
-ObjUserFactory::GetCreatorMap( void)
+UserObjFactory::CreatorMap&
+UserObjFactory::GetCreatorMap( void)
{
static CreatorMap s_CreatorMap ;
return s_CreatorMap ;