~ubuntu-branches/ubuntu/utopic/ginkgocadx/utopic-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/widgets/wanotacionesquina.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2014-01-09 07:37:09 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20140109073709-rpuh5x3p3finvtze
Tags: 3.6.0.1228.33+dfsg-1
New upstream release [December 2013]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  
3
 
 *  $Id: wanotacionesquina.h $
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
 
#pragma once
15
 
#include <api/iwidgets.h>
16
 
#include <api/api.h>
17
 
#include <api/ianotador.h>
18
 
#include <api/observers/ieventsobserver.h>
19
 
#include <vector>
20
 
#include <list>
21
 
#include "openglhelper.h"
22
 
 
23
 
#define TAMFUENTE 12.0f
24
 
#define TAMFUENTE_MIN 10.0f
25
 
#define PROPVIEWPORT 0.40f // Proporcion maxima del viewport, tanto de ancho como de alto. (25%)
26
 
 
27
 
namespace GNC {
28
 
        namespace GCS {
29
 
 
30
 
                namespace Widgets {
31
 
 
32
 
                        class EstadoInterno;
33
 
                        class Anotaciones;
34
 
                        class OrientationMarks;
35
 
 
36
 
                        //----------------------------------------------------------------------------------------------------
37
 
                        //region Widget anotador
38
 
                        class EXTAPI WAnotador : public GNC::GCS::Widgets::IWidget, public GNC::GCS::IEventsObserver {
39
 
                        public:
40
 
 
41
 
                                WAnotador(GNC::GCS::IAnotador* annotator, IWidgetsManager* pManager, long vid, const char* nombre, long gid);
42
 
 
43
 
                                ~WAnotador();
44
 
 
45
 
                                virtual void LiberarRecursos(GNC::GCS::IWidgetsRenderer* renderer);
46
 
                        //endregion
47
 
 
48
 
                        //----------------------------------------------------------------------------------------------------
49
 
                        //region "Interfaz generica"
50
 
                        public:
51
 
                                virtual void OnMouseEvents(GNC::GCS::Events::EventoRaton&);
52
 
 
53
 
                                virtual void OnKeyEvents(GNC::GCS::Events::EventoTeclado&);
54
 
 
55
 
                                virtual bool HitTest(float x, float y, const GNC::GCS::Vector& umbral);
56
 
 
57
 
                                virtual bool HitTest(GNC::GCS::Vector* vertices, int numVertices);
58
 
 
59
 
                                virtual void Render(GNC::GCS::Contexto3D* c);
60
 
 
61
 
                                virtual void OffscreenRender(Contexto3D* c);
62
 
 
63
 
                                virtual void Modificar(bool modificar);
64
 
 
65
 
                                virtual void Seleccionar(bool seleccionado);
66
 
 
67
 
                                virtual void Iluminar(bool iluminado);
68
 
 
69
 
                                virtual void Ocultar(bool oculto);
70
 
 
71
 
                                virtual void RecalcularEstaticas(Anotaciones* pAnotaciones, GNC::GCS::Contexto3D* c);
72
 
 
73
 
                                virtual void RecalcularPosicion(OrientationMarks* pAnotaciones, GNC::GCS::Contexto3D* c);
74
 
 
75
 
                        //endregion
76
 
 
77
 
                                //----------------------------------------------------------------------------------------------------
78
 
                                //region "Interfaz especifica"
79
 
                        public:
80
 
                                virtual void SetAnotador(GNC::GCS::IAnotador* anotador);
81
 
                                virtual void SetTextColor(const GNC::GCS::GLHelper::TColor& color);
82
 
                                GNC::GCS::IAnotador* m_pAnnotator;
83
 
                                
84
 
                                //endregion
85
 
 
86
 
                        public:
87
 
 
88
 
                                typedef enum TPosicionAnotacion {
89
 
                                        TP_TopLeft = 0,
90
 
                                        TP_TopRight,
91
 
                                        TP_BottomLeft,
92
 
                                        TP_BottomRight,
93
 
                                        TP_Top,
94
 
                                        TP_Right,
95
 
                                        TP_Bottom,
96
 
                                        TP_Left,
97
 
                                        TP_NumPosiciones
98
 
                                } TPosicionAnotacion;
99
 
 
100
 
                                //endregion
101
 
 
102
 
                                void setVolatileProperty(TPosicionAnotacion pos, bool enabled);
103
 
 
104
 
                                void InvalidarTodas();
105
 
 
106
 
                        //----------------------------------------------------------------------------------------------------
107
 
                        //region "Interfaz de eventos ginkgo"
108
 
                        public:
109
 
 
110
 
                                virtual void ProcesarEvento(GNC::GCS::Events::IEvent *evt);
111
 
 
112
 
                        //endregion
113
 
 
114
 
                        //----------------------------------------------------------------------------------------------------
115
 
                        //region "Estado interno"
116
 
                        protected:
117
 
 
118
 
                                EstadoInterno* m_Estado;                                
119
 
                                GNC::GCS::GLHelper::TColor m_color;
120
 
                                std::string m_CachedPatientPosition;
121
 
 
122
 
