MCPcopy Create free account
hub / github.com/assimp/assimp / TEST_F

Function TEST_F

test/unit/utTriangulate.cpp:98–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98TEST_F(TriangulateProcessTest, testTriangulation) {
99 piProcess->TriangulateMesh(pcMesh);
100
101 for (unsigned int m = 0, t = 0, q = 4, max = 1000, idx = 0; m < max; ++m) {
102 ++t;
103 aiFace &face = pcMesh->mFaces[m];
104 if (4 == t) {
105 t = 0;
106 max += q - 3;
107
108 std::vector<bool> ait(q, false);
109
110 for (unsigned int i = 0, tt = q - 2; i < tt; ++i, ++m) {
111 aiFace &curFace = pcMesh->mFaces[m];
112 EXPECT_EQ(3U, curFace.mNumIndices);
113
114 for (unsigned int qqq = 0; qqq < curFace.mNumIndices; ++qqq) {
115 ait[curFace.mIndices[qqq] - idx] = true;
116 }
117 }
118 for (std::vector<bool>::const_iterator it = ait.begin(); it != ait.end(); ++it) {
119 EXPECT_TRUE(*it);
120 }
121 --m;
122 idx += q;
123 if (++q == 10) {
124 q = 4;
125 }
126 } else {
127 EXPECT_EQ(t, face.mNumIndices);
128
129 for (unsigned int i = 0; i < face.mNumIndices; ++i, ++idx) {
130 EXPECT_EQ(idx, face.mIndices[i]);
131 }
132 }
133 }
134
135 // we should have no valid normal vectors now because we aren't a pure polygon mesh
136 EXPECT_TRUE(pcMesh->mNormals == nullptr);
137}

Callers

nothing calls this directly

Calls 3

TriangulateMeshMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected