20 x_string.
addXpair(get_sequence_start(), get_sequence_end());
25 xString =
new XString(db->length());
28 part->get_region()->generate_x_string(*xString);
33 SEC_helix_strand * SEC_segment::get_previous_strand() {
34 SEC_helix_strand *strand_pointer = next_helix_strand;
35 SEC_segment *segment_pointer = strand_pointer->get_next_segment();
37 while (segment_pointer !=
this) {
38 strand_pointer = segment_pointer->get_next_strand();
39 segment_pointer = strand_pointer->get_next_segment();
41 return strand_pointer;
45 for (
int i=0; i<indent; i++) out <<
"\t";
52 Block(
const char *name, ostream& Out,
int& Indent) :
57 out << name <<
"={\n";
68 void SEC_segment::save(ostream & out,
int indent,
const XString& x_string) {
69 Block b(
"SEGMENT", out, indent);
70 get_region()->save(out, indent, x_string);
74 int x_count_start = x_string.
getXleftOf(sequence_start);
75 int x_count_end = x_string.
getXleftOf(sequence_end);
77 do_indent(out, indent); out <<
"SEQ=" << x_count_start <<
":" << x_count_end <<
"\n";
80 void SEC_helix::save(ostream & out,
int indent,
const XString& x_string) {
81 Block b(
"STRAND", out, indent);
83 strandToOutside()->get_region()->save(out, indent, x_string);
85 do_indent(out, indent); out <<
"REL=" << get_rel_angle().radian() <<
"\n";
86 do_indent(out, indent); out <<
"LENGTH=" << minSize() <<
":" << maxSize() <<
"\n";
88 outsideLoop()->save(out, indent, x_string);
89 strandToRoot()->get_region()->save(out, indent, x_string);
92 void SEC_loop::save(ostream & out,
int indent,
const XString& x_string) {
93 Block b(
"LOOP", out, indent);
95 do_indent(out, indent); out <<
"RADIUS=" << minSize() <<
":" << maxSize() <<
"\n";
96 do_indent(out, indent); out <<
"REL=" << get_rel_angle().radian() <<
"\n";
98 SEC_helix *primary = get_fixpoint_helix();
99 bool root_loop = is_root_loop();
102 SEC_helix *helix = strand->get_helix();
103 if (helix != primary || root_loop) helix->save(out, indent, x_string);
104 strand->get_next_segment()->save(out, indent, x_string);
111 if (db->canDisplay()) generate_x_string();
117 get_root_loop()->save(out, 0, *xString);
121 const string& outstr = out.str();
122 char *
result =
new char[outstr.length()+1];
123 strcpy(result, outstr.c_str());
void do_indent(ostream &out, int indent)
int getXleftOf(size_t abspos) const
char * buildStructureString()
void generate_x_string(XString &x_string)
Block(const char *name, ostream &Out, int &Indent)
void save(std::ostream &out, int indent, const XString &x_string)
void addXpair(size_t start, size_t end)