MCPcopy Create free account
hub / github.com/RenderKit/embree / bind

Method bind

kernels/common/scene.cpp:717–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715 }
716
717 unsigned Scene::bind(unsigned geomID, Ref<Geometry> geometry)
718 {
719 Lock<MutexSys> lock(geometriesMutex);
720 if (geomID == RTC_INVALID_GEOMETRY_ID) {
721 geomID = id_pool.allocate();
722 if (geomID == RTC_INVALID_GEOMETRY_ID)
723 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"too many geometries inside scene");
724 }
725 else
726 {
727 if (!id_pool.add(geomID))
728 throw_RTCError(RTC_ERROR_INVALID_OPERATION,"invalid geometry ID provided");
729 }
730 if (geomID >= geometries.size()) {
731 geometries.resize(geomID+1);
732 vertices.resize(geomID+1);
733 geometryModCounters_.resize(geomID+1);
734 }
735 geometries[geomID] = geometry;
736 geometryModCounters_[geomID] = 0;
737 if (geometry->isEnabled()) {
738 setModified ();
739 }
740 return geomID;
741 }
742
743 void Scene::detachGeometry(size_t geomID)
744 {

Callers 3

rtcAttachGeometryFunction · 0.80
rtcAttachGeometryByIDFunction · 0.80
mallocMethod · 0.80

Calls 6

setModifiedFunction · 0.85
allocateMethod · 0.45
addMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45
isEnabledMethod · 0.45

Tested by

no test coverage detected