HYDROGUI_ChannelOp.h
HYDROGUI_ColorWidget.h
HYDROGUI_CopyPasteOp.h
+ HYDROGUI_CopyPastePositionOp.h
HYDROGUI_DataBrowser.h
HYDROGUI_DataModel.h
HYDROGUI_DataObject.h
HYDROGUI_ChannelOp.cxx
HYDROGUI_ColorWidget.cxx
HYDROGUI_CopyPasteOp.cxx
+ HYDROGUI_CopyPastePositionOp.cxx
HYDROGUI_DataBrowser.cxx
HYDROGUI_DataModel.cxx
HYDROGUI_DataObject.cxx
--- /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_CopyPastePositionOp.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_UpdateFlags.h"
+
+#include <gp_Pnt.hxx>
+
+#include <QApplication>
+#include <QClipboard>
+
+HYDROGUI_CopyPastePositionOp::HYDROGUI_CopyPastePositionOp( HYDROGUI_Module* theModule,
+ const bool theIsPaste )
+: HYDROGUI_Operation( theModule ),
+ myIsPaste( theIsPaste )
+{
+ setName( tr( "COPY_PASTE_VIEW_POSITION" ) );
+}
+
+HYDROGUI_CopyPastePositionOp::~HYDROGUI_CopyPastePositionOp()
+{
+}
+
+void HYDROGUI_CopyPastePositionOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+
+ HYDROGUI_DataModel* aModel = module()->getDataModel();
+
+ if( !myIsPaste )
+ {
+ QClipboard* aClBoard = QApplication::clipboard();
+
+
+ gp_Pnt aPoint( 100, 100, 0 );
+ QString aResult = tr( "%1,%2" ).arg( aPoint.X() ).arg( aPoint.Y() );
+ if ( !aResult.isEmpty() ) {
+ aClBoard->clear();
+ QApplication::clipboard()->setText( aResult );
+ }
+ }
+ else
+ {
+ }
+ commit();
+}
--- /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_COPYPASTEPOSITIONOP_H
+#define HYDROGUI_COPYPASTEPOSITIONOP_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_CopyPastePositionOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_CopyPastePositionOp( HYDROGUI_Module* theModule, const bool theIsPaste );
+ virtual ~HYDROGUI_CopyPastePositionOp();
+
+protected:
+ virtual void startOperation();
+
+private:
+ bool myIsPaste;
+};
+
+#endif
theMenu->addAction( action( HideAllId ) );
theMenu->addSeparator();
}
+ if ( anIsOCCView ) {
+ theMenu->addSeparator();
+ theMenu->addAction( action( CopyViewerPositionId ) );
+ }
}
void HYDROGUI_Module::update( const int flags )
#include "HYDROGUI_CalculationOp.h"
#include "HYDROGUI_ChannelOp.h"
#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_CopyPastePositionOp.h"
#include "HYDROGUI_DeleteOp.h"
#include "HYDROGUI_DigueOp.h"
#include "HYDROGUI_ExportImageOp.h"
createAction( SplitImageId, "SPLIT_IMAGE", "SPLIT_IMAGE_ICO" );
createAction( EditSplittedImageId, "EDIT_SPLITTED_IMAGE", "EDIT_SPLITTED_IMAGE_ICO" );
+ createAction( CopyViewerPositionId, "COPY_VIEWER_POSITION", "" );
+
createAction( DeleteId, "DELETE", "", Qt::Key_Delete, false,
SLOT( onDelete() ) );
anOp = new HYDROGUI_ImportGeomObjectOp( aModule,
HYDROGUI_ImportGeomObjectOp::ImportCreatedAsObstacle, GEOMOp::OpCylinder );
break;
+ case CopyViewerPositionId:
+ anOp = new HYDROGUI_CopyPastePositionOp( aModule, false );
+ break;
case DeleteId:
anOp = new HYDROGUI_DeleteOp( aModule );
break;
CreateBoxId,
CreateCylinderId,
+ CopyViewerPositionId,
+
DeleteId,
ShowId,
</message>
</context>
+ <context>
+ <name>HYDROGUI_CopyPastePositionOp</name>
+ <message>
+ <source>COPY_PASTE_VIEW_POSITION</source>
+ <translation>Copy/paste view position</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_DeleteOp</name>
<message>
<source>DSK_EDIT_SPLITTED_IMAGE</source>
<translation>Edit splitted image</translation>
</message>
+ <message>
+ <source>DSK_COPY_VIEWER_POSITION</source>
+ <translation>Copy position</translation>
+ </message>
<message>
<source>DSK_EXPORT_IMAGE</source>
<translation>Export image</translation>
<source>MEN_EDIT_SPLITTED_IMAGE</source>
<translation>Edit splitted image</translation>
</message>
+ <message>
+ <source>MEN_COPY_VIEWER_POSITION</source>
+ <translation>Copy position</translation>
+ </message>
<message>
<source>MEN_EXPORT_IMAGE</source>
<translation>Export image</translation>
<source>STB_EDIT_SPLITTED_IMAGE</source>
<translation>Edit splitted image</translation>
</message>
+ <message>
+ <source>STB_COPY_VIEWER_POSITION</source>
+ <translation>Copy position</translation>
+ </message>
<message>
<source>STB_EXPORT_IMAGE</source>
<translation>Export image</translation>