+ // Prepare the list of objects
+ HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
+
+ // get the document
+ Handle(HYDROData_Document) aDoc = doc();
+ if( !aDoc.IsNull() ) {
+ // get active OCC view id
+ size_t anActiveOCCViewId = HYDROGUI_Tool::GetActiveOCCViewId( module() );
+
+ // get objects list
+ HYDROData_SequenceOfObjects aSeqOfObjects = aDoc->GetObjectsLayerOrder( Standard_True );
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeqOfObjects );
+ for ( ; anIter.More(); anIter.Next() ) {
+ Handle(HYDROData_Entity) anObject = anIter.Value();
+ if ( !anObject.IsNull() ) {
+ bool isVisible = module()->isObjectVisible( anActiveOCCViewId, anObject );
+ anObject2VisibleList << HYDROGUI_ListModel::Object2Visible( anObject, isVisible );
+ }
+ }
+ }
+
+ // Show the dialog
+ if ( !myDlg ) {
+ myDlg = new HYDROGUI_ZLevelsDlg( module()->getApp()->desktop(), module() );
+ connect( myDlg, SIGNAL( applyOrder() ), this, SLOT( onApply() ) );
+ connect( myDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
+ }
+ myDlg->setObjects( anObject2VisibleList );
+
+ myDlg->exec();