source: branches/items/SL/NDS/nds.h

Last change on this file was 18734, checked in by westram, 3 years ago
  • fix NDEBUG warnings:
    • conditionally compile functions used only with assertions.
    • NodeTextBuilder is Noncopyable!
    • declare NDS_Labeler final.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1// ========================================================= //
2//                                                           //
3//   File      : nds.h                                       //
4//   Purpose   : Node Display Setup                          //
5//                                                           //
6//   Institute of Microbiology (Technical University Munich) //
7//   http://www.arb-home.de/                                 //
8//                                                           //
9// ========================================================= //
10
11#ifndef NDS_H
12#define NDS_H
13
14#ifndef ARBDB_BASE_H
15#include <arbdb_base.h>
16#endif
17#ifndef AW_BASE_HXX
18#include <aw_base.hxx>
19#endif
20#ifndef ARB_ASSERT_H
21#include <arb_assert.h>
22#endif
23#ifndef ARBTOOLS_H
24#include <arbtools.h>
25#endif
26#ifndef TREELABELER_H
27#include <TreeLabeler.h>
28#endif
29
30#define AWAR_SELECT_ACISRT     "tmp/acisrt/select"
31#define AWAR_SELECT_ACISRT_PRE "tmp/acisrt/select_pre"
32
33// --------------------------------------------------------------------------------
34
35enum NDS_Type {
36    NDS_OUTPUT_LEAFTEXT        = 0,   // compress info (no tabbing, separate single fields by comma, completely skip empty fields)
37    NDS_OUTPUT_SPACE_PADDED    = 1,   // format info (using spaces)
38    NDS_OUTPUT_TAB_SEPARATED   = 2,   // format info (using 1 tab per column - for easy import into star-calc, excel, etc. ).
39                                      // (also used by AWT_graphic_tree::show_nds_list for non-tree-display of species in ARB_NTREE)
40    NDS_OUTPUT_COMMA_SEPARATED = 3,   // like NDS_OUTPUT_TAB_SEPARATED, but using commas
41};
42
43class NDS_Labeler FINAL_TYPE : public TreeLabeler, virtual Noncopyable {
44    NDS_Type type;
45
46    mutable class NodeTextBuilder *builder; // pimpl
47    NodeTextBuilder& theBuilder(GBDATA *gb_main) const;
48
49public:
50
51    explicit NDS_Labeler(NDS_Type type_);
52    virtual ~NDS_Labeler();
53
54    const char *generate(GBDATA *gb_main, GBDATA *gbd, TreeNode *species, const char *tree_name) const OVERRIDE;
55
56    const char *groupLabel(GBDATA *gb_main, GBDATA *gbd, TreeNode *species, const char *tree_name) const;
57    NDS_Type get_NDS_Type() const { return type; }
58};
59
60// --------------------------------------------------------------------------------
61
62AW_window *NDS_create_window(AW_root *aw_root, GBDATA *gb_main);
63void       NDS_create_vars(AW_root *aw_root, AW_default awdef, GBDATA *gb_main, bool force_reinit);
64void       NDS_popup_select_srtaci_window(AW_window *aww, const char *acisrt_awarname);
65char      *NDS_mask_nonprintable_chars(char *inStr);
66
67#else
68#error nds.h included twice
69#endif // NDS_H
Note: See TracBrowser for help on using the repository browser.