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
8fd9c26f
Commit
8fd9c26f
authored
Feb 10, 2018
by
Davis King
Browse files
Made dlib.point() have writable x and y properties.
parent
fa39e518
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tools/python/src/vector.cpp
tools/python/src/vector.cpp
+2
-2
No files found.
tools/python/src/vector.cpp
View file @
8fd9c26f
...
...
@@ -167,8 +167,8 @@ void bind_vector(py::module& m)
.
def
(
py
::
init
<
long
,
long
>
(),
py
::
arg
(
"x"
),
py
::
arg
(
"y"
))
.
def
(
"__repr__"
,
&
point__repr__
)
.
def
(
"__str__"
,
&
point__str__
)
.
def_property
_readonly
(
"x"
,
&
point_x
,
"The x-coordinate of the point."
)
.
def_property
_readonly
(
"y"
,
&
point_y
,
"The y-coordinate of the point."
)
.
def_property
(
"x"
,
&
point_x
,
[](
point
&
p
,
long
x
){
p
.
x
()
=
x
;},
"The x-coordinate of the point."
)
.
def_property
(
"y"
,
&
point_y
,
[](
point
&
p
,
long
y
){
p
.
x
()
=
y
;},
"The y-coordinate of the point."
)
.
def
(
py
::
pickle
(
&
getstate
<
type
>
,
&
setstate
<
type
>
));
}
{
...
...
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