From ffa85558e92755a51cfffa02d4763e9d0840b8e6 Mon Sep 17 00:00:00 2001 From: nge Date: Tue, 8 Jul 2008 14:23:31 +0000 Subject: [PATCH] =?utf8?q?Suppression=20de=20l'appel=20aux=20m=C3=83=C2=A9?= =?utf8?q?thodes=20DisplayedObjects=20et=20ObjectsInCollector=20et=20rempl?= =?utf8?q?acement=20des=20boucles=20for=20par=20l'appel=20aux=20m=C3=83?= =?utf8?q?=C2=A9thodes=20IsDisplayed=20et=20IsInCollector.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/SOCC/SOCC_ViewModel.cxx | 52 +++++-------------------------------- 1 file changed, 7 insertions(+), 45 deletions(-) diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 51e48fc01..539836496 100755 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -24,7 +24,6 @@ #include "SUIT_Session.h" #include "SUIT_Application.h" #include -#include //#include "ToolsGUI.h" @@ -40,15 +39,6 @@ #include #include -struct AISLessThan -{ - bool operator()(const Handle(AIS_InteractiveObject)* theRightIO, - const Handle(AIS_InteractiveObject)* theLeftIO) const - { - return (theLeftIO( prs ); if ( !anOCCPrs || anOCCPrs->IsNull() ) @@ -345,43 +336,12 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) // get context Handle (AIS_InteractiveContext) ic = getAISContext(); - // get all displayed objects - AIS_ListOfInteractive List; -//CCAR -#if 0 -#else - ic->DisplayedObjects( List ); -#endif - // get objects in the collector - AIS_ListOfInteractive ListCollector; -//CCAR -#if 0 -#else - ic->ObjectsInCollector( ListCollector ); -#endif - - - START_TIMING // get objects to be displayed AIS_ListOfInteractive anAISObjects; anOCCPrs->GetObjects( anAISObjects ); AIS_ListIteratorOfListOfInteractive aIter( anAISObjects ); - AIS_ListIteratorOfListOfInteractive ite( List ); - - std::set check; - std::set checkCollector; - - for ( ; ite.More();ite.Next()) - { - check.insert(&ite.Value()); - } - ite.Initialize(ListCollector); - for ( ; ite.More();ite.Next()) - { - checkCollector.insert(&ite.Value()); - } - + //~ START_TIMING for ( ; aIter.More(); aIter.Next() ) { Handle(AIS_InteractiveObject) anAIS = aIter.Value(); @@ -390,17 +350,19 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) // try to find presentation in the viewer bool bDisplayed = false; // if insert.second is True object was not displayed before - if ((check.insert(&anAIS)).second) + if (ic->IsDisplayed(anAIS)) + { // compare presentations by handles // if the object is already displayed - nothing to do more // Deactivate object if necessary if ( !anOCCPrs->ToActivate() ) ic->Deactivate( anAIS ); bDisplayed = true; - + } + // then try to find presentation in the collector bDisplayed = false; - if ((checkCollector.insert(&anAIS)).second) + if (ic->IsInCollector(anAIS)) { // compare presentations by handles // if the object is in collector - display it -- 2.39.2