                                bool m_volatileProperty[TP_NumPosiciones];
123
 
 
124
 
                        //endregion
125
 
 
126
 
                        };
127
 
                        //endregion
128
 
                }
129
 
        }
130
 
}
 
1
/*
 
2
 *  
 
3
 *  $Id: wanotacionesquina.h $
 
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
#pragma once
 
15
#include <api/iwidgets.h>
 
16
#include <api/api.h>
 
17
#include <api/observers/ieventsobserver.h>
 
18
#include <vector>
 
19
#include <list>
 
20
#include "openglhelper.h"
 
21
 
 
22
#define TAMFUENTE 12.0f
 
23
#define TAMFUENTE_MIN 10.0f
 
24
#define PROPVIEWPORT 0.40f // Proporcion maxima del viewport, tanto de ancho como de alto. (25%)
 
25
 
 
26
namespace GNC {
 
27
        namespace GCS {
 
28
 
 
29
                namespace Widgets {
 
30
 
 
31
                        class EstadoInterno;
 
32
                        class OrientationMarks;
 
33
 
 
34
                        //----------------------------------------------------------------------------------------------------
 
35
                        //region Widget anotador
 
36
                        class EXTAPI WAnotador : public GNC::GCS::Widgets::IWidget {
 
37
                        public:
 
38
 
 
39
                                WAnotador(IWidgetsManager* pManager, long vid, const char* nombre, long gid);
 
40
 
 
41
                                ~WAnotador();
 
42
 
 
43
                                virtual void LiberarRecursos(GNC::GCS::IWidgetsRenderer* renderer);
 
44
                        //endregion
 
45
 
 
46
                        //----------------------------------------------------------------------------------------------------
 
47
                        //region "Interfaz generica"
 
48
                        public:
 
49
                                virtual void OnMouseEvents(GNC::GCS::Events::EventoRaton&);
 
50
 
 
51
                                virtual void OnKeyEvents(GNC::GCS::Events::EventoTeclado&);
 
52
 
 
53
                                virtual bool HitTest(float x, float y, const GNC::GCS::Vector& umbral);
 
54
 
 
55
                                virtual bool HitTest(GNC::GCS::Vector* vertices, int numVertices);
 
56
 
 
57
                                virtual void Render(GNC::GCS::Contexto3D* c);
 
58
 
 
59
                                virtual void OffscreenRender(Contexto3D* c);
 
60
                                
 
61
                                virtual void Seleccionar(bool seleccionado);
 
62
 
 
63
                                virtual void Iluminar(bool iluminado);
 
64
 
 
65
                                virtual void Ocultar(bool oculto);
 
66
                                
 
67
                                virtual void RecalcularPosicion(OrientationMarks* pAnotaciones, GNC::GCS::Contexto3D* c);
 
68
 
 
69
                        //endregion
 
70
 
 
71
                                //----------------------------------------------------------------------------------------------------
 
72
                                //region "Interfaz especifica"
 
73
                        public:
 
74
                                virtual void SetTextColor(const GNC::GCS::GLHelper::TColor& color);                             
 
75
                                //endregion
 
76
 
 
77
                        public:
 
78
 
 
79
                                typedef enum TPosicionAnotacion {
 
80
                                        TP_TopLeft = 0,
 
81
                                        TP_TopRight,
 
82
                                        TP_BottomLeft,
 
83
                                        TP_BottomRight,
 
84
                                        TP_Top,
 
85
                                        TP_Right,
 
86
                                        TP_Bottom,
 
87
                                        TP_Left,
 
88
                                        TP_NumPosiciones
 
89
                                } TPosicionAnotacion;
 
90
 
 
91
                                //endregion
 
92
 
 
93
 
 
94
                        
 
95
 
 
96
                        //endregion
 
97
 
 
98
                        //----------------------------------------------------------------------------------------------------
 
99
                        //region "Estado interno"
 
100
                        protected:
 
101
 
 
102
                                EstadoInterno* m_Estado;                                
 
103
                                GNC::GCS::GLHelper::TColor m_color;
 
104
                                
 
105
                        //endregion
 
106
 
 
107
                        };
 
108
                        //endregion
 
109
 
 
110
                        /**
 
111
                        * Gets the orientation index given string. Default is zero.
 
112
                        * strPos: The patient position string (HFS, HFP...)
 
113
                        * defautlunknown: When orientation index is empty, set the default index to unknown ("?") or empty ("") values
 
114
                        **/
 
115
                        int EXTAPI GetOrientationIndex(const std::string& strPos, bool defaultunknown);
 
116
 
 
117
                        /**
 
118
                        * Gets the patient orientation char ("R", "L", "S"...) from:
 
119
                        * patientPosIndex: The patient position index: get if from GetOrientationIndex() call.
 
120
                        * axis: The axis: 0==x, 1==y, 2==z
 
121
                        * dir: The direction: -1 == decreasing, +1 == decreasing
 
122
                        **/
 
123
                        const char* EXTAPI GetOrientationChar(int patientPosIndex, int axis, int dir);
 
124
                }
 
125
        }
 
126
}