|
FAUST compiler
0.9.9.6b8
|
Implement block-diagram schema generation in svg or postscript format. More...
#include <stdio.h>#include <ctype.h>#include <sys/stat.h>#include <sys/types.h>#include <errno.h>#include <string.h>#include <ostream>#include <sstream>#include <set>#include <utility>#include <map>#include <stack>#include <string>#include "boxes.hh"#include "ppbox.hh"#include "prim2.hh"#include <vector>#include "devLib.h"#include "xtended.hh"#include "occurrences.hh"#include "boxcomplexity.h"#include "schema.h"#include "drawschema.hh"#include "compatibility.hh"#include "names.hh"#include "description.hh"#include "property.hh"#include "files.hh"
Go to the source code of this file.
Macros | |
| #define | linkcolor "#003366" |
| #define | normalcolor "#4B71A1" |
| #define | uicolor "#477881" |
| #define | slotcolor "#47945E" |
| #define | numcolor "#f44800" |
| #define | invcolor "#ffffff" |
Functions | |
| static void | writeSchemaFile (Tree bd) |
| Write a top level diagram. More... | |
| static schema * | generateDiagramSchema (Tree t) |
| Generate an appropriate schema according to the type of block diagram. More... | |
| static schema * | generateInsideSchema (Tree t) |
| Generate the inside schema of a block diagram according to its type. More... | |
| static void | scheduleDrawing (Tree t) |
| Schedule a makeBlockSchema diagram to be drawn. More... | |
| static bool | pendingDrawing (Tree &t) |
| Retrieve next block diagram that must be drawn. More... | |
| static schema * | generateAbstractionSchema (schema *x, Tree t) |
| Generate an abstraction schema by placing in sequence the input slots and the body. More... | |
| static schema * | generateOutputSlotSchema (Tree a) |
| Generate a 0->1 block schema for an output slot. More... | |
| static schema * | generateInputSlotSchema (Tree a) |
| Generate a 1->0 block schema for an input slot. More... | |
| static schema * | generateBargraphSchema (Tree t) |
| Generate a 1->1 block schema for a user interface bargraph. More... | |
| static schema * | generateUserInterfaceSchema (Tree t) |
| Generate a 0->1 block schema for a user interface element. More... | |
| static char * | legalFileName (Tree t, int n, char *dst) |
| Transform the definition name property of tree <t> into a legal file name. More... | |
| static schema * | addSchemaInputs (int ins, schema *x) |
| static schema * | addSchemaOutputs (int outs, schema *x) |
| void | drawSchema (Tree bd, const char *projname, const char *dev) |
| The entry point to generate from a block diagram as a set of svg files stored in the directory "<projname>-svg/" or "<projname>-ps/" depending of <dev>. More... | |
| static bool | isInverter (Tree t) |
| static bool | isPureRouting (Tree t) |
| static void | UserInterfaceDescription (Tree box, string &d) |
| Convert User interface element into a textual representation. More... | |
Variables | |
| int | gFoldThreshold |
| static Occurrences * | gOccurrences |
| static bool | sFoldingFlag |
| static stack< Tree > | gPendingExp |
| static set< Tree > | gDrawnExp |
| static const char * | gDevSuffix |
| static string | gSchemaFileName |
| static map< Tree, string > | gBackLink |
| Tree | gInverter [6] |
| isInverter(t) returns true if t == '*(-1)'. More... | |
| property< bool > | gPureRoutingProperty |
| Compute the Pure Routing property, that is expressions only made of cut, wires and slots. More... | |
Implement block-diagram schema generation in svg or postscript format.
The result is a folder containing one or more schema files in svg or ps format. Complex block-diagrams are automatically splitted.
Definition in file drawschema.cpp.
| #define invcolor "#ffffff" |
Definition at line 119 of file drawschema.cpp.
Referenced by generateInsideSchema().
| #define linkcolor "#003366" |
Definition at line 114 of file drawschema.cpp.
Referenced by generateDiagramSchema().
| #define normalcolor "#4B71A1" |
Definition at line 115 of file drawschema.cpp.
Referenced by generateInsideSchema().
| #define numcolor "#f44800" |
Definition at line 118 of file drawschema.cpp.
Referenced by generateInsideSchema().
| #define slotcolor "#47945E" |
Definition at line 117 of file drawschema.cpp.
Referenced by generateInputSlotSchema(), and generateOutputSlotSchema().
| #define uicolor "#477881" |
Definition at line 116 of file drawschema.cpp.
Referenced by generateBargraphSchema(), and generateUserInterfaceSchema().
Definition at line 600 of file drawschema.cpp.
References makeConnectorSchema(), makeParSchema(), and makeSeqSchema().
Referenced by writeSchemaFile().


Definition at line 619 of file drawschema.cpp.
References makeConnectorSchema(), makeParSchema(), and makeSeqSchema().
Referenced by writeSchemaFile().


| void drawSchema | ( | Tree | bd, |
| const char * | projname, | ||
| const char * | dev | ||
| ) |
The entry point to generate from a block diagram as a set of svg files stored in the directory "<projname>-svg/" or "<projname>-ps/" depending of <dev>.
Definition at line 161 of file drawschema.cpp.
References boxComplexity(), cholddir(), gDevSuffix, gFoldThreshold, mkchdir(), pendingDrawing(), scheduleDrawing(), sFoldingFlag, and writeSchemaFile().
Referenced by main(), and printDocDgm().


Generate an abstraction schema by placing in sequence the input slots and the body.
Definition at line 589 of file drawschema.cpp.
References generateDiagramSchema(), generateInputSlotSchema(), isBoxSymbolic(), makeParSchema(), and makeSeqSchema().
Referenced by generateInsideSchema().


Generate a 1->1 block schema for a user interface bargraph.
Definition at line 553 of file drawschema.cpp.
References makeBlockSchema(), uicolor, and UserInterfaceDescription().
Referenced by generateInsideSchema().


Generate an appropriate schema according to the type of block diagram.
When folding is requiered, instead of going down block-diagrams with a name, schedule them for an individual file.
Definition at line 358 of file drawschema.cpp.
References boxComplexity(), gDevSuffix, generateInsideSchema(), getBoxType(), getDefNameProperty(), isPureRouting(), legalFileName(), linkcolor, makeBlockSchema(), makeDecorateSchema(), scheduleDrawing(), sFoldingFlag, and tree2str().
Referenced by generateAbstractionSchema(), and generateInsideSchema().


Generate a 1->0 block schema for an input slot.
Definition at line 564 of file drawschema.cpp.
References getDefNameProperty(), makeBlockSchema(), slotcolor, and tree2str().
Referenced by generateAbstractionSchema(), and generateInsideSchema().


Generate the inside schema of a block diagram according to its type.
Definition at line 398 of file drawschema.cpp.
References xtended::arity(), extractName(), ffarity(), ffname(), generateAbstractionSchema(), generateBargraphSchema(), generateDiagramSchema(), generateInputSlotSchema(), generateOutputSlotSchema(), generateUserInterfaceSchema(), getDefNameProperty(), getUserData(), invcolor, isBoxButton(), isBoxCheckbox(), isBoxCut(), isBoxFConst(), isBoxFFun(), isBoxFVar(), isBoxHBargraph(), isBoxHGroup(), isBoxHSlider(), isBoxInt(), isBoxMerge(), isBoxNumEntry(), isBoxPar(), isBoxPrim0(), isBoxPrim1(), isBoxPrim2(), isBoxPrim3(), isBoxPrim4(), isBoxPrim5(), isBoxReal(), isBoxRec(), isBoxSeq(), isBoxSlot(), isBoxSplit(), isBoxSymbolic(), isBoxTGroup(), isBoxVBargraph(), isBoxVGroup(), isBoxVSlider(), isBoxWaveform(), isBoxWire(), isInverter(), makeBlockSchema(), makeCableSchema(), makeCutSchema(), makeDecorateSchema(), makeInverterSchema(), makeMergeSchema(), makeParSchema(), makeRecSchema(), makeSeqSchema(), makeSplitSchema(), xtended::name(), name(), normalcolor, numcolor, prim0name(), prim1name(), prim2name(), prim3name(), prim4name(), prim5name(), print(), and tree2str().
Referenced by generateDiagramSchema(), and writeSchemaFile().

