Developer Documentation
unittests_trimesh_vec2i.cc
1#include <gtest/gtest.h>
2#include <Unittests/unittests_common.hh>
3
4#include <iostream>
5
7{
8 typedef OpenMesh::Vec2i Point;
9};
10
11
13
14
15/*
16 * OpenMesh Triangular with Vec2i
17 */
18
19class OpenMeshBaseTriVec2i : public testing::Test {
20
21 protected:
22
23 // This function is called before each test is run
24 virtual void SetUp() {
25
26 // Do some initial stuff with the member data here...
27 }
28
29 // This function is called after all tests are through
30 virtual void TearDown() {
31
32 // Do some final stuff with the member data here...
33 }
34
35 // This member will be accessible in all tests
36 TriMeshVec2i mesh_;
37};
38
39
40namespace {
41
42/*
43 * ====================================================================
44 * Define tests below
45 * ====================================================================
46 */
47
48/*
49 * Checking for feature edges based on angle
50 */
51TEST_F(OpenMeshBaseTriVec2i, Instance_Vec2i_Mesh) {
52
53 mesh_.clear();
54
55 // Add some vertices
57
58 vhandle[0] = mesh_.add_vertex(TriMeshVec2i::Point(0, 0));
59 vhandle[1] = mesh_.add_vertex(TriMeshVec2i::Point(0, 1));
60 vhandle[2] = mesh_.add_vertex(TriMeshVec2i::Point(1, 1));
61
62 // Add face
63 std::vector<TriMeshVec2i::VertexHandle> face_vhandles;
64
65 face_vhandles.push_back(vhandle[0]);
66 face_vhandles.push_back(vhandle[1]);
67 face_vhandles.push_back(vhandle[2]);
68 mesh_.add_face(face_vhandles);
69
70 // ===============================================
71 // Setup complete
72 // ===============================================
73
74 // Check one Request only vertex normals
75 // Face normals are required for vertex and halfedge normals, so
76 // that prevent access to non existing properties are in place
77
78 mesh_.request_vertex_normals();
79 mesh_.request_halfedge_normals();
80 mesh_.request_face_normals();
81
82}
83
84}
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:136
SmartVertexHandle add_vertex(const Point _p)
Definition: PolyMeshT.hh:255
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:112