| 253 | } |
| 254 | |
| 255 | void HnMesh::_InitRepr(const pxr::TfToken& ReprToken, pxr::HdDirtyBits* DirtyBits) |
| 256 | { |
| 257 | auto it = std::find_if(_reprs.begin(), _reprs.end(), _ReprComparator(ReprToken)); |
| 258 | if (it != _reprs.end()) |
| 259 | return; |
| 260 | |
| 261 | _reprs.emplace_back(ReprToken, std::make_shared<pxr::HdRepr>()); |
| 262 | auto& Repr = *_reprs.back().second; |
| 263 | |
| 264 | // set dirty bit to say we need to sync a new repr |
| 265 | *DirtyBits |= pxr::HdChangeTracker::NewRepr; |
| 266 | |
| 267 | _MeshReprConfig::DescArray ReprDescs = _GetReprDesc(ReprToken); |
| 268 | // All main draw items must be added before any geometry subset draw item. |
| 269 | for (const pxr::HdMeshReprDesc& Desc : ReprDescs) |
| 270 | { |
| 271 | if (Desc.geomStyle == pxr::HdMeshGeomStyleInvalid) |
| 272 | continue; |
| 273 | Repr.AddDrawItem(std::make_unique<HnDrawItem>(_sharedData, *this)); |
| 274 | } |
| 275 | |
| 276 | // Note that geometry susbset items may change later. |
| 277 | for (const pxr::HdMeshReprDesc& Desc : ReprDescs) |
| 278 | { |
| 279 | AddGeometrySubsetDrawItems(Desc, Repr); |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | void HnMesh::Invalidate() |
| 284 | { |
nothing calls this directly
no outgoing calls
no test coverage detected