| 478 | } |
| 479 | |
| 480 | RenderBufferRef<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 | |
| 503 | MR_REGISTER_RENDER_OBJECT_IMPL( ObjectLabel, RenderLabelObject ) |
| 504 |
nothing calls this directly
no test coverage detected