forked from FNNDSC/KWWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkKWHeaderAnnotationEditor.h
126 lines (97 loc) · 4.13 KB
/
vtkKWHeaderAnnotationEditor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*=========================================================================
Module: $RCSfile: vtkKWHeaderAnnotationEditor.h,v $
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkKWHeaderAnnotationEditor - a header annotation widget
// .SECTION Description
// A class that provides a UI for header annotation (vtkTextActor).
#ifndef __vtkKWHeaderAnnotationEditor_h
#define __vtkKWHeaderAnnotationEditor_h
#include "vtkKWCheckButtonWithPopupFrame.h"
class vtkKWEntryWithLabel;
class vtkKWPopupButtonWithLabel;
class vtkKWRenderWidget;
class vtkKWTextPropertyEditor;
class vtkTextActor;
class vtkKWFrame;
class KWWidgets_EXPORT vtkKWHeaderAnnotationEditor : public vtkKWCheckButtonWithPopupFrame
{
public:
static vtkKWHeaderAnnotationEditor* New();
vtkTypeMacro(vtkKWHeaderAnnotationEditor,vtkKWCheckButtonWithPopupFrame);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Makes the text property sub-widget popup (instead of displaying the
// whole text property UI, which can be long).
// This has to be called before Create(). Ignored if PopupMode is true.
vtkSetMacro(PopupTextProperty, int);
vtkGetMacro(PopupTextProperty, int);
vtkBooleanMacro(PopupTextProperty, int);
// Description:
// Set/Get the vtkKWRenderWidget that owns the header annotation.
// It is not ref-counted.
virtual void SetRenderWidget(vtkKWRenderWidget*);
vtkGetObjectMacro(RenderWidget, vtkKWRenderWidget);
// Description:
// Set/Get the annotation visibility
virtual void SetVisibility(int i);
virtual int GetVisibility();
vtkBooleanMacro(Visibility, int);
// Description:
// Set/Get the event invoked when the anything in the annotation is changed.
// Defaults to vtkKWEvent::ViewAnnotationChangedEvent
vtkSetMacro(AnnotationChangedEvent, int);
vtkGetMacro(AnnotationChangedEvent, int);
// Description:
// Access to sub-widgets
virtual vtkKWCheckButton* GetHeaderVisibilityButton()
{ return this->GetCheckButton(); };
// Description:
// Update the GUI according to the value of the ivars
void Update();
// Description:
// Update the "enable" state of the object and its internal parts.
// Depending on different Ivars (this->Enabled, the application's
// Limited Edition Mode, etc.), the "enable" state of the object is updated
// and propagated to its internal parts/subwidgets. This will, for example,
// enable/disable parts of the widget UI, enable/disable the visibility
// of 3D widgets, etc.
virtual void UpdateEnableState();
// Description:
// Callbacks. Internal, do not use.
virtual void CheckButtonCallback(int state);
virtual void HeaderTextCallback(const char *value);
virtual void TextPropertyCallback();
protected:
vtkKWHeaderAnnotationEditor();
~vtkKWHeaderAnnotationEditor();
// Description:
// Create the widget.
virtual void CreateWidget();
int AnnotationChangedEvent;
vtkKWRenderWidget *RenderWidget;
// GUI
int PopupTextProperty;
vtkKWFrame *TextFrame;
vtkKWEntryWithLabel *TextEntry;
vtkKWTextPropertyEditor *TextPropertyWidget;
vtkKWPopupButtonWithLabel *TextPropertyPopupButton;
virtual void Render();
virtual void SetHeaderText(const char *txt);
// Get the value that should be used to set the checkbutton state
// (i.e. depending on the value this checkbutton is supposed to reflect,
// for example, an annotation visibility).
// This does *not* return the state of the widget.
virtual int GetCheckButtonState() { return this->GetVisibility(); };
// Send an event representing the state of the widget
virtual void SendChangedEvent();
private:
vtkKWHeaderAnnotationEditor(const vtkKWHeaderAnnotationEditor&); // Not implemented
void operator=(const vtkKWHeaderAnnotationEditor&); // Not Implemented
};
#endif