~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/tools/copyimagetoclipboardtool.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-10-24 21:28:17 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20131024212817-ej1skb9og09d3ht6
Tags: 3.5.0.1137.31+dfsg-1
New upstream release [October 2013]

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
*  $Id: resettool.cpp $
4
4
*  Ginkgo CADx Project
5
5
*
6
 
*  Copyright 2008-12 MetaEmotion S.L. All rights reserved.
 
6
*  Copyright 2008-14 MetaEmotion S.L. All rights reserved.
7
7
*  http://ginkgo-cadx.com
8
8
*
9
9
*  This file is licensed under LGPL v3 license.
11
11
*
12
12
*
13
13
*/
14
 
 
 
14
 
15
15
#include "copyimagetoclipboardtool.h"
16
16
#include <export/contracts/iwidgetscontract.h>
17
17
#include <api/controllers/ieventscontroller.h>
45
45
#include <wx/dataobj.h>
46
46
#include <wx/clipbrd.h>
47
47
 
48
 
GNC::GCS::ITool* GNC::CopyImageToClipboardTool::NewTool()
49
 
{
50
 
        return new GNC::CopyImageToClipboardTool();
51
 
}
52
 
 
53
 
GNC::CopyImageToClipboardTool::CopyImageToClipboardTool()
54
 
{
55
 
}
56
 
GNC::CopyImageToClipboardTool::~CopyImageToClipboardTool()
57
 
{
58
 
}
59
 
 
60
 
bool GNC::CopyImageToClipboardTool::ExecuteAction()
 
48
GNC::GCS::ITool* GNC::CopyImageToClipboardTool::NewTool()
 
49
{
 
50
        return new GNC::CopyImageToClipboardTool();
 
51
}
 
52
 
 
53
GNC::CopyImageToClipboardTool::CopyImageToClipboardTool()
 
54
{
 
55
}
 
56
GNC::CopyImageToClipboardTool::~CopyImageToClipboardTool()
 
57
{
 
58
}
 
59
 
 
60
bool GNC::CopyImageToClipboardTool::ExecuteAction()
61
61
{       
62
62
        std::string tempName = GNC::Entorno::Instance()->CreateGinkgoTempFile();
63
63
        {
71
71
                vtkSmartPointer<vtkImageData> timg = windowToImageFilter->GetOutput();
72
72
                unsigned char *pVtkPix = (unsigned char *)timg->GetScalarPointer();
73
73
                
74
 
                unsigned long imgsize = timg->GetDimensions()[0] * timg->GetDimensions()[1] * sizeof(unsigned char) * 3;
 
74
                unsigned long imgsize = timg->GetDimensions()[0] * timg->GetDimensions()[1] * sizeof(unsigned char) * 3;
75
75
                unsigned char* data = new unsigned char[imgsize];
76
76
                int linesize = timg->GetDimensions()[0] *3;
77
77
                for (int y = 0; y < timg->GetDimensions()[1]; ++y) {
93
93
        }
94
94
 
95
95
        return true;
96
 
}
 
96
}