------------------------------------------------------------------------------
| 1371 | |
| 1372 | //------------------------------------------------------------------------------ |
| 1373 | void vtkOpenGLContextDevice2D::DrawPolygon(float* f, int n) |
| 1374 | { |
| 1375 | if (SkipDraw()) |
| 1376 | { |
| 1377 | return; |
| 1378 | } |
| 1379 | |
| 1380 | if (!f || n <= 0) |
| 1381 | { |
| 1382 | vtkWarningMacro(<< "Points supplied that were not of type float."); |
| 1383 | return; |
| 1384 | } |
| 1385 | |
| 1386 | // convert polygon to triangles |
| 1387 | std::vector<float> tverts; |
| 1388 | int numTVerts = 3 * (n - 2); |
| 1389 | tverts.reserve(numTVerts * 2); |
| 1390 | for (int i = 0; i < n - 2; i++) |
| 1391 | { |
| 1392 | tverts.push_back(f[0]); |
| 1393 | tverts.push_back(f[1]); |
| 1394 | tverts.push_back(f[i * 2 + 2]); |
| 1395 | tverts.push_back(f[i * 2 + 3]); |
| 1396 | tverts.push_back(f[i * 2 + 4]); |
| 1397 | tverts.push_back(f[i * 2 + 5]); |
| 1398 | } |
| 1399 | |
| 1400 | this->CoreDrawTriangles(tverts); |
| 1401 | } |
| 1402 | |
| 1403 | //------------------------------------------------------------------------------ |
| 1404 | void vtkOpenGLContextDevice2D::DrawColoredPolygon( |
no test coverage detected