aLayout->addWidget( myBathymetryLabel, 2, 0 );
aLayout->addWidget( myBathymetryChoice, 2, 1 );
+ QPushButton* aRegenerateBtn = new QPushButton( tr( "REGENERATE_COLORS" ), this );
+ aLayout->addWidget( aRegenerateBtn, 3, 0 );
+
aPage->setLayout( aLayout );
connect( myBrowser, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
SLOT( onZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
connect( myBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewRegion() ) );
-
+ connect( aRegenerateBtn, SIGNAL( clicked() ), this, SIGNAL( regenerateColors() ) );
return aPage;
}
connect( aPanel, SIGNAL( StricklerTableSelected( const QString & ) ),
SLOT( onStricklerTableSelected( const QString & ) ) );
+ connect( aPanel, SIGNAL( regenerateColors() ), this,
+ SLOT( onRegenerateColors() ) );
+
return aPanel;
}
float theSaturation/* = 0.5*/,
float theValue/* = 0.95*/ ) const
{
- float aGoldenRatioConjugate = (float)(360./582.);
- float aHue = (float)(rand()%100);
- aHue += aGoldenRatioConjugate*theIndex;
- aHue -= floor(aHue);
-
- float aR = 0., aG = 0., aB = 0.;
- int aHueInt = (int)(aHue*6.);
- float aF = aHue*6. - aHueInt;
- float aP = theValue * (1. - theSaturation);
- float aQ = theValue * (1. - aF*theSaturation);
- float aT = theValue * (1. - (1. - aF) * theSaturation);
- switch (aHueInt)
- {
- case 0: { aR = theValue; aG = aT; aB = aP; break; }
- case 1: { aR = aQ; aG = theValue; aB = aP; break; }
- case 2: { aR = aP; aG = theValue; aB = aT; break; }
- case 3: { aR = aP; aG = aQ; aB = theValue; break; }
- case 4: { aR = aT; aG = aP; aB = theValue; break; }
- case 5: { aR = theValue; aG = aP; aB = aQ; break; }
- default: break;
- }
-
- QColor aColor = QColor( (int)(aR*256.), (int)(aG*256.), (int)(aB*256.) );
+ float aHue = ( rand()%1000 ) * 0.001f;
+
+ QColor aColor;
+ aColor.setHsl( (int)(aHue*255.), 128, 128 );
+ int r = aColor.red();
+ int g = aColor.green();
+ int b = aColor.blue();
return ( aColor.isValid() ? aColor : HYDROData_ImmersibleZone::DefaultFillingColor() );
}
if( isConfirmed )
myEditedObject->SetToUpdate( true );
}
+
+void HYDROGUI_CalculationOp::onRegenerateColors()
+{
+ // For geometry zones
+ AssignDefaultZonesColors( false );
+ setZonesVisible( false, false );
+ setZonesVisible( true, false );
+}