{
HYDROGUI_Operation::startOperation();
- // TODO
- abort();
+ HYDROGUI_ZLevelsModel::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_ZLevelsModel::Object2Visible( anObject, isVisible );
+ }
+ }
+ }
+
+ // Show the dialog
+ myZLevelsDlg = new HYDROGUI_ZLevelsDlg( module()->getApp()->desktop() );
+ myZLevelsDlg->setModal( true );
+ myZLevelsDlg->setObjects( anObject2VisibleList );
+
+ //TODO: reimplement
+ connect( myZLevelsDlg, SIGNAL( accepted() ), this, SLOT( commit() ) );
+ connect( myZLevelsDlg, SIGNAL( rejected() ), this, SLOT( abort() ) );
+
+ myZLevelsDlg->exec();
}
bool HYDROGUI_ZLevelsOp::processApply( int& theUpdateFlags,