| 879 | } |
| 880 | |
| 881 | CornerControllerObject::PickedIds CornerControllerObject::pick_( const Vector2f& mousePos ) const |
| 882 | { |
| 883 | if ( !rootObj_ ) |
| 884 | return {}; |
| 885 | |
| 886 | auto hId = getViewerInstance().getHoveredViewportId(); |
| 887 | if ( !hId ) |
| 888 | return {}; |
| 889 | |
| 890 | if ( !rootObj_->isVisible( hId ) ) |
| 891 | return {}; |
| 892 | |
| 893 | const auto& vp = getViewerInstance().viewport( hId ); |
| 894 | auto screenPos = to2dim( getViewerInstance().viewportToScreen( to3dim( vp.getAxesPosition() ), hId ) ); |
| 895 | |
| 896 | if ( distanceSq( mousePos, screenPos ) > sqr( vp.getAxesSize() * 2.0f ) ) |
| 897 | return {}; |
| 898 | |
| 899 | const auto& children = rootObj_->children(); |
| 900 | auto staticRenderParams = vp.getBaseRenderParamsOrthoFixedPos(); |
| 901 | auto [obj, pick] = vp.pickRenderObject( { { |
| 902 | static_cast< VisualObject* >( children[0].get() ), |
| 903 | static_cast< VisualObject* >( children[1].get() ), |
| 904 | static_cast< VisualObject* >( children[2].get() ) |
| 905 | } }, { .baseRenderParams = &staticRenderParams } ); |
| 906 | if ( !obj ) |
| 907 | return {}; |
| 908 | |
| 909 | if ( obj == children[0] ) |
| 910 | return { hId, getCornerControllerRegionByFace( pick.face ) }; |
| 911 | else if ( obj == children[1] ) |
| 912 | return { hId, RegionId( int( SideRegions::CCWArrow ) ) }; |
| 913 | else |
| 914 | return { hId, RegionId( int( SideRegions::CWArrow ) ) }; |
| 915 | } |
| 916 | |
| 917 | void CornerControllerObject::hover_( const Vector2f& mousePos ) |
| 918 | { |
nothing calls this directly
no test coverage detected