Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
34265709
Commit
34265709
authored
May 28, 2018
by
Davis King
Browse files
More overloads for rectangle.contains()
parent
4f2f565c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
tools/python/src/rectangles.cpp
tools/python/src/rectangles.cpp
+6
-4
No files found.
tools/python/src/rectangles.cpp
View file @
34265709
...
@@ -41,8 +41,8 @@ point center(const rect_type& r) { return center(r); }
...
@@ -41,8 +41,8 @@ point center(const rect_type& r) { return center(r); }
template
<
typename
rect_type
>
template
<
typename
rect_type
>
point
dcenter
(
const
rect_type
&
r
)
{
return
dcenter
(
r
);
}
point
dcenter
(
const
rect_type
&
r
)
{
return
dcenter
(
r
);
}
template
<
typename
rect_type
>
template
<
typename
rect_type
,
typename
ptype
>
bool
contains
(
const
rect_type
&
r
,
const
p
oint
&
p
)
{
return
r
.
contains
(
p
);
}
bool
contains
(
const
rect_type
&
r
,
const
p
type
&
p
)
{
return
r
.
contains
(
p
);
}
template
<
typename
rect_type
>
template
<
typename
rect_type
>
bool
contains_xy
(
const
rect_type
&
r
,
const
long
x
,
const
long
y
)
{
return
r
.
contains
(
point
(
x
,
y
));
}
bool
contains_xy
(
const
rect_type
&
r
,
const
long
x
,
const
long
y
)
{
return
r
.
contains
(
point
(
x
,
y
));
}
...
@@ -113,7 +113,8 @@ void bind_rectangles(py::module& m)
...
@@ -113,7 +113,8 @@ void bind_rectangles(py::module& m)
.
def
(
"is_empty"
,
&::
is_empty
<
type
>
)
.
def
(
"is_empty"
,
&::
is_empty
<
type
>
)
.
def
(
"center"
,
&::
center
<
type
>
)
.
def
(
"center"
,
&::
center
<
type
>
)
.
def
(
"dcenter"
,
&::
dcenter
<
type
>
)
.
def
(
"dcenter"
,
&::
dcenter
<
type
>
)
.
def
(
"contains"
,
&::
contains
<
type
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
point
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
dpoint
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains_xy
<
type
>
,
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"contains"
,
&::
contains_xy
<
type
>
,
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"contains"
,
&::
contains_rec
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"contains"
,
&::
contains_rec
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"intersect"
,
&::
intersect
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"intersect"
,
&::
intersect
<
type
>
,
py
::
arg
(
"rectangle"
))
...
@@ -148,7 +149,8 @@ void bind_rectangles(py::module& m)
...
@@ -148,7 +149,8 @@ void bind_rectangles(py::module& m)
.
def
(
"tr_corner"
,
&
type
::
tr_corner
,
"Returns the top right corner of the rectangle."
)
.
def
(
"tr_corner"
,
&
type
::
tr_corner
,
"Returns the top right corner of the rectangle."
)
.
def
(
"bl_corner"
,
&
type
::
bl_corner
,
"Returns the bottom left corner of the rectangle."
)
.
def
(
"bl_corner"
,
&
type
::
bl_corner
,
"Returns the bottom left corner of the rectangle."
)
.
def
(
"br_corner"
,
&
type
::
br_corner
,
"Returns the bottom right corner of the rectangle."
)
.
def
(
"br_corner"
,
&
type
::
br_corner
,
"Returns the bottom right corner of the rectangle."
)
.
def
(
"contains"
,
&::
contains
<
type
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
point
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains
<
type
,
dpoint
>
,
py
::
arg
(
"point"
))
.
def
(
"contains"
,
&::
contains_xy
<
type
>
,
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"contains"
,
&::
contains_xy
<
type
>
,
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"contains"
,
&::
contains_rec
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"contains"
,
&::
contains_rec
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"intersect"
,
&::
intersect
<
type
>
,
py
::
arg
(
"rectangle"
))
.
def
(
"intersect"
,
&::
intersect
<
type
>
,
py
::
arg
(
"rectangle"
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment