|
Revision 10, 2.0 kB
(checked in by t, 3 years ago)
|
Tailorization
Import of the upstream sources from
Repository: :pserver:anonymous@cvs.sf.net:/cvsroot/familyjewels
Kind: cvs
Module: FRII
Revision: 2005-12-09 09:00:54 by titus
Original author: tailor@vallista.idyll.org
Date: 2005-12-09 09:00:54
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
#ifndef FEATURE_HH |
|---|
| 20 |
#define FEATURE_HH |
|---|
| 21 |
|
|---|
| 22 |
#include <string> |
|---|
| 23 |
|
|---|
| 24 |
namespace gui { |
|---|
| 25 |
class Feature { |
|---|
| 26 |
protected: |
|---|
| 27 |
Feature * _other; |
|---|
| 28 |
std::string top_aln, bot_aln; |
|---|
| 29 |
std::string _info; |
|---|
| 30 |
public: |
|---|
| 31 |
const unsigned int start, end; |
|---|
| 32 |
const int orientation; |
|---|
| 33 |
Feature(unsigned int s, unsigned int e, int o) : |
|---|
| 34 |
_other(NULL), start(s), end(e), orientation(o) |
|---|
| 35 |
{ ; } |
|---|
| 36 |
|
|---|
| 37 |
void other(int s, int e) { |
|---|
| 38 |
_other = new Feature(s, e, 1); |
|---|
| 39 |
} |
|---|
| 40 |
const Feature * other() const { return _other; } |
|---|
| 41 |
|
|---|
| 42 |
const std::string information() const { return _info; } |
|---|
| 43 |
void add_information(std::string i) { _info += i; } |
|---|
| 44 |
bool has_info() const { return (_info.length() > 0); } |
|---|
| 45 |
|
|---|
| 46 |
void set_alignment(std::string top, std::string bot) { |
|---|
| 47 |
top_aln = top; |
|---|
| 48 |
bot_aln = bot; |
|---|
| 49 |
} |
|---|
| 50 |
void get_alignment(std::string &top, std::string &bot) const { |
|---|
| 51 |
top = top_aln; |
|---|
| 52 |
bot = bot_aln; |
|---|
| 53 |
} |
|---|
| 54 |
|
|---|
| 55 |
Feature * copy_me() const { |
|---|
| 56 |
Feature * new_f = new Feature(start, end, orientation); |
|---|
| 57 |
if (_other) { |
|---|
| 58 |
new_f->_other = _other->copy_me(); |
|---|
| 59 |
} |
|---|
| 60 |
new_f->set_alignment(top_aln, bot_aln); |
|---|
| 61 |
new_f->_info = _info; |
|---|
| 62 |
|
|---|
| 63 |
return new_f; |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
bool has_alignment() const { |
|---|
| 67 |
if (_other && top_aln.length() && bot_aln.length()) { |
|---|
| 68 |
return true; |
|---|
| 69 |
} |
|---|
| 70 |
return false; |
|---|
| 71 |
} |
|---|
| 72 |
|
|---|
| 73 |
virtual ~Feature() { if (_other) delete _other; } |
|---|
| 74 |
}; |
|---|
| 75 |
} |
|---|
| 76 |
|
|---|
| 77 |
#endif |
|---|
| 78 |
|
|---|