Radium Engine
1.5.0
|
#include <Core/Geometry/deprecated/TopologicalMesh.hpp>
Inherits OpenMesh::PolyMesh_ArrayKernelT< TopologicalMeshTraits >.
Public Member Functions | |
template<typename NonManifoldFaceCommand > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | TopologicalMesh (const Ra::Core::Geometry::TriangleMesh &triMesh, NonManifoldFaceCommand command) |
TopologicalMesh (const Ra::Core::Geometry::TriangleMesh &triMesh) | |
Convenience constructor. More... | |
TopologicalMesh () | |
TriangleMesh | toTriangleMesh () |
void | updateTriangleMesh (Ra::Core::Geometry::TriangleMesh &mesh) |
HalfedgeHandle | halfedge_handle (VertexHandle vh, FaceHandle fh) const |
const Normal & | normal (VertexHandle vh, FaceHandle fh) const |
void | set_normal (VertexHandle vh, FaceHandle fh, const Normal &n) |
void | propagate_normal_to_halfedges (VertexHandle vh) |
const OpenMesh::HPropHandleT< Index > & | getInputTriangleMeshIndexPropHandle () const |
const OpenMesh::HPropHandleT< Index > & | getOutputTriangleMeshIndexPropHandle () const |
template<typename NonManifoldFaceCommand > | |
TopologicalMesh (const TriangleMesh &triMesh, NonManifoldFaceCommand command) | |
template<typename MeshIndex > | |
TopologicalMesh (const Ra::Core::Geometry::IndexedGeometry< MeshIndex > &mesh) | |
Const access to handles of the HalfEdge properties coming from | |
the TriangleMesh attributes. | |
const std::vector< OpenMesh::HPropHandleT< Scalar > > & | getFloatPropsHandles () const |
const std::vector< OpenMesh::HPropHandleT< Vector2 > > & | getVector2PropsHandles () const |
const std::vector< OpenMesh::HPropHandleT< Vector3 > > & | getVector3PropsHandles () const |
const std::vector< OpenMesh::HPropHandleT< Vector4 > > & | getVector4PropsHandles () const |
Dealing with normals | |
Utils to deal with normals when modifying the mesh topology. | |
void | createNormalPropOnFaces (OpenMesh::FPropHandleT< Normal > &fProp) |
void | clearProp (OpenMesh::FPropHandleT< Normal > &fProp) |
void | copyNormal (HalfedgeHandle input_heh, HalfedgeHandle copy_heh) |
void | copyNormalFromFace (FaceHandle fh, HalfedgeHandle heh, OpenMesh::FPropHandleT< Normal > fProp) |
void | interpolateNormal (HalfedgeHandle in_a, HalfedgeHandle in_b, HalfedgeHandle out, Scalar f) |
void | interpolateNormalOnFaces (FaceHandle fh, OpenMesh::FPropHandleT< Normal > fProp) |
Dealing with custom properties | |
Utils to deal with custom properties of any type when modifying the mesh topology. | |
template<typename T > | |
void | createPropsOnFaces (const std::vector< OpenMesh::HPropHandleT< T >> &input, std::vector< OpenMesh::FPropHandleT< T >> &output) |
template<typename T > | |
void | clearProps (std::vector< OpenMesh::FPropHandleT< T >> &props) |
template<typename T > | |
void | copyProps (HalfedgeHandle input_heh, HalfedgeHandle copy_heh, const std::vector< OpenMesh::HPropHandleT< T >> &props) |
template<typename T > | |
void | copyPropsFromFace (FaceHandle fh, HalfedgeHandle heh, const std::vector< OpenMesh::FPropHandleT< T >> &fProps, const std::vector< OpenMesh::HPropHandleT< T >> &hProps) |
template<typename T > | |
void | interpolateProps (HalfedgeHandle in_a, HalfedgeHandle in_b, HalfedgeHandle out, Scalar f, const std::vector< OpenMesh::HPropHandleT< T >> &props) |
template<typename T > | |
void | interpolatePropsOnFaces (FaceHandle fh, const std::vector< OpenMesh::HPropHandleT< T >> &hProps, const std::vector< OpenMesh::FPropHandleT< T >> &fProps) |
Deal with all attributes* Utils to deal with the normal and | |
custom properties when modifying the mesh topology. | |
void | createAllPropsOnFaces (OpenMesh::FPropHandleT< Normal > &normalProp, std::vector< OpenMesh::FPropHandleT< Scalar >> &floatProps, std::vector< OpenMesh::FPropHandleT< Vector2 >> &vec2Props, std::vector< OpenMesh::FPropHandleT< Vector3 >> &vec3Props, std::vector< OpenMesh::FPropHandleT< Vector4 >> &vec4Props) |
void | clearAllProps (OpenMesh::FPropHandleT< Normal > &normalProp, std::vector< OpenMesh::FPropHandleT< Scalar >> &floatProps, std::vector< OpenMesh::FPropHandleT< Vector2 >> &vec2Props, std::vector< OpenMesh::FPropHandleT< Vector3 >> &vec3Props, std::vector< OpenMesh::FPropHandleT< Vector4 >> &vec4Props) |
void | copyAllProps (HalfedgeHandle input_heh, HalfedgeHandle copy_heh) |
void | copyAllPropsFromFace (FaceHandle fh, HalfedgeHandle heh, OpenMesh::FPropHandleT< Normal > normalProp, std::vector< OpenMesh::FPropHandleT< Scalar >> &floatProps, std::vector< OpenMesh::FPropHandleT< Vector2 >> &vec2Props, std::vector< OpenMesh::FPropHandleT< Vector3 >> &vec3Props, std::vector< OpenMesh::FPropHandleT< Vector4 >> &vec4Props) |
void | interpolateAllProps (HalfedgeHandle in_a, HalfedgeHandle in_b, HalfedgeHandle out, Scalar f) |
void | interpolateAllPropsOnFaces (FaceHandle fh, OpenMesh::FPropHandleT< Normal > normalProp, std::vector< OpenMesh::FPropHandleT< Scalar >> &floatProps, std::vector< OpenMesh::FPropHandleT< Vector2 >> &vec2Props, std::vector< OpenMesh::FPropHandleT< Vector3 >> &vec3Props, std::vector< OpenMesh::FPropHandleT< Vector4 >> &vec4Props) |
Topological operations | |
bool | splitEdge (TopologicalMesh::EdgeHandle eh, Scalar f) |
bool | splitEdgeWedge (TopologicalMesh::EdgeHandle eh, Scalar f) |
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 56 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 initialize( const TriangleMesh& /*triMesh*/ ) {}
inline void process( const std::vector<TopologicalMesh::VertexHandle>& /*face_vhandles*/ ) {
LOG( logWARNING ) << "Invalid face handle returned : face not added " + m_details;
}
TopologicalMesh() Definition: TopologicalMesh.cpp:79 |
|
explicit |
Convenience constructor.
Definition at line 76 of file TopologicalMesh.cpp.
|
explicit |
Construct an empty topological mesh, only init mandatory properties.
Definition at line 79 of file TopologicalMesh.cpp.
|
inline |
Remove all the given properties from mesh.
Definition at line 761 of file TopologicalMesh.hpp.
|
inline |
Remove face property prop from mesh.
Definition at line 608 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::clearProps | ( | std::vector< OpenMesh::FPropHandleT< T >> & | props | ) |
|
inline |
Copy all properties from input_heh to copy_heh.
Definition at line 773 of file TopologicalMesh.hpp.
|
inline |
Copy all given face properties from fh to heh.
Definition at line 782 of file TopologicalMesh.hpp.
|
inline |
Copy the normal property from input_heh to copy_heh.
Definition at line 612 of file TopologicalMesh.hpp.
|
inline |
Copy the face normal property fProp from fh to heh.
Definition at line 621 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::copyProps | ( | HalfedgeHandle | input_heh, |
HalfedgeHandle | copy_heh, | ||
const std::vector< OpenMesh::HPropHandleT< T >> & | props | ||
) |
Copy props properties from input_heh to copy_heh.
Definition at line 684 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::copyPropsFromFace | ( | FaceHandle | fh, |
HalfedgeHandle | heh, | ||
const std::vector< OpenMesh::FPropHandleT< T >> & | fProps, | ||
const std::vector< OpenMesh::HPropHandleT< T >> & | hProps | ||
) |
Copy face properties props from fh to heh.
Definition at line 693 of file TopologicalMesh.hpp.
|
inline |
Create a new property for each property of mesh on faces. Outputs the new face properties handles in the corresponding output parameters.
Definition at line 748 of file TopologicalMesh.hpp.
|
inline |
Create a new property for normals on faces of mesh.
Definition at line 599 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::createPropsOnFaces | ( | const std::vector< OpenMesh::HPropHandleT< T >> & | input, |
std::vector< OpenMesh::FPropHandleT< T >> & | output | ||
) |
Create a new property for each input properties of mesh on faces.
Definition at line 665 of file TopologicalMesh.hpp.
|
inline |
Return a handle to the halfedge property storing vertices indices within the TriangleMesh *this has been built on.
Definition at line 570 of file TopologicalMesh.hpp.
|
inline |
Return a handle to the halfedge property storing vertices indices within the TriangleMesh returned by toTriangleMesh().
Definition at line 575 of file TopologicalMesh.hpp.
|
inline |
Return the half-edge associated with a given vertex and face.
Definition at line 560 of file TopologicalMesh.hpp.
|
inline |
Interpolate all properties on edge center (after edge split).
Definition at line 796 of file TopologicalMesh.hpp.
|
inline |
Interpolate hprops on face center.
Definition at line 807 of file TopologicalMesh.hpp.
|
inline |
Interpolate normal property on edge center (after edge split).
Definition at line 632 of file TopologicalMesh.hpp.
|
inline |
Interpolate normal property on face center.
Definition at line 641 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::interpolateProps | ( | HalfedgeHandle | in_a, |
HalfedgeHandle | in_b, | ||
HalfedgeHandle | out, | ||
Scalar | f, | ||
const std::vector< OpenMesh::HPropHandleT< T >> & | props | ||
) |
Interpolate props on edge center (after edge split).
Definition at line 705 of file TopologicalMesh.hpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::interpolatePropsOnFaces | ( | FaceHandle | fh, |
const std::vector< OpenMesh::HPropHandleT< T >> & | hProps, | ||
const std::vector< OpenMesh::FPropHandleT< T >> & | fProps | ||
) |
Interpolate hprops on face center.
Definition at line 717 of file TopologicalMesh.hpp.
|
inline |
Get normal of the vertex vh, when member of fh.
Definition at line 530 of file TopologicalMesh.hpp.
|
inline |
Set the normal n to all the halfedges that points to vh (i.e. incomming halfedges) . If you work with vertex normals, please call this function on all vertex handles before convertion with toTriangleMesh.
Definition at line 550 of file TopologicalMesh.hpp.
|
inline |
Set normal of the vertex vh, when member of fh.
Definition at line 541 of file TopologicalMesh.hpp.
bool Ra::Core::Geometry::deprecated::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 197 of file TopologicalMesh.cpp.
TriangleMesh Ra::Core::Geometry::deprecated::TopologicalMesh::toTriangleMesh | ( | ) |
Return a triangleMesh from the topological mesh.
Definition at line 83 of file TopologicalMesh.cpp.
void Ra::Core::Geometry::deprecated::TopologicalMesh::updateTriangleMesh | ( | Ra::Core::Geometry::TriangleMesh & | mesh | ) |
Update triangle mesh data, assuming the mesh and this topo mesh has the same topology.