Radium Engine
1.5.0
|
#include <Core/Geometry/TopologicalMesh.hpp>
Inherits OpenMesh::PolyMesh_ArrayKernelT< TopologicalMeshTraits >.
Classes | |
class | WedgeData |
Public Types | |
using | WedgeIndex = Ra::Core::Utils::Index |
using | WedgeAttribIndex = Ra::Core::Utils::Index |
Public Member Functions | |
TopologicalMesh () | |
template<typename MeshIndex > | |
TopologicalMesh ([[deprecated("Use MultiIndexedGeometry instead")]] const Ra::Core::Geometry::IndexedGeometry< MeshIndex > &mesh) | |
Convenience constructor. More... | |
TopologicalMesh (const Ra::Core::Geometry::MultiIndexedGeometry &mesh, const Ra::Core::Geometry::MultiIndexedGeometry::LayerKeyType &layerKey) | |
Convenience constructor. More... | |
template<typename MeshIndex , typename NonManifoldFaceCommand > | |
TopologicalMesh ([[deprecated("Use MultiIndexedGeometry instead")]] const Ra::Core::Geometry::IndexedGeometry< MeshIndex > &mesh, NonManifoldFaceCommand command) | |
template<typename NonManifoldFaceCommand > | |
TopologicalMesh (const Ra::Core::Geometry::MultiIndexedGeometry &mesh, const Ra::Core::Geometry::MultiIndexedGeometry::LayerKeyType &layerKey, NonManifoldFaceCommand command) | |
void | initWithWedge (const Ra::Core::Geometry::MultiIndexedGeometry &mesh, const Ra::Core::Geometry::MultiIndexedGeometry::LayerKeyType &layerKey) |
template<typename NonManifoldFaceCommand > | |
void | initWithWedge (const Ra::Core::Geometry::MultiIndexedGeometry &mesh, const Ra::Core::Geometry::MultiIndexedGeometry::LayerKeyType &layerKey, NonManifoldFaceCommand command) |
TriangleMesh | toTriangleMesh () |
PolyMesh | toPolyMesh () |
LineMesh | toLineMesh () |
void | updateTriangleMesh (Ra::Core::Geometry::MultiIndexedGeometry &mesh) |
void | updateTriangleMeshNormals (Ra::Core::Geometry::MultiIndexedGeometry &mesh) |
void | updateTriangleMeshNormals (AttribArrayGeometry::NormalAttribHandle::Container &normals) |
void | update (const Ra::Core::Geometry::MultiIndexedGeometry &mesh) |
void | updateNormals (const Ra::Core::Geometry::MultiIndexedGeometry &mesh) |
void | updatePositions (const Ra::Core::Geometry::MultiIndexedGeometry &mesh) |
void | updatePositions (const AttribArrayGeometry::PointAttribHandle::Container &vertices) |
HalfedgeHandle | halfedge_handle (VertexHandle vh, FaceHandle fh) const |
void | propagate_normal_to_wedges (VertexHandle vh) |
const OpenMesh::HPropHandleT< Index > & | getInputTriangleMeshIndexPropHandle () const |
const OpenMesh::HPropHandleT< Index > & | getOutputTriangleMeshIndexPropHandle () const |
void | copyPointsPositionToWedges () |
std::set< WedgeIndex > | getVertexWedges (OpenMesh::VertexHandle vh) const |
WedgeIndex | getWedgeIndex (OpenMesh::HalfedgeHandle heh) const |
const WedgeData & | getWedgeData (const WedgeIndex &idx) const |
template<typename T > | |
const T & | getWedgeData (const WedgeIndex &idx, const std::string &name) const |
template<typename T > | |
const T & | getWedgeAttrib (const WedgeIndex &idx, const std::string &name) const |
unsigned int | getWedgeRefCount (const WedgeIndex &idx) const |
void | setWedgeData (WedgeIndex widx, const WedgeData &wd) |
template<typename T > | |
bool | setWedgeData (const WedgeIndex &idx, const std::string &name, const T &value) |
template<typename T > | |
bool | setWedgeAttrib (const WedgeIndex &idx, const std::string &name, const T &value) |
WedgeData | newWedgeData () const |
WedgeData | newWedgeData (HalfedgeHandle he) const |
WedgeIndex | replaceWedge (OpenMesh::HalfedgeHandle he, const WedgeData &wd) |
template<typename T > | |
WedgeAttribIndex | addWedgeAttrib (const std::string &name, T value={}) |
void | replaceWedgeIndex (OpenMesh::HalfedgeHandle he, const WedgeIndex &widx) |
void | mergeEqualWedges () |
void | mergeEqualWedges (OpenMesh::VertexHandle vh) |
void | garbage_collection () |
Remove deleted element from the mesh, including wedges. | |
void | clean () |
const std::vector< std::string > & | getVec4AttribNames () const |
const std::vector< std::string > & | getVec3AttribNames () const |
const std::vector< std::string > & | getVec2AttribNames () const |
const std::vector< std::string > & | getFloatAttribNames () const |
bool | isFeatureVertex (const VertexHandle &vh) const |
true if more than one wedge arount vertex vh, false if only one wedge | |
bool | isFeatureEdge (const EdgeHandle &eh) const |
const OpenMesh::HPropHandleT< WedgeIndex > & | getWedgeIndexPph () const |
void | delete_face (FaceHandle _fh, bool _delete_isolated_vertices=true) |
bool | isManifold (VertexHandle vh) const |
bool | checkIntegrity () const |
void | triangulate () |
template<typename MeshIndex , typename NonManifoldFaceCommand > | |
TopologicalMesh (const IndexedGeometry< MeshIndex > &mesh, NonManifoldFaceCommand command) | |
Dealing with normals | |
Utils to deal with normals when modifying the mesh topology. | |
void | updateWedgeNormals () |
Topological operations | |
bool | splitEdge (TopologicalMesh::EdgeHandle eh, Scalar f) |
void | collapse (HalfedgeHandle, bool=false) |
void | collapseWedge (TopologicalMesh::HalfedgeHandle he, bool keepFromVertex=false) |
Friends | |
class | TMOperations |
This class represents a mesh with topological information on the vertex graph, using a half-edge representation.
This integration is inspired by: https://gist.github.com/Unril/03fa353d0461ed6bd41d
rename methods to respect Radium guideline (get/set/is, camelCase)
private inheritance from OpenMesh, and import relevant methods.
Definition at line 55 of file TopologicalMesh.hpp.
|
explicit |
Construct an empty topological mesh, only initialize mandatory properties.
Definition at line 183 of file TopologicalMesh.cpp.
|
explicit |
Convenience constructor.
|
inlineexplicit |
Convenience constructor.
Definition at line 1051 of file TopologicalMesh.hpp.
|
explicit |
Construct a topological mesh from a triangle mesh. This operation merges vertex with same position, but keeps vertex attributes on halfedges, so that TriangleMesh vertices with the same 3D position are represented only once in the topological mesh.
NonManifoldFaceCommand | Command executed when non-manifold faces are found. API and default implementation: struct DefaultNonManifoldFaceCommand {
DefaultNonManifoldFaceCommand( const std::string& details = {} ) : m_details { details } {}
inline void process( const std::vector<TopologicalMesh::VertexHandle>& /*face_vhandles*/ ) {
LOG( logWARNING ) << "Invalid face handle returned : face not added " + m_details;
}
private:
std::string m_details;
};
AbstractGeometry with per-vertex attributes and layers of indices. Each layer represents a different ... Definition: IndexedGeometry.hpp:132 TopologicalMesh() Definition: TopologicalMesh.cpp:183 |
|
explicit |
Construct a topological mesh from a triangle mesh. This operation merges vertex with same position, but keeps vertex attributes on halfedges, so that TriangleMesh vertices with the same 3D position are represented only once in the topological mesh.
NonManifoldFaceCommand | Command executed when non-manifold faces are found. API and default implementation: struct DefaultNonManifoldFaceCommand {
DefaultNonManifoldFaceCommand( const std::string& details = {} ) : m_details { details } {}
inline void process( const std::vector<TopologicalMesh::VertexHandle>& /*face_vhandles*/ ) {
LOG( logWARNING ) << "Invalid face handle returned : face not added " + m_details;
}
private:
std::string m_details;
};
|
Definition at line 1057 of file TopologicalMesh.hpp.
bool Ra::Core::Geometry::TopologicalMesh::checkIntegrity | ( | ) | const |
Check if evrything looks right in the data structure
Definition at line 68 of file TopologicalMesh.cpp.
void Ra::Core::Geometry::TopologicalMesh::collapse | ( | HalfedgeHandle | _hh, |
bool | keepFrom = false |
||
) |
Halfedge collapes he. vo=from_vertex_handle(he) is deleted. After collapse vo incoming halfedges points to vh = to_vertex_handle(he). Wedge indices are updated to reflect the change in topology. For detailed topological modifications see 3D objects (a.k.a. Meshes).
he | halfedge's hangle to collapse. |
Definition at line 783 of file TopologicalMesh.cpp.
void Ra::Core::Geometry::TopologicalMesh::copyPointsPositionToWedges | ( | ) |
update wedge's position to correspond to current point position, which might not be the case if point(handle) = something; has been used.
Definition at line 497 of file TopologicalMesh.cpp.
|
inline |
Return a handle to the halfedge property storing vertices indices within the TriangleMesh *this has been built on.
Definition at line 1331 of file TopologicalMesh.hpp.
|
inline |
Return a handle to the halfedge property storing vertices indices within the TriangleMesh returned by toTriangleMesh().
Definition at line 1336 of file TopologicalMesh.hpp.
|
inline |
Return the set of WedgeIndex incident to a given Vertex vh. only valid non deleted wedges are present in the set.
Definition at line 1341 of file TopologicalMesh.hpp.
|
inline |
Access to wedge data.
idx | must be valid and correspond to a non delete wedge index. |
Definition at line 1380 of file TopologicalMesh.hpp.
|
inline |
get the wedge index associated with an halfedge
Definition at line 1352 of file TopologicalMesh.hpp.
|
inline |
Return the wedge refcount, for debug purpose.
Definition at line 1356 of file TopologicalMesh.hpp.
|
inline |
Return the half-edge associated with a given vertex and face.
Definition at line 1321 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::TopologicalMesh::initWithWedge | ( | const Ra::Core::Geometry::MultiIndexedGeometry & | mesh, |
const Ra::Core::Geometry::MultiIndexedGeometry::LayerKeyType & | layerKey, | ||
NonManifoldFaceCommand | command | ||
) |
Definition at line 1074 of file TopologicalMesh.hpp.
|
inline |
true if at least one of edge's vertex as two different wedge arount the edge. false if the two vertices have the same wedge for both face aside the edge.
Definition at line 1441 of file TopologicalMesh.hpp.
bool Ra::Core::Geometry::TopologicalMesh::isManifold | ( | VertexHandle | vh | ) | const |
is the vertex a "bow tie" vertex ?
Definition at line 64 of file TopologicalMesh.cpp.
|
inline |
call mergeEquelWedges( vh ) for every vertices of the mesh.
Definition at line 1410 of file TopologicalMesh.hpp.
|
inline |
Merge (make same index) wegdes with the same data around vh
vh | vertex handle to process |
Definition at line 1416 of file TopologicalMesh.hpp.
|
inline |
return a WedgeData with all attrib initialized to default values
Definition at line 291 of file TopologicalMesh.hpp.
|
inline |
return a WedgeData with position (and vertex handle) initialized from the value of he's to vertex.
Definition at line 294 of file TopologicalMesh.hpp.
|
inline |
Set the normal n to all the wedges that share to vh. If you work with vertex normals, please call this function on all vertex handles before convertion with toTriangleMesh.
Definition at line 1307 of file TopologicalMesh.hpp.
|
inline |
Replace the wedge data associated with an halfedge. The old wedge is "deleted". If wedge data correspond to an already present wedge, it's index is used.
Definition at line 1396 of file TopologicalMesh.hpp.
|
inline |
Replace the wedge index associated with an halfedge. The old wedge is "deleted". The new wedge reference count is incremented.
Definition at line 1404 of file TopologicalMesh.hpp.
|
inline |
Change the WedgeData associated for idx, for attrib name to value. The data is changed for all halfedges referencing this wedge.
Definition at line 1361 of file TopologicalMesh.hpp.
|
inline |
set WedgeData wd to the wedge with index widx. All halfedge that point to widx will get the new values.
widx | index of the wedge |
wd | data to set to wedge that correspond to widx |
Definition at line 1374 of file TopologicalMesh.hpp.
bool Ra::Core::Geometry::TopologicalMesh::splitEdge | ( | TopologicalMesh::EdgeHandle | eh, |
Scalar | f | ||
) |
Apply a 2-4 edge split.
eh | The handle to the edge to split. |
f | The interpolation factor to place the new point on the edge. Must be in [0,1]. |
Definition at line 647 of file TopologicalMesh.cpp.
LineMesh Ra::Core::Geometry::TopologicalMesh::toLineMesh | ( | ) |
Wedges are output vertices !
Definition at line 258 of file TopologicalMesh.cpp.
PolyMesh Ra::Core::Geometry::TopologicalMesh::toPolyMesh | ( | ) |
Return a triangleMesh from the topological mesh.
add attribs to out
Wedges are output vertices !
Definition at line 316 of file TopologicalMesh.cpp.
TriangleMesh Ra::Core::Geometry::TopologicalMesh::toTriangleMesh | ( | ) |
Return a triangleMesh from the topological mesh.
add attribs to out
Wedges are output vertices !
Definition at line 206 of file TopologicalMesh.cpp.
void Ra::Core::Geometry::TopologicalMesh::updateTriangleMesh | ( | Ra::Core::Geometry::MultiIndexedGeometry & | mesh | ) |
Update triangle mesh data, assuming the mesh and this topo mesh has the same topology.
Wedges are output vertices !
Definition at line 373 of file TopologicalMesh.cpp.