| 48 | |
| 49 | |
| 50 | std::vector<CurvesPrimitivePtr> IECoreScene::CurvesAlgo::segment( const CurvesPrimitive *curves, const PrimitiveVariable &primitiveVariable, const IECore::Data *segmentValues, const Canceller *canceller ) |
| 51 | { |
| 52 | |
| 53 | DataPtr data; |
| 54 | if( !segmentValues ) |
| 55 | { |
| 56 | data = IECore::uniqueValues( primitiveVariable.data.get() ); |
| 57 | segmentValues = data.get(); |
| 58 | } |
| 59 | |
| 60 | std::string primitiveVariableName; |
| 61 | for (const auto &pv : curves->variables ) |
| 62 | { |
| 63 | if ( pv.second == primitiveVariable ) |
| 64 | { |
| 65 | primitiveVariableName = pv.first; |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | if( primitiveVariableName == "" ) |
| 70 | { |
| 71 | throw IECore::InvalidArgumentException( "IECoreScene::CurvesAlgo::segment : Primitive variable not found CurvesPrimitive " ); |
| 72 | } |
| 73 | |
| 74 | |
| 75 | auto f = CurvesAlgo::deleteCurves; |
| 76 | |
| 77 | IECoreScene::Detail::TaskSegmenter<IECoreScene::CurvesPrimitive, decltype(f) > segmenter( curves, const_cast<IECore::Data*> ( segmentValues ), primitiveVariableName, f, canceller ); |
| 78 | |
| 79 | return dispatch( primitiveVariable.data.get(), segmenter ); |
| 80 | } |
nothing calls this directly
no test coverage detected