2 Copyright (c) 2002-2009 Tampere University.
4 This file is part of TTA-Based Codesign Environment (TCE).
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:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
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.
27 * Inline implementation of Figure class.
29 * @author Ari Metsähalme 2004 (ari.metsahalme-no.spam-tut.fi)
30 * @note rating: yellow
31 * @note reviewed Jul 22 2004 by tr, ml, jm, am
39 * Returns the top-left location of the Figure's bounding rectangle.
41 * @return The top-left location of the Figure's bounding rectangle.
44 Figure::location() const {
49 * Sets the top-left location of the Figure's bounding rectangle.
51 * @param point New location.
54 Figure::setLocation(wxPoint point) {
59 * Sets the x-coordinate of the Figure's location.
61 * @param x New x-coordinate.
70 * Sets the y-coordinate of the Figure's location.
72 * @param y New y-coordinate.
80 * Returns the Figure's bounding rectangle.
82 * @return The Figure's bounding rectangle.
85 Figure::bounds() const {
86 return wxRect(location_, size_);
90 * Returns the Figure's virtual bounding rectangle for easying
91 * selection of smaller blocks.
93 * Default implementation returns normal bounds.
95 * @return The Figure's virtual bounding rectangle.
98 Figure::virtualBounds() const {
99 return wxRect(location_, size_);
103 * Sets an 'ok' x-coordinate, that will be used if not decided
106 * @param prefX New preferred x-coordinate.
109 Figure::setPreferredX(int prefX) {
114 * Tells if the x-coordinate of the Figure has been finally decided.
116 * @return True if x-coordinate has been fixed.
119 Figure::xSet() const {
124 * Clears the flag that tells that the x-coordinate of this Figure has
128 Figure::clearXSetFlag() {
133 * Adds a Figure as a child of this Figure.
135 * @param child Child to be added.
138 Figure::addChild(Figure* child) {
139 children_.push_back(child);
143 * Returns the number of child Figures.
145 * @return The number of child Figures.
148 Figure::childCount() const {
149 return children_.size();
153 * Returns the child figure at index.
155 * @param index Index of the child to return.
156 * @return The child figure corresponding to the given index.
159 Figure::child(int index) const {
160 return children_[index];
164 * Empty default implementation that can be used if no specific laying
165 * out needs to be done.
168 Figure::layoutSelf(wxDC*) {
172 * Empty default implementation that can be used if the Figure is invisible.
174 * @param dc Device context.
177 Figure::drawSelf(wxDC*) {