const bool theIsEdit )
: HYDROGUI_Operation( theModule ),
myIsEdit( theIsEdit ),
- myViewManager( 0 ),
myPreviewPrs( 0 )
{
setName( theIsEdit ? tr( "EDIT_CHANNEL" ) : tr( "CREATE_CHANNEL" ) );
}
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 )
+ OCCViewer_ViewManager* aViewManager = getPreviewManager();
+ if ( aViewManager && !myPreviewPrs )
{
- if ( OCCViewer_Viewer* aViewer = myViewManager->getOCCViewer() )
+ 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 ( !myViewManager || !myPreviewPrs )
+ if ( !aViewManager || !myPreviewPrs )
return;
myPreviewPrs->update( true, true );
virtual Handle(HYDROData_Channel) getObjectToEdit() const;
+ virtual HYDROGUI_Shape* getPreviewShape() const { return myPreviewPrs; };
+
protected:
bool myIsEdit;
Handle(HYDROData_Channel) myEditedObject;
- OCCViewer_ViewManager* myViewManager;
-
HYDROGUI_Shape* myPreviewPrs;
};
if ( !getPreviewManager() )
setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
-
OCCViewer_ViewManager* aViewManager = getPreviewManager();
if ( aViewManager && !myPreviewPrs )
{