45 point(
double u,
double v) : x(u), y(v) {}
49 if (x < p.
x)
return true;
50 else if (x > p.
x)
return false;
51 else if (y < p.
y)
return true;
67 if (start < t.
start)
return true;
68 else if (t.
start < start)
return false;
69 else if (end < t.
end)
return true;
85 void computeVisibleTraits();
86 bool isVisible(
const trait& t);
113 schema(
unsigned int inputs,
unsigned int outputs,
double width,
double height)
126 double width()
const {
return fWidth; }
127 double height()
const {
return fHeight; }
128 unsigned int inputs()
const {
return fInputs; }
129 unsigned int outputs()
const {
return fOutputs; }
133 { fX = x; fY = y; fOrientation = orientation; }
138 double x()
const {
return fX; }
139 double y()
const {
return fY; }
144 virtual void place(
double x,
double y,
int orientation) = 0;
145 virtual void draw(
device& dev) = 0;
146 virtual point inputPoint(
unsigned int i)
const = 0;
147 virtual point outputPoint(
unsigned int i)
const = 0;
148 virtual void collectTraits(
collector& c) = 0;
154 unsigned int outputs,
void addOutput(const point &p)
void addTrait(const trait &t)
schema * makeInverterSchema(const string &color)
Build n cables in parallel.
unsigned int outputs() const
schema * makeConnectorSchema()
Connectors are used to ensure unused inputs and outputs are drawn.
const double dWire
distance between two wires
schema * makeEnlargedSchema(schema *s, double width)
Returns an enlarged schema, but only if really needed that is if the requiered width is greater that ...
const unsigned int fOutputs
void beginPlace(double x, double y, int orientation)
void draw(device &dev) const
bool fPlaced
false until place() is called
schema * makeCableSchema(unsigned int n=1)
Build n cables in parallel.
const double dVert
marge verticale
unsigned int inputs() const
bool operator<(const trait &t) const
schema * makeMergeSchema(schema *s1, schema *s2)
Creates a new merge schema.
point(double u, double v)
const unsigned int fInputs
trait(const point &p1, const point &p2)
schema * makeSplitSchema(schema *s1, schema *s2)
Creates a new split schema.
schema * makeParSchema(schema *s1, schema *s2)
schema * makeBlockSchema(unsigned int inputs, unsigned int outputs, const string &name, const string &color, const string &link)
Build a simple colored blockSchema with a certain number of inputs and outputs, a text to be displaye...
schema * makeTopSchema(schema *s1, double margin, const string &text, const string &link)
Creates a new top schema.
schema(unsigned int inputs, unsigned int outputs, double width, double height)
const char * name(Symbol *sym)
Returns the name of a symbol.
An abstract block diagram schema.
const double dHorz
marge horizontale
schema * makeRecSchema(schema *s1, schema *s2)
Creates a new recursive schema (s1 ~ s2).
void addInput(const point &p)
const double dLetter
width of a letter
schema * makeSeqSchema(schema *s1, schema *s2)
Make a sequential schema.
schema * makeDecorateSchema(schema *s1, double margin, const string &text)
Creates a new decorated schema.
bool operator<(const point &p) const
virtual void trait(double x1, double y1, double x2, double y2)=0
schema * makeCutSchema()
Creates a new Cut schema.