connect( aPanel, SIGNAL( StricklerTableSelected( const QString & ) ),
SLOT( onStricklerTableSelected( const QString & ) ) );
+ connect( aPanel, SIGNAL( regenerateColors() ), this,
+ SLOT( onRegenerateColors() ) );
+
return aPanel;
}
bool HYDROGUI_CalculationOp::confirmRegionsChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
bool HYDROGUI_CalculationOp::confirmOrderChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
bool HYDROGUI_CalculationOp::confirmRuleChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
bool HYDROGUI_CalculationOp::confirmModeChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with zones
bool HYDROGUI_CalculationOp::confirmLandCoverRegionsChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with land cover zones
bool HYDROGUI_CalculationOp::confirmLandCoverModeChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with land cover zones
bool HYDROGUI_CalculationOp::confirmLandCoverOrderChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with land cover zones
bool HYDROGUI_CalculationOp::confirmLandCoverRuleChange() const
{
// Check if the case is already modified or not
- bool isConfirmed = myEditedObject->IsMustBeUpdated();
+ bool isConfirmed = myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_No );
if ( !isConfirmed )
{
// If not modified check if the case has already defined regions with land cover zones
}
}
aPanel->setStricklerTableNames( aList, anEntryList );
- bool anUpdateState = myEditedObject->IsMustBeUpdated();
+ //@ASL: bool anUpdateState = myEditedObject->IsMustBeUpdated();
if ( !aList.isEmpty() )
aPanel->setStricklerTable( aList.at( 0 ), false );
- myEditedObject->SetToUpdate( anUpdateState );
+ //@ASL: myEditedObject->SetToUpdate( anUpdateState );
// Fill in list widget with all available land covers
aSeq = HYDROGUI_Tool::GetLandCovers( module() );
if ( aMode == HYDROData_CalculationCase::AUTOMATIC )
{
// Set objects in the specified order
- if( myEditedObject->IsMustBeUpdated() )
+ if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) )
{
myEditedObject->RemoveGeometryObjects();
foreach ( const QString& aName, aPanel->getAllGeomObjects() )
if ( aMode == HYDROData_CalculationCase::AUTOMATIC )
{
// Set objects in the specified order
- if( myEditedObject->IsMustBeUpdated() )
+ if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) )
{
myEditedObject->RemoveLandCovers();
foreach ( const QString& aName, aPanel->getAllLandCovers() )
}
aPanel->setEditLandCoverZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
- if ( myEditedObject->IsMustBeUpdated() )
+ if ( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_All ) )
{
myShowZones = true;
myEditedObject->Update();
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() );
}
aGroupsNames.append( aGroup->GetName() );
}
}
- if( myEditedObject->IsMustBeUpdated() ) {
+ if( myEditedObject->IsMustBeUpdated( HYDROData_Entity::Geom_2d ) ) {
for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ ) {
Handle(HYDROData_ShapesGroup) aGeomGroup =
Handle(HYDROData_ShapesGroup)::DownCast( aSeq.Value( anIndex ) );
aPanel->setAvailableGroups( aGroupsNames );
aPanel->includeGroups( aList );
- bool isUpdated = myEditedObject->IsMustBeUpdated();
+ //@ASL: bool isUpdated = myEditedObject->IsMustBeUpdated();
}
void HYDROGUI_CalculationOp::onAddGroups()
isConfirmed = confirmOrderChange();
if( isConfirmed )
- myEditedObject->SetToUpdate( true );
+ myEditedObject->Changed( HYDROData_Entity::Geom_2d );
}
void HYDROGUI_CalculationOp::onOrderLandCoverChanged( bool& isConfirmed )
isConfirmed = confirmLandCoverOrderChange();
if( isConfirmed )
- myEditedObject->SetToUpdate( true );
+ myEditedObject->Changed( HYDROData_Entity::Geom_No );
}
void HYDROGUI_CalculationOp::onRuleChanged( bool& isConfirmed )
isConfirmed = confirmRuleChange();
if( isConfirmed )
- myEditedObject->SetToUpdate( true );
+ myEditedObject->Changed( HYDROData_Entity::Geom_2d );
}
void HYDROGUI_CalculationOp::onRuleLandCoverChanged( bool& isConfirmed )
isConfirmed = confirmLandCoverRuleChange();
if( isConfirmed )
- myEditedObject->SetToUpdate( true );
+ myEditedObject->Changed( HYDROData_Entity::Geom_No );
+}
+
+void HYDROGUI_CalculationOp::onRegenerateColors()
+{
+ // For geometry zones
+ AssignDefaultZonesColors( false );
+ setZonesVisible( false, false );
+ setZonesVisible( true, false );
}