3
* $Id: wanotacionesquina.h $
6
* Copyright 2008-14 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
15
#include <api/iwidgets.h>
17
#include <api/ianotador.h>
18
#include <api/observers/ieventsobserver.h>
21
#include "openglhelper.h"
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%)
34
class OrientationMarks;
36
//----------------------------------------------------------------------------------------------------
37
//region Widget anotador
38
class EXTAPI WAnotador : public GNC::GCS::Widgets::IWidget, public GNC::GCS::IEventsObserver {
41
WAnotador(GNC::GCS::IAnotador* annotator, IWidgetsManager* pManager, long vid, const char* nombre, long gid);
45
virtual void LiberarRecursos(GNC::GCS::IWidgetsRenderer* renderer);
48
//----------------------------------------------------------------------------------------------------
49
//region "Interfaz generica"
51
virtual void OnMouseEvents(GNC::GCS::Events::EventoRaton&);
53
virtual void OnKeyEvents(GNC::GCS::Events::EventoTeclado&);
55
virtual bool HitTest(float x, float y, const GNC::GCS::Vector& umbral);
57
virtual bool HitTest(GNC::GCS::Vector* vertices, int numVertices);
59
virtual void Render(GNC::GCS::Contexto3D* c);
61
virtual void OffscreenRender(Contexto3D* c);
63
virtual void Modificar(bool modificar);
65
virtual void Seleccionar(bool seleccionado);
67
virtual void Iluminar(bool iluminado);
69
virtual void Ocultar(bool oculto);
71
virtual void RecalcularEstaticas(Anotaciones* pAnotaciones, GNC::GCS::Contexto3D* c);
73
virtual void RecalcularPosicion(OrientationMarks* pAnotaciones, GNC::GCS::Contexto3D* c);
77
//----------------------------------------------------------------------------------------------------
78
//region "Interfaz especifica"
80
virtual void SetAnotador(GNC::GCS::IAnotador* anotador);
81
virtual void SetTextColor(const GNC::GCS::GLHelper::TColor& color);
82
GNC::GCS::IAnotador* m_pAnnotator;
88
typedef enum TPosicionAnotacion {
102
void setVolatileProperty(TPosicionAnotacion pos, bool enabled);
104
void InvalidarTodas();
106
//----------------------------------------------------------------------------------------------------
107
//region "Interfaz de eventos ginkgo"
110
virtual void ProcesarEvento(GNC::GCS::Events::IEvent *evt);
114
//----------------------------------------------------------------------------------------------------
115
//region "Estado interno"
118
EstadoInterno* m_Estado;
119
GNC::GCS::GLHelper::TColor m_color;
120
std::string m_CachedPatientPosition;
122
bool m_volatileProperty[TP_NumPosiciones];
3
* $Id: wanotacionesquina.h $
6
* Copyright 2008-14 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
15
#include <api/iwidgets.h>
17
#include <api/observers/ieventsobserver.h>
20
#include "openglhelper.h"
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%)
32
class OrientationMarks;
34
//----------------------------------------------------------------------------------------------------
35
//region Widget anotador
36
class EXTAPI WAnotador : public GNC::GCS::Widgets::IWidget {
39
WAnotador(IWidgetsManager* pManager, long vid, const char* nombre, long gid);
43
virtual void LiberarRecursos(GNC::GCS::IWidgetsRenderer* renderer);
46
//----------------------------------------------------------------------------------------------------
47
//region "Interfaz generica"
49
virtual void OnMouseEvents(GNC::GCS::Events::EventoRaton&);
51
virtual void OnKeyEvents(GNC::GCS::Events::EventoTeclado&);
53
virtual bool HitTest(float x, float y, const GNC::GCS::Vector& umbral);
55
virtual bool HitTest(GNC::GCS::Vector* vertices, int numVertices);
57
virtual void Render(GNC::GCS::Contexto3D* c);
59
virtual void OffscreenRender(Contexto3D* c);
61
virtual void Seleccionar(bool seleccionado);
63
virtual void Iluminar(bool iluminado);
65
virtual void Ocultar(bool oculto);
67
virtual void RecalcularPosicion(OrientationMarks* pAnotaciones, GNC::GCS::Contexto3D* c);
71
//----------------------------------------------------------------------------------------------------
72
//region "Interfaz especifica"
74
virtual void SetTextColor(const GNC::GCS::GLHelper::TColor& color);
79
typedef enum TPosicionAnotacion {
98
//----------------------------------------------------------------------------------------------------
99
//region "Estado interno"
102
EstadoInterno* m_Estado;
103
GNC::GCS::GLHelper::TColor m_color;
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
115
int EXTAPI GetOrientationIndex(const std::string& strPos, bool defaultunknown);
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
123
const char* EXTAPI GetOrientationChar(int patientPosIndex, int axis, int dir);