-bool PatternDataSelectionModel::execute(ObjectList& objects)
-{
- bool res = false;
-
- _PTR(Study) aStudy = GetActiveStudyDocument();
- _PTR(SObject) aSChild;
- CORBA::Object_var aCorbaObj = CORBA::Object::_nil();
- GEOM::GEOM_Object_var assoc;
-
- foreach( const DocumentModel::GeomObj& anAssoc, _assocList ){
- std::cout << "FOUND=> " << anAssoc.entry.toStdString() << std::endl;
- aSChild = aStudy->FindObjectID( anAssoc.entry.toStdString() );
- aCorbaObj = corbaObj(aSChild);
- assoc = GEOM::GEOM_Object::_narrow(aCorbaObj);
-
- if ( !CORBA::is_nil(assoc) ){
- std::cout << "geom to highlight =>" << anAssoc.name.toStdString() << std::endl;
- objects.push_back( assoc._retn() );
- res = true;
- } else {
- std::cout << "not a geom =>" << anAssoc.name.toStdString()<< std::endl;
- }
- }
-
- return res;
-}
-*/
-
-
-// SVTK_ViewWindow* PatternDataSelectionModel::GetViewWindow()
-// {
-// SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
-// (SUIT_Session::session()->activeApplication());
-// if (anApp) {
-// if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(anApp->desktop()->activeWindow()))
-// return aView;
-//
-// // SUIT_ViewManager* aViewManager =
-// // anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound);
-// // if (aViewManager) {
-// // if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) {
-// // if (SVTK_ViewWindow* aView = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
-// // aViewWindow->raise();
-// // aViewWindow->setFocus();
-// // return aView;
-// // }
-// // }
-// // }
-// }
-// return NULL;
-// }
-
-
-
-
-// void PatternDataSelectionModel::SetSelectionMode(Selection_Mode theMode)
-// {
-//
-// QList<SUIT_Selector*> aSelectors;
-// _salomeSelectionMgr->selectors( SVTK_Viewer::Type(), aSelectors );
-// QListIterator<SUIT_Selector*> it( aSelectors );
-//
-// std::cout << "PatternDataSelectionModel::SetSelectionMode()" << std::endl;
-// while ( it.hasNext() )
-// {
-// // SUIT_Selector* selector = it.next();
-// SVTK_Selector* selector = dynamic_cast<SVTK_Selector*>( it.next() );
-// if ( selector ){
-// std::cout << "PatternDataSelectionModel::SetSelectionMode()" << theMode << std::endl;
-// selector->SetSelectionMode(theMode);
-// }
-// }
-// }
-
-// LightApp_SelectionMgr* PatternDataSelectionModel::selectionMgr()
-// {
-// SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
-// if( anApp )
-// return dynamic_cast<LightApp_SelectionMgr*>( anApp->selectionMgr() );
-// else
-// return 0;
-// }
-
-// //CS_TEST
-// SUIT_DataOwnerPtrList aOList;
-// LightApp_DataOwner* anOwher = new LightApp_DataOwner( "0:1:1:1:2" );
-// aOList.append( anOwher );
-// _salomeSelectionMgr->setSelected( aOList, false );
-// //CS_TEST
-
-// void PatternDataSelectionModel::_highlightGEOM( const QModelIndex & anEltIndex )
-// {
-// std::cout << "PatternDataSelectionModel::_highlightGEOM go find ASSOCIATION for"<< anEltIndex.data().toString().toStdString()<<std::endl;
-// // HEXABLOCKGUI::currentVtkView
-//
-// QList<DocumentModel::GeomObj> assocList;
-//
-// DocumentModel *docModel = NULL;
-// const QSortFilterProxyModel *pModel = NULL;
-// // const QStandardItemModel *smodel
-// // const QAbstractItemModel *theModel = NULL;
-//
-// pModel = dynamic_cast<const QSortFilterProxyModel *>( model() );
-//
-// std::cout << "pModel "<< pModel << std::endl;
-// if ( pModel ){
-// std::cout << "if ( pModel ){"<< std::endl;
-// docModel = dynamic_cast<DocumentModel*>( pModel->sourceModel() );
-// if ( docModel ){
-// std::cout << "if ( docModel ){"<< std::endl;
-// assocList = docModel->getAssociations( pModel->mapToSource(anEltIndex) );
-// }
-// }
-//
-//
-// _PTR(Study) aStudy = GetActiveStudyDocument();
-// _PTR(SObject) aSChild;
-// CORBA::Object_var aCorbaObj = CORBA::Object::_nil();
-// GEOM::GEOM_Object_var assoc;
-// // foreach( const QString& entry, geomEntries ){
-// // struct GeomObj
-// // {
-// // QString name;
-// // QString entry;
-// // QString brep;
-// // double start;
-// // double end;
-// // };
-//
-// QVariant treeVariant = pModel->mapToSource(anEltIndex).data( HEXA_TREE_ROLE );
-// int eltType;
-// if ( !treeVariant.isValid() ) return;
-// eltType = treeVariant.toInt();
-//
-// // GEOM::GeomObjPtr
-// // GEOM::GEOM_Object_ptr firstLine; //firstLine.nullify();//
-// GEOM::GEOM_Object_var firstLine = GEOM::GEOM_Object::_nil(); //GEOM::GeomObjPtr
-// GEOM::GEOM_Object_var lastLine = GEOM::GEOM_Object::_nil();
-// double firstParameter = 0.2; //CS_TODO
-// double lastParameter = 0.4; //CS_TODO
-//
-// foreach( const DocumentModel::GeomObj& anAssoc, assocList ){
-// std::cout << "FOUND=> " << anAssoc.entry.toStdString() << std::endl;
-// aSChild = aStudy->FindObjectID( anAssoc.entry.toStdString() );
-// aCorbaObj = corbaObj(aSChild);
-// assoc = GEOM::GEOM_Object::_narrow(aCorbaObj);
-//
-// if ( !CORBA::is_nil(assoc) ){
-// std::cout << "geom to highlight =>" << anAssoc.name.toStdString() << std::endl;
-// // objects.push_back(assoc._retn());
-// // if ( eltType == EDGE_TREE ){
-// // if ( CORBA::is_nil(firstLine) ){
-// // firstLine = GEOM::GEOM_Object::_duplicate( assoc._retn() );
-// // }
-// // lastLine = GEOM::GEOM_Object::_duplicate( assoc._retn() );
-// // }
-// displayPreview( assoc._retn(),
-// true, //false, //append,
-// false,//true, //false, //activate,
-// false,//true,//update,
-// 4,//lineWidth,
-// 1,//-1,//displayMode,
-// Quantity_NOC_RED );
-// } else {
-// std::cout << "not a geom =>" << anAssoc.name.toStdString()<< std::endl;
-// }
-// }
-// // std::cout << "CORBA::is_nil(firstLine) =>" << CORBA::is_nil(firstLine) << std::endl;
-// // std::cout << "CORBA::is_nil(lastLine) =>" << CORBA::is_nil(lastLine) << std::endl;
-// // std::cout << "test" << ( !( CORBA::is_nil(firstLine) and !CORBA::is_nil(lastLine) ) ) << std::endl;
-// /*
-// if ( !( CORBA::is_nil(firstLine) and !CORBA::is_nil(lastLine) ) ){
-// GEOM::GEOM_IBasicOperations_var anOper = _geomEngine->GetIBasicOperations( getStudyId() );
-// GEOM::GEOM_Object_var firstPoint = anOper->MakePointOnCurve( firstLine, firstParameter );
-// GEOM::GEOM_Object_var lastPoint = anOper->MakePointOnCurve( lastLine, lastParameter );
-//
-// // std::cout << "firstPoint->_is_nil() =>" << firstPoint->_is_nil() << std::endl;
-// std::cout << "lastPoint->_is_nil() =>" << lastPoint->_is_nil() << std::endl;
-// if ( !( CORBA::is_nil(firstPoint) ) )// !firstPoint->_is_nil() )
-// displayPreview( firstPoint._retn(), true );
-// if ( !( CORBA::is_nil(lastPoint) ) )//if ( !lastPoint->_is_nil() )
-// displayPreview( lastPoint._retn(), true );
-// }*/
-// }
-//