HYDROGUI_InputPanel.h
HYDROGUI_Module.h
HYDROGUI_ObjSelector.h
+ HYDROGUI_ObserveImageOp.h
HYDROGUI_Operation.h
HYDROGUI_Operations.h
HYDROGUI_PolylineDlg.h
HYDROGUI_InputPanel.cxx
HYDROGUI_Module.cxx
HYDROGUI_ObjSelector.cxx
+ HYDROGUI_ObserveImageOp.cxx
HYDROGUI_Operation.cxx
HYDROGUI_Operations.cxx
HYDROGUI_PolylineDlg.cxx
dynamic_cast<GraphicsView_ViewManager*>( anApp->createViewManager( GraphicsView_Viewer::Type() ) );
if( myPreviewViewManager )
{
- module()->setViewManagerRole( myPreviewViewManager, HYDROGUI_Module::VMR_Mapping );
- myPreviewViewManager->setTitle( tr( "MAPPING" ) );
+ module()->setViewManagerRole( myPreviewViewManager, HYDROGUI_Module::VMR_TransformImage );
+ myPreviewViewManager->setTitle( tr( "TRANSFORM_IMAGE" ) );
if( GraphicsView_Viewer* aViewer = myPreviewViewManager->getViewer() )
{
if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
if( anIsImage )
{
theMenu->addAction( action( EditImageId ) );
+ theMenu->addAction( action( ObserveImageId ) );
theMenu->addAction( action( ExportImageId ) );
theMenu->addSeparator();
}
aViewPort->setViewLabelText( QString( "X: %1\nY: %2" ).arg( aXStr ).arg( aYStr ) );
}
- else if( aRole == VMR_Mapping )
+ else if( aRole == VMR_TransformImage )
aViewPort->setViewLabelText( QString( "X: %1\nY: %2" ).arg( (int)aMouseX ).arg( (int)aMouseY ) );
}
}
enum CustomEvent { NewViewEvent = QEvent::User + 100 };
public:
- enum ViewManagerRole { VMR_Unknown = 0, VMR_General, VMR_Observe, VMR_Mapping };
+ enum ViewManagerRole { VMR_Unknown = 0, VMR_General, VMR_TransformImage, VMR_ObserveImage };
typedef QPair< SUIT_ViewManager*, ViewManagerRole > ViewManagerInfo;
typedef QMap < int, ViewManagerInfo > ViewManagerMap;
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ObserveImageOp.h"
+
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_PrsImage.h"
+#include "HYDROGUI_Tool.h"
+
+#include <HYDROData_Image.h>
+
+#include <LightApp_Application.h>
+
+#include <GraphicsView_ViewManager.h>
+#include <GraphicsView_Viewer.h>
+
+HYDROGUI_ObserveImageOp::HYDROGUI_ObserveImageOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+ setName( tr( "OBSERVE_IMAGE" ) );
+}
+
+HYDROGUI_ObserveImageOp::~HYDROGUI_ObserveImageOp()
+{
+}
+
+void HYDROGUI_ObserveImageOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+
+ Handle(HYDROData_Image) anImageObj =
+ Handle(HYDROData_Image)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+ if( !anImageObj.IsNull() )
+ {
+ QImage anImage = anImageObj->Image();
+ QTransform aTransform = anImageObj->Trsf();
+
+ HYDROGUI_PrsImage* aPrs = new HYDROGUI_PrsImage( anImageObj );
+ aPrs->setImage( anImage );
+ aPrs->setTransform( aTransform );
+ aPrs->compute();
+
+ LightApp_Application* anApp = module()->getApp();
+ GraphicsView_ViewManager* aViewManager =
+ dynamic_cast<GraphicsView_ViewManager*>( anApp->createViewManager( GraphicsView_Viewer::Type() ) );
+ if( aViewManager )
+ {
+ module()->setViewManagerRole( aViewManager, HYDROGUI_Module::VMR_ObserveImage );
+ aViewManager->setTitle( anImageObj->GetName() );
+ if( GraphicsView_Viewer* aViewer = aViewManager->getViewer() )
+ {
+ if( GraphicsView_ViewPort* aViewPort = aViewer->getActiveViewPort() )
+ {
+ aViewPort->addItem( aPrs );
+ aViewPort->fitAll();
+ }
+ }
+ }
+ }
+
+ abort(); // do not commit the document command
+}
--- /dev/null
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_OBSERVEIMAGEOP_H
+#define HYDROGUI_OBSERVEIMAGEOP_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_ObserveImageOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_ObserveImageOp( HYDROGUI_Module* theModule );
+ virtual ~HYDROGUI_ObserveImageOp();
+
+protected:
+ virtual void startOperation();
+};
+
+#endif
#include "HYDROGUI_ExportImageOp.h"
#include "HYDROGUI_ImportImageOp.h"
#include "HYDROGUI_Module.h"
+#include "HYDROGUI_ObserveImageOp.h"
#include "HYDROGUI_PolylineOp.h"
#include "HYDROGUI_ShowHideOp.h"
#include "HYDROGUI_TwoImagesOp.h"
{
createAction( ImportImageId, "IMPORT_IMAGE", "", Qt::CTRL + Qt::Key_I );
createAction( EditImageId, "EDIT_IMAGE" );
+ createAction( ObserveImageId, "OBSERVE_IMAGE" );
createAction( ExportImageId, "EXPORT_IMAGE" );
createAction( CreatePolylineId, "CREATE_POLYLINE" );
createAction( EditPolylineId, "EDIT_POLYLINE" );
case EditImageId:
anOp = new HYDROGUI_ImportImageOp( aModule, theId == EditImageId );
break;
+ case ObserveImageId:
+ anOp = new HYDROGUI_ObserveImageOp( aModule );
+ break;
case ExportImageId:
anOp = new HYDROGUI_ExportImageOp( aModule );
break;
RedoId,
ImportImageId,
EditImageId,
+ ObserveImageId,
ExportImageId,
CreatePolylineId,
EditPolylineId,
<translation>Import image</translation>
</message>
<message>
- <source>MAPPING</source>
- <translation>Mapping</translation>
+ <source>TRANSFORM_IMAGE</source>
+ <translation>Transform image</translation>
</message>
<message>
<source>POINTS_A_B_C_BELONG_TO_SINGLE_LINE</source>
<source>DSK_IMPORT_IMAGE</source>
<translation>Import image</translation>
</message>
+ <message>
+ <source>DSK_OBSERVE_IMAGE</source>
+ <translation>Observe image</translation>
+ </message>
<message>
<source>DSK_REDO</source>
<translation>Redo</translation>
<source>MEN_IMPORT_IMAGE</source>
<translation>Import image</translation>
</message>
+ <message>
+ <source>MEN_OBSERVE_IMAGE</source>
+ <translation>Observe image</translation>
+ </message>
<message>
<source>MEN_REDO</source>
<translation>Redo</translation>
<source>STB_IMPORT_IMAGE</source>
<translation>Import image</translation>
</message>
+ <message>
+ <source>STB_OBSERVE_IMAGE</source>
+ <translation>Observe image</translation>
+ </message>
<message>
<source>STB_REDO</source>
<translation>Redo</translation>
<translation>Hide all</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_ObserveImageOp</name>
+ <message>
+ <source>OBSERVE_IMAGE</source>
+ <translation>Observe image</translation>
+ </message>
+ </context>
<context>
<name>HYDROGUI_TwoImagesDlg</name>
<message>