From 44a932b81d66aeb85a55b448bff776085d00fd19 Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 21 Sep 2017 15:57:48 +0300 Subject: [PATCH] refs #1330: debug of presentation and selection of polylines --- src/HYDROGUI/HYDROGUI_OCCSelector.cxx | 29 +++++++++++++++++++++------ src/HYDROGUI/HYDROGUI_Polyline.cxx | 4 ++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_OCCSelector.cxx b/src/HYDROGUI/HYDROGUI_OCCSelector.cxx index 43230662..edd6effe 100644 --- a/src/HYDROGUI/HYDROGUI_OCCSelector.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCSelector.cxx @@ -22,6 +22,7 @@ #include "HYDROGUI_DataObject.h" #include "HYDROGUI_DataOwner.h" #include "HYDROGUI_Module.h" +#include "HYDROGUI_Shape.h" #include #include @@ -76,13 +77,17 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) if ( !aViewer ) return; + int aViewerId = (size_t)aViewer; + Handle(AIS_InteractiveContext) aContext = aViewer->getAISContext(); if ( aContext.IsNull() || aContext->HasOpenedContext() ) { return; } - QMap aDisplayed; - AIS_ListOfInteractive aDispList, aSelList; + AIS_ListOfInteractive aSelList; + + /*QMap aDisplayed; + AIS_ListOfInteractive aDispList; aContext->DisplayedObjects( aDispList ); for ( AIS_ListIteratorOfListOfInteractive it( aDispList ); it.More(); it.Next() ) @@ -90,15 +95,27 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) QString entryStr = entry( it.Value() ); if ( !entryStr.isEmpty() ) aDisplayed.insert( entryStr, it.Value() ); - } + }*/ mySelectedExternals.clear(); for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr ) { const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); - if ( owner && aDisplayed.contains( owner->entry() ) ) - aSelList.Append( aDisplayed[owner->entry()] ); + if ( owner ) //&& aDisplayed.contains( owner->entry() ) ) + { + QString anEntry = owner->entry(); + Handle(HYDROData_Entity) anEntity = myModule->getDataModel()->objectByEntry( anEntry ); + if( !anEntity.IsNull() ) + { + HYDROGUI_Shape* aShape = myModule->getObjectShape( aViewerId, anEntity ); + if( aShape && aShape->isVisible() ) + { + foreach( Handle(AIS_InteractiveObject) obj, aShape->getAISObjects() ) + aSelList.Append( obj ); + } + } + } else { const HYDROGUI_DataOwner* hydroOwner = dynamic_cast( (*itr).operator->() ); if ( hydroOwner && !hydroOwner->IO().IsNull() ) { @@ -125,4 +142,4 @@ QString HYDROGUI_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS aRes = HYDROGUI_DataObject::dataObjectEntry( anObj ); return aRes; -} \ No newline at end of file +} diff --git a/src/HYDROGUI/HYDROGUI_Polyline.cxx b/src/HYDROGUI/HYDROGUI_Polyline.cxx index 2fd67197..035e0ca3 100644 --- a/src/HYDROGUI/HYDROGUI_Polyline.cxx +++ b/src/HYDROGUI/HYDROGUI_Polyline.cxx @@ -221,7 +221,11 @@ void HYDROGUI_Arrow::Compute( const Handle(PrsMgr_PresentationManager3d)& aPrese P1 = gp_Pnt(); } else + { + aPrs->SetTransformation( Handle(Geom_Transformation)() ); + SetTransformPersistence( Handle(Graphic3d_TransformPers)() ); P1 = P; + } Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup( aPrs ); Quantity_Color aColor; -- 2.39.2