|
FAUST compiler
0.9.9.6b8
|

Go to the source code of this file.
Functions | |
| static double | quantize (int n) |
| 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 displayed, and an optional link. | |
| 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 displayed, and an optional link.
Computes the size of the box according to the length of the text and the maximum number of ports.
Definition at line 40 of file blockSchema.cpp.
References dHorz, dVert, dWire, max(), and quantize().
Referenced by generateBargraphSchema(), generateDiagramSchema(), generateInputSlotSchema(), generateInsideSchema(), generateOutputSlotSchema(), and generateUserInterfaceSchema().
{
// determine the optimal size of the box
double minimal = 3*dWire;
double w = 2*dHorz + max( minimal, quantize(text.size()) );
double h = 2*dVert + max( minimal, max(inputs, outputs) * dWire );
return new blockSchema(inputs, outputs, w, h, text, color, link);
}


| static double quantize | ( | int | n | ) | [static] |
Definition at line 28 of file blockSchema.cpp.
References dLetter.
Referenced by makeBlockSchema().
{
int q = 3;
return dLetter * (q *((n+q-1)/q));
}

1.8.0