OpenASIP 2.2
Loading...
Searching...
No Matches
BidirBridgeFigure.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2009 Tampere University.
3
4 This file is part of TTA-Based Codesign Environment (TCE).
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23 */
24/**
25 * @file BidirBridgeFigure.cc
26 *
27 * Definition of BidirBridgeFigure class.
28 *
29 * @author Ari Metsähalme 2004 (ari.metsahalme-no.spam-tut.fi)
30 * @note rating: yellow
31 * @note reviewed Jul 27 2004 by ml, pj, am
32 */
33
34#include <vector>
35
36#include "Application.hh"
37#include "BidirBridgeFigure.hh"
38#include "BridgeFigure.hh"
40
41using std::vector;
42
43/**
44 * The Constructor.
45 */
52
53/**
54 * The Destructor.
55 */
58
59/**
60 * Lays out the two child bridges.
61 *
62 * @param dc Device context.
63 */
64void
66
67 assert(children_.size() == 2);
68
69 dynamic_cast<BridgeFigure*>(
71
73 children_[0]->setY(location_.y);
74 children_[0]->setWidth(size_.GetWidth());
75 children_[0]->layout(dc);
76
77 dynamic_cast<BridgeFigure*>(
79
81 children_[1]->setY(
83
84 children_[1]->setWidth(size_.GetWidth());
85 children_[1]->layout(dc);
86}
87
88/**
89 * This figure is not visible on the canvas.
90 *
91 * Empty implementation is defined to override BridgeFigure.
92 */
93void
#define assert(condition)
virtual void layoutChildren(wxDC *)
virtual void drawSelf(wxDC *dc)
void setDirection(BridgeFigure::Direction direction)
wxSize minSize_
Figure's minimum size.
Definition Figure.hh:88
void setX(int x)
std::vector< Figure * > children_
Figure's children.
Definition Figure.hh:90
wxSize size_
wxSize of the Figure's bounding rectangle.
Definition Figure.hh:86
wxPoint location_
Top-left location of the Figure's bounding rectangle.
Definition Figure.hh:84
static const int BRIDGE_WIDTH
Width of a bridge.
static const int BRIDGE_HEIGHT
Height of a bridge.