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
908f5540
Commit
908f5540
authored
Jun 02, 2018
by
Davis King
Browse files
Make arrays of points and rectangles constructable with a size in the Python API.
parent
44c06150
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
tools/python/src/rectangles.cpp
tools/python/src/rectangles.cpp
+2
-0
tools/python/src/vector.cpp
tools/python/src/vector.cpp
+2
-0
No files found.
tools/python/src/rectangles.cpp
View file @
908f5540
...
@@ -241,6 +241,7 @@ ensures \n\
...
@@ -241,6 +241,7 @@ ensures \n\
{
{
typedef
std
::
vector
<
rectangle
>
type
;
typedef
std
::
vector
<
rectangle
>
type
;
py
::
bind_vector
<
type
>
(
m
,
"rectangles"
,
"An array of rectangle objects."
)
py
::
bind_vector
<
type
>
(
m
,
"rectangles"
,
"An array of rectangle objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
rectangle
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
rectangle
>
)
...
@@ -250,6 +251,7 @@ ensures \n\
...
@@ -250,6 +251,7 @@ ensures \n\
{
{
typedef
std
::
vector
<
std
::
vector
<
rectangle
>>
type
;
typedef
std
::
vector
<
std
::
vector
<
rectangle
>>
type
;
py
::
bind_vector
<
type
>
(
m
,
"rectangless"
,
"An array of arrays of rectangle objects."
)
py
::
bind_vector
<
type
>
(
m
,
"rectangless"
,
"An array of arrays of rectangle objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
rectangle
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
rectangle
>
)
...
...
tools/python/src/vector.cpp
View file @
908f5540
...
@@ -438,6 +438,7 @@ void bind_vector(py::module& m)
...
@@ -438,6 +438,7 @@ void bind_vector(py::module& m)
{
{
typedef
std
::
vector
<
point
>
type
;
typedef
std
::
vector
<
point
>
type
;
py
::
bind_vector
<
type
>
(
m
,
"points"
,
"An array of point objects."
)
py
::
bind_vector
<
type
>
(
m
,
"points"
,
"An array of point objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
point
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
point
>
)
...
@@ -467,6 +468,7 @@ void bind_vector(py::module& m)
...
@@ -467,6 +468,7 @@ void bind_vector(py::module& m)
{
{
typedef
std
::
vector
<
dpoint
>
type
;
typedef
std
::
vector
<
dpoint
>
type
;
py
::
bind_vector
<
type
>
(
m
,
"dpoints"
,
"An array of dpoint objects."
)
py
::
bind_vector
<
type
>
(
m
,
"dpoints"
,
"An array of dpoint objects."
)
.
def
(
py
::
init
<
size_t
>
(),
py
::
arg
(
"initial_size"
))
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"clear"
,
&
type
::
clear
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"resize"
,
resize
<
type
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
dpoint
>
)
.
def
(
"extend"
,
extend_vector_with_python_list
<
dpoint
>
)
...
...
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