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

« back to all changes in this revision

Viewing changes to src/fooextension/fooextension/commands/dicomizecommand.h

  • 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: dicomizecommand.h 3681 2011-04-12 10:53:31Z tovar $
 
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
#pragma once
 
15
//#define _GINKGO_TRACE
 
16
#include <api/globals.h>
 
17
#include <api/icomando.h>
 
18
#include <api/imgproxy.h>
 
19
#include <api/ientorno.h>
 
20
#include <api/icontroladoreventos.h>
 
21
#include <api/imodelointegracion.h>
 
22
#include <fooextension/gui/importation/importationpersistentdata.h>
 
23
 
 
24
#include <wx/xml/xml.h>
 
25
#include <wx/thread.h>
 
26
 
 
27
 
 
28
namespace FooExtension {
 
29
        namespace GADAPI {
 
30
 
 
31
                //data that command uses is defined in the parameters class, this class will be deleted when command is destroyed
 
32
                class DicomizeCommandParameters : public GNC::GCS::IComandoParams {
 
33
                public:
 
34
                        DicomizeCommandParameters(GnkPtr< ::FooExtension::GUI::ImportationPersistentData > pDatosPersistentes, GNC::GCS::IEntorno* pEntorno) ;
 
35
 
 
36
                        //if you reserve memory in the parameters you have to define virtual destructor
 
37
                        virtual ~DicomizeCommandParameters() ;
 
38
 
 
39
                public:
 
40
                        GnkPtr< ::FooExtension::GUI::ImportationPersistentData > m_pPersistentData;
 
41
                        GNC::GCS::IEntorno* m_pEntorno;
 
42
 
 
43
                        std::string m_TmpDir;
 
44
                        std::string m_errorMessage;
 
45
                };
 
46
 
 
47
 
 
48
                //command of dicomization, all commands has one part executed in background and another synchronized with interface
 
49
                class DicomizeCommand : public GNC::GCS:: IComando {
 
50
                public:
 
51
                        //receives parameters used in processing
 
52
                        DicomizeCommand(DicomizeCommandParameters* pParams);
 
53
 
 
54
                 protected:
 
55
                        //this part is executed in background, it can't call interface methods neither asks for user interaction
 
56
                        virtual void Execute();
 
57
 
 
58
                        //this method is called after execute is performed, is synchronized with user interface
 
59
                        virtual void Update();
 
60
                        
 
61
                        //called when command is aborted
 
62
                        virtual void OnAbort();
 
63
 
 
64
                protected:
 
65
                        bool ImportFiles();
 
66
 
 
67
                        bool CopyDICOMToGinkgoCADx();
 
68
 
 
69
                        bool RemoveTempDir(const wxString& dirPath);
 
70
 
 
71
                        DicomizeCommandParameters* m_pDicomizationParameters;
 
72
                };
 
73
        }
 
74
}