#include "HYDROGUI_CopyPastePositionOp.h"
-#include "HYDROGUI_DataModel.h"
#include "HYDROGUI_Module.h"
-#include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_Displayer.h"
-#include <gp_Pnt.hxx>
+#include <SUIT_ViewManager.h>
+#include <LightApp_Application.h>
-#include <QApplication>
#include <QClipboard>
+#include <QApplication>
HYDROGUI_CopyPastePositionOp::HYDROGUI_CopyPastePositionOp( HYDROGUI_Module* theModule,
const bool theIsPaste )
{
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() );
+ QString aResult;
+ HYDROGUI_Module* aModule = module();
+ HYDROGUI_Displayer* aDisplayer = aModule->getDisplayer();
+ if ( aDisplayer ) {
+ SUIT_ViewManager* aViewMgr = aModule->getApp()->activeViewManager();
+ SUIT_ViewWindow* aViewWindow = aViewMgr ? aViewMgr->getActiveView() : 0;
+ double aX, aY, aZ;
+ if ( aDisplayer->GetCursorViewCoordinates( aViewWindow, aX, aY, aZ ) )
+ aResult = tr( "%1,%2" ).arg( aX ).arg( aY );
+ }
if ( !aResult.isEmpty() ) {
+ QClipboard* aClBoard = QApplication::clipboard();
aClBoard->clear();
QApplication::clipboard()->setText( aResult );
}
}
- else
- {
- }
commit();
}