| 156 | } |
| 157 | |
| 158 | std::shared_ptr<ObjectLines> cloneRegion( const std::shared_ptr<ObjectLines>& objLines, const UndirectedEdgeBitSet& region ) |
| 159 | { |
| 160 | MR_TIMER; |
| 161 | std::shared_ptr<Polyline3> newPolyline = std::make_shared<Polyline3>(); |
| 162 | VertMap src2clone; |
| 163 | newPolyline->addPartByMask( *objLines->polyline(), region, &src2clone ); |
| 164 | std::shared_ptr<ObjectLines> newObj = std::make_shared<ObjectLines>(); |
| 165 | newObj->setFrontColor( objLines->getFrontColor( true ), true ); |
| 166 | newObj->setFrontColor( objLines->getFrontColor( false ), false ); |
| 167 | newObj->setBackColor( objLines->getBackColor() ); |
| 168 | newObj->setPolyline( newPolyline ); |
| 169 | newObj->setAllVisualizeProperties( objLines->getAllVisualizeProperties() ); |
| 170 | |
| 171 | VertMap clone2src; |
| 172 | clone2src.resizeNoInit( newPolyline->points.size() ); |
| 173 | ParallelFor( src2clone, [&] ( VertId srcV ) |
| 174 | { |
| 175 | if( auto cloneV = src2clone[srcV] ) |
| 176 | clone2src[cloneV] = srcV; |
| 177 | } ); |
| 178 | newObj->copyColors( *objLines, clone2src ); |
| 179 | newObj->setName( objLines->name() + "_part" ); |
| 180 | return newObj; |
| 181 | } |
| 182 | |
| 183 | } // namespace MR |
nothing calls this directly
no test coverage detected