FAUST compiler  0.9.9.6b8
cutSchema.cpp
Go to the documentation of this file.
1 /************************************************************************
2  ************************************************************************
3  FAUST compiler
4  Copyright (C) 2003-2004 GRAME, Centre National de Creation Musicale
5  ---------------------------------------------------------------------
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  ************************************************************************
20  ************************************************************************/
21 
22 
23 #include "cutSchema.h"
24 #include <assert.h>
25 
26 using namespace std;
27 
28 
29 
34 {
35  return new cutSchema();
36 }
37 
38 
46  : schema (1, 0, 0, dWire/100.0), fPoint(0,0)
47 {}
48 
49 
53 void cutSchema::place(double ox, double oy, int orientation)
54 {
55  beginPlace(ox, oy, orientation);
56  fPoint = point(ox, oy + height()*0.5); //, -1);
57  endPlace();
58 }
59 
60 
65 {
66  //dev.rond(fPoint.x, fPoint.y, dWire/8.0);
67 }
68 
70 {}
71 
75 point cutSchema::inputPoint(unsigned int i) const
76 {
77  assert(i==0);
78  return fPoint;
79 }
80 
84 point cutSchema::outputPoint(unsigned int) const
85 {
86  assert(false);
87  return point(-1,-1);
88 }
89 
90 
void endPlace()
Definition: schema.h:134
const double dWire
distance between two wires
Definition: schema.h:33
virtual void collectTraits(collector &c)
Definition: cutSchema.cpp:69
void beginPlace(double x, double y, int orientation)
Definition: schema.h:132
schema * makeCutSchema()
Creates a new Cut schema.
Definition: cutSchema.cpp:33
point fPoint
Definition: cutSchema.h:34
Terminate a cable (cut box)
Definition: cutSchema.h:32
cutSchema()
A Cut is represented by a small black dot.
Definition: cutSchema.cpp:45
virtual void place(double x, double y, int orientation)
The input point is placed in the middle.
Definition: cutSchema.cpp:53
virtual point outputPoint(unsigned int i) const
By definition a Cut has no output point.
Definition: cutSchema.cpp:84
Definition: device.h:32
virtual void draw(device &dev)
A cut is represented by a small black dot.
Definition: cutSchema.cpp:64
Definition: schema.h:40
An abstract block diagram schema.
Definition: schema.h:97
double height() const
Definition: schema.h:127
virtual point inputPoint(unsigned int i) const
By definition a Cut has only one input point.
Definition: cutSchema.cpp:75