From 3b24ce0f93401688844eea31f77bcf3d7ca8397c Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 21 Apr 2014 22:00:15 +0000 Subject: [PATCH] TestEGr : - rami del tree si popolano se oggetti non superano numero limite. --- GeomDBTree.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/GeomDBTree.cpp b/GeomDBTree.cpp index 6ec6e2c..97df15f 100644 --- a/GeomDBTree.cpp +++ b/GeomDBTree.cpp @@ -103,11 +103,11 @@ bool CTestEGrDlg::InsertGroupOnTree( int nId, HTREEITEM hParent) { // inserisco il gruppo nell'albero (se non è la radice) + string sGroup ; HTREEITEM hGroup ; if ( nId == GDB_ID_ROOT) hGroup = hParent ; else { - string sGroup ; string sName ; if ( m_pGeomDB->GetName( nId, sName)) sGroup += sName + " (Group " + ToString( nId) +")" ; @@ -118,6 +118,14 @@ CTestEGrDlg::InsertGroupOnTree( int nId, HTREEITEM hParent) return false ; } + // Se troppi figli, non li visualizzo + int nObjs = m_pGeomDB->GetGroupObjs( nId) ; + if ( nObjs > 16000) { + string sInfo = sGroup + " Too many objects ..." ; + m_Tree.SetItemText( hGroup, stringtoW( sInfo)) ; + return true ; + } + // creo un iteratore PtrOwner pIter( CreateGdbIterator()) ; if ( ! ::IsValid( pIter))