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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-05-02 08:09:26 UTC
  • Revision ID: james.westby@ubuntu.com-20110502080926-bql5wep49c7hg91t
Tags: upstream-2.4.1.1
ImportĀ upstreamĀ versionĀ 2.4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  $Id: volumecommand.cpp 3387 2011-02-23 09:33:54Z 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 "volumecommand.h"
 
19
#include "voiextractioncommand.h"
 
20
#include "../pipelines/volumepipeline.h"
 
21
 
 
22
MedicalViewer::Reconstruction::Volume::Commands::VolumeCommandParams::VolumeCommandParams(
 
23
        const GnkPtr<TPipeline>& pipeline,
 
24
        unsigned int datasetNum,
 
25
        double reductionFactor,
 
26
        double window,
 
27
        double level,
 
28
        TBlendType blendType
 
29
        ) : Pipeline(pipeline), DataSetNum(datasetNum), ReductionFactor(reductionFactor), Window(window), Level(level), BlendType(blendType)
 
30
{
 
31
}
 
32
 
 
33
MedicalViewer::Reconstruction::Volume::Commands::VolumeCommandParams::~VolumeCommandParams()
 
34
{
 
35
}
 
36
 
 
37
//====================================================================
 
38
 
 
39
MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::VolumeCommand(VolumeCommandParams* pParams) : GNC::GCS::IComando(pParams, "VolumeReconstruction" )
 
40
{
 
41
        m_pVolumeParams = pParams;
 
42
        SetId(IDC_VOLUME_RECONSTRUCTION);
 
43
        CancelaA(IDC_VOLUME_RECONSTRUCTION);
 
44
        EsperaA(IDC_VOI_EXTRACTION);    
 
45
}
 
46
 
 
47
MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::~VolumeCommand(void)
 
48
{
 
49
}
 
50
 
 
51
void MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::Execute()
 
52
{
 
53
 
 
54
        m_pVolumeParams->Pipeline->SetDataSet(m_pVolumeParams->DataSetNum, m_pVolumeParams->ReductionFactor);
 
55
        m_pVolumeParams->Pipeline->SetWindowLevel(m_pVolumeParams->Window, m_pVolumeParams->Level);
 
56
        m_pVolumeParams->Pipeline->SetBlendingType(m_pVolumeParams->BlendType);
 
57
 
 
58
        try {
 
59
                m_pVolumeParams->Pipeline->SetProgressNotifier(this);
 
60
                m_pVolumeParams->Pipeline->Update();
 
61
                m_pVolumeParams->Pipeline->SetProgressNotifier(NULL);
 
62
        }
 
63
        catch (...) {
 
64
 
 
65
        }
 
66
}
 
67
 
 
68
void MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::Update()
 
69
{
 
70
        
 
71
        m_pVolumeParams->Pipeline->Enable(true);
 
72
        m_pVolumeParams->Pipeline->Render();
 
73
}
 
74
 
 
75
void MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::OnAbort()
 
76
{
 
77
}
 
78
 
 
79
void MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::LiberarRecursos()
 
80
{
 
81
}
 
82
 
 
83
bool MedicalViewer::Reconstruction::Volume::Commands::VolumeCommand::NotifyReconstructionProgress(const std::string& text, float progress)
 
84
{
 
85
        return NotificarProgreso(progress, text);
 
86
}