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

« back to all changes in this revision

Viewing changes to src/cadxcore/api/ivista.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: ivista.h 3763 2011-04-25 12:07:55Z 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
#pragma once
 
14
#include <api/api.h>
 
15
#include <api/globals.h>
 
16
#include <api/ilock.h>
 
17
#include <string>
 
18
#include <vector>
 
19
#include <yasper/yasper.h>
 
20
 
 
21
 
 
22
//----------------------------------------------------------------------------------------------------
 
23
//region Forward Declarations
 
24
 
 
25
class wxWindow;
 
26
class vtkAlgorithmOutput;
 
27
class vtkImageData;
 
28
 
 
29
namespace GNC{
 
30
        namespace GCS {
 
31
                class IControladorModulo;
 
32
                class IContextoEstudio;
 
33
                class IHerramienta;
 
34
                class IComando;
 
35
        }
 
36
}
 
37
 
 
38
namespace GIL {
 
39
        class IModeloIntegracion;
 
40
}
 
41
//endregion
 
42
 
 
43
 
 
44
namespace GNC {
 
45
        namespace GCS {
 
46
 
 
47
//----------------------------------------------------------------------------------------------------
 
48
//region Excepcion de tipo vista
 
49
                class EXTAPI VistaException : public std::exception {
 
50
                public:
 
51
                        VistaException(const std::string& msg, const std::string& componente="Modelo", bool fatal = true) throw();
 
52
 
 
53
                        ~VistaException() throw();
 
54
 
 
55
                        const std::string& GetComponent() const;
 
56
 
 
57
                        const std::string& GetCause() const;
 
58
 
 
59
                        std::string GetFullCause() const;
 
60
 
 
61
                        bool IsFatal()  const;
 
62
 
 
63
                        operator const std::string () const;
 
64
 
 
65
                        friend std::ostream& operator<<(std::ostream& out, const VistaException& ex);
 
66
 
 
67
                        friend std::ostream& operator<<(std::ostream& out, const VistaException* ex);
 
68
 
 
69
                protected:
 
70
                        std::string cause;
 
71
                        std::string component;
 
72
                        bool fatal;
 
73
                };
 
74
//endregion
 
75
 
 
76
//----------------------------------------------------------------------------------------------------
 
77
//region Interfaz de vistas
 
78
 
 
79
                class EXTAPI IVista : public GNC::GCS::ILockable {
 
80
                public:
 
81
 
 
82
                        /* Constructor */
 
83
                        IVista(const GnkPtr<GNC::GCS::IContextoEstudio>& estudio);
 
84
 
 
85
                        /* Destructor */
 
86
                        virtual ~IVista();
 
87
 
 
88
                        virtual std::string& GetTitulo();
 
89
 
 
90
                        virtual wxWindow* GetWindow() = 0;
 
91
 
 
92
                        virtual bool SoportaHerramienta(GNC::GCS::IHerramienta* pHerramienta);
 
93
 
 
94
                        virtual bool SoportaGuardar() = 0;
 
95
 
 
96
                        virtual bool SoportaExportar() = 0;
 
97
 
 
98
                        /* Notificacion de cambio en la configuracion */
 
99
                        virtual void OnConfiguracionCambiada();
 
100
 
 
101
                        virtual void Activar();
 
102
 
 
103
                        virtual void Desactivar();
 
104
 
 
105
                        /* Obtiene el identificador unico del modulo al que pertenece */
 
106
                        virtual const std::string& GetUIDModulo();
 
107
 
 
108
                        /* Obtiene el modulo al que pertenece */
 
109
                        virtual GNC::GCS::IControladorModulo* GetModulo();
 
110
 
 
111
                        GnkPtr<GNC::GCS::IContextoEstudio>& GetEstudio();
 
112
 
 
113
                        virtual bool EstaCargada();
 
114
 
 
115
                        virtual bool EstaModificada();
 
116
 
 
117
                        virtual void SetCargada(bool cargada = true);
 
118
 
 
119
                        virtual bool Guardar();
 
120
 
 
121
                        virtual const std::vector<std::string> GetRutasImagenes() const;
 
122
                        virtual const std::vector<std::string> GetRutasDiagnosticos() const;
 
123
 
 
124
                        virtual void ActivarRuta(const std::string& path);
 
125
 
 
126
                        //----------------------------------------------------------------------------------------------------
 
127
                        //region Interfaz de Carga
 
128
 
 
129
                        // Comienzo de carga. Metodo sincrono con la interfaz.
 
130
                        virtual void OnCargaIniciada() = 0;
 
131
 
 
132
                        // Paso 1: Cargar el estudio. Metodo NO sincrono con la interfaz.
 
133
                        virtual void CargarEstudio(GNC::GCS::IComando* pCmdInvocador) = 0;
 
134
 
 
135
                        // Finalizacion de la carga. Metodo sincrono con la interfaz.
 
136
                        virtual void OnCargaFinalizada() = 0;
 
137
 
 
138
                        // Paso 2: Inicializacion del pipeline. Metodo sincrono con la interfaz.
 
139
                        virtual void IniciarPipeline() = 0;
 
140
 
 
141
                        // Parada del pipeline. Metodo sincrono con la interfaz Se invoca en el caso de que ocurra un error de carga.
 
142
                        virtual void DetenerPipeline() = 0;
 
143
 
 
144
                        //endregion
 
145
 
 
146
                private:
 
147
                        // Estudio is a pointer to GnkPtr to avoid circular dependencies.
 
148
                        GnkPtr<GNC::GCS::IContextoEstudio>* Estudio;
 
149
 
 
150
                protected:
 
151
                        std::string                        m_Titulo;
 
152
 
 
153
                        bool                               m_Activada;
 
154
                        bool                               m_Cargada;
 
155
                        bool                               m_Guardada;
 
156
 
 
157
                };
 
158
        }
 
159
}