FAUST compiler  0.9.9.6b8
Functions
blockSchema.cpp File Reference
#include "blockSchema.h"
#include <assert.h>
Include dependency graph for blockSchema.cpp:

Go to the source code of this file.

Functions

static double quantize (int n)
schemamakeBlockSchema (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.

Function Documentation

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);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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));
}

Here is the caller graph for this function: