From cb422c360c6f5232e01508046abab14b7fec413a Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 31 Jan 2014 11:47:47 +0000 Subject: [PATCH] #refs 327 - Polyline is not shown during creation Stream --- src/HYDROGUI/HYDROGUI_ChannelOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_Shape.cxx | 14 +------------- src/HYDROGUI/HYDROGUI_Shape.h | 3 +-- src/HYDROGUI/HYDROGUI_StreamOp.cxx | 17 ++++++++--------- src/HYDROGUI/HYDROGUI_StreamOp.h | 3 --- 5 files changed, 11 insertions(+), 28 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index 8d6729e4..fe415317 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -255,7 +255,7 @@ void HYDROGUI_ChannelOp::onCreatePreview( const bool theIsInit ) if ( !aViewManager || !myPreviewPrs ) return; - myPreviewPrs->update( true, true ); + myPreviewPrs->update( true ); } void HYDROGUI_ChannelOp::erasePreview() diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index 9cfb65e1..eccdb620 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -114,8 +114,7 @@ void HYDROGUI_Shape::erase( const bool theIsUpdateViewer ) myContext->Erase( myShape, theIsUpdateViewer ); } -void HYDROGUI_Shape::update( const bool theIsUpdateViewer, - const bool theIsDisplayOnTop ) +void HYDROGUI_Shape::update( const bool theIsUpdateViewer ) { setIsToUpdate( false ); @@ -392,17 +391,6 @@ void HYDROGUI_Shape::update( const bool theIsUpdateViewer, return; displayShape( theIsUpdateViewer ); - // the following code is not necessary if the Z layer is set for the shape - if ( myZLayer && theIsDisplayOnTop ) - { - // Display the shape on the top Z layer - Standard_Integer aNewLayerId = -1; - if ( myContext->CurrentViewer() && - myContext->CurrentViewer()->AddZLayer( aNewLayerId ) && - aNewLayerId > 0 ) { - myContext->SetZLayer( myShape, aNewLayerId ); - } - } if (isDeactivateSelection) myContext->Deactivate(myShape); diff --git a/src/HYDROGUI/HYDROGUI_Shape.h b/src/HYDROGUI/HYDROGUI_Shape.h index 333083ca..6226f542 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.h +++ b/src/HYDROGUI/HYDROGUI_Shape.h @@ -52,8 +52,7 @@ public: Handle(HYDROData_Entity) getObject() const { return myObject; } - virtual void update( const bool theIsUpdateViewer = true, - const bool theIsDisplayOnTop = false ); + virtual void update( const bool theIsUpdateViewer = true ); virtual bool getIsToUpdate() const { return myIsToUpdate; } virtual void setIsToUpdate( bool theState ) { myIsToUpdate = theState; } diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.cxx b/src/HYDROGUI/HYDROGUI_StreamOp.cxx index 66178e7d..b85cfb80 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.cxx +++ b/src/HYDROGUI/HYDROGUI_StreamOp.cxx @@ -55,7 +55,6 @@ HYDROGUI_StreamOp::HYDROGUI_StreamOp( HYDROGUI_Module* theModule, bool theIsEdit ) : HYDROGUI_Operation( theModule ), myIsEdit( theIsEdit ), - myViewManager( NULL ), myPreviewPrs( NULL ) { setName( theIsEdit ? tr( "EDIT_STREAM" ) : tr( "CREATE_STREAM" ) ); @@ -206,22 +205,22 @@ void HYDROGUI_StreamOp::createPreview() } LightApp_Application* anApp = module()->getApp(); - if ( !myViewManager ) { - myViewManager = ::qobject_cast( - anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ); - } + if ( !getPreviewManager() ) + setPreviewManager( ::qobject_cast( + anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) ); - if ( myViewManager && !myPreviewPrs ) { - if ( OCCViewer_Viewer* aViewer = myViewManager->getOCCViewer() ) { + OCCViewer_ViewManager* aViewManager = getPreviewManager(); + if ( aViewManager && !myPreviewPrs ) { + if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) { Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext(); if ( !aCtx.IsNull() ) { - myPreviewPrs = new HYDROGUI_Shape( aCtx, myEditedObject ); + myPreviewPrs = new HYDROGUI_Shape( aCtx, myEditedObject, getPreviewZLayer() ); } } } if ( myPreviewPrs ) { - myPreviewPrs->update( true, true ); + myPreviewPrs->update( true ); } } diff --git a/src/HYDROGUI/HYDROGUI_StreamOp.h b/src/HYDROGUI/HYDROGUI_StreamOp.h index 8d356e0a..cee48b2d 100755 --- a/src/HYDROGUI/HYDROGUI_StreamOp.h +++ b/src/HYDROGUI/HYDROGUI_StreamOp.h @@ -27,7 +27,6 @@ #include -class OCCViewer_ViewManager; class HYDROGUI_Shape; class HYDROGUI_StreamOp : public HYDROGUI_Operation @@ -61,8 +60,6 @@ private: void updatePanelData(); private: - OCCViewer_ViewManager* myViewManager; - bool myIsEdit; Handle(HYDROData_Stream) myEditedObject; -- 2.39.2