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

« back to all changes in this revision

Viewing changes to src/cadxcore/main/tools/camerarotationtool.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:
 
1
/*
 
2
*  
 
3
*  $Id: toolpan.cpp $
 
4
*  Ginkgo CADx Project
 
5
*
 
6
*  Copyright 2008-14 MetaEmotion S.L. All rights reserved.
 
7
*  http://ginkgo-cadx.com
 
8
*
 
9
*  This file is licensed under LGPL v3 license.
 
10
*  See License.txt for details
 
11
*
 
12
*
 
13
*/
 
14
#include "camerarotationtool.h"
 
15
 
 
16
 
 
17
#include <export/contracts/iwidgetscontract.h>
 
18
 
 
19
#include <api/globals.h>
 
20
#include <api/iwidgetsmanager.h>
 
21
#include <resources/ginkgoresourcesmanager.h>
 
22
#include <widgets/wcamerarotation.h>
 
23
 
 
24
#include <iostream>
 
25
#ifdef __DEPRECATED
 
26
#undef __DEPRECATED
 
27
#endif
 
28
#include <vtk/vtkginkgoimageviewer.h>
 
29
#include <vtkRenderWindowInteractor.h>
 
30
#include <vtk/interactor/ginkgointeractorstyleimage2d.h>
 
31
 
 
32
 
 
33
GNC::CameraRotationTool::CameraRotationTool() {
 
34
        m_pBuilder = NULL;
 
35
}
 
36
 
 
37
GNC::CameraRotationTool::~CameraRotationTool() 
 
38
{
 
39
        if (m_pBuilder != NULL) {
 
40
                delete m_pBuilder;
 
41
                m_pBuilder = NULL;
 
42
        }
 
43
}
 
44
 
 
45
GNC::GCS::ITool* GNC::CameraRotationTool::NewTool()
 
46
{
 
47
        return new GNC::CameraRotationTool();
 
48
}
 
49
 
 
50
void GNC::CameraRotationTool::Connect()
 
51
{
 
52
        if (m_pBuilder != NULL) {
 
53
                delete m_pBuilder;
 
54
                m_pBuilder = NULL;
 
55
        }
 
56
        m_pBuilder = new TBuilder(WidgetsContract->GetManager(), GetTriggerButton(), (unsigned long)this);
 
57
        WidgetsContract->GetViewerActivo()->SetInteractionStyle(vtkGinkgoImageViewer::ZOOM_INTERACTION);
 
58
        WidgetsContract->GetManager()->SetCursor(m_pBuilder->GetCursor());
 
59
}
 
60
 
 
61
void GNC::CameraRotationTool::Disconnect()
 
62
{
 
63
        WidgetsContract->GetViewerActivo()->SetInteractionStyle(vtkGinkgoImageViewer::ZOOM_INTERACTION);
 
64
        WidgetsContract->GetManager()->SetCursor(GNC::GCS::Widgets::CUR_FLECHA);
 
65
        // DesSubscribimos los eventos de la ventana a un metodo especifico del panel de esta herramienta
 
66
        if (m_pBuilder != NULL) {
 
67
                delete m_pBuilder;
 
68
                m_pBuilder = NULL;
 
69
        }
 
70
}