topSchema Class Reference

A topSchema is a schema surrounded by a dashed rectangle with a label on the top left. More...

#include <topSchema.h>

Inheritance diagram for topSchema:

schema

List of all members.

Public Member Functions

virtual void place (double ox, double oy, int orientation)
 Define the graphic position of the schema.
virtual void draw (device &dev)
 Draw the enlarged schema.
virtual point inputPoint (unsigned int i)
 Top schema has no input.
virtual point outputPoint (unsigned int i)
 Top schema has no output.

Private Member Functions

 topSchema (schema *s1, double margin, const string &text, const string &link)
 A topSchema is a schema surrounded by a dashed rectangle with a label on the top left.

Friends

schemamakeTopSchema (schema *s1, double margin, const string &text, const string &link)
 Creates a new top schema.


Detailed Description

A topSchema is a schema surrounded by a dashed rectangle with a label on the top left.

The rectangle is placed at half the margin parameter. Arrows are added to all the outputs

Definition at line 34 of file topSchema.h.


Constructor & Destructor Documentation

topSchema::topSchema ( schema s,
double  margin,
const string &  text,
const string &  link 
) [private]

A topSchema is a schema surrounded by a dashed rectangle with a label on the top left.

The rectangle is placed at half the margin parameter. Arrows are added to the outputs. The constructor is made private to enforce the usage of makeTopSchema.

Definition at line 44 of file topSchema.cpp.

00045     :   schema(0, 0, s->width()+2*margin, s->height()+2*margin),
00046         fSchema(s),
00047         fMargin(margin),
00048         fText(text),
00049         fLink(link)
00050 {
00051 }


Member Function Documentation

void topSchema::draw ( device &  dev  )  [virtual]

Draw the enlarged schema.

This methos can only be called after the block have been placed

Implements schema.

Definition at line 91 of file topSchema.cpp.

00092 {
00093     assert(placed());
00094 
00095     // draw a background white rectangle
00096     dev.rect(x(), y(), width()-1, height()-1, "#ffffff", fLink.c_str());
00097 
00098     // draw the label
00099     dev.label(x()+fMargin, y()+fMargin/2, fText.c_str());
00100 
00101     fSchema->draw(dev);
00102 
00103     // draw arrows at output points of schema
00104     for (unsigned int i=0; i<fSchema->outputs(); i++) {
00105         point p = fSchema->outputPoint(i);
00106         dev.fleche(p.x, p.y, 0, orientation());
00107     }
00108 }

void topSchema::place ( double  ox,
double  oy,
int  orientation 
) [virtual]

Define the graphic position of the schema.

Computes the graphic position of all the elements, in particular the inputs and outputs. This method must be called before draw(), otherwise draw is not allowed

Implements schema.

Definition at line 59 of file topSchema.cpp.

00060 {
00061     beginPlace(ox, oy, orientation);
00062 
00063     fSchema->place(ox+fMargin, oy+fMargin, orientation);
00064     endPlace();
00065 }


The documentation for this class was generated from the following files:

Generated on Sat Jul 25 13:29:16 2009 for FAUST compiler by  doxygen 1.5.9