ALBA
albaTextKit.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaTextKit
5 Authors: Paolo Quadrani
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaTextKit_H__
18#define __albaTextKit_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include "albaEvent.h"
24#include "albaObserver.h"
25#include "albaServiceClient.h"
26#include "albaAbsLogicManager.h"
27
28//----------------------------------------------------------------------------
29// forward references :
30//----------------------------------------------------------------------------
31class albaGUI;
32class vtkRenderer;
33class vtkActor2D;
34class vtkTextMapper;
35
36//----------------------------------------------------------------------------
37// albaTextKit :
38//----------------------------------------------------------------------------
43class ALBA_EXPORT albaTextKit : public albaObserver, public albaServiceClient
44{
45public:
46 albaTextKit(wxWindow* parent, vtkRenderer *renderer, albaObserver *Listener = NULL);
48
49 void OnEvent(albaEventBase *alba_event);
50 void SetListener(albaObserver *Listener) {m_Listener = Listener;};
51
53 {
54 UPPER_LEFT = 0,
62 LOWER_RIGHT
63 };
64
66 void SetText(const char *text);
67
69 void SetTextPosition(double nv_x, double nv_y);
70
72 void SetTextColor(int textColor[3]);
73 void SetTextColor(int textColorRed,int textColorGreen,int textColorBlue );
74
76 void SetTextSize(int size);
77
79 void SetTextAlignment(int align = UPPER_LEFT);
80
82 albaGUI *GetGui() {return m_Gui;};
83
84protected:
86 void CreateGui();
87
91 double m_TextPosition[2];
93 double m_TextOffset;
94 wxColor m_TextColor;
95
96 vtkTextMapper *m_TextMapper;
97 vtkActor2D *m_TextActor;
98
101 vtkRenderer *m_TextRenderer;
102 wxWindow *m_ParentPanel;
103};
104#endif
Implementation of the message object for the Subject/Observer design pattern.
Definition: albaEventBase.h:49
albaGUI is a panel with function to easily create GUI.
Definition: albaGUI.h:110
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36
albaString - performs common string operations on c-strings.
Definition: albaString.h:43
albaTextKit is tool to visualize text into a given albaRWI.
Definition: albaTextKit.h:44
wxColor m_TextColor
Color applied to text.
Definition: albaTextKit.h:94
int m_TextAlign
Definition: albaTextKit.h:89
vtkActor2D * m_TextActor
Definition: albaTextKit.h:97
int m_ShowText
Definition: albaTextKit.h:88
albaString m_TextInView
Text visualized inside the view.
Definition: albaTextKit.h:92
int m_TextSize
Definition: albaTextKit.h:90
void SetTextColor(int textColor[3])
Allow to change the text color.
wxWindow * m_ParentPanel
Definition: albaTextKit.h:102
albaGUI * GetGui()
Returns the albaTextKit's GUI.
Definition: albaTextKit.h:82
void SetTextSize(int size)
Allow to change the font size.
void SetTextColor(int textColorRed, int textColorGreen, int textColorBlue)
void SetTextAlignment(int align=UPPER_LEFT)
Align text into the render window.
TEXT_KIT_ALIGN_MODALITY
Definition: albaTextKit.h:53
void SetText(const char *text)
Insert a text into the render window.
void CreateGui()
Create GUI for AttachCamera module.
albaObserver * m_Listener
Definition: albaTextKit.h:99
double m_TextOffset
Offset in positioning the text.
Definition: albaTextKit.h:93
albaGUI * m_Gui
Definition: albaTextKit.h:100
vtkTextMapper * m_TextMapper
Definition: albaTextKit.h:96
void OnEvent(albaEventBase *alba_event)
process the events sent by subjects
void SetTextPosition(double nv_x, double nv_y)
Position the text into the render window at normalized view's position x,y.
vtkRenderer * m_TextRenderer
Definition: albaTextKit.h:101
void SetListener(albaObserver *Listener)
Definition: albaTextKit.h:50
albaTextKit(wxWindow *parent, vtkRenderer *renderer, albaObserver *Listener=NULL)