| 4 | { |
| 5 | |
| 6 | void forEachVisualSubfeature( const Features::Primitives::Variant& feature, const Features::SubfeatureFunc& func ) |
| 7 | { |
| 8 | Features::forEachSubfeature( feature, func ); |
| 9 | |
| 10 | // Cap centers. |
| 11 | if ( const auto* cone = std::get_if<Features::Primitives::ConeSegment>( &feature ) ) |
| 12 | { |
| 13 | if ( !cone->isCircle() ) |
| 14 | { |
| 15 | for ( bool negativeCap : { false, true } ) |
| 16 | { |
| 17 | float sideLength = negativeCap ? cone->negativeLength : cone->positiveLength; |
| 18 | float sideRadius = negativeCap ? cone->negativeSideRadius : cone->positiveSideRadius; |
| 19 | float otherSideRadius = negativeCap ? cone->positiveSideRadius : cone->negativeSideRadius; |
| 20 | if ( std::isfinite( sideLength ) && sideRadius > 0 ) |
| 21 | { |
| 22 | func( { |
| 23 | .name = otherSideRadius <= 0 ? "Base circle center" : negativeCap ? "Base circle center (negative side)" : "Base circle center (positive side)", |
| 24 | .isInfinite = false, |
| 25 | .create = [negativeCap]( const Features::Primitives::Variant& f ){ return std::get<Features::Primitives::ConeSegment>( f ).basePoint( negativeCap ); }, |
| 26 | } ); |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | } // namespace MR::Features |
no test coverage detected