Generate a 0->1 block schema for an output slot.
Definition at line 576 of file drawschema.cpp.
References getDefNameProperty(), makeBlockSchema(), slotcolor, and tree2str().
Referenced by generateInsideSchema().


Generate a 0->1 block schema for a user interface element.
Definition at line 543 of file drawschema.cpp.
References makeBlockSchema(), uicolor, and UserInterfaceDescription().
Referenced by generateInsideSchema().


|
static |
Definition at line 299 of file drawschema.cpp.
References boxInt(), boxPar(), boxPrim2(), boxReal(), boxSeq(), boxWire(), gInverter, sigMul(), and sigSub().
Referenced by generateInsideSchema(), and isPureRouting().


|
static |
Definition at line 326 of file drawschema.cpp.
References gPureRoutingProperty, isBoxCut(), isBoxMerge(), isBoxPar(), isBoxSeq(), isBoxSlot(), isBoxSplit(), isBoxWire(), and isInverter().
Referenced by generateDiagramSchema().


|
static |
Transform the definition name property of tree <t> into a legal file name.
The resulting file name is stored in <dst> a table of at least <n> chars. Returns the <dst> pointer for convenience.
Definition at line 271 of file drawschema.cpp.
References getDefNameProperty(), and tree2str().
Referenced by generateDiagramSchema(), and writeSchemaFile().


|
static |
Retrieve next block diagram that must be drawn.
Definition at line 202 of file drawschema.cpp.
References gPendingExp.
Referenced by drawSchema().

|
static |
Schedule a makeBlockSchema diagram to be drawn.
Definition at line 190 of file drawschema.cpp.
References gBackLink, gDrawnExp, gPendingExp, and gSchemaFileName.
Referenced by drawSchema(), and generateDiagramSchema().

|
static |
Convert User interface element into a textual representation.
Definition at line 480 of file drawschema.cpp.
References extractName(), isBoxButton(), isBoxCheckbox(), isBoxHBargraph(), isBoxHGroup(), isBoxHSlider(), isBoxNumEntry(), isBoxTGroup(), isBoxVBargraph(), isBoxVGroup(), isBoxVSlider(), max(), and min().
Referenced by generateBargraphSchema(), and generateUserInterfaceSchema().


|
static |
Write a top level diagram.
A top level diagram is decorated with its definition name property and is drawn in an individual file
Definition at line 219 of file drawschema.cpp.
References addSchemaInputs(), addSchemaOutputs(), schema::collectTraits(), collector::draw(), schema::draw(), gBackLink, gDevSuffix, generateInsideSchema(), getBoxType(), getDefNameProperty(), gOccurrences, gSchemaFileName, schema::height(), kLeftRight, legalFileName(), makeTopSchema(), schema::place(), tree(), tree2str(), unique(), and schema::width().
Referenced by drawSchema().


|
static |
Definition at line 135 of file drawschema.cpp.
Referenced by scheduleDrawing(), and writeSchemaFile().
|
static |
Definition at line 133 of file drawschema.cpp.
Referenced by drawSchema(), generateDiagramSchema(), and writeSchemaFile().
|
static |
Definition at line 132 of file drawschema.cpp.
Referenced by scheduleDrawing().
| int gFoldThreshold |
Definition at line 126 of file main.cpp.
Referenced by drawSchema(), and process_cmdline().
| Tree gInverter[6] |
isInverter(t) returns true if t == '*(-1)'.
This test is used to simplify diagram by using a special symbol for inverters.
Definition at line 297 of file drawschema.cpp.
Referenced by isInverter().
|
static |
Definition at line 129 of file drawschema.cpp.
Referenced by writeSchemaFile().
|
static |
Definition at line 131 of file drawschema.cpp.
Referenced by pendingDrawing(), and scheduleDrawing().
| property<bool> gPureRoutingProperty |
Compute the Pure Routing property, that is expressions only made of cut, wires and slots.
No labels will be dispayed for pure routing expressions.
Definition at line 324 of file drawschema.cpp.
Referenced by isPureRouting().
|
static |
Definition at line 134 of file drawschema.cpp.
Referenced by scheduleDrawing(), and writeSchemaFile().
|
static |
Definition at line 130 of file drawschema.cpp.
Referenced by drawSchema(), and generateDiagramSchema().
1.8.7