theName2 = myImage2->GetName();
return !theName1.isEmpty() && !theName2.isEmpty();
}
+
+void HYDROGUI_TwoImagesDlg::setColor( const QColor& theColor )
+{
+ if( theColor.alpha() == 0 ) // transparent
+ myTransparent->setChecked( true );
+ else
+ myColor->setChecked( true );
+ myColorBox->setColor( theColor );
+}
+
+QColor HYDROGUI_TwoImagesDlg::getColor() const
+{
+ QColor aColor( 255, 255, 255, 0 ); // transparent
+ if( myColor->isChecked() )
+ aColor = myColorBox->color();
+ return aColor;
+}
bool getSelectedImages( QString& theName1,
QString& theName2 ) const;
+ void setColor( const QColor& theColor );
+ QColor getColor() const;
+
private:
QLineEdit* myImageName;
HYDROGUI_ObjSelector* myImage1;
aSelectedName2 = anImage2->GetName();
}
aPanel->setSelectedImages( aSelectedName1, aSelectedName2 );
+
+ HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory();
+ if( ImageComposer_Operator* anOperator = aFactory->Operator( myEditedObject ) )
+ {
+ QColor aColor;
+ anOperator->getArgs( aColor );
+ aPanel->setColor( aColor );
+ }
}
}
aResult->SetName( anImageName );
aResult->AppendReference( anImage1 );
aResult->AppendReference( anImage2 );
+
+ if( ImageComposer_Operator* anOperator = aFactory->Operator( aResult ) )
+ {
+ anOperator->setArgs( aPanel->getColor() );
+ aResult->SetArgs( anOperator->getBinArgs() );
+ }
+
aFactory->UpdateImage( doc(), aResult );
if( !myIsEdit )
module()->setObjectVisible( aViewId, anImage1, false );
module()->setObjectVisible( aViewId, anImage2, false );
module()->setObjectVisible( aViewId, aResult, true );
-
}
theUpdateFlags = UF_Model | UF_Viewer | UF_GV_Forced;