42 void call()
const { (instance->*member_fun)(
this); }
76 return fill_translation_table(edit4_sym, trans_sym);
124 void SEC_db_interface::reload_sequence(
const SEC_dbcb *
cb) {
129 bool had_sequence = sequence;
134 Host.announce_current_species(species_name);
136 if (
bool(sequence) != had_sequence) scr->request_zoom_reset();
139 scr->request_refresh();
144 void SEC_db_interface::reload_ecoli(
const SEC_dbcb *cb) {
153 ecoli_seq =
new SEC_seq_data(gb_ecoli, aliname, cb);
156 Ecoli->
init(ecoli_seq->sequence(), ecoli_seq->length());
164 scr->request_refresh();
167 void SEC_db_interface::reload_helix(
const SEC_dbcb *cb) {
171 delete helix_nr; helix_nr =
NULp;
172 delete helix_pos; helix_pos =
NULp;
173 delete Helix; Helix =
NULp;
182 helix_pos =
new SEC_seq_data(gb_helix_pos, aliname, cb);
183 helix_nr =
new SEC_seq_data(gb_helix_nr, aliname, cb);
186 GB_ERROR error = Helix->initFromData(helix_nr->sequence(), helix_pos->sequence(), helix_pos->length());
195 free(helix_pos_name);
198 scr->request_refresh();
201 void SEC_db_interface::update_positions(
const SEC_dbcb *) {
206 gfx->sec_root->nail_cursor();
208 scr->request_refresh();
211 void SEC_db_interface::relayout(
const SEC_dbcb *) {
217 scr->request_refresh();
220 void SEC_db_interface::refresh(
const SEC_dbcb *) {
224 scr->request_refresh();
230 int nailedPos = nailedAbsPos;
232 cursorAbsPos = abspos;
236 db->canvas()->request_refresh();
239 nailedAbsPos = nailedPos;
240 position_cursor(
false,
false);
243 void SEC_db_interface::cursor_changed(
const SEC_dbcb *) {
250 void SEC_db_interface::alilen_changed(
const SEC_dbcb *) {
256 scr->request_refresh();
291 void SEC_db_interface::bind_awars(
const char **awars,
SEC_dbcb *cb) {
292 RootCallback awarcb = makeRootCallback(
sec_dbcb, cb);
293 for (
int i = 0; awars[i]; ++i) {
294 aw_root->awar(awars[i])->add_callback(awarcb);
337 displayEcoliPositions(
false),
340 displayBindingHelixPositions(
true),
347 aw_root(gfx->aw_root)
362 displayPos =
new bool[ali_length];
367 sequence_cb =
new SEC_dbcb(
this, &SEC_db_interface::reload_sequence);
368 ecoli_cb =
new SEC_dbcb(
this, &SEC_db_interface::reload_ecoli);
369 helix_cb =
new SEC_dbcb(
this, &SEC_db_interface::reload_helix);
370 updatepos_cb =
new SEC_dbcb(
this, &SEC_db_interface::update_positions);
371 relayout_cb =
new SEC_dbcb(
this, &SEC_db_interface::relayout);
372 refresh_cb =
new SEC_dbcb(
this, &SEC_db_interface::refresh);
373 cursorpos_cb =
new SEC_dbcb(
this, &SEC_db_interface::cursor_changed);
374 alilen_changed_cb =
new SEC_dbcb(
this, &SEC_db_interface::alilen_changed);
379 bind_awars(update_pos_awars, updatepos_cb);
380 bind_awars(relayout_awars, relayout_cb);
381 bind_awars(refresh_awars, refresh_cb);
398 updatepos_cb->
call();
411 delete [] displayPos;
413 delete sequence; sequence =
NULp;
415 delete ecoli_seq; ecoli_seq =
NULp;
416 delete Ecoli; Ecoli =
NULp;
418 delete helix_nr; helix_nr =
NULp;
419 delete helix_pos; helix_pos =
NULp;
420 delete Helix; Helix =
NULp;
422 delete sequence_cb; sequence_cb =
NULp;
423 delete ecoli_cb; ecoli_cb =
NULp;
424 delete helix_cb; helix_cb =
NULp;
425 delete updatepos_cb; updatepos_cb =
NULp;
426 delete relayout_cb; relayout_cb =
NULp;
427 delete refresh_cb; refresh_cb =
NULp;
428 delete cursorpos_cb; cursorpos_cb =
NULp;
429 delete alilen_changed_cb; alilen_changed_cb =
NULp;
431 delete toggler; toggler =
NULp;
433 delete bonddef; bonddef =
NULp;
445 for (
size_t pos = 0; pos<ali_length; ++pos) {
449 if (displayBindingHelixPositions) {
450 displayPos[pos] =
true;
461 shown += displayPos[pos];
465 if (displayEcoliPositions && ecoli_seq) {
466 for (
size_t pos = 0; pos<ali_length; ++pos) {
468 displayPos[pos] =
true;
bool is_pairpos(size_t pos) const
#define AWAR_SECEDIT_SHOW_CURPOS
#define AWAR_SECEDIT_SKELETON_THICKNESS
SEC_dbcb(SEC_db_interface *db, interface_cb cb)
static void bind_transldef_awars(SEC_db_interface *db)
GB_CSTR GB_path_in_arbprop(const char *relative_path)
static const char * update_pos_awars[]
GB_ERROR GB_add_callback(GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
static void sec_dbcb(UNFIXED, const SEC_dbcb *cb)
#define AWAR_SECEDIT_DISPLAY_SEARCH
GB_ERROR update_translation(AW_root *awr)
#define AWAR_CURSOR_POSITION
void update_shown_positions()
GBDATA * GBT_get_alignment(GBDATA *gb_main, const char *aliname)
AWT_canvas * canvas() const
#define AWAR_SECEDIT_BASELINEWIDTH
SEC_db_interface * instance
char * ARB_strdup(const char *str)
virtual const AW_helix * get_helix() const =0
virtual bool SAIs_visualized() const =0
AW_awar * set_minmax(float min, float max)
void add_callback(const RootCallback &cb) const
size_t opposite_position(size_t pos) const
long GBT_get_alignment_len(GBDATA *gb_main, const char *aliname)
void update_shown_positions()
char data(size_t abspos) const
#define AWAR_EDIT_RIGHTWARD
char * GBT_get_default_helix_nr(GBDATA *)
AW_awar * add_callback(const RootCallback &cb)
struct Unfixed_cb_parameter * UNFIXED
#define AWAR_SECEDIT_BOND_THICKNESS
GBDATA * GBT_find_SAI(GBDATA *gb_main, const char *name)
const char * read_char_pntr() const
size_t GB_read_string_count(GBDATA *gbd)
void reread_display_params(AW_root *aw_root, const ED4_plugin_host &Host)
SEC_db_interface(SEC_graphic *Gfx, AWT_canvas *Scr, ED4_plugin_host &host_)
AW_awar * awar_float(const char *var_name, float default_value=0.0, AW_default default_file=AW_ROOT_DEFAULT)
#define AWAR_SECEDIT_SHOW_STR_SKELETON
#define ED4_AWAR_SEARCH_RESULT_CHANGED
#define AWAR_SECEDIT_SAVEDIR
static void error(const char *msg)
#define AWAR_SECEDIT_HIDE_BASES
void AW_create_fileselection_awars(AW_root *awr, const char *awar_base, const char *directories, const char *filter, const char *file_name)
#define AWAR_SECEDIT_SHOW_DEBUG
#define AWAR_SECEDIT_SHOW_ECOLI_POS
SEC_root * secroot() const
void set_cursor(int abspos)
#define AWAR_SPECIES_NAME
void reread(AW_root *aw_root, const ED4_plugin_host &host)
void init(const char *seq, int size)
#define AWAR_SECEDIT_SHOW_BONDS
#define AWAR_SECEDIT_SHOW_HELIX_NRS
#define AWAR_SECEDIT_DIST_BETW_STRANDS
AW_awar * awar(const char *awar)
#define AWAR_SECEDIT_BOND_SYMBOLS_EDIT4
GBDATA * GBT_find_sequence(GBDATA *gb_species, const char *aliname)
#define AWAR_SECEDIT_BOND_SYMBOLS_TRANS
static void transl_def_changed_cb(AW_root *aw_root, SEC_db_interface *db)
ASSERTING_CONSTEXPR_INLINE int bio2info(int biopos)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
GB_ERROR close(GB_ERROR error)
char * GB_read_string(GBDATA *gbd)
#define AWAR_SECEDIT_DISPLAY_SAI
void GB_remove_callback(GBDATA *gbd, GB_CB_TYPE type, const DatabaseCallback &dbcb)
static const char * refresh_awars[]
void init_toggler() const
void(SEC_db_interface::* interface_cb)(const SEC_dbcb *)
#define AWAR_SECEDIT_DISPPOS_ECOLI
void aw_message(const char *msg)
static const char * relayout_awars[]
char baseAt(size_t abspos) const
char * GBT_get_default_helix(GBDATA *)
GBDATA * GBT_find_species(GBDATA *gb_main, const char *name)
char * GBT_get_default_alignment(GBDATA *gb_main)
SEC_bond_def * bonds() const
GB_transaction ta(gb_var)
SEC_seq_data(GBDATA *gb_item, const char *aliname, const SEC_dbcb *reload_item)
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
GBDATA * GB_search(GBDATA *gbd, const char *fieldpath, GB_TYPES create)
static void create_awars(AW_root *aw_root, AW_default def)
#define AWAR_SECEDIT_DISPPOS_BINDING