From: Paul RASCLE Date: Sun, 13 Sep 2020 16:08:21 +0000 (+0200) Subject: trying to fix selection mecanism in OCC Viewer: Selection is OK, but broken after... X-Git-Tag: SH_V2_2_0~45 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=058a65f7bf943ca9d7ee68df3a34db33d4a0c2c8;p=modules%2Fhydro.git trying to fix selection mecanism in OCC Viewer: Selection is OK, but broken after a polyline edit, and highlight NOK. --- diff --git a/src/HYDROGUI/HYDROGUI_AbstractDisplayer.cxx b/src/HYDROGUI/HYDROGUI_AbstractDisplayer.cxx index 032c9d3f..c0a7099e 100644 --- a/src/HYDROGUI/HYDROGUI_AbstractDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_AbstractDisplayer.cxx @@ -25,6 +25,9 @@ #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROGUI_AbstractDisplayer::HYDROGUI_AbstractDisplayer( HYDROGUI_Module* theModule ) : myModule( theModule ) { @@ -34,7 +37,7 @@ HYDROGUI_AbstractDisplayer::~HYDROGUI_AbstractDisplayer() { } -bool HYDROGUI_AbstractDisplayer::IsApplicable( const int theViewerId ) const +bool HYDROGUI_AbstractDisplayer::IsApplicable( const size_t theViewerId ) const { return IsApplicable( myModule->getViewManager( theViewerId ) ); } @@ -44,31 +47,34 @@ bool HYDROGUI_AbstractDisplayer::IsApplicable( const SUIT_ViewManager* theViewMg return ( theViewMgr && ( theViewMgr->getType() == GetType() ) ); } -void HYDROGUI_AbstractDisplayer::UpdateAll( const int theViewerId, +void HYDROGUI_AbstractDisplayer::UpdateAll( const size_t theViewerId, const bool theIsInit, const bool theIsForced, const bool theDoFitAll ) { + DEBTRACE("UpdateAll"); if ( theIsInit ) EraseAll( theViewerId ); DisplayAll( theViewerId, theIsForced, theDoFitAll ); } -void HYDROGUI_AbstractDisplayer::DisplayAll( const int theViewerId, +void HYDROGUI_AbstractDisplayer::DisplayAll( const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ) { + DEBTRACE("DisplayAll"); HYDROData_SequenceOfObjects aSeq; HYDROGUI_Tool::GetPrsSubObjects( myModule, aSeq ); Update( aSeq, theViewerId, theIsForced, theDoFitAll ); } void HYDROGUI_AbstractDisplayer::Update( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ) { + DEBTRACE("Update"); // First of all, kill all bad presentations purgeObjects( theViewerId ); diff --git a/src/HYDROGUI/HYDROGUI_AbstractDisplayer.h b/src/HYDROGUI/HYDROGUI_AbstractDisplayer.h index 2973dc1d..5c3888ac 100644 --- a/src/HYDROGUI/HYDROGUI_AbstractDisplayer.h +++ b/src/HYDROGUI/HYDROGUI_AbstractDisplayer.h @@ -48,7 +48,7 @@ public: * The view manager method getType is used. * \param theViewerId viewer identifier */ - virtual bool IsApplicable( const int theViewerId ) const; + virtual bool IsApplicable( const size_t theViewerId ) const; /** * \brief Check if this displayer is applicable to the given view manager. @@ -63,7 +63,7 @@ public: * \param theIsInit flag used for initial update * \param theIsForced flag used to update all objects, including the unchanged ones */ - virtual void UpdateAll( const int theViewerId, + virtual void UpdateAll( const size_t theViewerId, const bool theIsInit, const bool theIsForced, const bool theDoFitAll ); @@ -74,7 +74,7 @@ public: * \param theViewerId viewer identifier */ virtual void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) = 0; + const size_t theViewerId ) = 0; /** * \brief Get the applicable viewer type. @@ -89,7 +89,7 @@ protected: * \param theViewerId viewer identifier * \param theIsForced flag used to update all objects, including the unchanged ones */ - virtual void DisplayAll( const int theViewerId, + virtual void DisplayAll( const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ); @@ -101,7 +101,7 @@ protected: * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default */ virtual void Update( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ); @@ -109,7 +109,7 @@ protected: * \brief Erase all viewer objects. * \param theViewerId viewer identifier */ - virtual void EraseAll( const int theViewerId ) = 0; + virtual void EraseAll( const size_t theViewerId ) = 0; /** * \brief Erase the specified viewer objects. @@ -117,7 +117,7 @@ protected: * \param theViewerId viewer identifier */ virtual void Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) = 0; + const size_t theViewerId ) = 0; /** * \brief Display the specified viewer objects. @@ -127,7 +127,7 @@ protected: * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default */ virtual void Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ) = 0; @@ -136,7 +136,7 @@ protected: * \brief Purge all invalid objects in the viewer. * \param theViewerId viewer identifier */ - virtual void purgeObjects( const int theViewerId ) = 0; + virtual void purgeObjects( const size_t theViewerId ) = 0; //HYDROGUI_Module* module() const {return myModule;} diff --git a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx index e9ec399b..a6896f36 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx @@ -28,6 +28,9 @@ #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROGUI_BathymetrySelectionOp::HYDROGUI_BathymetrySelectionOp( HYDROGUI_Module* theModule ) : HYDROGUI_Operation( theModule ), myIsActive( false ) { @@ -88,6 +91,7 @@ QList getShownBathymetries( HYDROGUI_Module* the void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) { + DEBTRACE("activateSelection " << isActive); if( myIsActive==isActive ) return; @@ -99,6 +103,7 @@ void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) if( isActive ) { const int aSelectionMode = 1; + //ctx->Deactivate( Standard_True ); //ctx->OpenLocalContext( Standard_True ); foreach( Handle(HYDROGUI_BathymetryPrs) bath, baths ) { diff --git a/src/HYDROGUI/HYDROGUI_Displayer.cxx b/src/HYDROGUI/HYDROGUI_Displayer.cxx index 64bbb6e4..c869d87c 100644 --- a/src/HYDROGUI/HYDROGUI_Displayer.cxx +++ b/src/HYDROGUI/HYDROGUI_Displayer.cxx @@ -55,7 +55,7 @@ HYDROGUI_Displayer::~HYDROGUI_Displayer() } void HYDROGUI_Displayer::SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) + const size_t theViewerId ) { GraphicsView_Viewer* aViewer = module()->getViewer( theViewerId ); if( !aViewer ) @@ -77,7 +77,7 @@ void HYDROGUI_Displayer::SetToUpdate( const HYDROData_SequenceOfObjects& theObjs } } -void HYDROGUI_Displayer::EraseAll( const int theViewerId ) +void HYDROGUI_Displayer::EraseAll( const size_t theViewerId ) { GraphicsView_Viewer* aViewer = module()->getViewer( theViewerId ); if( !aViewer ) @@ -99,7 +99,7 @@ void HYDROGUI_Displayer::EraseAll( const int theViewerId ) } void HYDROGUI_Displayer::Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) + const size_t theViewerId ) { GraphicsView_Viewer* aViewer = module()->getViewer( theViewerId ); if( !aViewer ) @@ -128,7 +128,7 @@ void HYDROGUI_Displayer::Erase( const HYDROData_SequenceOfObjects& theObjs, } void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll) { @@ -174,7 +174,7 @@ void HYDROGUI_Displayer::Display( const HYDROData_SequenceOfObjects& theObjs, } } -void HYDROGUI_Displayer::purgeObjects( const int theViewerId ) +void HYDROGUI_Displayer::purgeObjects( const size_t theViewerId ) { GraphicsView_Viewer* aViewer = module()->getViewer( theViewerId ); if( !aViewer ) diff --git a/src/HYDROGUI/HYDROGUI_Displayer.h b/src/HYDROGUI/HYDROGUI_Displayer.h index b4a574ed..70ebb1d8 100644 --- a/src/HYDROGUI/HYDROGUI_Displayer.h +++ b/src/HYDROGUI/HYDROGUI_Displayer.h @@ -55,7 +55,7 @@ public: * \param theViewerId viewer identifier */ void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ); + const size_t theViewerId ); /** * \brief Get the applicable viewer type. @@ -86,7 +86,7 @@ protected: * \brief Erase all viewer objects. * \param theViewerId viewer identifier */ - void EraseAll( const int theViewerId ); + void EraseAll( const size_t theViewerId ); /** * \brief Erase the specified viewer objects. @@ -94,7 +94,7 @@ protected: * \param theViewerId viewer identifier */ void Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ); + const size_t theViewerId ); /** * \brief Display the specified viewer objects. @@ -104,7 +104,7 @@ protected: * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default */ void Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ); @@ -113,7 +113,7 @@ protected: * \brief Purge all invalid objects in the viewer. * \param theViewerId viewer identifier */ - void purgeObjects( const int theViewerId ); + void purgeObjects( const size_t theViewerId ); private: /** diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 7cee9227..5eafac64 100755 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -114,7 +114,7 @@ #define _DEVDEBUG_ #include "HYDRO_trace.hxx" -static int ViewManagerId = 0; +static size_t ViewManagerId = 1; extern "C" HYDRO_EXPORT CAM_Module* createModule() { @@ -1157,6 +1157,7 @@ void HYDROGUI_Module::updateCommandsStatus() void HYDROGUI_Module::selectionChanged() { + DEBTRACE("HYDROGUI_Module::selectionChanged"); LightApp_Module::selectionChanged(); updateCommandsStatus(); } @@ -1185,9 +1186,9 @@ HYDROGUI_VTKPrsDisplayer* HYDROGUI_Module::getVTKDisplayer() const return myVTKDisplayer; } -SUIT_ViewManager* HYDROGUI_Module::getViewManager( const int theId ) const +SUIT_ViewManager* HYDROGUI_Module::getViewManager( const size_t theId ) const { - DEBTRACE("HYDROGUI_Module::getViewManager"); + DEBTRACE("HYDROGUI_Module::getViewManager " << theId); if( myViewManagerMap.contains( theId ) ) { return myViewManagerMap[ theId ].first; @@ -1195,9 +1196,9 @@ SUIT_ViewManager* HYDROGUI_Module::getViewManager( const int theId ) const return NULL; } -GraphicsView_Viewer* HYDROGUI_Module::getViewer( const int theId ) const +GraphicsView_Viewer* HYDROGUI_Module::getViewer( const size_t theId ) const { - DEBTRACE("HYDROGUI_Module::getViewer"); + DEBTRACE("HYDROGUI_Module::getViewer " << theId); if( myViewManagerMap.contains( theId ) ) { ViewManagerInfo anInfo = myViewManagerMap[ theId ]; @@ -1209,9 +1210,9 @@ GraphicsView_Viewer* HYDROGUI_Module::getViewer( const int theId ) const return NULL; } -OCCViewer_Viewer* HYDROGUI_Module::getOCCViewer( const int theId ) const +OCCViewer_Viewer* HYDROGUI_Module::getOCCViewer( const size_t theId ) const { - DEBTRACE("HYDROGUI_Module::getOCCViewer"); + DEBTRACE("HYDROGUI_Module::getOCCViewer " << theId); if( myViewManagerMap.contains( theId ) ) { ViewManagerInfo anInfo = myViewManagerMap[ theId ]; @@ -1223,9 +1224,9 @@ OCCViewer_Viewer* HYDROGUI_Module::getOCCViewer( const int theId ) const return NULL; } -SVTK_Viewer* HYDROGUI_Module::getVTKViewer( const int theId ) const +SVTK_Viewer* HYDROGUI_Module::getVTKViewer( const size_t theId ) const { - DEBTRACE("HYDROGUI_Module::getVTKViewer"); + DEBTRACE("HYDROGUI_Module::getVTKViewer " << theId); if( myViewManagerMap.contains( theId ) ) { ViewManagerInfo anInfo = myViewManagerMap[ theId ]; @@ -1237,25 +1238,25 @@ SVTK_Viewer* HYDROGUI_Module::getVTKViewer( const int theId ) const return NULL; } -int HYDROGUI_Module::getViewManagerId( SUIT_ViewManager* theViewManager ) +size_t HYDROGUI_Module::getViewManagerId( SUIT_ViewManager* theViewManager ) { DEBTRACE("HYDROGUI_Module::getViewManagerId"); ViewManagerMapIterator anIter( myViewManagerMap ); while( anIter.hasNext() ) { - int anId = anIter.next().key(); + size_t anId = anIter.next().key(); const ViewManagerInfo& anInfo = anIter.value(); if( anInfo.first == theViewManager ) return anId; } - return -1; + return 0; } HYDROGUI_Module::ViewManagerRole HYDROGUI_Module::getViewManagerRole( SUIT_ViewManager* theViewManager ) { DEBTRACE("HYDROGUI_Module::getViewManagerRole"); - int anId = getViewManagerId( theViewManager ); - if( anId != -1 ) + size_t anId = getViewManagerId( theViewManager ); + if( anId == 0 ) { const ViewManagerInfo& anInfo = myViewManagerMap[ anId ]; return anInfo.second; @@ -1386,7 +1387,7 @@ void HYDROGUI_Module::setIsToUpdate( const Handle(HYDROData_Entity)& theObject, } /////////////////// OCC SHAPES PROCESSING -QList HYDROGUI_Module::getObjectShapes( const int theViewId, +QList HYDROGUI_Module::getObjectShapes( const size_t theViewId, ObjectKind theKind ) const { QList aResult; @@ -1403,7 +1404,7 @@ QList HYDROGUI_Module::getObjectShapes( const int theViewId, return aResult; } -HYDROGUI_Shape* HYDROGUI_Module::getObjectShape( const int theViewId, +HYDROGUI_Shape* HYDROGUI_Module::getObjectShape( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ) const { HYDROGUI_Shape* aResShape = NULL; @@ -1426,7 +1427,7 @@ HYDROGUI_Shape* HYDROGUI_Module::getObjectShape( const int return aResShape; } -void HYDROGUI_Module::setObjectShape( const int theViewId, +void HYDROGUI_Module::setObjectShape( const size_t theViewId, const Handle(HYDROData_Entity)& theObject, HYDROGUI_Shape* theShape ) { @@ -1437,7 +1438,7 @@ void HYDROGUI_Module::setObjectShape( const int theViewId, aViewShapes.append( theShape ); } -void HYDROGUI_Module::removeObjectShape( const int theViewId, +void HYDROGUI_Module::removeObjectShape( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ) { if ( !myShapesMap.contains( theViewId ) ) @@ -1460,7 +1461,7 @@ void HYDROGUI_Module::removeObjectShape( const int theView } } -void HYDROGUI_Module::removeViewShapes( const int theViewId ) +void HYDROGUI_Module::removeViewShapes( const size_t theViewId ) { if ( !myShapesMap.contains( theViewId ) ) return; @@ -1478,7 +1479,7 @@ void HYDROGUI_Module::removeViewShapes( const int theViewId ) /////////////////// END OF OCC SHAPES PROCESSING /////////////////// VTKPrs PROCESSING -HYDROGUI_VTKPrs* HYDROGUI_Module::getObjectVTKPrs( const int theViewId, +HYDROGUI_VTKPrs* HYDROGUI_Module::getObjectVTKPrs( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ) const { HYDROGUI_VTKPrs* aResShape = NULL; @@ -1501,7 +1502,7 @@ HYDROGUI_VTKPrs* HYDROGUI_Module::getObjectVTKPrs( const int return aResShape; } -void HYDROGUI_Module::setObjectVTKPrs( const int theViewId, +void HYDROGUI_Module::setObjectVTKPrs( const size_t theViewId, const Handle(HYDROData_Entity)& theObject, HYDROGUI_VTKPrs* theShape ) { @@ -1535,7 +1536,7 @@ void HYDROGUI_Module::setObjectVTKPrs( const int theViewId aViewShapes.append( theShape ); } -void HYDROGUI_Module::removeObjectVTKPrs( const int theViewId, +void HYDROGUI_Module::removeObjectVTKPrs( const size_t theViewId, const QString& theEntry ) { if ( !myVTKPrsMap.contains( theViewId ) ) @@ -1564,7 +1565,7 @@ void HYDROGUI_Module::removeObjectVTKPrs( const int theViewId, getVTKDisplayer()->SetZRange( theViewId, anInvalidRange ); } -void HYDROGUI_Module::removeObjectVTKPrs( const int theViewId, +void HYDROGUI_Module::removeObjectVTKPrs( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ) { if ( !myVTKPrsMap.contains( theViewId ) ) @@ -1591,7 +1592,7 @@ void HYDROGUI_Module::removeObjectVTKPrs( const int theVie getVTKDisplayer()->SetZRange( theViewId, anInvalidRange ); } -void HYDROGUI_Module::removeViewVTKPrs( const int theViewId ) +void HYDROGUI_Module::removeViewVTKPrs( const size_t theViewId ) { if ( !myVTKPrsMap.contains( theViewId ) ) return; @@ -1607,7 +1608,7 @@ void HYDROGUI_Module::removeViewVTKPrs( const int theViewId ) myVTKPrsMap.remove( theViewId ); } -void HYDROGUI_Module::updateVTKZRange( const int theViewId, double theRange[] ) +void HYDROGUI_Module::updateVTKZRange( const size_t theViewId, double theRange[] ) { if ( myVTKPrsMap.contains( theViewId ) ) { @@ -1789,8 +1790,10 @@ void HYDROGUI_Module::onViewCreated( SUIT_ViewWindow* theViewWindow ) DEBTRACE("HYDROGUI_Module::onViewCreated"); if( theViewWindow && theViewWindow->inherits( "GraphicsView_ViewFrame" ) ) { + DEBTRACE("theViewWindow->inherits( 'GraphicsView_ViewFrame' )"); if( GraphicsView_ViewFrame* aViewFrame = dynamic_cast( theViewWindow ) ) { + DEBTRACE("---"); aViewFrame->installEventFilter( this ); GraphicsView_ViewPort* aViewPort = aViewFrame->getViewPort(); @@ -1802,8 +1805,10 @@ void HYDROGUI_Module::onViewCreated( SUIT_ViewWindow* theViewWindow ) } else if( theViewWindow && theViewWindow->inherits( "OCCViewer_ViewFrame" ) ) { + DEBTRACE("theViewWindow->inherits( 'OCCViewer_ViewFrame' )"); if( OCCViewer_ViewFrame* aViewFrame = dynamic_cast( theViewWindow ) ) { + DEBTRACE("---"); aViewFrame->onTopView(); HYDROGUI_Tool::setOCCActionShown( aViewFrame, OCCViewer_ViewWindow::MaximizedId, false ); @@ -1815,8 +1820,10 @@ void HYDROGUI_Module::onViewCreated( SUIT_ViewWindow* theViewWindow ) } else if( theViewWindow && theViewWindow->inherits( "SVTK_ViewWindow" ) ) { + DEBTRACE("theViewWindow->inherits( 'SVTK_ViewWindow' )"); if( SVTK_ViewWindow* aViewFrame = dynamic_cast( theViewWindow ) ) { + DEBTRACE("---"); aViewFrame->installEventFilter( this ); } } @@ -1900,7 +1907,7 @@ void HYDROGUI_Module::updateViewer( HYDROGUI_AbstractDisplayer* theDisplayer, void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager ) { - DEBTRACE("HYDROGUI_Module::createSelector"); + DEBTRACE("HYDROGUI_Module::createSelector ===================================="); if( !theViewManager ) return; @@ -1909,6 +1916,7 @@ void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager ) return; QString aViewType = theViewManager->getType(); + DEBTRACE("aViewType " << aViewType.toStdString() << " " << GraphicsView_Viewer::Type().toStdString() << " " << OCCViewer_Viewer::Type().toStdString()); if( aViewType != GraphicsView_Viewer::Type() && aViewType != OCCViewer_Viewer::Type()) return; @@ -1917,29 +1925,70 @@ void HYDROGUI_Module::createSelector( SUIT_ViewManager* theViewManager ) aSelectionMgr->selectors( aViewType, aSelectorList ); // disable all alien selectors + bool isGV = false; + bool isOCC = false; QList::iterator anIter, anIterEnd = aSelectorList.end(); for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ ) { SUIT_Selector* aSelector = *anIter; - if( aSelector && ( !dynamic_cast( aSelector ) && - !dynamic_cast( aSelector ) && - !dynamic_cast( aSelector ) ) ) - aSelector->setEnabled( false ); +// if( aSelector && ( !dynamic_cast( aSelector ) && +// !dynamic_cast( aSelector ) && +// !dynamic_cast( aSelector ) ) ) + bool isOk = false; + if (aSelector) + { + DEBTRACE("Selector " << aSelector->type().toStdString()); + if (dynamic_cast( aSelector )) + { + isOk = true; + isGV = true; + DEBTRACE("HYDROGUI_GVSelector"); + } + else if (dynamic_cast( aSelector )) + { + isOk = true; + DEBTRACE("SVTK_Selector"); + } + else if (dynamic_cast( aSelector )) + { + isOk = true; + isOCC = true; + DEBTRACE("HYDROGUI_OCCSelector"); + } + if (isOk) + { + DEBTRACE("Selector enabled " << aSelector->type().toStdString()); + aSelector->setEnabled( true ); + } + else + { + DEBTRACE("Selector disabled " << aSelector->type().toStdString()); + aSelector->setEnabled( false ); + } + } } - if ( aViewType == GraphicsView_Viewer::Type() ) + if ( !isGV && aViewType == GraphicsView_Viewer::Type() ) { GraphicsView_ViewManager* aViewManager = ::qobject_cast( theViewManager ); if( aViewManager ) - new HYDROGUI_GVSelector( this, aViewManager->getViewer(), aSelectionMgr ); + { + HYDROGUI_GVSelector* sel = new HYDROGUI_GVSelector( this, aViewManager->getViewer(), aSelectionMgr ); + DEBTRACE("new HYDROGUI_GVSelector " << sel << " " << sel->type().toStdString()); + sel->setEnabled( true ); + } } - else if ( aViewType == OCCViewer_Viewer::Type() ) + else if ( !isOCC && aViewType == OCCViewer_Viewer::Type() ) { OCCViewer_ViewManager* aViewManager = ::qobject_cast( theViewManager ); if( aViewManager ) - new HYDROGUI_OCCSelector( this, aViewManager->getOCCViewer(), aSelectionMgr ); + { + HYDROGUI_OCCSelector* sel = new HYDROGUI_OCCSelector( this, aViewManager->getOCCViewer(), aSelectionMgr ); + DEBTRACE("new HYDROGUI_OCCSelector " << sel << " " << sel->type().toStdString()); + sel->setEnabled( true ); + } } } @@ -2183,7 +2232,7 @@ void HYDROGUI_Module::setObjectRemoved( const Handle(HYDROData_Entity)& theObjec Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( theObject ); QList aViewIds; - QMutableMapIterator anIter( myLandCoverColoringMap ); + QMutableMapIterator anIter( myLandCoverColoringMap ); while ( anIter.hasNext() ) { if ( HYDROGUI_DataObject::dataObjectEntry( anIter.next().value() ) == HYDROGUI_DataObject::dataObjectEntry( aTable ) ) { diff --git a/src/HYDROGUI/HYDROGUI_Module.h b/src/HYDROGUI/HYDROGUI_Module.h index a8daaaa2..b8b57f38 100644 --- a/src/HYDROGUI/HYDROGUI_Module.h +++ b/src/HYDROGUI/HYDROGUI_Module.h @@ -116,12 +116,12 @@ public: typedef QMap< size_t, Entry2ObjectStateMap > ViewId2Entry2ObjectStateMap; typedef QList ListOfShapes; - typedef QMap ViewId2ListOfShapes; + typedef QMap ViewId2ListOfShapes; typedef QList ListOfVTKPrs; - typedef QMap ViewId2ListOfVTKPrs; + typedef QMap ViewId2ListOfVTKPrs; - typedef QMap ViewId2StricklerTable; + typedef QMap ViewId2StricklerTable; public: HYDROGUI_Module(); @@ -142,17 +142,17 @@ public: virtual void selectionChanged(); virtual void studyClosed( SUIT_Study* ); - SUIT_ViewManager* getViewManager( const int theId ) const; + SUIT_ViewManager* getViewManager( const size_t theId ) const; HYDROGUI_DataModel* getDataModel() const; HYDROGUI_Displayer* getDisplayer() const; HYDROGUI_OCCDisplayer* getOCCDisplayer() const; HYDROGUI_VTKPrsDisplayer* getVTKDisplayer() const; - GraphicsView_Viewer* getViewer( const int theId ) const; - OCCViewer_Viewer* getOCCViewer( const int theId ) const; - SVTK_Viewer* getVTKViewer( const int theId ) const; + GraphicsView_Viewer* getViewer( const size_t theId ) const; + OCCViewer_Viewer* getOCCViewer( const size_t theId ) const; + SVTK_Viewer* getVTKViewer( const size_t theId ) const; - int getViewManagerId( SUIT_ViewManager* theViewManager ); + size_t getViewManagerId( SUIT_ViewManager* theViewManager ); ViewManagerRole getViewManagerRole( SUIT_ViewManager* theViewManager ); void setViewManagerRole( SUIT_ViewManager* theViewManager, const ViewManagerRole theRole ); @@ -175,33 +175,33 @@ public: */ void setIsToUpdate( const Handle(HYDROData_Entity)& theObject, const bool theState = true ); - QList getObjectShapes( const int theViewId, + QList getObjectShapes( const size_t theViewId, ObjectKind theKind ) const; - HYDROGUI_Shape* getObjectShape( const int theViewId, + HYDROGUI_Shape* getObjectShape( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ) const; - void setObjectShape( const int theViewId, + void setObjectShape( const size_t theViewId, const Handle(HYDROData_Entity)& theObject, HYDROGUI_Shape* theShape ); - void removeViewShapes( const int theViewId ); - void removeObjectShape( const int theViewId, + void removeViewShapes( const size_t theViewId ); + void removeObjectShape( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ); - HYDROGUI_VTKPrs* getObjectVTKPrs( const int theViewId, + HYDROGUI_VTKPrs* getObjectVTKPrs( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ) const; - void setObjectVTKPrs( const int theViewId, + void setObjectVTKPrs( const size_t theViewId, const Handle(HYDROData_Entity)& theObject, HYDROGUI_VTKPrs* theShape ); - void removeViewVTKPrs( const int theViewId ); - void removeObjectVTKPrs( const int theViewId, + void removeViewVTKPrs( const size_t theViewId ); + void removeObjectVTKPrs( const size_t theViewId, const Handle(HYDROData_Entity)& theObject ); - void removeObjectVTKPrs( const int theViewId, + void removeObjectVTKPrs( const size_t theViewId, const QString& theEntry ); /** * Update global imposed range of Z values for the given VTK viewer id */ - void updateVTKZRange( const int theViewId, double theRange[] ); + void updateVTKZRange( const size_t theViewId, double theRange[] ); /** * Returns true if the object with the given entry can be renamed. diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx index f3ab5f2f..11b8175d 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx @@ -49,6 +49,9 @@ #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROGUI_OCCDisplayer::HYDROGUI_OCCDisplayer( HYDROGUI_Module* theModule ) : HYDROGUI_AbstractDisplayer( theModule ) { @@ -60,7 +63,7 @@ HYDROGUI_OCCDisplayer::~HYDROGUI_OCCDisplayer() } void HYDROGUI_OCCDisplayer::SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) + const size_t theViewerId ) { OCCViewer_Viewer* aViewer = module()->getOCCViewer( theViewerId ); if( !aViewer ) @@ -120,7 +123,7 @@ void HYDROGUI_OCCDisplayer::RemoveZLayer( OCCViewer_ViewManager* theMgr, aViewer->getViewer3d()->RemoveZLayer( theLayer ); } -void HYDROGUI_OCCDisplayer::EraseAll( const int theViewerId ) +void HYDROGUI_OCCDisplayer::EraseAll( const size_t theViewerId ) { OCCViewer_Viewer* aViewer = module()->getOCCViewer( theViewerId ); if( !aViewer ) @@ -131,7 +134,7 @@ void HYDROGUI_OCCDisplayer::EraseAll( const int theViewerId ) } void HYDROGUI_OCCDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) + const size_t theViewerId ) { OCCViewer_Viewer* aViewer = module()->getOCCViewer( theViewerId ); if( !aViewer ) @@ -151,10 +154,11 @@ void HYDROGUI_OCCDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs, } } -HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int theViewerId, +HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const size_t theViewerId, const Handle(AIS_InteractiveContext)& theContext, const Handle(HYDROData_Entity)& theObject ) { + DEBTRACE("createShape " << theViewerId); HYDROGUI_Shape* aResShape = NULL; if ( theContext.IsNull() || theObject.IsNull() ) return aResShape; @@ -179,7 +183,7 @@ HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int } void HYDROGUI_OCCDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ) { @@ -300,7 +304,7 @@ void HYDROGUI_OCCDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs, UpdateColorScale( aViewer ); } -void HYDROGUI_OCCDisplayer::purgeObjects( const int theViewerId ) +void HYDROGUI_OCCDisplayer::purgeObjects( const size_t theViewerId ) { OCCViewer_Viewer* aViewer = module()->getOCCViewer( theViewerId ); if( !aViewer ) @@ -337,6 +341,7 @@ bool HYDROGUI_OCCDisplayer::Display( const Handle(HYDROData_Entity)& theObject, const OCCViewer_Viewer* theViewer, const bool theIsForced ) { + DEBTRACE("Display"); bool aRes = false; if ( theObject.IsNull() || theObject->IsRemoved() || !theViewer ) { @@ -548,7 +553,7 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer myToUpdateColorScale = false; } -Handle(AIS_ColorScale) HYDROGUI_OCCDisplayer::GetColorScale( const int theViewerId ) +Handle(AIS_ColorScale) HYDROGUI_OCCDisplayer::GetColorScale( const size_t theViewerId ) { Handle(AIS_ColorScale) aColorScale; @@ -582,7 +587,7 @@ Handle(AIS_ColorScale) HYDROGUI_OCCDisplayer::GetColorScale( const int theViewer return aColorScale; } -void HYDROGUI_OCCDisplayer::UpdatePolylines( int theViewerId, int theType, int theSize ) +void HYDROGUI_OCCDisplayer::UpdatePolylines( size_t theViewerId, int theType, int theSize ) { OCCViewer_Viewer* aViewer = module()->getOCCViewer( theViewerId ); if( !aViewer ) diff --git a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h index e7aea2a9..80a55c9c 100644 --- a/src/HYDROGUI/HYDROGUI_OCCDisplayer.h +++ b/src/HYDROGUI/HYDROGUI_OCCDisplayer.h @@ -52,7 +52,7 @@ public: * \param theViewerId viewer identifier */ void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ); + const size_t theViewerId ); /** * \brief Get the applicable viewer type. @@ -80,10 +80,10 @@ public: * \param theViewerId viewer identifier * \return the color scale */ - Handle(AIS_ColorScale) GetColorScale( const int theViewerId ); + Handle(AIS_ColorScale) GetColorScale( const size_t theViewerId ); - void UpdatePolylines( int theViewerId, int theType, int theSize ); + void UpdatePolylines( size_t theViewerId, int theType, int theSize ); void UpdateColorScale( const OCCViewer_Viewer* ); @@ -92,7 +92,7 @@ protected: * \brief Erase all viewer objects. * \param theViewerId viewer identifier */ - void EraseAll( const int theViewerId ); + void EraseAll( const size_t theViewerId ); /** * \brief Erase the specified viewer objects. @@ -100,7 +100,7 @@ protected: * \param theViewerId viewer identifier */ void Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ); + const size_t theViewerId ); /** * \brief Display the specified viewer objects. @@ -110,14 +110,14 @@ protected: * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default */ void Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ); /** * \brief Purge all invalid objects in the viewer. * \param theViewerId viewer identifier */ - void purgeObjects( const int theViewerId ); + void purgeObjects( const size_t theViewerId ); private: /** @@ -127,7 +127,7 @@ private: * \param theObject data model object * \return pointer to new created shape */ - HYDROGUI_Shape* createShape( const int theViewerId, + HYDROGUI_Shape* createShape( const size_t theViewerId, const Handle(AIS_InteractiveContext)& theContext, const Handle(HYDROData_Entity)& theObject ); @@ -155,7 +155,7 @@ private: private: bool myToUpdateColorScale; - QMap myColorScales; + QMap myColorScales; }; #endif diff --git a/src/HYDROGUI/HYDROGUI_OCCSelector.cxx b/src/HYDROGUI/HYDROGUI_OCCSelector.cxx index 8f189c57..6bd771fa 100644 --- a/src/HYDROGUI/HYDROGUI_OCCSelector.cxx +++ b/src/HYDROGUI/HYDROGUI_OCCSelector.cxx @@ -29,6 +29,9 @@ #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROGUI_OCCSelector::HYDROGUI_OCCSelector( HYDROGUI_Module* theModule, OCCViewer_Viewer* theViewer, SUIT_SelectionMgr* theSelMgr ) @@ -43,6 +46,7 @@ HYDROGUI_OCCSelector::~HYDROGUI_OCCSelector() void HYDROGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const { + DEBTRACE("getSelection"); OCCViewer_Viewer* aViewer = viewer(); if ( !aViewer ) return; @@ -52,11 +56,13 @@ void HYDROGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const AIS_ListOfInteractive aSelList; aViewer->getSelectedObjects( aSelList ); + DEBTRACE(" aSelList.Size(): " << aSelList.Size()); for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() ) if ( !anIt.Value().IsNull() ) { //if ( !isLocalContext ) { QString anEntry = entry( anIt.Value() ); + DEBTRACE(" anEntry: " << anEntry.toStdString()); if ( !anEntry.isEmpty() ) { aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) ); } else { @@ -67,12 +73,14 @@ void HYDROGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const // add externally selected objects SUIT_DataOwnerPtrList::const_iterator anExtIter; for(anExtIter = mySelectedExternals.begin(); anExtIter != mySelectedExternals.end(); anExtIter++) { + DEBTRACE(" anExternal"); aList.append(*anExtIter); } } void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) { + DEBTRACE("setSelection"); OCCViewer_Viewer* aViewer = viewer(); if ( !aViewer ) return; @@ -98,13 +106,14 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) }*/ mySelectedExternals.clear(); - + DEBTRACE(" ..."); 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() ) ) { QString anEntry = owner->entry(); + DEBTRACE(" anEntry: " << anEntry.toStdString()); Handle(HYDROData_Entity) anEntity = myModule->getDataModel()->objectByEntry( anEntry ); if( !anEntity.IsNull() ) { @@ -118,6 +127,7 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) } else { const HYDROGUI_DataOwner* hydroOwner = dynamic_cast( (*itr).operator->() ); + DEBTRACE(" hydroOwner: " << hydroOwner); if ( hydroOwner && !hydroOwner->IO().IsNull() ) { aSelList.Append( hydroOwner->IO() ); } else diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 6ce0e1a1..96a2fd19 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -47,6 +47,9 @@ #include #include +#define _DEVDEBUG_ +#include "HYDRO_trace.hxx" + HYDROGUI_Shape::HYDROGUI_Shape( const Handle(AIS_InteractiveContext)& theContext, const Handle(HYDROData_Entity)& theObject, const int theZLayer ) @@ -124,6 +127,7 @@ void HYDROGUI_Shape::update( bool isUpdateViewer, bool isDeactivateSelection ) { + DEBTRACE("update " << isUpdateViewer << " " << isDeactivateSelection); setIsToUpdate( false ); if ( myContext.IsNull() ) @@ -389,6 +393,7 @@ void HYDROGUI_Shape::update( bool isUpdateViewer, void HYDROGUI_Shape::setVisible( const bool theState, const bool theIsUpdateViewer ) { + DEBTRACE("setVisible") myIsVisible = theState; if ( myShapes.empty() ) @@ -407,6 +412,7 @@ void HYDROGUI_Shape::setVisible( const bool theState, void HYDROGUI_Shape::highlight( bool theIsHighlight, bool isUpdateViewer ) { + DEBTRACE("highlight " << theIsHighlight << " " << isUpdateViewer); if ( myIsHighlight == theIsHighlight ) return; @@ -421,6 +427,7 @@ void HYDROGUI_Shape::highlight( bool theIsHighlight, bool isUpdateViewer ) bool HYDROGUI_Shape::isHighlighted() const { + DEBTRACE("isHighlighted " << myIsHighlight); return myIsHighlight; } @@ -659,6 +666,7 @@ void HYDROGUI_Shape::buildShape() void HYDROGUI_Shape::updateShape( const bool theToDisplay, const bool theIsUpdateViewer ) { + DEBTRACE("updateShape " << theToDisplay << " " << theIsUpdateViewer); foreach( Handle(AIS_InteractiveObject) aShape, myShapes ) { const Handle(Prs3d_Drawer)& anAttributes = aShape->Attributes(); @@ -691,14 +699,16 @@ void HYDROGUI_Shape::updateShape( const bool theToDisplay, void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer ) { + DEBTRACE("displayShape " << theIsUpdateViewer << " " << mySelectionMode); // if ( myContext->HasOpenedContext() && mySelectionMode > 0 ) // myContext->CloseLocalContext(); foreach( Handle(AIS_InteractiveObject) aShape, myShapes ) { - if ( mySelectionMode > 0 ) + if ( mySelectionMode >= 0 ) // Display object in local context with selection - myContext->Display( aShape, myDisplayMode, mySelectionMode, Standard_False, Standard_False ); + //myContext->Display( aShape, myDisplayMode, mySelectionMode, Standard_False, Standard_False ); + myContext->Display( aShape, Standard_False ); else { // if ( !myContext->HasOpenedContext() ) @@ -710,9 +720,9 @@ void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer ) } } - if ( mySelectionMode > 0 ) + if ( mySelectionMode >= 0 ) { - //myContext->OpenLocalContext(); + //myContext->Deactivate(); //OpenLocalContext(); foreach( Handle(AIS_InteractiveObject) aShape, myShapes ) myContext->Activate( aShape, mySelectionMode, Standard_True ); } diff --git a/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx b/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx index 20901f2b..7401f43e 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx +++ b/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.cxx @@ -65,7 +65,7 @@ HYDROGUI_VTKPrsDisplayer::~HYDROGUI_VTKPrsDisplayer() } void HYDROGUI_VTKPrsDisplayer::SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) + const size_t theViewerId ) { SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId ); if( !aViewer ) @@ -86,7 +86,7 @@ void HYDROGUI_VTKPrsDisplayer::SetToUpdate( const HYDROData_SequenceOfObjects& t } } -void HYDROGUI_VTKPrsDisplayer::DisplayAll( const int theViewerId, +void HYDROGUI_VTKPrsDisplayer::DisplayAll( const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ) { @@ -123,7 +123,7 @@ void HYDROGUI_VTKPrsDisplayer::DisplayAll( const int theViewerId, EraseScalarBar( theViewerId ); } -void HYDROGUI_VTKPrsDisplayer::EraseAll( const int theViewerId ) +void HYDROGUI_VTKPrsDisplayer::EraseAll( const size_t theViewerId ) { SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId ); if( aViewer ) @@ -134,7 +134,7 @@ void HYDROGUI_VTKPrsDisplayer::EraseAll( const int theViewerId ) } } -void HYDROGUI_VTKPrsDisplayer::EraseScalarBar( const int theViewerId, const bool theIsDelete ) +void HYDROGUI_VTKPrsDisplayer::EraseScalarBar( const size_t theViewerId, const bool theIsDelete ) { SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId ); if( aViewer ) @@ -163,7 +163,7 @@ void HYDROGUI_VTKPrsDisplayer::EraseScalarBar( const int theViewerId, const bool } void HYDROGUI_VTKPrsDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ) + const size_t theViewerId ) { SVTK_Viewer* aViewer = module()->getVTKViewer( theViewerId ); if( aViewer ) @@ -189,7 +189,7 @@ void HYDROGUI_VTKPrsDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs } void HYDROGUI_VTKPrsDisplayer::Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll) { @@ -310,7 +310,7 @@ void HYDROGUI_VTKPrsDisplayer::Display( const HYDROData_SequenceOfObjects& theOb } } -void HYDROGUI_VTKPrsDisplayer::purgeObjects( const int theViewerId ) +void HYDROGUI_VTKPrsDisplayer::purgeObjects( const size_t theViewerId ) { bool doEraseScalarBar = false; @@ -373,7 +373,7 @@ void HYDROGUI_VTKPrsDisplayer::purgeObjects( const int theViewerId ) } } -HYDROGUI_VTKPrsDriver* HYDROGUI_VTKPrsDisplayer::getDriver( const int theViewId, const Handle(HYDROData_Entity)& theObj ) +HYDROGUI_VTKPrsDriver* HYDROGUI_VTKPrsDisplayer::getDriver( const size_t theViewId, const Handle(HYDROData_Entity)& theObj ) { HYDROGUI_VTKPrsDriver* aDriver = NULL; ObjectKind aKind = theObj->GetKind(); @@ -402,17 +402,17 @@ QString HYDROGUI_VTKPrsDisplayer::GetType() const return SVTK_Viewer::Type(); } -void HYDROGUI_VTKPrsDisplayer::SetZRange( const int theViewId, double theRange[] ) +void HYDROGUI_VTKPrsDisplayer::SetZRange( const size_t theViewId, double theRange[] ) { myScalarBars[ theViewId ]->GetLookupTable()->SetRange( theRange ); } -double* HYDROGUI_VTKPrsDisplayer::GetZRange( const int theViewId ) const +double* HYDROGUI_VTKPrsDisplayer::GetZRange( const size_t theViewId ) const { return myScalarBars[ theViewId ]->GetLookupTable()->GetRange(); } -void HYDROGUI_VTKPrsDisplayer::createScalarBar( const int theViewId ) +void HYDROGUI_VTKPrsDisplayer::createScalarBar( const size_t theViewId ) { if ( !myScalarBars.contains( theViewId ) ) { diff --git a/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.h b/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.h index 403bae9c..e9beb9b2 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.h +++ b/src/HYDROGUI/HYDROGUI_VTKPrsDisplayer.h @@ -50,7 +50,7 @@ public: * \param theViewerId viewer identifier */ void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ); + const size_t theViewerId ); /** * \brief Get the applicable viewer type. @@ -60,22 +60,22 @@ public: /** * \brief Set the range of Z values for the color legend bar. */ - void SetZRange( const int theViewerId, double theRange[] ); + void SetZRange( const size_t theViewerId, double theRange[] ); /** * \brief Get the range of Z values for the color legend bar. */ - double* GetZRange( const int theViewerId ) const; + double* GetZRange( const size_t theViewerId ) const; /** * \brief Delete scalar bar for the given viewer id. * \param theViewerId viewer identifier */ - void EraseScalarBar( const int theViewerId, const bool theIsDelete = false ); + void EraseScalarBar( const size_t theViewerId, const bool theIsDelete = false ); protected: - virtual void DisplayAll( const int theViewerId, + virtual void DisplayAll( const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ); @@ -83,7 +83,7 @@ protected: * \brief Erase all viewer objects. * \param theViewerId viewer identifier */ - void EraseAll( const int theViewerId ); + void EraseAll( const size_t theViewerId ); /** * \brief Erase the specified viewer objects. @@ -91,7 +91,7 @@ protected: * \param theViewerId viewer identifier */ void Erase( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId ); + const size_t theViewerId ); /** * \brief Display the specified viewer objects. @@ -101,7 +101,7 @@ protected: * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default */ void Display( const HYDROData_SequenceOfObjects& theObjs, - const int theViewerId, + const size_t theViewerId, const bool theIsForced, const bool theDoFitAll ); @@ -110,7 +110,7 @@ protected: * \brief Purge all invalid objects in the viewer. * \param theViewerId viewer identifier */ - void purgeObjects( const int theViewerId ); + void purgeObjects( const size_t theViewerId ); private: @@ -118,18 +118,18 @@ private: * \brief Create a new scalar bar for the given view id. * \param theViewId view identifier */ - void createScalarBar( const int theViewId ); + void createScalarBar( const size_t theViewId ); /** * \brief Get the presentation driver for the specified data object. * \param theObj data object */ - HYDROGUI_VTKPrsDriver* getDriver( const int theViewId, const Handle(HYDROData_Entity)& theObj ); + HYDROGUI_VTKPrsDriver* getDriver( const size_t theViewId, const Handle(HYDROData_Entity)& theObj ); HYDROGUI_VTKPrsDriver* myDriver; HYDROGUI_VTKPrsDriver* myShapeDriver; - QMap > myScalarBars; //!< Colors legend presentations + QMap > myScalarBars; //!< Colors legend presentations }; #endif diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index c4219ae2..c350a219 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -152,7 +152,7 @@ void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject, if( theSelectionMode > 0 ) { - //context()->OpenLocalContext(); + context()->Deactivate(); //OpenLocalContext(); context()->Display( theObject, theMode, theSelectionMode, true ); context()->Activate( theObject, theSelectionMode, Standard_True ); }