ALBA
albaGUILutHistogramSwatch.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUILutHistogramSwatch
5 Authors: Crimi Gianluigi
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 __albaGUILutSwatch_H__
18#define __albaGUILutSwatch_H__
19
20#include "albaDefines.h"
21#include "albaEvent.h"
22#include "vtkLookupTable.h"
23#include "albaServiceClient.h"
24#include "albaAbsLogicManager.h"
25
26//----------------------------------------------------------------------------
30class vtkDataSet;
32class albaGUI;
33
34class ALBA_EXPORT albaGUILutHistogramSwatch: public wxPanel, public albaServiceClient
35{
36public:
38 albaGUILutHistogramSwatch(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(184,18), long style = wxTAB_TRAVERSAL );
39
41 albaGUILutHistogramSwatch::albaGUILutHistogramSwatch(albaGUI *parent, wxWindowID id, wxString name, vtkDataSet *dataSet, mmaVolumeMaterial *material, wxSize size = wxSize(184,18), bool showText=true);
42
45
47 void SetDataSet(vtkDataSet *dataSet);
48
54 void SetEditable(bool b) {m_Editable = b;};
55
57 void ShowThreshold(bool b);
58
60 void EnableOverHighlight(bool b) {m_OverHighlight=b;};
61
63 bool IsEditable(){return m_Editable;};
64
65 /* method for updating GUI on LUT update */
66 void Modified();
67
69 virtual void SetListener(albaObserver *Listener) {m_Listener = Listener;};
70
72 virtual albaObserver *GetListener() {return m_Listener;};
73
74
75protected:
77
78 wxBitmap m_Bmp;
80 void OnEraseBackground(wxEraseEvent& event) {};
82 void OnPaint(wxPaintEvent &event);
83 /* Update Function */
84 void Update();
85
86 /* If Editable run albaGUILutHistogramEditor */
87 void OnLeftMouseButtonDown(wxMouseEvent &event);
88 /* Do nothing */
89 void OnLeftMouseButtonUp(wxMouseEvent &event);
90 /* Show/update the label */
91 void OnMouseMotion(wxMouseEvent &event);
92
94 void OnSize(wxSizeEvent &event);
95
96 /* Get the lut index by the x position over the widget */
97 int GetLutIndexByPos(float fullWidth, float x);
98
104 vtkLookupTable *m_Lut;
105 vtkDataSet *m_DataSet;
106
107 // widgets
109 wxString m_Tip;
111 unsigned long m_UpdateTime;
113 wxFont m_Font;
114 DECLARE_EVENT_TABLE()
115};
116#endif
virtual albaObserver * GetListener()
Get the event listener.
virtual void SetListener(albaObserver *Listener)
Set the event listener.
void SetMaterial(mmaVolumeMaterial *material)
Set the Lock Up Table.
void OnLeftMouseButtonUp(wxMouseEvent &event)
void EnableOverHighlight(bool b)
Activate/Deactivate threshold view on LUT.
void OnMouseMotion(wxMouseEvent &event)
void ShowThreshold(bool b)
Activate/Deactivate threshold view on LUT.
albaGUILutHistogramSwatch(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(184, 18), long style=wxTAB_TRAVERSAL)
constructor.
bool IsEditable()
return true if the pop-up menu is enabled
void OnPaint(wxPaintEvent &event)
OnPaint event handler.
int GetLutIndexByPos(float fullWidth, float x)
void OnLeftMouseButtonDown(wxMouseEvent &event)
void SetDataSet(vtkDataSet *dataSet)
Set the VME for the histogram.
void OnEraseBackground(wxEraseEvent &event)
overrided to prevent flickering
void SetEditable(bool b)
-if b=true LeftMouseButtonDown will pop-up the LutEditor -the user is notified anyway -default = fals...
void OnSize(wxSizeEvent &event)
Update the panel when resized.
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