EgtInterface 1.5j1 :

- aggiunta gestione selezione con mouse.
This commit is contained in:
Dario Sassi
2014-10-10 06:40:53 +00:00
parent 50b2d271ac
commit 2b09a8356e
6 changed files with 122 additions and 8 deletions
+63 -7
View File
@@ -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)