MCPcopy Create free account
hub / github.com/Kitware/VTK / GetLines

Method GetLines

Web/WebGLExporter/vtkWebGLPolyData.cxx:422–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422void 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
455void vtkWebGLPolyData::SetPoints(
456 float* points, int numberOfPoints, unsigned char* colors, int maxSize)

Callers 4

meshFunction · 0.45
polydataSerializerFunction · 0.45
parseActorMethod · 0.45
lines_arraysMethod · 0.45

Calls 8

GetColorsFromPolyDataMethod · 0.95
GetConnectivityArrayMethod · 0.80
SetLineMethod · 0.80
GetOutputMethod · 0.45
GetNumberOfValuesMethod · 0.45
GetComponentMethod · 0.45
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45

Tested by

no test coverage detected