MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / loadFaceIndicesBuffer_

Method loadFaceIndicesBuffer_

source/MRViewer/MRRenderLabelObject.cpp:480–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480RenderBufferRef<Vector3i> RenderLabelObject::loadFaceIndicesBuffer_()
481{
482 auto& glBuffer = GLStaticHolder::getStaticGLBuffer();
483 if ( !( dirty_ & DIRTY_FACE ) || !objLabel_->labelRepresentingMesh() )
484 return glBuffer.prepareBuffer<Vector3i>( faceIndicesSize_, !facesIndicesBuffer_.valid() );
485
486 MR_TIMER;
487
488 const auto& mesh = objLabel_->labelRepresentingMesh();
489 const auto& topology = mesh->topology;
490 auto numF = topology.lastValidFace() + 1;
491 auto buffer = glBuffer.prepareBuffer<Vector3i>( faceIndicesSize_ = numF );
492
493 BitSetParallelForAll( topology.getValidFaces(), [&] ( FaceId f )
494 {
495 if ( f >= numF )
496 return;
497 topology.getTriVerts( f, ( VertId( & )[3] ) buffer[int( f )] );
498 } );
499
500 return buffer;
501}
502
503MR_REGISTER_RENDER_OBJECT_IMPL( ObjectLabel, RenderLabelObject )
504

Callers

nothing calls this directly

Calls 4

BitSetParallelForAllFunction · 0.85
lastValidFaceMethod · 0.80
getTriVertsMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected