FAUST compiler  0.9.9.6b8
inverterSchema.cpp
Go to the documentation of this file.
1 
2 /************************************************************************
3  ************************************************************************
4  FAUST compiler
5  Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
6  ---------------------------------------------------------------------
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  ************************************************************************
21  ************************************************************************/
22 
23 
24 #include "inverterSchema.h"
25 #include <assert.h>
26 #include <iostream>
27 
28 using namespace std;
29 
30 //#define invcolor "#f44444"
31 
32 
36 schema* makeInverterSchema (const string& color)
37 {
38  return new inverterSchema(color);
39 }
40 
41 
45 inverterSchema::inverterSchema(const string& color)
46  : blockSchema (1, 1, 2.5*dWire, dWire, "-1", color, "")
47 {
48 }
49 
50 
56 {
57  dev.triangle(x() + dHorz, y()+0.5, width() - 2*dHorz, height()-1, fColor.c_str(),fLink.c_str(), orientation()==kLeftRight);
58 }
const string fLink
option URL link
Definition: blockSchema.h:40
const double dWire
distance between two wires
Definition: schema.h:33
virtual void draw(device &dev)
Nothing to draw.
double y() const
Definition: schema.h:139
double width() const
Definition: schema.h:126
schema * makeInverterSchema(const string &color)
Build n cables in parallel.
Definition: device.h:32
inverterSchema(const string &color)
Build n cables in parallel.
A simple rectangular box with a text and inputs and outputs.
Definition: blockSchema.h:35
double x() const
Definition: schema.h:138
int orientation() const
Definition: schema.h:140
An inverter : a special symbol corresponding to '*(-1)' to create more compact diagrams.
An abstract block diagram schema.
Definition: schema.h:97
double height() const
Definition: schema.h:127
const double dHorz
marge horizontale
Definition: schema.h:36
virtual void triangle(double x, double y, double l, double h, const char *color, const char *link, bool leftright)=0
const string fColor
color of the box
Definition: blockSchema.h:39