blockSchema.cpp File Reference

#include "blockSchema.h"
#include "device.h"
#include <vector>
#include <string>
#include <assert.h>
Include dependency graph for blockSchema.cpp:
This graph shows which files directly or indirectly include this file:

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().

00045 {
00046     // determine the optimal size of the box
00047     double minimal = 3*dWire;
00048     double w = 2*dHorz + max( minimal, quantize(text.size()) );
00049     double h = 2*dVert + max( minimal, max(inputs, outputs) * dWire );
00050 
00051     return new blockSchema(inputs, outputs, w, h, text, color, link);
00052 }

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().

00029 {
00030     int q = 3;
00031     return dLetter * (q *((n+q-1)/q));
00032 }

Here is the caller graph for this function:

Generated on Wed Apr 28 23:59:59 2010 for FAUST compiler by  doxygen 1.6.3