Commit 2c9ac0d9 authored by Max Lyon's avatar Max Lyon

add selectElements method in MeshTools for simpler template programming

parent f2ebc879
......@@ -61,6 +61,7 @@
//== INCLUDES =================================================================
#include <OpenMesh/Core/Mesh/Handles.hh>
#include <vector>
//== FORWARDDECLARATIONS ======================================================
......@@ -71,6 +72,7 @@ namespace MeshSelection {
//== DEFINITIONS ==============================================================
//===========================================================================
/** @name Vertex Selection
* @{ */
......@@ -78,12 +80,24 @@ namespace MeshSelection {
/** \brief Select given vertices of a mesh
* @param _mesh Mesh to work on
* @param _vertices Vertex index to select
* @param _vertices Vertex indices to select
*/
template< typename MeshT >
inline
void selectVertices(MeshT* _mesh, const std::vector< int >& _vertices);
/** \brief Select given vertices of a mesh
* Same as selectVertices
* @param _mesh Mesh to work on
* @param _vertices Vertex index to select
*/
template< typename MeshT >
inline
void selectElements(MeshT* _mesh, const std::vector< int >& _vertices, OpenMesh::VertexHandle /*_tag*/)
{
selectVertices(_mesh, _vertices);
}
/** \brief Unselect given vertices of a mesh
* @param _mesh Mesh to work on
......@@ -293,11 +307,29 @@ std::vector< int > getArea(MeshT* _mesh, unsigned int _type , bool& _invert);
* @{ */
//===========================================================================
/// Select given edges of a mesh
/** \brief Select given edges of a mesh
* @param _mesh Mesh to work on
* @param _edges Edge indices to select
* @param _dihedral_angle_threshold If mesh has normals, dihedral angle must be greator than or equal to this threshold in order to be selected
*/
template< typename MeshT >
inline
void selectEdges(MeshT* _mesh, const std::vector< int >& _edges, const double _dihedral_angle_threshold = 0.0);
/** \brief Select given edges of a mesh
* Same as selectEdges
* @param _mesh Mesh to work on
* @param _edges Edge indices to select
* @param _dihedral_angle_threshold If mesh has normals, dihedral angle must be greator than or equal to this threshold in order to be selected
*/
template< typename MeshT >
inline
void selectElements(MeshT* _mesh, const std::vector< int >& _edges, OpenMesh::EdgeHandle /*_tag*/)
{
selectEdges(_mesh, _edges);
}
/// Unselect given edges of a mesh
template< typename MeshT >
inline
......@@ -409,11 +441,26 @@ void clearFeatureEdges(MeshT* _mesh);
* @{ */
//===========================================================================
/// Select given edges of a mesh
/** \brief Select given halfedges of a mesh
* @param _mesh Mesh to work on
* @param _halfedges face indices to select
*/
template< typename MeshT >
inline
void selectHalfedges(MeshT* _mesh, const std::vector< int >& _halfedges);
/** \brief Select given halfedges of a mesh
* Same as selectHalfedges
* @param _mesh Mesh to work on
* @param _halfedges halfedge indices to select
*/
template< typename MeshT >
inline
void selectElements(MeshT* _mesh, const std::vector< int >& _halfedges, OpenMesh::HalfedgeHandle /*_tag*/)
{
selectHalfedges(_mesh, _halfedges);
}
/// Unselect given edges of a mesh
template< typename MeshT >
inline
......@@ -470,11 +517,26 @@ void convertHalfedgeToFaceSelection(MeshT* _mesh);
* @{ */
//===========================================================================
/// Select given faces of a mesh
/** \brief Select given faces of a mesh
* @param _mesh Mesh to work on
* @param _faces face indices to select
*/
template< typename MeshT >
inline
void selectFaces(MeshT* _mesh, const std::vector< int >& _faces );
/** \brief Select given faces of a mesh
* Same as selectFaces
* @param _mesh Mesh to work on
* @param _faces face indices to select
*/
template< typename MeshT >
inline
void selectElements(MeshT* _mesh, const std::vector< int >& _faces, OpenMesh::FaceHandle /*_tag*/)
{
selectFaces(_mesh, _faces);
}
/// Unselect given faces of a mesh
template< typename MeshT >
inline
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment