diff --git a/API_GdbObjSelection.cpp b/API_GdbObjSelection.cpp
new file mode 100644
index 0000000..96dcfa7
--- /dev/null
+++ b/API_GdbObjSelection.cpp
@@ -0,0 +1,54 @@
+//----------------------------------------------------------------------------
+// EgalTech 2014-2014
+//----------------------------------------------------------------------------
+// File : API_GdbObjects.cpp Data : 02.09.14 Versione : 1.5i1
+// Contenuto : Funzioni iterazione di DB geometrico per API.
+//
+//
+//
+// Modifiche : 02.09.14 DS Creazione modulo.
+//
+//
+//----------------------------------------------------------------------------
+
+//--------------------------- Include ----------------------------------------
+#include "stdafx.h"
+#include "API.h"
+#include "API_Macro.h"
+#include "/EgtDev/Include/EInAPI.h"
+#include "/EgtDev/Include/EGkStringUtils3d.h"
+#include "/EgtDev/Include/EGnStringConverter.h"
+#include "/EgtDev/Include/EgtPointerOwner.h"
+
+using namespace std ;
+
+
+//-----------------------------------------------------------------------------
+BOOL
+ __stdcall EgtIsSelectedObj( int nGseCtx, int nId)
+ {
+ IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
+ VERIFY_GEOMDB( pGeomDB, FALSE)
+ // verifico se l'oggetto è selezionato
+ return ( pGeomDB->IsSelectedObj( nId) ? TRUE : FALSE) ;
+ }
+
+//-----------------------------------------------------------------------------
+BOOL
+ __stdcall EgtSelectObj( int nGseCtx, int nId)
+ {
+ IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
+ VERIFY_GEOMDB( pGeomDB, FALSE)
+ // seleziono l'oggetto
+ return ( pGeomDB->SelectObj( nId) ? TRUE : FALSE) ;
+ }
+
+//-----------------------------------------------------------------------------
+BOOL
+ __stdcall EgtDeselectObj( int nGseCtx, int nId)
+ {
+ IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
+ VERIFY_GEOMDB( pGeomDB, FALSE)
+ // deseleziono l'oggetto
+ return ( pGeomDB->DeselectObj( nId) ? TRUE : FALSE) ;
+ }
diff --git a/API_GdbObjects.cpp b/API_GdbObjects.cpp
index 6cf313d..8859c6b 100644
--- a/API_GdbObjects.cpp
+++ b/API_GdbObjects.cpp
@@ -1,7 +1,7 @@
//----------------------------------------------------------------------------
// EgalTech 2014-2014
//----------------------------------------------------------------------------
-// File : API_GdbIterate.cpp Data : 02.09.14 Versione : 1.5i1
+// File : API_GdbObjects.cpp Data : 02.09.14 Versione : 1.5i1
// Contenuto : Funzioni iterazione di DB geometrico per API.
//
//
diff --git a/API_Scene.cpp b/API_Scene.cpp
index de9df2d..692079b 100644
--- a/API_Scene.cpp
+++ b/API_Scene.cpp
@@ -68,6 +68,17 @@ __stdcall EgtSetBackground( int nGseCtx, int nTopRed, int nTopGreen, int nTopBlu
return TRUE ;
}
+//-----------------------------------------------------------------------------
+BOOL
+__stdcall EgtResize( int nGseCtx, int nW, int nH)
+{
+ IEGrScene* pScene = GetScene( nGseCtx) ;
+ VERIFY_SCENE( pScene, FALSE)
+ // eseguo resize
+ pScene->Resize( nW, nH) ;
+ return TRUE ;
+}
+
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtDraw( int nGseCtx)
@@ -84,13 +95,32 @@ __stdcall EgtDraw( int nGseCtx)
//-----------------------------------------------------------------------------
BOOL
-__stdcall EgtResize( int nGseCtx, int nW, int nH)
+__stdcall EgtSelect( int nGseCtx, int nWinX, int nWinY, int nSelW, int nSelH, int* pnSel)
{
- IEGrScene* pScene = GetScene( nGseCtx) ;
- VERIFY_SCENE( pScene, FALSE)
- // eseguo resize
- pScene->Resize( nW, nH) ;
- return TRUE ;
+ GseContext* pGseCtx = GetGseContext( nGseCtx) ;
+ VERIFY_CTX_SCENE( pGseCtx, FALSE)
+ // eseguo la selezione
+ return ( pGseCtx->m_pScene->Select( Point3d( nWinX, nWinY), nSelW, nSelH, *pnSel) ? TRUE : FALSE) ;
+}
+
+//-----------------------------------------------------------------------------
+int
+__stdcall EgtGetFirstSelectedObj( int nGseCtx)
+{
+ GseContext* pGseCtx = GetGseContext( nGseCtx) ;
+ VERIFY_CTX_SCENE( pGseCtx, FALSE)
+ // restituisco il primo oggetto selezionato
+ return pGseCtx->m_pScene->GetFirstSelectedObj() ;
+}
+
+//-----------------------------------------------------------------------------
+int
+__stdcall EgtGetNextSelectedObj( int nGseCtx)
+{
+ GseContext* pGseCtx = GetGseContext( nGseCtx) ;
+ VERIFY_CTX_SCENE( pGseCtx, FALSE)
+ // restituisco il successivo oggetto selezionato
+ return pGseCtx->m_pScene->GetNextSelectedObj() ;
}
//-----------------------------------------------------------------------------
@@ -170,6 +200,32 @@ __stdcall EgtZoomOnPoint( int nGseCtx, int nWinX, int nWinY, double dCoeff, BOOL
return TRUE ;
}
+//-----------------------------------------------------------------------------
+BOOL
+__stdcall EgtSetGeoLine( int nGseCtx, const double ptP1[3], const double ptP2[3], BOOL bRedraw)
+{
+ GseContext* pGseCtx = GetGseContext( nGseCtx) ;
+ VERIFY_CTX_SCENE( pGseCtx, FALSE)
+ // disegno linea per distanza o similari
+ pGseCtx->m_pScene->SetGeoLine( Point3d( ptP1), Point3d( ptP2)) ;
+ if ( bRedraw)
+ pGseCtx->m_pScene->RedrawWindow() ;
+ return TRUE ;
+}
+
+//-----------------------------------------------------------------------------
+BOOL
+__stdcall EgtResetGeoLine( int nGseCtx, BOOL bRedraw)
+{
+ GseContext* pGseCtx = GetGseContext( nGseCtx) ;
+ VERIFY_CTX_SCENE( pGseCtx, FALSE)
+ // cancello linea per distanza o similari
+ pGseCtx->m_pScene->ResetGeoLine() ;
+ if ( bRedraw)
+ pGseCtx->m_pScene->RedrawWindow() ;
+ return TRUE ;
+}
+
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtSetWinRect( int nGseCtx, int nPrevX, int nPrevY, int nCurrX, int nCurrY, BOOL bRedraw)
@@ -241,7 +297,7 @@ __stdcall EgtSetGenericView( int nGseCtx, double dAngVertDeg, double dAngHorizDe
//-----------------------------------------------------------------------------
BOOL
-__stdcall EgtSetViewCenter( int nGseCtx, double ptP[3], BOOL bRedraw)
+__stdcall EgtSetViewCenter( int nGseCtx, const double ptP[3], BOOL bRedraw)
{
GseContext* pGseCtx = GetGseContext( nGseCtx) ;
VERIFY_CTX_SCENE( pGseCtx, FALSE)
diff --git a/EgtInterface.rc b/EgtInterface.rc
index 68b8e9d..b264170 100644
Binary files a/EgtInterface.rc and b/EgtInterface.rc differ
diff --git a/EgtInterface.vcxproj b/EgtInterface.vcxproj
index 10e65d5..10298df 100644
--- a/EgtInterface.vcxproj
+++ b/EgtInterface.vcxproj
@@ -200,6 +200,7 @@ copy $(TargetPath) \EgtProg\Dll64
+
diff --git a/EgtInterface.vcxproj.filters b/EgtInterface.vcxproj.filters
index 5a0655b..1eb6f78 100644
--- a/EgtInterface.vcxproj.filters
+++ b/EgtInterface.vcxproj.filters
@@ -125,6 +125,9 @@
File di origine
+
+ File di origine
+