: HYDROGUI_Operation( theModule ),
myIsEdit( theIsEdit ),
myActiveViewManager( NULL ),
- myPreviewViewManager( NULL )
+ myPreviewViewManager( NULL ),
+ myShowGeomObjects( true ),
+ myShowLandCovers( false ),
+ myShowZones( false )
{
setName( myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ) );
}
if ( !aPanel )
return;
+ setLandCoversVisible( true );
+
QStringList aList;
QStringList anEntryList;
HYDROData_SequenceOfObjects aSeq;
return;
QApplication::setOverrideCursor( Qt::WaitCursor );
-
+
+ setGeomObjectsVisible( false );
+ setLandCoversVisible( false );
+
QString aNewCaseName = aPanel->getObjectName();
QString anOldCaseName = myEditedObject->GetName();
bool isNameChanged = anOldCaseName != aNewCaseName;
{
if( theIndex==1 )
{
+ setGeomObjectsVisible( true );
+
closePreview( false );
createPreview( false );
}
if( theIndex==2 )
{
+ setLandCoversVisible( true );
+
closePreview( false );
createPreview( true );
}
}
+void HYDROGUI_CalculationOp::setGeomObjectsVisible( bool theIsVisible )
+{
+ myShowGeomObjects = theIsVisible;
+
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetGeometryObjects();
+
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ for ( ; anIter.More(); anIter.Next() ) {
+ setObjectVisibility( anIter.Value(), theIsVisible );
+ }
+}
+
+void HYDROGUI_CalculationOp::setLandCoversVisible( bool theIsVisible )
+{
+ myShowLandCovers = theIsVisible;
+
+ HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCovers();
+
+ HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+ for ( ; anIter.More(); anIter.Next() ) {
+ setObjectVisibility( anIter.Value(), theIsVisible );
+ }
+}
+
void HYDROGUI_CalculationOp::AssignDefaultZonesColors( const bool theLandCover )
{
HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions( theLandCover );
float theValue/* = 0.95*/ ) const
{
float aGoldenRatioConjugate = (float)(360./582.);
- float aHue = (float)rand();
+ float aHue = (float)(rand()%100);
aHue += aGoldenRatioConjugate*theIndex;
aHue -= floor(aHue);
{
LightApp_Application* anApp = module()->getApp();
HYDROData_SequenceOfObjects aSeq;
- if ( theLandCover )
- aSeq = myEditedObject->GetLandCovers();
- else
- aSeq = myEditedObject->GetGeometryObjects();
+ if ( theLandCover && myShowLandCovers )
+ {
+ HYDROData_SequenceOfObjects aSeqLC = myEditedObject->GetLandCovers();
+ aSeq.Append( aSeqLC );
+ }
+ else if ( !theLandCover && myShowGeomObjects )
+ {
+ HYDROData_SequenceOfObjects aSeqGO = myEditedObject->GetGeometryObjects();
+ aSeq.Append( aSeqGO );
+ }
+
Handle(HYDROData_Entity) anEntity;
if ( myShowZones )