| 420 | } |
| 421 | |
| 422 | void vtkWebGLPolyData::GetLines(vtkTriangleFilter* polydata, vtkActor* actor, int lineMaxSize) |
| 423 | { |
| 424 | vtkWebGLPolyData* object = this; |
| 425 | vtkCellArray* lines = polydata->GetOutput(0)->GetLines(); |
| 426 | |
| 427 | // Index |
| 428 | // Array of 3 Values. [#number of index, i1, i2] |
| 429 | // Discarting the first value |
| 430 | vtkDataArray* conn = lines->GetConnectivityArray(); |
| 431 | const vtkIdType connSize = conn->GetNumberOfValues(); |
| 432 | int* index = new int[static_cast<size_t>(connSize)]; |
| 433 | for (vtkIdType i = 0; i < connSize; ++i) |
| 434 | { |
| 435 | index[i] = static_cast<int>(conn->GetComponent(i, 0)); |
| 436 | } |
| 437 | // Point |
| 438 | double point[3]; |
| 439 | float* points = new float[polydata->GetOutput(0)->GetNumberOfPoints() * 3]; |
| 440 | for (int i = 0; i < polydata->GetOutput(0)->GetNumberOfPoints(); i++) |
| 441 | { |
| 442 | polydata->GetOutput(0)->GetPoint(i, point); |
| 443 | points[i * 3 + 0] = point[0]; |
| 444 | points[i * 3 + 1] = point[1]; |
| 445 | points[i * 3 + 2] = point[2]; |
| 446 | } |
| 447 | // Colors |
| 448 | unsigned char* color = new unsigned char[polydata->GetOutput(0)->GetNumberOfPoints() * 4]; |
| 449 | this->GetColorsFromPolyData(color, polydata->GetOutput(0), actor); |
| 450 | |
| 451 | object->SetLine(points, polydata->GetOutput(0)->GetNumberOfPoints(), index, |
| 452 | static_cast<int>(connSize), color, lineMaxSize); |
| 453 | } |
| 454 | |
| 455 | void vtkWebGLPolyData::SetPoints( |
| 456 | float* points, int numberOfPoints, unsigned char* colors, int maxSize) |
no test coverage detected