ARB
SaiProbeVisualization.hxx
Go to the documentation of this file.
1 #ifndef SAIPROBEVISUALIZATION_HXX
2 #define SAIPROBEVISUALIZATION_HXX
3 
4 #ifndef _GLIBCXX_CCTYPE
5 #include <cctype>
6 #endif
7 #ifndef _GLIBCXX_VECTOR
8 #include <vector>
9 #endif
10 #ifndef AWT_CANVAS_HXX
11 #include <awt_canvas.hxx>
12 #endif
13 
14 #include <string>
15 
16 #define sai_assert(cond) arb_assert(cond)
17 
18 #define AWAR_SPV_SAI_2_PROBE "sai_visualize/sai_2_probe"
19 #define AWAR_SPV_DISP_SAI "sai_visualize/disp_sai"
20 #define AWAR_SPV_SAI_COLOR "sai_visualize/probeSai/color_0"
21 
22 #define AWAR_SPV_DB_FIELD_NAME "sai_visualize/db_field_name"
23 #define AWAR_SPV_DB_FIELD_WIDTH "sai_visualize/db_field_width"
24 #define AWAR_SPV_ACI_COMMAND "sai_visualize/aci_command"
25 #define AWAR_SPV_SELECTED_PROBE "sai_visualize/selected_probe"
26 
27 #define SAI_CLR_COUNT 10
28 
29 enum {
33 };
34 
35 enum {
39 
42 
44 };
45 
46 // global data for interaction with probe match result list:
47 
48 class saiProbeData : virtual Noncopyable { // Note: also used for ProbeCollection!
49  std::string probeTarget;
50  std::string headline; // needed for ProbeMatchParser
51 
52 public:
53 
54  std::vector<std::string> probeSpecies;
55  std::vector<std::string> probeSeq;
56 
57  saiProbeData() : probeTarget("<notarget>"), headline() {}
59  probeSpecies.clear();
60  probeSeq.clear();
61  }
62 
63  const char *getProbeTarget() const {
64  // sai_assert(probeTarget.length() > 0); // always need a target
65  return probeTarget.c_str();
66  }
67  size_t getProbeTargetLen() const {
68  return probeTarget.length();
69  }
70  const char *getHeadline() const { return headline.c_str(); }
71 
72  void setProbeTarget(const char *target) {
73  sai_assert(target);
74 
75  unsigned int len = strlen(target);
76  char temp[len+1];
77  for (unsigned int i = 0; i < len; i++) {
78  temp[i] = toupper(target[i]); // converting the Bases to Upper case
79  }
80  temp[len] = '\0';
81  probeTarget = temp;
82  }
83  void setHeadline(const char *hline) {
84  sai_assert(hline);
85  headline = hline;
86  }
87 };
88 
89 struct SAI_graphic : public AWT_nonDB_graphic, virtual Noncopyable {
92 
93  SAI_graphic(AW_root *aw_root, GBDATA *gb_main);
95 
97 
98  void show(AW_device *device) OVERRIDE;
99  void handle_command(AW_device *device, AWT_graphic_event& event) OVERRIDE;
100  void paint(AW_device *device);
101 
102 };
103 
104 AW_window *createSaiProbeMatchWindow(AW_root *awr, GBDATA *gb_main);
106 
107 #else
108 #error SaiProbeVisualization.hxx included twice
109 #endif
void paint(AW_device *device)
return string(buffer, length)
std::vector< std::string > probeSeq
const char * getProbeTarget() const
size_t getProbeTargetLen() const
SAI_graphic(AW_root *aw_root, GBDATA *gb_main)
void setHeadline(const char *hline)
const char * getHeadline() const
AW_gc_manager * init_devices(AW_window *, AW_device *, AWT_canvas *scr) OVERRIDE
void show(AW_device *device) OVERRIDE
std::vector< std::string > probeSpecies
void handle_command(AW_device *device, AWT_graphic_event &event) OVERRIDE
#define OVERRIDE
Definition: cxxforward.h:93
AW_window * createSaiProbeMatchWindow(AW_root *awr, GBDATA *gb_main)
void setProbeTarget(const char *target)
#define sai_assert(cond)
void transferProbeData(saiProbeData *spd)