14 #define AP_F_LOADED ((AW_active)1)
15 #define AP_F_NLOADED ((AW_active)2)
16 #define AP_F_SEQUENCES ((AW_active)4)
17 #define AP_F_MATRIX ((AW_active)8)
18 #define AP_F_TREE ((AW_active)16)
19 #define AP_F_ALL ((AW_active)-1)
24 #ifndef AP_SEQUENCE_HXX
67 #if defined(ASSERTION_USED)
83 void *root_changed_cd;
85 void *node_deleted_cd;
190 callback_exists =
false;
200 std::swap(left_linewidth, right_linewidth);
206 right_angle = -org_left;
219 void load_node_info();
222 char& linewidth_ref() {
226 const char& linewidth_ref()
const {
return const_cast<AP_tree*
>(
this)->linewidth_ref(); }
232 const float& angle_ref()
const {
return const_cast<AP_tree*
>(
this)->angle_ref(); }
234 static inline int force_legal_width(
int width) {
return width<0 ? 0 : (width>128 ? 128 : width); }
236 void buildLeafList_rek(
AP_tree **list,
long& num);
240 void reset_child_angles();
241 void reset_child_linewidths();
242 void reset_child_layout();
244 template<
class RESULT> RESULT update_subtree_information(
const group_scaling& gscaling);
248 inline void recalc_hidden();
250 inline void remove_root_remark() {
266 inline void smart_remove_remark() {
274 inline void remove_remarks_from_this_and_parent() {
277 smart_remove_remark();
357 const char *
mark_long_branches(
double min_rel_diff,
double min_abs_diff,
double& found_max_abs_diff);
358 const char *
mark_deep_leafs(
int min_depth,
double min_rootdist,
int& found_max_depth,
double& found_max_rootdist);
374 bool hasName(
const char *Name)
const {
return Name &&
name && Name[0] ==
name[0] && strcmp(Name,
name) == 0; }
376 #if defined(ASSERTION_USED) || defined(UNIT_TESTS)
390 #error AP_Tree.hxx included twice
391 #endif // AP_TREE_HXX
void reset_subtree_angles()
long remove_leafs(AWT_RemoveType awt_remove_type)
void change_root(TreeNode *old, TreeNode *newroot) FINAL_OVERRIDE
void buildLeafList(AP_tree **&list, long &num)
void recompute_and_write_folding()
GB_ERROR move_group_to(AP_tree *new_group) __ATTR__USERESULT
unsigned get_leaf_count() const OVERRIDE
PREPARE_MARK_NONFINAL_CLASS(AP_tree)
virtual void moveNextTo(AP_tree *new_brother, AP_FLOAT rel_pos)
char * init(AP_filter *fil)
void set_node_deleted_callback(AP_nodeDelCb cb, void *cd)
POS_TREE1 * get_father() const
bool is_folded_group() const
#define DEFAULT_BRANCH_LENGTH
const char * analyse_distances()
GB_ERROR tree_write_tree_rek(GBDATA *gb_tree)
void(* AP_nodeDelCb)(void *cd, AP_tree *del)
AP_tree_root(AliView *aliView, AP_sequence *seq_proto, bool add_delete_callbacks, const group_scaling *scaling)
MARK_NONFINAL_METHOD(AP_tree_root, destroyNode,(TreeNode *) const)
int colorize(GB_HASH *hashptr)
const char * mark_long_branches(double min_rel_diff, double min_abs_diff, double &found_max_abs_diff)
GB_ERROR cantMoveNextTo(AP_tree *new_brother)
void swap_sons() OVERRIDE
bool hasName(const char *Name) const
void reset_subtree_linewidths()
virtual void insert(AP_tree *new_brother)
#define DOWNCAST(totype, expr)
unsigned count_leafs() const
virtual AP_tree * REMOVE()
bool has_valid_root_remarks() const
void set_linewidth_recursive(int width)
POS_TREE1 * get_father() const
void set_angle(float angle)
void compute_tree() FINAL_OVERRIDE
PREPARE_MARK_NONFINAL_CLASS(AP_tree_root)
bool is_son_of_root() const
int get_linewidth() const
DEFINE_TREE_ACCESSORS(AP_tree_root, AP_tree)
MARK_NONFINAL_FUNCTION(AP_tree_root, GB_ERROR, saveToDB,(), NULp)
bool is_species_updated()
bool is_root_node() const
void relink_tree(GBDATA *gb_main, void(*relinker)(GBDATA *&ref_gb_node, char *&ref_name, GB_HASH *organism_hash), GB_HASH *organism_hash)
CONSTEXPR_INLINE_Cxx14 void swap(unsigned char &c1, unsigned char &c2)
GB_ERROR loadFromDB(const char *name) FINAL_OVERRIDE
bool is_keeled_group() const
void reset_subtree_spreads()
DEFINE_TREE_ROOT_ACCESSORS(AP_tree_root, AP_tree)
void(* AP_rootChangedCb)(void *cd, AP_tree *old, AP_tree *newroot)
void reset_both_child_linewidths()
bool is_inside_folded_group() const
bool has_been_set() const
double mark_degenerated_branches(double degeneration_factor)
GB_ERROR saveToDB() OVERRIDE
virtual void initial_insert(AP_tree *new_brother, AP_tree_root *troot)
void reset_subtree_layout()
bool has_correct_mark_flags() const
#define __ATTR__USERESULT
void justify_branch_lenghs(GBDATA *gb_main)
TreeNode * makeNode() const OVERRIDE
const group_scaling * get_group_scaling() const
const char * mark_deep_leafs(int min_depth, double min_rootdist, int &found_max_depth, double &found_max_rootdist)
void reset_child_layout()
static const AP_TreeShader * get_tree_shader()
static void set_tree_shader(AP_TreeShader *new_shader)
void set_linewidth(int width)
MARK_NONFINAL_CLASS(AP_tree_root)
void set_root_changed_callback(AP_rootChangedCb cb, void *cd)
GB_ERROR relink() __ATTR__USERESULT
bool is_normal_group() const
void reset_both_child_angles()
void destroyNode(TreeNode *node) const OVERRIDE
void inform_about_delete(AP_tree *old)
void reset_child_spread()
virtual AP_UPDATE_FLAGS check_update()