35 #ifndef LVR2_GEOMETRY_BASEMESH_H_ 36 #define LVR2_GEOMETRY_BASEMESH_H_ 41 #include <type_traits> 43 #include <boost/optional.hpp> 60 template<
typename HandleT>
63 static_assert(std::is_base_of<
BaseHandle<Index>, HandleT>::value,
"HandleT must inherit from BaseHandle!");
80 template<
typename HandleT>
92 std::unique_ptr<MeshHandleIterator<HandleT>>
m_iter;
139 template<
typename BaseVecT>
180 virtual void removeFace(
FaceHandle handle) = 0;
221 virtual size_t numVertices()
const = 0;
226 virtual size_t numFaces()
const = 0;
231 virtual size_t numEdges()
const = 0;
241 virtual bool containsFace(
FaceHandle vH)
const = 0;
246 virtual bool containsEdge(
EdgeHandle vH)
const = 0;
255 virtual Index nextVertexIndex()
const = 0;
264 virtual Index nextFaceIndex()
const = 0;
273 virtual Index nextEdgeIndex()
const = 0;
278 virtual BaseVecT getVertexPosition(
VertexHandle handle)
const = 0;
283 virtual BaseVecT& getVertexPosition(
VertexHandle handle) = 0;
290 virtual std::array<VertexHandle, 3> getVerticesOfFace(
FaceHandle handle)
const = 0;
297 virtual std::array<EdgeHandle, 3> getEdgesOfFace(
FaceHandle handle)
const = 0;
316 virtual void getNeighboursOfFace(
FaceHandle handle, std::vector<FaceHandle>& facesOut)
const = 0;
323 virtual std::array<VertexHandle, 2> getVerticesOfEdge(
EdgeHandle edgeH)
const = 0;
330 virtual std::array<OptionalFaceHandle, 2> getFacesOfEdge(
EdgeHandle edgeH)
const = 0;
347 virtual void getFacesOfVertex(
VertexHandle handle, std::vector<FaceHandle>& facesOut)
const = 0;
364 virtual void getEdgesOfVertex(
VertexHandle handle, std::vector<EdgeHandle>& edgesOut)
const = 0;
382 virtual void getNeighboursOfVertex(
VertexHandle handle, std::vector<VertexHandle>& verticesOut)
const = 0;
462 virtual std::array<BaseVecT, 3> getVertexPositionsOfFace(
FaceHandle handle)
const;
467 BaseVecT calcFaceCentroid(
FaceHandle handle)
const;
472 typename BaseVecT::CoordType calcFaceArea(
FaceHandle handle)
const;
484 virtual std::vector<FaceHandle> getNeighboursOfFace(
FaceHandle handle)
const;
494 virtual bool isCollapsable(
EdgeHandle handle)
const;
503 virtual bool isFlippable(
EdgeHandle handle)
const;
509 virtual bool isBorderEdge(
EdgeHandle handle)
const = 0;
541 virtual uint8_t numAdjacentFaces(
EdgeHandle handle)
const;
553 virtual std::vector<FaceHandle> getFacesOfVertex(
VertexHandle handle)
const;
565 virtual std::vector<EdgeHandle> getEdgesOfVertex(
VertexHandle handle)
const;
577 virtual std::vector<VertexHandle> getNeighboursOfVertex(
VertexHandle handle)
const;
614 template <
typename BaseVecT>
627 template <
typename BaseVecT>
640 template <
typename BaseVecT>
666 std::array<EdgeHandle, 2> removedEdges,
668 ) : removedFace(removedFace), removedEdges(removedEdges), newEdge(newEdge) {};
681 std::array<boost::optional<EdgeCollapseRemovedFace>, 2>
neighbors;
707 #include "lvr2/geometry/BaseMesh.tcc" FaceIteratorProxy(const BaseMesh< BaseVecT > &mesh)
A wrapper for the MeshHandleIterator to save beloved future programmers from dereferencing too much <...
EdgeCollapseResult(VertexHandle midPoint, VertexHandle removedPoint)
MeshHandleIteratorPtr(std::unique_ptr< MeshHandleIterator< HandleT >> iter)
VertexHandle midPoint
The vertex which was inserted to replace the collapsed edge.
const BaseMesh< BaseVecT > & m_mesh
Handle to access vertices of the mesh.
EdgeHandle newEdge
The edge that was inserted to replace the removed face.
virtual bool operator!=(const MeshHandleIterator &other) const =0
std::unique_ptr< MeshHandleIterator< HandleT > > m_iter
Handle to access edges of the mesh.
const BaseMesh< BaseVecT > & m_mesh
virtual bool operator==(const MeshHandleIterator &other) const =0
VertexIteratorProxy(const BaseMesh< BaseVecT > &mesh)
uint32_t Index
Datatype used as index for each vertex, face and edge.
const BaseMesh< BaseVecT > & m_mesh
std::array< boost::optional< EdgeCollapseRemovedFace >, 2 > neighbors
Semantically equivalent to boost::optional<VertexHandle>
Interface for triangle-meshes with adjacency information.
VertexSplitResult(VertexHandle longestEdgeCenter)
FaceHandle removedFace
A face adjacent to the collapsed edge which was removed.
virtual HandleT operator*() const =0
Returns the current handle.
VertexHandle removedPoint
EdgeIteratorProxy(const BaseMesh< BaseVecT > &mesh)
Semantically equivalent to boost::optional<FaceHandle>
An iterator for handles in the BaseMesh.
virtual MeshHandleIterator & operator++()=0
std::array< EdgeHandle, 2 > removedEdges
The edges of the removed face (excluding the collapsed edge itself)
EdgeSplitResult(VertexHandle longestEdgeCenter)
EdgeCollapseRemovedFace(FaceHandle removedFace, std::array< EdgeHandle, 2 > removedEdges, EdgeHandle newEdge)
std::vector< FaceHandle > addedFaces
virtual ~MeshHandleIterator()=default
std::vector< FaceHandle > addedFaces
Handle to access faces of the mesh.
Semantically equivalent to boost::optional<EdgeHandle>