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

Function test_permutation

tests/mesh/test-triangulated-surface.cpp:101–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void test_permutation( const geode::TriangulatedSurface3D& surface,
102 geode::TriangulatedSurfaceBuilder3D& builder )
103{
104 std::vector< geode::index_t > vertex_permutation{ 4, 2, 1, 0, 3 };
105 builder.permute_vertices( vertex_permutation );
106 geode::OpenGeodeMeshException::test(
107 surface.polygon_vertex( { 0, 0 } ) == 3,
108 "Wrong PolygonVertex after vertex permute" );
109 geode::OpenGeodeMeshException::test(
110 surface.polygon_vertex( { 0, 1 } ) == 2,
111 "Wrong PolygonVertex after vertex permute" );
112 geode::OpenGeodeMeshException::test(
113 surface.polygon_vertex( { 0, 2 } ) == 1,
114 "Wrong PolygonVertex after vertex permute" );
115 geode::OpenGeodeMeshException::test(
116 surface.polygon_vertex( { 1, 0 } ) == 2,
117 "Wrong PolygonVertex after vertex permute" );
118 geode::OpenGeodeMeshException::test(
119 surface.polygon_vertex( { 1, 1 } ) == 4,
120 "Wrong PolygonVertex after vertex permute" );
121 geode::OpenGeodeMeshException::test(
122 surface.polygon_vertex( { 1, 2 } ) == 1,
123 "Wrong PolygonVertex after vertex permute" );
124 geode::OpenGeodeMeshException::test(
125 surface.polygon_vertex( { 2, 0 } ) == 4,
126 "Wrong PolygonVertex after vertex permute" );
127 geode::OpenGeodeMeshException::test(
128 surface.polygon_vertex( { 2, 1 } ) == 0,
129 "Wrong PolygonVertex after vertex permute" );
130 geode::OpenGeodeMeshException::test(
131 surface.polygon_vertex( { 2, 2 } ) == 1,
132 "Wrong PolygonVertex after vertex permute" );
133
134 std::vector< geode::index_t > polygon_permutation{ 2, 0, 1 };
135 builder.permute_polygons( polygon_permutation );
136 geode::OpenGeodeMeshException::test(
137 surface.polygon_vertex( { 0, 0 } ) == 4,
138 "Wrong PolygonVertex after polygon permute" );
139 geode::OpenGeodeMeshException::test(
140 surface.polygon_vertex( { 0, 1 } ) == 0,
141 "Wrong PolygonVertex after polygon permute" );
142 geode::OpenGeodeMeshException::test(
143 surface.polygon_vertex( { 0, 2 } ) == 1,
144 "Wrong PolygonVertex after polygon permute" );
145 geode::OpenGeodeMeshException::test(
146 surface.polygon_vertex( { 1, 0 } ) == 3,
147 "Wrong PolygonVertex after polygon permute" );
148 geode::OpenGeodeMeshException::test(
149 surface.polygon_vertex( { 1, 1 } ) == 2,
150 "Wrong PolygonVertex after polygon permute" );
151 geode::OpenGeodeMeshException::test(
152 surface.polygon_vertex( { 1, 2 } ) == 1,
153 "Wrong PolygonVertex after polygon permute" );
154 geode::OpenGeodeMeshException::test(
155 surface.polygon_vertex( { 2, 0 } ) == 2,
156 "Wrong PolygonVertex after polygon permute" );
157 geode::OpenGeodeMeshException::test(
158 surface.polygon_vertex( { 2, 1 } ) == 4,

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