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_common.hh
1
#ifndef INCLUDE_UNITTESTS_COMMON_HH
2
#define INCLUDE_UNITTESTS_COMMON_HH
3
4
#include <gtest/gtest.h>
5
6
#include <OpenVolumeMesh/Mesh/PolyhedralMesh.hh>
7
#include <OpenVolumeMesh/Mesh/HexahedralMesh.hh>
8
#include <OpenVolumeMesh/Geometry/VectorT.hh>
9
10
/*
11
* Simple test setting for polyhedral meshes
12
*/
13
14
typedef
OpenVolumeMesh::GeometricPolyhedralMeshV3d
PolyhedralMesh
;
15
16
class
PolyhedralMeshBase
:
public
testing::Test {
17
18
protected
:
19
20
typedef
OpenVolumeMesh::VertexHandle
VertexHandle
;
21
typedef
OpenVolumeMesh::HalfEdgeHandle
HalfEdgeHandle
;
22
typedef
OpenVolumeMesh::EdgeHandle
EdgeHandle
;
23
typedef
OpenVolumeMesh::HalfFaceHandle
HalfFaceHandle
;
24
typedef
OpenVolumeMesh::FaceHandle
FaceHandle
;
25
typedef
OpenVolumeMesh::CellHandle
CellHandle
;
26
27
// This function is called before each test is run
28
virtual
void
SetUp() {
29
30
// Do some initial stuff with the member data here...
31
mesh_.enable_deferred_deletion(
false
);
32
mesh_.enable_fast_deletion(
false
);
33
}
34
35
// This function is called after all tests are through
36
virtual
void
TearDown() {
37
38
// Do some final stuff with the member data here...
39
}
40
41
// Generate a basic hexahedral mesh
42
void
generatePolyhedralMesh(
PolyhedralMesh
& _mesh);
43
44
// This member will be accessible in all tests
45
PolyhedralMesh
mesh_;
46
};
47
48
/*
49
* Simple test setting for hexahedral meshes
50
*/
51
52
typedef
OpenVolumeMesh::GeometricHexahedralMeshV3d
HexahedralMesh
;
53
54
class
HexahedralMeshBase
:
public
testing::Test {
55
56
protected
:
57
58
typedef
OpenVolumeMesh::VertexHandle
VertexHandle
;
59
typedef
OpenVolumeMesh::HalfEdgeHandle
HalfEdgeHandle
;
60
typedef
OpenVolumeMesh::EdgeHandle
EdgeHandle
;
61
typedef
OpenVolumeMesh::HalfFaceHandle
HalfFaceHandle
;
62
typedef
OpenVolumeMesh::FaceHandle
FaceHandle
;
63
typedef
OpenVolumeMesh::CellHandle
CellHandle
;
64
65
// This function is called before each test is run
66
virtual
void
SetUp() {
67
68
// Do some initial stuff with the member data here...
69
mesh_.enable_deferred_deletion(
false
);
70
mesh_.enable_fast_deletion(
false
);
71
}
72
73
// This function is called after all tests are through
74
virtual
void
TearDown() {
75
76
// Do some final stuff with the member data here...
77
}
78
79
// Generate a basic hexahedral mesh
80
void
generateHexahedralMesh(
HexahedralMesh
& _mesh);
81
82
// This member will be accessible in all tests
83
HexahedralMesh
mesh_;
84
};
85
86
// Printer class (for STL compliance test)
87
class
Print
{
88
public
:
89
Print
(
bool
_mute =
false
) : mute_(_mute) {}
90
void
mute(
bool
_mute) { mute_ = _mute; }
91
bool
mute()
const
{
return
mute_; }
92
void
operator()(
const
OpenVolumeMesh::OpenVolumeMeshHandle
& _h)
const
{
93
if
(!mute_) std::cerr <<
"Handle: "
<< _h.idx() << std::endl;
94
}
95
private
:
96
bool
mute_;
97
};
98
99
#endif // INCLUDE GUARD
OpenVolumeMesh::EdgeHandle
Definition:
OpenVolumeMeshHandle.hh:99
OpenVolumeMesh::CellHandle
Definition:
OpenVolumeMeshHandle.hh:101
OpenVolumeMesh::FaceHandle
Definition:
OpenVolumeMeshHandle.hh:100
Print
Definition:
unittests_common.hh:87
OpenVolumeMesh::HalfFaceHandle
Definition:
OpenVolumeMeshHandle.hh:103
OpenVolumeMesh::OpenVolumeMeshHandle
Definition:
OpenVolumeMeshHandle.hh:55
OpenVolumeMesh::HalfEdgeHandle
Definition:
OpenVolumeMeshHandle.hh:102
OpenVolumeMesh::VertexHandle
Definition:
OpenVolumeMeshHandle.hh:98
OpenVolumeMesh::GeometryKernel
Definition:
GeometryKernel.hh:55
PolyhedralMeshBase
Definition:
unittests_common.hh:16
HexahedralMeshBase
Definition:
unittests_common.hh:54
libs_required
OpenVolumeMesh
src
Unittests
unittests_common.hh
Generated on Wed Jul 13 2016 13:36:22 for Developer Documentation by
1.8.8