56#ifndef OPENMESH_MESH_DUAL_H
57#define OPENMESH_MESH_DUAL_H
63#if defined(OM_CC_MIPS)
69#include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh>
70#include <OpenMesh/Core/Utils/Property.hh>
87template <
typename MeshTraits>
88PolyMesh_ArrayKernelT<MeshTraits>* MeshDual (PolyMesh_ArrayKernelT<MeshTraits> &primal)
90 PolyMesh_ArrayKernelT<MeshTraits>* dual =
new PolyMesh_ArrayKernelT<MeshTraits>();
95 FPropHandleT< typename PolyMesh_ArrayKernelT<MeshTraits>::VertexHandle > primalToDual;
96 primal.add_property(primalToDual);
104 centerPoint += primal.point(*vit);
107 centerPoint /= degree;
108 primal.property(primalToDual, *fit) = dual->add_vertex(centerPoint);
112 std::vector< typename PolyMesh_ArrayKernelT<MeshTraits>::VertexHandle > face_vhandles;
115 if(!primal.is_boundary(*vit))
117 face_vhandles.clear();
119 face_vhandles.push_back(primal.property(primalToDual, *fit));
120 dual->add_face(face_vhandles);
124 primal.remove_property(primalToDual);
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
Kernel::ConstFaceIter ConstFaceIter
Scalar type.
Definition: PolyMeshT.hh:151
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:110
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition: PolyMeshT.hh:177
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition: PolyMeshT.hh:176
Kernel::ConstVertexIter ConstVertexIter
Scalar type.
Definition: PolyMeshT.hh:148
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:112