Place and connect two diagrams in merge composition. More...
#include <mergeSchema.h>
Public Member Functions | |
virtual void | place (double ox, double oy, int orientation) |
Places the two subschema horizontaly, centered, with enough gap for the connections. | |
virtual void | draw (device &dev) |
Draw the two sub schema and the connections between them. | |
virtual point | inputPoint (unsigned int i) |
The inputs of s1 :> s2 are the inputs of s1. | |
virtual point | outputPoint (unsigned int i) |
The outputs of s1 :> s2 are the outputs of s2. | |
Private Member Functions | |
mergeSchema (schema *s1, schema *s2, double hgap) | |
Constructor for a merge schema s1 :> s2 where the outputs of s1 are merged to the inputs of s2. | |
Friends | |
schema * | makeMergeSchema (schema *s1, schema *s2) |
Creates a new merge schema. |
Place and connect two diagrams in merge composition.
Definition at line 33 of file mergeSchema.h.
Constructor for a merge schema s1 :> s2 where the outputs of s1 are merged to the inputs of s2.
The constructor is private in order to enforce the usage of makeMergeSchema
Definition at line 50 of file mergeSchema.cpp.
00051 : schema( s1->inputs(), 00052 s2->outputs(), 00053 s1->width() + s2->width() + hgap, 00054 max(s1->height(), s2->height()) ), 00055 fSchema1(s1), 00056 fSchema2(s2), 00057 fHorzGap(hgap) 00058 { 00059 }
Creates a new merge schema.
Cables are enlarged to dWire. The horizontal gap between the two subschema is such that the connections are not too slopy.
Definition at line 35 of file mergeSchema.cpp.
00036 { 00037 // avoid ugly diagram by ensuring at least dWire width 00038 schema * a = makeEnlargedSchema(s1, dWire); 00039 schema * b = makeEnlargedSchema(s2, dWire); 00040 double hgap = (a->height()+b->height())/4; 00041 return new mergeSchema(a,b,hgap); 00042 }