2 #include <HYDROGUI_TwoImagesOp.h>
3 #include <HYDROGUI_TwoImagesDlg.h>
4 #include <HYDROData_Image.h>
5 #include <HYDROData_Document.h>
6 #include <HYDROOperations_Factory.h>
8 HYDROGUI_TwoImagesOp::HYDROGUI_TwoImagesOp( HYDROGUI_Module* theModule, const QString& theTitle )
9 : HYDROGUI_Operation( theModule ), myTitle( theTitle )
13 HYDROGUI_TwoImagesOp::~HYDROGUI_TwoImagesOp()
17 HYDROGUI_InputPanel* HYDROGUI_TwoImagesOp::createInputPanel() const
19 return new HYDROGUI_TwoImagesDlg( module(), myTitle );
22 void HYDROGUI_TwoImagesOp::OnApply()
24 HYDROGUI_TwoImagesDlg* aPanel = dynamic_cast<HYDROGUI_TwoImagesDlg*>( inputPanel() );
25 QString aName1, aName2;
26 aPanel->GetSelectedImages( aName1, aName2 );
28 Handle_HYDROData_Image anImage1 = Handle_HYDROData_Image::DownCast(
29 FindObjectByName( aName1, KIND_IMAGE ) );
30 Handle_HYDROData_Image anImage2 = Handle_HYDROData_Image::DownCast(
31 FindObjectByName( aName2, KIND_IMAGE ) );
33 HYDROOperations_Factory* aFactory = HYDROOperations_Factory::Factory();
34 ImageComposer_Operator* anOperator = 0; //TODO
36 Handle(HYDROData_Image) aResult = aFactory->CreateImage( doc(), anOperator );
37 aResult->AppendReference( anImage1 );
38 aResult->AppendReference( anImage2 );
39 aFactory->UpdateImage( doc(), aResult );