38 double m =
dWire *
max(b->inputs(), b->outputs());
39 double w = a->
width() + 2*m;
49 :
schema( s1->inputs() - s2->outputs(),
52 s1->height() + s2->height() ),
92 for (
unsigned int i=0; i<
inputs(); i++) {
98 for (
unsigned int i=0; i<
outputs(); i++) {
151 dev.
trait(x-size/2, y, x-size/2, y-size);
152 dev.
trait(x-size/2, y-size, x+size/2, y-size);
153 dev.
trait(x+size/2, y-size, x+size/2, y);
184 for (
unsigned int i=0; i<
inputs(); i++) {
208 point br(ox+ct/2.0, src.
y);
void drawDelaySign(device &dev, double x, double y, double size)
Draw the delay sign of a feedback connection.
void addOutput(const point &p)
void addTrait(const trait &t)
unsigned int outputs() const
const double dWire
distance between two wires
virtual void collectTraits(collector &c)
Draw the two subschema s1 and s2 as well as the feedback connections between s1 and s2...
virtual point inputPoint(unsigned int i) const =0
void beginPlace(double x, double y, int orientation)
virtual void draw(device &dev)=0
virtual void collectTraits(collector &c)=0
void collectFeedback(collector &c, const point &src, const point &dst, double dx, const point &out)
Draw a feedback connection between two points with an horizontal displacement dx. ...
unsigned int inputs() const
double max(double x, double y)
void collectFeedfront(collector &c, const point &src, const point &dst, double dx)
Draw a feedfrom connection between two points with an horizontal displacement dx. ...
vector< point > fInputPoint
schema * makeRecSchema(schema *s1, schema *s2)
Creates a new recursive schema (s1 ~ s2).
virtual point inputPoint(unsigned int i) const
The input points s1 ~ s2.
virtual void place(double x, double y, int orientation)=0
virtual point outputPoint(unsigned int i) const =0
An abstract block diagram schema.
place and connect two diagrams in recursive composition
vector< point > fOutputPoint
void addInput(const point &p)
virtual void place(double ox, double oy, int orientation)
The two subschema are placed centered vertically, s2 on top of s1.
virtual point outputPoint(unsigned int i) const
The output points s1 ~ s2.
virtual void trait(double x1, double y1, double x2, double y2)=0
recSchema(schema *s1, schema *s2, double width)
Constructor of a recursive schema (s1 ~ s2).
virtual void draw(device &dev)
Draw the two subschema s1 and s2 as well as the implicit feedback delays between s1 and s2...
schema * makeEnlargedSchema(schema *s, double width)
Returns an enlarged schema, but only if really needed that is if the requiered width is greater that ...