#include <seqSchema.h>
Public Member Functions | |
virtual void | place (double ox, double oy, int orientation) |
Place the two components horizontally with enough space for the connections. | |
virtual void | draw (device &dev) |
Draw the two components as well as the internal wires. | |
virtual point | inputPoint (unsigned int i) |
The input points are the input points of the first component. | |
virtual point | outputPoint (unsigned int i) |
The output points are the output points of the second component. | |
Private Member Functions | |
seqSchema (schema *s1, schema *s2, double hgap) | |
Constructor for a sequential schema (s1:s2). | |
void | drawInternalWires (device &dev) |
Draw the internal wires aligning the vertical segments in a symetric way when possible. | |
Friends | |
schema * | makeSeqSchema (schema *s1, schema *s2) |
Make a sequential schema. |
Place and connect two diagrams in sequence. The constructor is private because one should use the makeSeqSchema function instead.
Definition at line 36 of file seqSchema.h.
Constructor for a sequential schema (s1:s2).
The components s1 and s2 are supposed to be "compatible" (s1 : n->m and s2 : m->q)
Definition at line 62 of file seqSchema.cpp.
00063 : schema( s1->inputs(), 00064 s2->outputs(), 00065 s1->width() + hgap + s2->width(), 00066 max(s1->height(), s2->height()) ), 00067 fSchema1(s1), 00068 fSchema2(s2), 00069 fHorzGap(hgap) 00070 { 00071 assert(s1->outputs() == s2->inputs()); 00072 }
Make a sequential schema.
May add cables to ensure the internal connections are between the same number of outputs and inputs. Compute an horizontal gap based on the number of upward and downward connections.
Definition at line 43 of file seqSchema.cpp.
00044 { 00045 unsigned int o = s1->outputs(); 00046 unsigned int i = s2->inputs(); 00047 00048 schema* a = (o < i) ? makeParSchema(s1, makeCableSchema(i-o)) : s1; 00049 schema* b = (o > i) ? makeParSchema(s2, makeCableSchema(o-i)) : s2; 00050 00051 return new seqSchema(a, b, computeHorzGap(a,b)); 00052 }