| 293 | } |
| 294 | |
| 295 | void SubdivMesh::updateBuffer(RTCBufferType type, unsigned int slot) |
| 296 | { |
| 297 | if (type != RTC_BUFFER_TYPE_LEVEL) |
| 298 | commitCounter++; |
| 299 | |
| 300 | if (type == RTC_BUFFER_TYPE_VERTEX) |
| 301 | { |
| 302 | if (slot >= vertices.size()) |
| 303 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 304 | vertices[slot].setModified(); |
| 305 | } |
| 306 | else if (type == RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE) |
| 307 | { |
| 308 | if (slot >= vertexAttribs.size()) |
| 309 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 310 | vertexAttribs[slot].setModified(); |
| 311 | } |
| 312 | else if (type == RTC_BUFFER_TYPE_FACE) |
| 313 | { |
| 314 | if (slot != 0) |
| 315 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 316 | faceVertices.setModified(); |
| 317 | } |
| 318 | else if (type == RTC_BUFFER_TYPE_INDEX) |
| 319 | { |
| 320 | if (slot >= topology.size()) |
| 321 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 322 | topology[slot].vertexIndices.setModified(); |
| 323 | } |
| 324 | else if (type == RTC_BUFFER_TYPE_EDGE_CREASE_INDEX) |
| 325 | { |
| 326 | if (slot != 0) |
| 327 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 328 | edge_creases.setModified(); |
| 329 | } |
| 330 | else if (type == RTC_BUFFER_TYPE_EDGE_CREASE_WEIGHT) |
| 331 | { |
| 332 | if (slot != 0) |
| 333 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 334 | edge_crease_weights.setModified(); |
| 335 | } |
| 336 | else if (type == RTC_BUFFER_TYPE_VERTEX_CREASE_INDEX) |
| 337 | { |
| 338 | if (slot != 0) |
| 339 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 340 | vertex_creases.setModified(); |
| 341 | } |
| 342 | else if (type == RTC_BUFFER_TYPE_VERTEX_CREASE_WEIGHT) |
| 343 | { |
| 344 | if (slot != 0) |
| 345 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 346 | vertex_crease_weights.setModified(); |
| 347 | } |
| 348 | else if (type == RTC_BUFFER_TYPE_HOLE) |
| 349 | { |
| 350 | if (slot != 0) |
| 351 | throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot"); |
| 352 | holes.setModified(); |
no test coverage detected