Developer Documentation

unittests_mesh_cast.cc
1 #include <iostream>
2
3 #include <gtest/gtest.h>
4
5 #include <Unittests/unittests_common.hh>
6
7
8 namespace {
9
10 class OpenMeshMeshCastTest: public testing::Test {
11 };
12
13 struct TriTraits1: public OpenMesh::DefaultTraits {
14 typedef OpenMesh::Vec3d Point;
15 };
16 struct TriTraits2: public OpenMesh::DefaultTraits {
17 typedef OpenMesh::Vec3d Point;
18 };
19
20 TEST_F(OpenMeshMeshCastTest, PerformCast) {
21 OpenMesh::TriMesh_ArrayKernelT<TriTraits1> a;
22 OpenMesh::TriMesh_ArrayKernelT<TriTraits2> &b =
23 OpenMesh::mesh_cast<OpenMesh::TriMesh_ArrayKernelT<TriTraits2>&>(a);
24 b.reserve(10,10,10);
25 /*
26 OpenMesh::TriMesh_ArrayKernelT < TriTraits2 > &b =
27 OpenMesh::MeshCast<
28 TriMesh_ArrayKernelT<TriTraits2>&,
29 OpenMesh::TriMesh_ArrayKernelT<TriTraits1>&
30 >::cast(a);
31 */
32 }
33
34 }
OpenMesh::TriMesh_ArrayKernelT
Definition: PolyMesh_ArrayKernelT.hh:73
OpenMesh::mesh_cast
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition: PolyMeshT.hh:607
OpenMesh::DefaultTraits
Definition: Traits.hh:121
OpenMesh::VectorT
Definition: Vector11T.hh:83