if ( !aViewManager || !myPreviewPrs )
return;
- myPreviewPrs->update( true, true );
+ myPreviewPrs->update( true );
}
void HYDROGUI_ChannelOp::erasePreview()
myContext->Erase( myShape, theIsUpdateViewer );
}
-void HYDROGUI_Shape::update( const bool theIsUpdateViewer,
- const bool theIsDisplayOnTop )
+void HYDROGUI_Shape::update( const bool theIsUpdateViewer )
{
setIsToUpdate( false );
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);
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; }
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" ) );
}
LightApp_Application* anApp = module()->getApp();
- if ( !myViewManager ) {
- myViewManager = ::qobject_cast<OCCViewer_ViewManager*>(
- anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
- }
+ if ( !getPreviewManager() )
+ setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
+ 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 );
}
}
#include <HYDROData_Stream.h>
-class OCCViewer_ViewManager;
class HYDROGUI_Shape;
class HYDROGUI_StreamOp : public HYDROGUI_Operation
void updatePanelData();
private:
- OCCViewer_ViewManager* myViewManager;
-
bool myIsEdit;
Handle(HYDROData_Stream) myEditedObject;