MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_permutation

Function test_permutation

tests/mesh/test-polygonal-surface.cpp:87–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void test_permutation( const geode::PolygonalSurface3D& surface,
88 geode::PolygonalSurfaceBuilder3D& builder )
89{
90 std::vector< geode::index_t > vertex_permutation{ 4, 2, 6, 1, 5, 0, 3 };
91 builder.permute_vertices( vertex_permutation );
92 geode::OpenGeodeMeshException::test(
93 surface.polygon_vertex( { 0, 0 } ) == 5,
94 "Wrong PolygonVertex after vertex permute" );
95 geode::OpenGeodeMeshException::test(
96 surface.polygon_vertex( { 0, 1 } ) == 3,
97 "Wrong PolygonVertex after vertex permute" );
98 geode::OpenGeodeMeshException::test(
99 surface.polygon_vertex( { 0, 2 } ) == 1,
100 "Wrong PolygonVertex after vertex permute" );
101 geode::OpenGeodeMeshException::test(
102 surface.polygon_vertex( { 1, 0 } ) == 3,
103 "Wrong PolygonVertex after vertex permute" );
104 geode::OpenGeodeMeshException::test(
105 surface.polygon_vertex( { 1, 1 } ) == 6,
106 "Wrong PolygonVertex after vertex permute" );
107 geode::OpenGeodeMeshException::test(
108 surface.polygon_vertex( { 1, 2 } ) == 0,
109 "Wrong PolygonVertex after vertex permute" );
110 geode::OpenGeodeMeshException::test(
111 surface.polygon_vertex( { 1, 3 } ) == 1,
112 "Wrong PolygonVertex after vertex permute" );
113 geode::OpenGeodeMeshException::test(
114 surface.polygon_vertex( { 2, 0 } ) == 3,
115 "Wrong PolygonVertex after vertex permute" );
116 geode::OpenGeodeMeshException::test(
117 surface.polygon_vertex( { 2, 1 } ) == 4,
118 "Wrong PolygonVertex after vertex permute" );
119 geode::OpenGeodeMeshException::test(
120 surface.polygon_vertex( { 2, 2 } ) == 2,
121 "Wrong PolygonVertex after vertex permute" );
122 geode::OpenGeodeMeshException::test(
123 surface.polygon_vertex( { 2, 3 } ) == 6,
124 "Wrong PolygonVertex after vertex permute" );
125
126 std::vector< geode::index_t > polygon_permutation{ 2, 0, 1 };
127 builder.permute_polygons( polygon_permutation );
128 geode::OpenGeodeMeshException::test(
129 surface.polygon_vertex( { 0, 0 } ) == 3,
130 "Wrong PolygonVertex after polygon permute" );
131 geode::OpenGeodeMeshException::test(
132 surface.polygon_vertex( { 0, 1 } ) == 4,
133 "Wrong PolygonVertex after polygon permute" );
134 geode::OpenGeodeMeshException::test(
135 surface.polygon_vertex( { 0, 2 } ) == 2,
136 "Wrong PolygonVertex after polygon permute" );
137 geode::OpenGeodeMeshException::test(
138 surface.polygon_vertex( { 0, 3 } ) == 6,
139 "Wrong PolygonVertex after polygon permute" );
140 geode::OpenGeodeMeshException::test(
141 surface.polygon_vertex( { 1, 0 } ) == 5,
142 "Wrong PolygonVertex after polygon permute" );
143 geode::OpenGeodeMeshException::test(
144 surface.polygon_vertex( { 1, 1 } ) == 3,

Callers 1

testFunction · 0.70

Calls 6

permute_verticesMethod · 0.80
polygon_vertexMethod · 0.80
polygon_adjacentMethod · 0.80
testFunction · 0.70
permute_polygonsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected