Free Electron
DrawAttributeLabels.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __dataui_DrawAttributeLabels_h__
8 #define __dataui_DrawAttributeLabels_h__
9 
10 #include <dataui/dataui.pmh>
11 
12 #include "viewer/DrawView.h"
13 namespace fe
14 {
15 namespace ext
16 {
17 
18 /** draw names
19 
20  Use AsAttributeLabel records in the "input" RecordGroup to specify
21  labels and attributes.
22 
23  @copydoc DrawNames_info
24  */
25 class FE_DL_EXPORT DrawAttributeLabels :
26  public Initialize<DrawAttributeLabels>,
27  virtual public Config,
28  virtual public HandlerI
29 {
30  public:
31  DrawAttributeLabels(void);
32 virtual ~DrawAttributeLabels(void);
33  void initialize(void);
34 
35 virtual void handle(Record &r_sig);
36 virtual void handleBind( sp<SignalerI> spSignalerI,
37  sp<Layout> l_sig);
38 
39  private:
40  class Label
41  {
42  public:
43  String m_name;
44  Vector2 m_offset;
45  };
46  class AnnoLabel
47  {
48  public:
49  String m_label;
50  String m_name;
51  Vector2 m_offset;
52  };
53  DrawView m_drawview;
54  AsProjected m_asProjected;
55  std::vector<Label> m_attrs;
56  std::vector<AnnoLabel> m_labels;
57  StringAccessor m_aString;
58 };
59 
60 class AsAttributeLabel : public AccessorSet, public Initialize<AsAttributeLabel>
61 {
62  public:
63  AsAttributeLabel(void){}
64  void initialize(void)
65  {
66  add(name, FE_USE("dataui:name"));
67  add(label, FE_USE("dataui:label"));
68  add(offset, FE_USE("dataui:offset"));
69  }
70 
71  Accessor<String> name;
72  Accessor<String> label;
73  Accessor<Vector2> offset;
74 };
75 
76 
77 } /* namespace ext */
78 } /* namespace fe */
79 
80 #endif /* __dataui_DrawAttributeLabels_h__ */
81 
Convienience base class for specification and use of path accessors.
Definition: Config.h:19
Set of accessors.
Definition: AccessorSet.h:18
kernel
Definition: namespace.dox:3
Access attributes as string lists, one string per sub item.
Definition: StringAccessor.h:26
Per-class participation in the Initialized <> mechanism.
Definition: Initialized.h:117
Interface to handle signals from an SignalerI.
Definition: HandlerI.h:22
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordSB.h:35
draw names
Definition: DrawAttributeLabels.h:25
Helper class for draw operators (handlers)
Definition: DrawView.h:22
projected
Definition: windowAS.h:242