Minsky: 3.17.0
lasso.h
Go to the documentation of this file.
1
/*
2
@copyright Steve Keen 2021
3
@author Russell Standish
4
This file is part of Minsky.
5
6
Minsky is free software: you can redistribute it and/or modify it
7
under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
Minsky 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 Minsky. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef LASSO_H
21
#define LASSO_H
22
23
namespace
minsky
24
{
25
class
Wire;
26
28
struct
LassoBox
29
{
30
float
x0
=0,
y0
=0,
x1
=0,
y1
=0,
angle
=0;
31
LassoBox
() {}
32
LassoBox
(
float
x0
,
float
y0
,
float
x1
,
float
y1
);
33
35
template
<
class
Item>
36
bool
intersects
(
const
Item
& item)
const
{
37
return
item.
right
() >=
x0
&& item.
left
() <=
x1
&&
38
item.
bottom
() >=
y0
&& item.
top
() <=
y1
;
39
}
40
43
bool
contains
(
const
Wire
&
wire
)
const
;
44
};
45
}
46
47
#include "lasso.cd"
48
#include "lasso.xcd"
49
#endif
minsky::LassoBox::intersects
bool intersects(const Item &item) const
returns whether item's icon overlaps the lasso
Definition:
lasso.h:36
minsky::Item::right
float right() const
Definition:
item.cc:170
minsky::Item::top
float top() const
Definition:
item.cc:177
minsky::Item
Definition:
item.h:146
minsky::LassoBox
represents rectangular region of a lasso operation
Definition:
lasso.h:28
minsky::LassoBox::contains
bool contains(const Wire &wire) const
return true if both endpoints of the wire lie within the lasso
Definition:
lasso.cc:37
minsky::LassoBox::angle
float angle
Definition:
lasso.h:30
minsky::Wire
Definition:
wire.h:39
minsky::Item::left
float left() const
Definition:
item.cc:163
minsky
Definition:
constMap.h:22
minsky::Item::bottom
float bottom() const
Definition:
item.cc:184
minsky::LassoBox::x0
float x0
Definition:
lasso.h:30
minsky::LassoBox::y1
float y1
Definition:
lasso.h:30
minsky::LassoBox::x1
float x1
Definition:
lasso.h:30
minsky::LassoBox::y0
float y0
Definition:
lasso.h:30
minsky::wire
Definition:
minsky.h:117
minsky::LassoBox::LassoBox
LassoBox()
Definition:
lasso.h:31
model
lasso.h
Generated on Wed Jun 18 2025 16:22:22 for Minsky: 3.17.0 by
1.8.14