| 917 | } |
| 918 | |
| 919 | void TransformControls::setActiveLineFromPoints_( const Contour3f& points ) |
| 920 | { |
| 921 | auto activePolyline = std::make_shared<Polyline3>(); |
| 922 | activePolyline->addFromPoints( points.data(), points.size(), false ); |
| 923 | activeLine_->setPolyline( activePolyline ); |
| 924 | activeLine_->setVisible( true, getViewerInstance().viewport().id ); |
| 925 | auto disableBlackLinesIfNeeded = [&] ( auto& obj ) |
| 926 | { |
| 927 | if ( !getPickThrough() || obj->getFrontColor( false ) == params_.helperLineColor ) |
| 928 | obj->setVisible( false ); |
| 929 | else |
| 930 | { |
| 931 | auto color = 0.5f * params_.helperLineColor + 0.5f * params_.activeLineColor; |
| 932 | color.a = 255; |
| 933 | obj->setFrontColor( color, false ); |
| 934 | obj->setLineWidth( 1.0f ); |
| 935 | } |
| 936 | }; |
| 937 | for ( auto& obj : translateLines_ ) |
| 938 | disableBlackLinesIfNeeded( obj ); |
| 939 | for ( auto& obj : rotateLines_ ) |
| 940 | disableBlackLinesIfNeeded( obj ); |
| 941 | } |
| 942 | |
| 943 | void ITransformControls::setCenter( const Vector3f& center ) |
| 944 | { |
nothing calls this directly
no test coverage detected