ARB
ED4_consensus.cxx
Go to the documentation of this file.
1 // =============================================================== //
2 // //
3 // File : ED4_consensus.cxx //
4 // Purpose : consensus control functions //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // =============================================================== //
10 
11 
12 #include "ed4_class.hxx"
13 #include "ed4_awars.hxx"
14 #include "ed4_seq_colors.hxx"
15 
16 #include <aw_root.hxx>
17 #include <aw_awar.hxx>
18 
19 #define CONSENSUS_AWAR_SOURCE CAS_EDIT4
20 #include <consensus.h>
21 
22 // ------------------------
23 // Build consensus
24 
26  if (!cons_param) cons_param = new ConsensusBuildParams(aw_root);
27  return *cons_param;
28 }
29 
31  if (cons_param) {
32  delete cons_param;
33  cons_param = NULp;
34  }
35 }
36 
39 
41  if (ref->reference_is_a_consensus()) {
42  ref->data_changed_cb(NULp);
44  }
45  else {
47  }
48 }
49 
50 static ARB_ERROR toggle_consensus_display(ED4_base *base, bool show) {
51  if (base->is_consensus_manager()) {
52  ED4_manager *consensus_man = base->to_manager();
53  ED4_spacer_terminal *spacer = consensus_man->parent->get_defined_level(LEV_SPACER)->to_spacer_terminal();
54 
55  if (show) {
56  consensus_man->unhide_children();
57  }
58  else {
59  consensus_man->hide_children();
60  }
61  spacer->resize_dynamic();
62  }
63 
64  return NULp;
65 }
66 
68  bool show = root->awar(ED4_AWAR_CONSENSUS_SHOW)->read_int();
70 }
71 
void unhide_children()
Definition: ED4_base.cxx:830
void reset_consensus_params()
ED4_base * get_defined_level(ED4_level lev) const
Definition: ED4_base.cxx:696
long read_int() const
Definition: AW_awar.cxx:187
ED4_reference * reference
Definition: ed4_class.hxx:1447
ED4_root * ED4_ROOT
Definition: ED4_main.cxx:48
ED4_manager * parent
Definition: ed4_class.hxx:921
#define ED4_AWAR_CONSENSUS_SHOW
Definition: ed4_awars.hxx:51
void ED4_consensus_display_changed(AW_root *root)
void request_refresh_for_specific_terminals(ED4_level lev)
Definition: ED4_root.cxx:87
bool is_consensus_manager() const
Definition: ed4_class.hxx:1842
void hide_children()
Definition: ED4_base.cxx:819
void expect_no_error() const
Definition: arb_error.h:136
void data_changed_cb(ED4_species_manager *calledFrom)
ED4_root_group_manager * root_group_man
Definition: ed4_class.hxx:1436
ARB_ERROR route_down_hierarchy(const ED4_route_cb &cb) FINAL_OVERRIDE
Definition: ED4_base.cxx:392
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
static ARB_ERROR toggle_consensus_display(ED4_base *base, bool show)
void ED4_consensus_definition_changed(AW_root *)
const ConsensusBuildParams & get_consensus_params()
AW_root * aw_root
Definition: ed4_class.hxx:1429
bool reference_is_a_consensus() const
#define NULp
Definition: cxxforward.h:97
void request_refresh_for_consensus_terminals()
Definition: ED4_root.cxx:103