| 279 | } |
| 280 | |
| 281 | void MeshPrimitive::setCorners( const IECore::IntVectorData *ids, const IECore::FloatVectorData *sharpnesses ) |
| 282 | { |
| 283 | for( auto id : ids->readable() ) |
| 284 | { |
| 285 | if( id < 0 || (size_t)id >= m_numVertices ) |
| 286 | { |
| 287 | throw Exception( boost::str( |
| 288 | boost::format( |
| 289 | "Bad corners : id (%1%) is out of expected range (0-%2%)" |
| 290 | ) % id % (m_numVertices - 1) |
| 291 | ) ); |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | if( sharpnesses->readable().size() != ids->readable().size() ) |
| 296 | { |
| 297 | throw Exception( boost::str( |
| 298 | boost::format( |
| 299 | "Bad corners : number of sharpnesses (%1%) does not match number of ids (%2%)" |
| 300 | ) % sharpnesses->readable().size() % ids->readable().size() |
| 301 | ) ); |
| 302 | } |
| 303 | |
| 304 | m_cornerIds = ids->copy(); |
| 305 | m_cornerSharpnesses = sharpnesses->copy(); |
| 306 | } |
| 307 | |
| 308 | const IECore::IntVectorData *MeshPrimitive::cornerIds() const |
| 309 | { |