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

« back to all changes in this revision

Viewing changes to src/cadxcore/main/tools/brightnesscontrasttool.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: brightnesscontrasttool.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 "brightnesscontrasttool.h"
 
15
#if defined(ENABLE_BRIGHTNESSCONTRASTTOOL)
 
16
 
 
17
#include <api/globals.h>
 
18
#include <export/contracts/iwidgetscontract.h>
 
19
#include <api/iwidgetsmanager.h>
 
20
#include <widgets/wbrightnesscontrast.h>
 
21
 
 
22
#ifdef __DEPRECATED
 
23
#undef __DEPRECATED
 
24
#endif
 
25
#include <vtk/vtkginkgoimageviewer.h>
 
26
 
 
27
GNC::BrightnessContrastTool::BrightnessContrastTool() : m_pBuilder(NULL)
 
28
{
 
29
        m_pBuilder = NULL;
 
30
}
 
31
 
 
32
GNC::BrightnessContrastTool::~BrightnessContrastTool() {
 
33
 
 
34
}
 
35
 
 
36
//------------------------------------------------------------------------------
 
37
//region "ITool/IContract realization"
 
38
 
 
39
GNC::GCS::ITool* GNC::BrightnessContrastTool::NewTool()
 
40
{
 
41
        return new GNC::BrightnessContrastTool();
 
42
}
 
43
 
 
44
void GNC::BrightnessContrastTool::Connect()
 
45
{
 
46
        if (m_pBuilder != NULL)
 
47
        {
 
48
                delete m_pBuilder;
 
49
                m_pBuilder = NULL;
 
50
        }
 
51
 
 
52
        m_pBuilder = new GNC::GCS::Widgets::WBrightnessContrastBuilder(WidgetsContract->GetManager(), GetTriggerButton(), (unsigned long) this);
 
53
        WidgetsContract->GetViewerActivo()->SetInteractionStyle(vtkGinkgoImageViewer::ZOOM_INTERACTION);
 
54
        WidgetsContract->GetManager()->SetCursor(m_pBuilder->GetCursor());
 
55
}
 
56
 
 
57
void GNC::BrightnessContrastTool::Disconnect()
 
58
{
 
59
        WidgetsContract->GetManager()->EnableAnotacionDinamica(false);
 
60
        WidgetsContract->GetViewerActivo()->SetInteractionStyle(vtkGinkgoImageViewer::ZOOM_INTERACTION);
 
61
        WidgetsContract->GetManager()->SetCursor(GNC::GCS::Widgets::CUR_FLECHA);
 
62
        if (m_pBuilder != NULL)
 
63
        {               
 
64
                // DesSubscribimos los eventos de la ventana a un metodo especifico del panel de esta herramienta
 
65
                delete m_pBuilder;
 
66
                m_pBuilder = NULL;
 
67
        }
 
68
}
 
69
 
 
70
//endregion
 
71
#endif
 
 
b'\\ No newline at end of file'