31 return dLetter * (q *((n+q-1)/q));
48 double minimal = 3*
dWire;
52 return new blockSchema(inputs, outputs, w, h, text, color, link);
70 :
schema( inputs, outputs, width, height ),
131 for (
int i=0; i<N; i++) {
137 double px =
x() +
width();
140 for (
int i=0; i<N; i++) {
157 double px =
x() +
width();
160 for (
int i=0; i<N; i++) {
169 for (
int i=0; i<N; i++) {
244 for (
unsigned int i=0; i<
inputs(); i++) {
269 for (
unsigned int i=0; i<
inputs(); i++) {
284 for (
unsigned int i=0; i<
outputs(); i++) {
vector< point > fInputPoint
input connection points
void addOutput(const point &p)
void addTrait(const trait &t)
const string fLink
option URL link
void drawText(device &dev)
Draw the text centered on the box.
unsigned int outputs() const
void placeInputPoints()
Computes the input points according to the position and the orientation of the blockSchema.
const double dWire
distance between two wires
void beginPlace(double x, double y, int orientation)
const string fText
Text to be displayed.
vector< point > fOutputPoint
output connection points
virtual void text(double x, double y, const char *name, const char *link)=0
void placeOutputPoints()
Computes the output points according to the position and the orientation of the blockSchema.
virtual void draw(device &dev)
Draw the blockSchema on the device.
virtual void collectTraits(collector &c)
Draw horizontal arrows from the input points to the blockSchema rectangle.
const double dVert
marge verticale
unsigned int inputs() const
double max(double x, double y)
virtual void rect(double x, double y, double l, double h, const char *color, const char *link)=0
static double quantize(int n)
A simple rectangular box with a text and inputs and outputs.
virtual point outputPoint(unsigned int i) const
Returns an output point.
blockSchema(unsigned int inputs, unsigned int outputs, double width, double height, const string &name, const string &color, const string &link)
Build a simple colored blockSchema with a certain number of inputs and outputs, a text to be displaye...
void drawInputArrows(device &dev)
Draw horizontal arrows from the input points to the blockSchema rectangle.
void drawOrientationMark(device &dev)
Draw the orientation mark, a small point that indicates the first input (like integrated circuits) ...
virtual point inputPoint(unsigned int i) const
Returns an input point.
An abstract block diagram schema.
void collectOutputWires(collector &c)
Draw horizontal line from the blockSchema rectangle to the output points.
virtual void fleche(double x, double y, double rotation, int sens)=0
const double dHorz
marge horizontale
void collectInputWires(collector &c)
Draw horizontal arrows from the input points to the blockSchema rectangle.
void addInput(const point &p)
const double dLetter
width of a letter
virtual void markSens(double x, double y, int sens)=0
schema * makeBlockSchema(unsigned int inputs, unsigned int outputs, const string &text, const string &color, const string &link)
Build a simple colored blockSchema with a certain number of inputs and outputs, a text to be displaye...
void drawRectangle(device &dev)
Draw the colored rectangle with the optional link.
virtual void place(double x, double y, int orientation)
Define the graphic position of the blockSchema.
const string fColor
color of the box