#include <QTreeView>
#include <QWizardPage>
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool IsComplete )
: HYDROGUI_Wizard( theModule, theTitle )
void HYDROGUI_CalculationDlg::onSelected( SUIT_DataObject* theObject )
{
+ DEBTRACE("onSelected");
bool doShow = false;
HYDROGUI_Zone* aZone = dynamic_cast<HYDROGUI_Zone*>( theObject );
if ( aZone )
#include <HYDROData_CompleteCalcCase.h>
+//#define _DEVDEBUG_
+#include "HYDRO_trace.hxx"
+
HYDROGUI_CalculationOp::HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool theIsEdit, bool IsComplete )
: HYDROGUI_Operation( theModule ),
void HYDROGUI_CalculationOp::onObjectsSelected()
{
+ DEBTRACE("onObjectsSelected");
HYDROGUI_CalculationDlg* aPanel =
::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
void HYDROGUI_CalculationOp::onClickedInZonesBrowser( SUIT_DataObject* theItem )
{
+ DEBTRACE("onClickedInZonesBrowser");
HYDROGUI_Region* aRegionItem = dynamic_cast<HYDROGUI_Region*>(theItem);
HYDROGUI_Zone* aZoneItem;
selectionMgr()->clearSelected();
if ( aRegionItem )
{
+ DEBTRACE("Region");
// Select a region in preview
SUIT_DataOwnerPtrList aList( true );
DataObjectList aZones = aRegionItem->children();
aZoneItem = dynamic_cast<HYDROGUI_Zone*>(theItem);
if ( aZoneItem )
{
+ DEBTRACE("Zone");
SUIT_DataOwnerPtrList aList( true );
aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( aZoneItem->entry() ) ) );
selectionMgr()->setSelected( aList );
void HYDROGUI_CalculationOp::createPreview( const bool theLandCoverMap, bool fitAllFlag, bool onTopViewAndFit )
{
+ DEBTRACE("createPreview " << theLandCoverMap << " " << fitAllFlag << " " << onTopViewAndFit);
LightApp_Application* anApp = module()->getApp();
HYDROData_SequenceOfObjects aSeq;
if ( theLandCoverMap && myShowLandCoverMap )
{
myPreviewViewManager = ::qobject_cast<OCCViewer_ViewManager*>(
anApp->createViewManager( OCCViewer_Viewer::Type() ) );
+ DEBTRACE(" createViewManager " << myPreviewViewManager);
if ( myPreviewViewManager )
{
connect( myPreviewViewManager, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ),
if ( !myPreviewViewManager )
return;
+ restoreOCCViewerSelection(myPreviewViewManager);
if ( OCCViewer_Viewer* aViewer = myPreviewViewManager->getOCCViewer() )
{
return;
QString aViewType = theViewManager->getType();
- DEBTRACE("aViewType " << aViewType.toStdString() << " " << GraphicsView_Viewer::Type().toStdString() << " " << OCCViewer_Viewer::Type().toStdString());
+ DEBTRACE("aViewType " << aViewType.toStdString());
if( aViewType != GraphicsView_Viewer::Type() &&
aViewType != OCCViewer_Viewer::Type())
return;
}
}
- if ( !isGV && aViewType == GraphicsView_Viewer::Type() )
+ if ( aViewType == GraphicsView_Viewer::Type() )
{
GraphicsView_ViewManager* aViewManager =
::qobject_cast<GraphicsView_ViewManager*>( theViewManager );
sel->setEnabled( true );
}
}
- else if ( !isOCC && aViewType == OCCViewer_Viewer::Type() )
+ else if ( aViewType == OCCViewer_Viewer::Type() )
{
OCCViewer_ViewManager* aViewManager =
::qobject_cast<OCCViewer_ViewManager*>( theViewManager );
restoreOCCViewerSelection();
}
-void HYDROGUI_Operation::restoreOCCViewerSelection()
+void HYDROGUI_Operation::restoreOCCViewerSelection(OCCViewer_ViewManager* theViewManager)
{
- DEBTRACE("restoreOCCViewerSelection");
+ DEBTRACE("restoreOCCViewerSelection " << theViewManager);
LightApp_Application* anApp = module()->getApp();
LightApp_SelectionMgr* sm = anApp->selectionMgr();
if(sm)
{
sm->clearFilters(); // see GEOM_Displayer::GlobalSelection
}
- OCCViewer_ViewManager* aViewManager =
- dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
+ OCCViewer_ViewManager* aViewManager = theViewManager;
+ if (!aViewManager)
+ aViewManager = dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
if( aViewManager )
{
if( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
if( !aCtx.IsNull() )
{
- DEBTRACE("AIScontext " << aCtx.get());
+ DEBTRACE("aViewManager " << aViewManager << " AIScontext " << aCtx.get());
aCtx->Deactivate();
aCtx->Activate(0);
aCtx->SetAutomaticHilight( Standard_True );
*/
virtual void apply();
- virtual void restoreOCCViewerSelection();
+ virtual void restoreOCCViewerSelection(OCCViewer_ViewManager* theViewManager = 0);
private: