~ubuntu-branches/ubuntu/trusty/ginkgocadx/trusty

« back to all changes in this revision

Viewing changes to src/visualizator/visualizator/wxvtk/reconstruction/commands/surfacecommand.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-07-21 11:58:53 UTC
  • mfrom: (1.2.1) (7.1.6 experimental)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20130721115853-0aii5ee76hxm8z1f
* New upstream release [July 2013]
  + new B-D: "libjsoncpp-dev".
  + new patch "unbundle-libjsoncpp.patch" to avoid building bundled
    "libjsoncpp-dev".
  + new patch "fix-wx.patch" to avoid FTBFS due to missing
    "-lwx_gtk2u_html-2.8".
* Removed unnecessary versioned Build-Depends.
* Removed obsolete lintian override.
* Reference get-orig-source implementation for orig.tar clean-up and
  DFSG-repackaging.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *
3
 
 *  $Id: surfacecommand.cpp 3359 2011-02-21 08:23:37Z carlos $
4
 
 *  Ginkgo CADx Project
5
 
 *
6
 
 *  Copyright 2008-10 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
 
#ifdef __DEPRECATED
15
 
#undef __DEPRECATED
16
 
#endif
17
 
#include <exception>
18
 
#include "surfacecommand.h"
19
 
#include "voiextractioncommand.h"
20
 
#include "../pipelines/surfacepipeline.h"
21
 
 
22
 
MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommandParams::SurfaceCommandParams(
23
 
        const GnkPtr<TPipeline>& pipeline,
24
 
        unsigned int datasetNum,
25
 
        bool         preSmooth,
26
 
        bool         postSmooth,
27
 
        unsigned int quality,
28
 
        const SurfaceProps& propsS1,
29
 
        const SurfaceProps& propsS2
30
 
        ) : Pipeline(pipeline), DataSetNum(datasetNum), PreSmooth(preSmooth), PostSmooth(postSmooth), Quality(quality), Surface1Props(propsS1), Surface2Props(propsS2)
31
 
{
32
 
}
33
 
 
34
 
MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommandParams::~SurfaceCommandParams()
35
 
{
36
 
}
37
 
 
38
 
//====================================================================
39
 
 
40
 
MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::SurfaceCommand(SurfaceCommandParams* pParams) : GNC::GCS::IComando(pParams, "SurfaceReconstruction" )
41
 
{
42
 
        m_pSurfaceParams = pParams;
43
 
        SetId(IDC_SURFACE_RECONSTRUCTION);
44
 
        CancelaA(IDC_SURFACE_RECONSTRUCTION);
45
 
        EsperaA(IDC_VOI_EXTRACTION);
46
 
}
47
 
 
48
 
MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::~SurfaceCommand(void)
49
 
{
50
 
}
51
 
 
52
 
void MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::Execute()
53
 
{
54
 
 
55
 
        m_pSurfaceParams->Pipeline->EnableSmooth(m_pSurfaceParams->PreSmooth, m_pSurfaceParams->PostSmooth);
56
 
 
57
 
        m_pSurfaceParams->Pipeline->Enabled[0] = m_pSurfaceParams->Surface1Props.Enabled;
58
 
        m_pSurfaceParams->Pipeline->SetSurfValue(0, m_pSurfaceParams->Surface1Props.ISOValue);
59
 
        m_pSurfaceParams->Pipeline->SetSurfColor(0, m_pSurfaceParams->Surface1Props.Red, m_pSurfaceParams->Surface1Props.Green, m_pSurfaceParams->Surface1Props.Blue);
60
 
        m_pSurfaceParams->Pipeline->SetSurfTransparency(0, m_pSurfaceParams->Surface1Props.Alpha);
61
 
 
62
 
        m_pSurfaceParams->Pipeline->Enabled[1] = m_pSurfaceParams->Surface2Props.Enabled;
63
 
        m_pSurfaceParams->Pipeline->SetSurfValue(1, m_pSurfaceParams->Surface2Props.ISOValue);
64
 
        m_pSurfaceParams->Pipeline->SetSurfColor(1, m_pSurfaceParams->Surface2Props.Red, m_pSurfaceParams->Surface2Props.Green, m_pSurfaceParams->Surface2Props.Blue);
65
 
        m_pSurfaceParams->Pipeline->SetSurfTransparency(1, m_pSurfaceParams->Surface2Props.Alpha);
66
 
 
67
 
        m_pSurfaceParams->Pipeline->SetDataSet(m_pSurfaceParams->DataSetNum, m_pSurfaceParams->Quality);
68
 
 
69
 
        try {
70
 
                m_pSurfaceParams->Pipeline->SetProgressNotifier(this);
71
 
                m_pSurfaceParams->Pipeline->Update();
72
 
                m_pSurfaceParams->Pipeline->SetProgressNotifier(NULL);
73
 
        }
74
 
        catch (...) {
75
 
 
76
 
        }
77
 
}
78
 
 
79
 
void MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::Update()
80
 
{
81
 
        m_pSurfaceParams->Pipeline->Enable(0, m_pSurfaceParams->Surface1Props.Enabled);
82
 
        m_pSurfaceParams->Pipeline->Enable(1, m_pSurfaceParams->Surface2Props.Enabled);
83
 
        m_pSurfaceParams->Pipeline->Render();
84
 
}
85
 
 
86
 
void MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::OnAbort()
87
 
{
88
 
}
89
 
 
90
 
void MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::LiberarRecursos()
91
 
{
92
 
}
93
 
 
94
 
bool MedicalViewer::Reconstruction::Surface::Commands::SurfaceCommand::NotifyReconstructionProgress(const std::string& text, float progress)
95
 
{
96
 
        return NotificarProgreso(progress, text);
97
 
}