Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
openmesh-python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenMesh
openmesh-python
Commits
2b6ec7fe
Commit
2b6ec7fe
authored
4 years ago
by
Isaak Lim
Browse files
Options
Downloads
Patches
Plain Diff
property handles map to py::object instead of py::none
parent
3d26ee3c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#16103
failed
4 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/MeshTypes.hh
+11
-5
11 additions, 5 deletions
src/MeshTypes.hh
with
11 additions
and
5 deletions
src/MeshTypes.hh
+
11
−
5
View file @
2b6ec7fe
...
...
@@ -13,6 +13,8 @@
#include
<pybind11/pybind11.h>
#include
<pybind11/numpy.h>
#include
<iostream>
#include
<typeinfo>
namespace
py
=
pybind11
;
...
...
@@ -38,13 +40,13 @@ template <class Mesh>
class
MeshWrapperT
:
public
Mesh
{
public:
typedef
OpenMesh
::
VPropHandleT
<
py
::
none
>
VPropHandle
;
typedef
OpenMesh
::
HPropHandleT
<
py
::
none
>
HPropHandle
;
typedef
OpenMesh
::
EPropHandleT
<
py
::
none
>
EPropHandle
;
typedef
OpenMesh
::
FPropHandleT
<
py
::
none
>
FPropHandle
;
typedef
OpenMesh
::
VPropHandleT
<
py
::
object
>
VPropHandle
;
typedef
OpenMesh
::
HPropHandleT
<
py
::
object
>
HPropHandle
;
typedef
OpenMesh
::
EPropHandleT
<
py
::
object
>
EPropHandle
;
typedef
OpenMesh
::
FPropHandleT
<
py
::
object
>
FPropHandle
;
template
<
class
Handle
,
class
PropHandle
>
py
::
none
py_property
(
const
std
::
string
&
_name
,
Handle
_h
)
{
py
::
object
py_property
(
const
std
::
string
&
_name
,
Handle
_h
)
{
const
auto
prop
=
py_prop_on_demand
<
Handle
,
PropHandle
>
(
_name
);
return
Mesh
::
property
(
prop
,
_h
);
}
...
...
@@ -238,6 +240,10 @@ private:
PropHandle
prop
;
Mesh
::
add_property
(
prop
,
_name
);
prop_map
[
_name
]
=
prop
;
const
size_t
n
=
py_n_items
(
Handle
());
for
(
size_t
i
=
0
;
i
<
n
;
++
i
)
{
Mesh
::
property
(
prop
,
Handle
(
i
))
=
py
::
none
();
}
}
return
prop_map
.
at
(
_name
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment