Developer Documentation

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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: TriMesh_ArrayKernelT.hh:98
OpenMesh::VectorT
Definition: Vector11T.hh:83
OpenMesh::mesh_cast
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition: PolyMeshT.hh:592
OpenMesh::DefaultTraits::Point
Vec3f Point
The default coordinate type is OpenMesh::Vec3f.
Definition: Traits.hh:129
OpenMesh::DefaultTraits
Definition: Traits.hh:126