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
19005f68
"tools/python/vscode:/vscode.git/clone" did not exist on "0249bcb9dec85b582b7af69a7922dd22242bb16b"
Commit
19005f68
authored
Jun 17, 2018
by
Davis King
Browse files
Added translate_rect() to python API
parent
165310c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
tools/python/src/rectangles.cpp
tools/python/src/rectangles.cpp
+22
-0
No files found.
tools/python/src/rectangles.cpp
View file @
19005f68
...
@@ -258,6 +258,28 @@ ensures \n\
...
@@ -258,6 +258,28 @@ ensures \n\
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
}
}
m
.
def
(
"translate_rect"
,
[](
const
rectangle
&
rect
,
const
point
&
p
){
return
translate_rect
(
rect
,
p
);},
" returns rectangle(rect.left()+p.x, rect.top()+p.y, rect.right()+p.x, rect.bottom()+p.y)
\n
\
(i.e. moves the location of the rectangle but doesn't change its shape)"
,
py
::
arg
(
"rect"
),
py
::
arg
(
"p"
));
m
.
def
(
"translate_rect"
,
[](
const
drectangle
&
rect
,
const
point
&
p
){
return
translate_rect
(
rect
,
p
);},
" returns rectangle(rect.left()+p.x, rect.top()+p.y, rect.right()+p.x, rect.bottom()+p.y)
\n
\
(i.e. moves the location of the rectangle but doesn't change its shape)"
,
py
::
arg
(
"rect"
),
py
::
arg
(
"p"
));
m
.
def
(
"translate_rect"
,
[](
const
rectangle
&
rect
,
const
dpoint
&
p
){
return
translate_rect
(
rect
,
point
(
p
));},
" returns rectangle(rect.left()+p.x, rect.top()+p.y, rect.right()+p.x, rect.bottom()+p.y)
\n
\
(i.e. moves the location of the rectangle but doesn't change its shape)"
,
py
::
arg
(
"rect"
),
py
::
arg
(
"p"
));
m
.
def
(
"translate_rect"
,
[](
const
drectangle
&
rect
,
const
dpoint
&
p
){
return
translate_rect
(
rect
,
p
);},
" returns rectangle(rect.left()+p.x, rect.top()+p.y, rect.right()+p.x, rect.bottom()+p.y)
\n
\
(i.e. moves the location of the rectangle but doesn't change its shape)"
,
py
::
arg
(
"rect"
),
py
::
arg
(
"p"
));
m
.
def
(
"shrink_rect"
,
[](
const
rectangle
&
rect
,
long
num
){
return
shrink_rect
(
rect
,
num
);},
m
.
def
(
"shrink_rect"
,
[](
const
rectangle
&
rect
,
long
num
){
return
shrink_rect
(
rect
,
num
);},
" returns rectangle(rect.left()+num, rect.top()+num, rect.right()-num, rect.bottom()-num)
\n
\
" returns rectangle(rect.left()+num, rect.top()+num, rect.right()-num, rect.bottom()-num)
\n
\
(i.e. shrinks the given rectangle by shrinking its border by num)"
,
(i.e. shrinks the given rectangle by shrinking its border by num)"
,
...
...
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