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
a40e0497
There was a problem fetching the pipeline summary.
Commit
a40e0497
authored
7 years ago
by
Alexander Dielen
Browse files
Options
Downloads
Patches
Plain Diff
request status on demand and return by reference
parent
f5a1c90c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Mesh.hh
+39
-45
39 additions, 45 deletions
src/Mesh.hh
with
39 additions
and
45 deletions
src/Mesh.hh
+
39
−
45
View file @
a40e0497
...
...
@@ -16,31 +16,6 @@ namespace py = pybind11;
namespace
OM
=
OpenMesh
;
/**
* Return value policy for functions that return references to objects that are
* managed by %OpenMesh.
*/
#define OPENMESH_PYTHON_DEFAULT_POLICY py::return_value_policy::copy
/**
* Set the status of an item.
*
* @tparam Mesh A mesh type.
* @tparam PropHandle A handle type.
*
* @param _self The mesh instance that is to be used.
* @param _h The handle of the item whose status is to be set.
* @param _info The status to be set.
*
* Depending on @ref OPENMESH_PYTHON_DEFAULT_POLICY, Mesh::status may
* return by value instead of reference. This function ensures that the
* status of an item can be changed nonetheless.
*/
template
<
class
Mesh
,
class
IndexHandle
>
void
set_status
(
Mesh
&
_self
,
IndexHandle
_h
,
const
OpenMesh
::
Attributes
::
StatusInfo
&
_info
)
{
_self
.
status
(
_h
)
=
_info
;
}
/**
* Thin wrapper for assign_connectivity.
*
...
...
@@ -497,18 +472,6 @@ void expose_mesh(py::module& m, const char *_name) {
const
typename
Mesh
::
Edge
&
(
Mesh
::*
edge
)(
OM
::
EdgeHandle
)
const
=
&
Mesh
::
edge
;
const
typename
Mesh
::
Face
&
(
Mesh
::*
face
)(
OM
::
FaceHandle
)
const
=
&
Mesh
::
face
;
// Get value of a standard property (status)
const
StatusInfo
&
(
Mesh
::*
status_vh
)(
OM
::
VertexHandle
)
const
=
&
Mesh
::
status
;
const
StatusInfo
&
(
Mesh
::*
status_hh
)(
OM
::
HalfedgeHandle
)
const
=
&
Mesh
::
status
;
const
StatusInfo
&
(
Mesh
::*
status_eh
)(
OM
::
EdgeHandle
)
const
=
&
Mesh
::
status
;
const
StatusInfo
&
(
Mesh
::*
status_fh
)(
OM
::
FaceHandle
)
const
=
&
Mesh
::
status
;
// Set value of a standard property (status)
void
(
*
set_status_vh
)(
Mesh
&
,
OM
::
VertexHandle
,
const
StatusInfo
&
)
=
&
set_status
;
void
(
*
set_status_hh
)(
Mesh
&
,
OM
::
HalfedgeHandle
,
const
StatusInfo
&
)
=
&
set_status
;
void
(
*
set_status_eh
)(
Mesh
&
,
OM
::
EdgeHandle
,
const
StatusInfo
&
)
=
&
set_status
;
void
(
*
set_status_fh
)(
Mesh
&
,
OM
::
FaceHandle
,
const
StatusInfo
&
)
=
&
set_status
;
// Low-level adding new items
OM
::
VertexHandle
(
Mesh
::*
new_vertex_void
)(
void
)
=
&
Mesh
::
new_vertex
;
OM
::
FaceHandle
(
Mesh
::*
new_face_void
)(
void
)
=
&
Mesh
::
new_face
;
...
...
@@ -654,14 +617,45 @@ void expose_mesh(py::module& m, const char *_name) {
.
def
(
"halfedge_handle"
,
halfedge_handle_fh
)
.
def
(
"set_halfedge_handle"
,
set_halfedge_handle_fh_hh
)
.
def
(
"status"
,
status_vh
,
OPENMESH_PYTHON_DEFAULT_POLICY
)
.
def
(
"set_status"
,
set_status_vh
)
.
def
(
"status"
,
status_hh
,
OPENMESH_PYTHON_DEFAULT_POLICY
)
.
def
(
"set_status"
,
set_status_hh
)
.
def
(
"status"
,
status_eh
,
OPENMESH_PYTHON_DEFAULT_POLICY
)
.
def
(
"set_status"
,
set_status_eh
)
.
def
(
"status"
,
status_fh
,
OPENMESH_PYTHON_DEFAULT_POLICY
)
.
def
(
"set_status"
,
set_status_fh
)
.
def
(
"status"
,
[](
Mesh
&
_self
,
OM
::
VertexHandle
_vh
)
->
StatusInfo
&
{
if
(
!
_self
.
has_vertex_status
())
_self
.
request_vertex_status
();
return
_self
.
status
(
_vh
);
},
py
::
return_value_policy
::
reference_internal
)
.
def
(
"set_status"
,
[](
Mesh
&
_self
,
OM
::
VertexHandle
_vh
,
const
StatusInfo
&
_info
)
{
if
(
!
_self
.
has_vertex_status
())
_self
.
request_vertex_status
();
_self
.
status
(
_vh
)
=
_info
;
})
.
def
(
"status"
,
[](
Mesh
&
_self
,
OM
::
HalfedgeHandle
_hh
)
->
StatusInfo
&
{
if
(
!
_self
.
has_halfedge_status
())
_self
.
request_halfedge_status
();
return
_self
.
status
(
_hh
);
},
py
::
return_value_policy
::
reference_internal
)
.
def
(
"set_status"
,
[](
Mesh
&
_self
,
OM
::
HalfedgeHandle
_hh
,
const
StatusInfo
&
_info
)
{
if
(
!
_self
.
has_halfedge_status
())
_self
.
request_halfedge_status
();
_self
.
status
(
_hh
)
=
_info
;
})
.
def
(
"status"
,
[](
Mesh
&
_self
,
OM
::
EdgeHandle
_eh
)
->
StatusInfo
&
{
if
(
!
_self
.
has_edge_status
())
_self
.
request_edge_status
();
return
_self
.
status
(
_eh
);
},
py
::
return_value_policy
::
reference_internal
)
.
def
(
"set_status"
,
[](
Mesh
&
_self
,
OM
::
EdgeHandle
_eh
,
const
StatusInfo
&
_info
)
{
if
(
!
_self
.
has_edge_status
())
_self
.
request_edge_status
();
_self
.
status
(
_eh
)
=
_info
;
})
.
def
(
"status"
,
[](
Mesh
&
_self
,
OM
::
FaceHandle
_fh
)
->
StatusInfo
&
{
if
(
!
_self
.
has_face_status
())
_self
.
request_face_status
();
return
_self
.
status
(
_fh
);
},
py
::
return_value_policy
::
reference_internal
)
.
def
(
"set_status"
,
[](
Mesh
&
_self
,
OM
::
FaceHandle
_fh
,
const
StatusInfo
&
_info
)
{
if
(
!
_self
.
has_face_status
())
_self
.
request_face_status
();
_self
.
status
(
_fh
)
=
_info
;
})
.
def
(
"request_vertex_normals"
,
&
Mesh
::
request_vertex_normals
)
.
def
(
"request_vertex_colors"
,
&
Mesh
::
request_vertex_colors
)
...
...
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