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

Method CreateTriangleLineIndexBuffer

Rendering/OpenGL2/vtkOpenGLIndexBufferObject.cxx:332–344  ·  view source on GitHub ↗

used to create an IBO for primitives as lines. This method treats each line segment as independent. So for a triangle mesh you would get 6 verts per triangle 3 edges * 2 verts each. With a line loop you only get 3 verts so half the storage. but... line loops are slower than line segments.

Source from the content-addressed store, hash-verified

330// 3 edges * 2 verts each. With a line loop you only get 3 verts so half the storage.
331// but... line loops are slower than line segments.
332size_t vtkOpenGLIndexBufferObject::CreateTriangleLineIndexBuffer(vtkCellArray* cells)
333{
334 if (!cells->GetNumberOfCells())
335 {
336 this->IndexCount = 0;
337 return 0;
338 }
339 std::vector<unsigned int> indexArray;
340 AppendTriangleLineIndexBuffer(indexArray, cells, 0);
341 this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
342 this->IndexCount = indexArray.size();
343 return indexArray.size();
344}
345
346// used to create an IBO for primitives as lines. This method treats each
347// line segment as independent. So for a line strip you would get multiple

Callers 1

BuildIBOMethod · 0.80

Calls 3

GetNumberOfCellsMethod · 0.45
UploadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected