2#include <gtest/gtest.h>
3#include <Unittests/unittests_common.hh>
8class OpenMeshSplitCopyTriangleMesh :
public OpenMeshBase {
13 virtual void SetUp() {
19 virtual void TearDown() {
33 virtual void SetUp() {
39 virtual void TearDown() {
57TEST_F(OpenMeshSplitCopyTriangleMesh, SplitCopyTriangleMesh) {
60 mesh_.request_face_status();
61 mesh_.request_edge_status();
73 std::vector<Mesh::VertexHandle> face_vhandles;
75 face_vhandles.push_back(vhandle[2]);
76 face_vhandles.push_back(vhandle[1]);
77 face_vhandles.push_back(vhandle[0]);
91 mesh_.add_property(fprop_int);
92 mesh_.property(fprop_int, fh) = 999;
94 mesh_.status(fh).set_tagged(
true);
102 for (; f_it != f_end; ++f_it)
104 EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) <<
"Different Property value";
105 EXPECT_TRUE(mesh_.status(*f_it).tagged()) <<
"Different internal property value";
110 mesh_.add_property(eprop_int);
111 mesh_.property(eprop_int, eh) = 999;
113 mesh_.status(eh).set_feature(
true);
117 Mesh::EdgeHandle eh0 = mesh_.edge_handle( mesh_.next_halfedge_handle( mesh_.halfedge_handle(eh, 1) ) );
118 EXPECT_EQ(999, mesh_.property(eprop_int, eh0)) <<
"Different Property value";
119 EXPECT_TRUE(mesh_.status(eh0).feature()) <<
"Different internal property value";
125TEST_F(OpenMeshSplitCopyPolyMesh, SplitCopyPolymesh) {
128 mesh_.request_face_status();
140 std::vector<Mesh::VertexHandle> face_vhandles;
142 face_vhandles.push_back(vhandle[0]);
143 face_vhandles.push_back(vhandle[1]);
144 face_vhandles.push_back(vhandle[2]);
145 face_vhandles.push_back(vhandle[3]);
158 mesh_.add_property(fprop_int);
159 mesh_.property(fprop_int, fh) = 999;
161 mesh_.status(fh).set_tagged(
true);
169 for (; f_it != f_end; ++f_it)
171 EXPECT_EQ(999, mesh_.property(fprop_int, *f_it)) <<
"Different Property value";
172 EXPECT_TRUE(mesh_.status(*f_it).tagged()) <<
"Different internal property value";
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Kernel::EdgeHandle EdgeHandle
Scalar type.
Kernel::FaceIter FaceIter
Scalar type.
SmartVertexHandle add_vertex(const Point _p)
Kernel::FaceHandle FaceHandle
Scalar type.
Kernel::Point Point
Coordinate type.
SmartVertexHandle split_copy(EdgeHandle _eh, const Point &_p)
Edge split (= 2-to-4 split)