Loading...
Searching...
No Matches
TriConnectivity.hh
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2022, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
* ========================================================================= */
#ifndef OPENMESH_TRICONNECTIVITY_HH
#define OPENMESH_TRICONNECTIVITY_HH
#include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
namespace OpenMesh {
class OPENMESHDLLEXPORT TriConnectivity : public PolyConnectivity
{
public:
TriConnectivity() {}
virtual ~TriConnectivity() {}
inline static bool is_triangles()
{ return true; }
inline void assign_connectivity(const TriConnectivity& _other)
{ PolyConnectivity::assign_connectivity(_other); }
inline void assign_connectivity(const PolyConnectivity& _other)
{
PolyConnectivity::assign_connectivity(_other);
triangulate();
}
SmartFaceHandle add_face(const VertexHandle* _vhandles, size_t _vhs_size);
SmartFaceHandle add_face(const std::vector<VertexHandle>& _vhandles);
SmartFaceHandle add_face(const std::vector<SmartVertexHandle>& _vhandles);
SmartFaceHandle add_face(VertexHandle _vh0, VertexHandle _vh1, VertexHandle _vh2);
inline VertexHandle opposite_vh(HalfedgeHandle _heh) const
{
return is_boundary(_heh) ? InvalidVertexHandle :
to_vertex_handle(next_halfedge_handle(_heh));
}
VertexHandle opposite_he_opposite_vh(HalfedgeHandle _heh) const
{ return opposite_vh(opposite_halfedge_handle(_heh)); }
bool is_collapse_ok(HalfedgeHandle _heh);
HalfedgeHandle vertex_split(VertexHandle v0, VertexHandle v1,
VertexHandle vl, VertexHandle vr);
bool is_flip_ok(EdgeHandle _eh) const;
void flip(EdgeHandle _eh);
void split(EdgeHandle _eh, VertexHandle _vh);
inline void split_edge(EdgeHandle _eh, VertexHandle _vh) { TriConnectivity::split(_eh, _vh); }
void split_copy(EdgeHandle _eh, VertexHandle _vh);
inline void split_edge_copy(EdgeHandle _eh, VertexHandle _vh) { TriConnectivity::split_copy(_eh, _vh); }
inline void split(FaceHandle _fh, VertexHandle _vh)
{ PolyConnectivity::split(_fh, _vh); }
inline void split_copy(FaceHandle _fh, VertexHandle _vh)
{ PolyConnectivity::split_copy(_fh, _vh); }
private:
HalfedgeHandle insert_loop(HalfedgeHandle _hh);
HalfedgeHandle insert_edge(VertexHandle _vh,
HalfedgeHandle _h0, HalfedgeHandle _h1);
};
}
#endif//OPENMESH_TRICONNECTIVITY_HH
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59
OpenMesh::VertexHandle
Handle for a vertex entity.
Definition Handles.hh:121
OpenMesh::HalfedgeHandle
Handle for a halfedge entity.
Definition Handles.hh:128
OpenMesh::EdgeHandle
Handle for a edge entity.
Definition Handles.hh:135
OpenMesh::FaceHandle
Handle for a face entity.
Definition Handles.hh:142
OpenMesh::PolyConnectivity
Connectivity Class for polygonal meshes.
Definition PolyConnectivity.hh:115
OpenMesh::TriConnectivity
Connectivity Class for Triangle Meshes.
Definition TriConnectivity.hh:54
OpenMesh::TriConnectivity::split_edge
void split_edge(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Definition TriConnectivity.hh:190
OpenMesh::TriConnectivity::split_copy
void split_copy(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3) split, calls corresponding PolyMeshT function).
Definition TriConnectivity.hh:237
OpenMesh::TriConnectivity::split_edge_copy
void split_edge_copy(EdgeHandle _eh, VertexHandle _vh)
Edge split (= 2-to-4 split)
Definition TriConnectivity.hh:222
OpenMesh::TriConnectivity::opposite_he_opposite_vh
VertexHandle opposite_he_opposite_vh(HalfedgeHandle _heh) const
Returns the opposite vertex to the opposite halfedge of _heh in the face referenced by it returns Inv...
Definition TriConnectivity.hh:136
OpenMesh::TriConnectivity::opposite_vh
VertexHandle opposite_vh(HalfedgeHandle _heh) const
Returns the opposite vertex to the halfedge _heh in the face referenced by _heh returns InvalidVertex...
Definition TriConnectivity.hh:127
OpenMesh::TriConnectivity::split
void split(FaceHandle _fh, VertexHandle _vh)
Face split (= 1-to-3) split, calls corresponding PolyMeshT function).
Definition TriConnectivity.hh:229
OpenMesh::TriConnectivity::assign_connectivity
void assign_connectivity(const TriConnectivity &_other)
assign_connectivity() methods.
Definition TriConnectivity.hh:66