Simple cables (identity box) in parallel. More...
#include <cableSchema.h>
Inherits schema.
Public Member Functions | |
virtual void | place (double x, double y, int orientation) |
Place the communication points vertically spaced by dWire. | |
virtual void | draw (device &dev) |
Nothing to draw. | |
virtual point | inputPoint (unsigned int i) const |
input and output points are the same as the width is 0 | |
virtual point | outputPoint (unsigned int i) const |
input and output points are the same as the width is 0 | |
Private Member Functions | |
cableSchema (unsigned int n) | |
Build n cables in parallel. | |
Private Attributes | |
vector< point > | fPoint |
Friends | |
schema * | makeCableSchema (unsigned int n) |
Build n cables in parallel. |
Simple cables (identity box) in parallel.
The width of a cable is null. Therefore input and output connection points are the same. The constructor is private to enforce the use of makeCableSchema.
Definition at line 34 of file cableSchema.h.
cableSchema::cableSchema | ( | unsigned int | n | ) | [private] |
void cableSchema::draw | ( | device & | dev | ) | [virtual] |
Nothing to draw.
Actual drawing will take place when the wires are enlargered
Implements schema.
Definition at line 73 of file cableSchema.cpp.
point cableSchema::inputPoint | ( | unsigned int | i | ) | const [virtual] |
input and output points are the same as the width is 0
Implements schema.
Definition at line 80 of file cableSchema.cpp.
References fPoint, and schema::inputs().
point cableSchema::outputPoint | ( | unsigned int | i | ) | const [virtual] |
input and output points are the same as the width is 0
Implements schema.
Definition at line 89 of file cableSchema.cpp.
References fPoint, and schema::outputs().
void cableSchema::place | ( | double | x, | |
double | y, | |||
int | orientation | |||
) | [virtual] |
Place the communication points vertically spaced by dWire.
Implements schema.
Definition at line 52 of file cableSchema.cpp.
References schema::beginPlace(), dWire, schema::endPlace(), fPoint, schema::height(), schema::inputs(), and kLeftRight.
00053 { 00054 beginPlace(ox, oy, orientation); 00055 if (orientation == kLeftRight) { 00056 for (unsigned int i=0; i<inputs(); i++) { 00057 fPoint[i] = point(ox, oy + dWire/2.0 + i*dWire); 00058 } 00059 } else { 00060 for (unsigned int i=0; i<inputs(); i++) { 00061 fPoint[i] = point(ox, oy + height() - dWire/2.0 - i*dWire); 00062 } 00063 } 00064 endPlace(); 00065 }
schema* makeCableSchema | ( | unsigned int | n | ) | [friend] |
Build n cables in parallel.
Definition at line 32 of file cableSchema.cpp.
00033 { 00034 assert(n>0); 00035 return new cableSchema(n); 00036 }
vector<point> cableSchema::fPoint [private] |
Definition at line 36 of file cableSchema.h.
Referenced by cableSchema(), inputPoint(), outputPoint(), and place().