#include <HYDROData_Polyline.h>
#include <HYDROData_Iterator.h>
-#include <HYDROData_Zone.h>
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewWindow.h>
#include <LightApp_Application.h>
#include <LightApp_UpdateFlags.h>
if ( aSplitZoneName.isEmpty() )
continue;
+ SplittedZone aSplittedZone;
+ aSplittedZone.SplitData.Path = aSplitZone->GetPainterPath();
+ // aSplittedZone.SplitData.ZoneNames ???
+
+ aSplittedZone.FillingColor = aSplitZone->GetFillingColor();
+ aSplittedZone.BorderColor = aSplitZone->GetBorderColor();
+
+ aSplittedZone.ZoneName = aSplitZoneName;
+
+ Handle(HYDROData_Polyline) aZonePolyline = aSplitZone->GetPolyline();
+ if ( !aZonePolyline.IsNull() )
+ aSplittedZone.PolylineName = aZonePolyline->GetName();
+
+ aSplittedZone.DataZone = aSplitZone;
+
+ mySplittedZones.append( aSplittedZone );
+
aSplittedZones.append( aSplitZoneName );
}
}
aPanel->setZones( aZones );
aPanel->setSelectedZones( aSelectedZones );
aPanel->setSplittedZones( aSplittedZones );
+
+ createPreview();
}
void HYDROGUI_CalculationOp::abortOperation()
{
const SplittedZone& aSplittedZone = *anIter;
+ if ( !aSplittedZone.DataZone.IsNull() )
+ {
+ //No need to create new but use old zone
+ aSplittedZones.Append( aSplittedZone.DataZone );
+ continue;
+ }
+
Handle(HYDROData_Polyline) aPolyline =
Handle(HYDROData_Polyline)::DownCast( aDocument->CreateObject( KIND_POLYLINE ) );
- Handle(HYDROData_Zone) aDtaZone =
+ Handle(HYDROData_Zone) aDataZone =
Handle(HYDROData_Zone)::DownCast( aDocument->CreateObject( KIND_ZONE ) );
- if( aPolyline.IsNull() || aDtaZone.IsNull() )
+ if( aPolyline.IsNull() || aDataZone.IsNull() )
continue;
// Fill the polyline data
aPolyline->setPolylineData( aPolylineData );
// Fill the zone data
- aDtaZone->SetName( aSplittedZone.ZoneName );
- aDtaZone->SetPolyline( aPolyline );
- aDtaZone->SetBorderColor( aSplittedZone.BorderColor );
- aDtaZone->SetFillingColor( aSplittedZone.FillingColor );
+ aDataZone->SetName( aSplittedZone.ZoneName );
+ aDataZone->SetPolyline( aPolyline );
+ aDataZone->SetBorderColor( aSplittedZone.BorderColor );
+ aDataZone->SetFillingColor( aSplittedZone.FillingColor );
- aSplittedZones.Append( aDtaZone );
+ aSplittedZones.Append( aDataZone );
}
aCalculObj->SetSplittedZones( aSplittedZones );
if ( !myActiveViewManager )
{
+ if ( mySplittedZones.isEmpty() )
+ return;
+
myActiveViewManager = anApp->activeViewManager();
}
aSplittedZone.Shape->setBorderColor( aSplittedZone.BorderColor, false );
aSplittedZone.Shape->setPath( aSplittedZone.SplitData.Path, true );
}
+
+ //Process the draw events for viewer
+ QApplication::processEvents();
+ if ( OCCViewer_ViewWindow* vw = (OCCViewer_ViewWindow*)myPreviewViewManager->getActiveView() )
+ vw->onTopView();
}
}
}