MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / drawShadowsOptions_

Method drawShadowsOptions_

source/MRViewer/MRViewerSettingsPlugin.cpp:887–930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887void ViewerSettingsPlugin::drawShadowsOptions_( float )
888{
889 const auto& style = ImGui::GetStyle();
890 ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, { style.FramePadding.x, cButtonPadding * UI::scale() } );
891 const bool showShadows = shadowGl_ && RibbonButtonDrawer::CustomCollapsingHeader( _tr( "Shadows" ) );
892 ImGui::PopStyleVar();
893
894 if ( showShadows )
895 {
896 ImGui::SetCursorPosY( ImGui::GetCursorPosY() + cDefaultItemSpacing * UI::scale() * 0.5f );
897 ImGui::PushStyleVar( ImGuiStyleVar_ItemSpacing, { style.ItemSpacing.x, style.ItemSpacing.y * 1.5f } );
898 bool isEnableShadows = shadowGl_->isEnabled();
899 UI::checkbox( _tr( "Enabled" ), &isEnableShadows );
900 if ( isEnableShadows != shadowGl_->isEnabled() )
901 {
902 CommandLoop::appendCommand( [shadowGl = shadowGl_.get(), isEnableShadows] ()
903 {
904 shadowGl->enable( isEnableShadows );
905 } );
906 }
907 ImGui::SameLine( 116.0f * UI::scale() );
908 auto color = shadowGl_->getShadowColor();
909 UI::colorEdit4( _tr( "Shadow Color" ), color,
910 ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_PickerHueWheel );
911 shadowGl_->setShadowColor( color );
912 ImGui::PopStyleVar();
913
914 ImGui::PushStyleVar( ImGuiStyleVar_FramePadding, { style.FramePadding.x, cButtonPadding * 1.5f } );
915 ImGui::PushItemWidth( 208.0f * UI::scale() );
916 auto shift = shadowGl_->getShadowShift();
917 auto radius = shadowGl_->getBlurRadius();
918 auto quality = shadowGl_->getQuality();
919 UI::drag<PixelSizeUnit>( _tr( "Shift" ), shift, 0.4f, -200.0f, 200.0f );
920 ImGui::SetItemTooltip( "%s", _tr( "X = shift to the left, Y = shift upwards" ) );
921 UI::drag<PixelSizeUnit>( _tr( "Blur Radius" ), radius, 0.2f, 0.f, 200.f );
922 UI::drag<NoUnit>( _tr( "Quality" ), quality, 0.001f, 0.0625f, 1.0f );
923 ImGui::PopItemWidth();
924 ImGui::PopStyleVar();
925 UI::setTooltipIfHovered( _tr( "Blur texture downscaling coefficient" ) );
926 shadowGl_->setShadowShift( shift );
927 shadowGl_->setBlurRadius( radius );
928 shadowGl_->setQuality( quality );
929 }
930}
931
932void ViewerSettingsPlugin::drawLanguageSelector_()
933{

Callers

nothing calls this directly

Calls 11

colorEdit4Function · 0.85
setTooltipIfHoveredFunction · 0.85
isEnabledMethod · 0.80
setShadowColorMethod · 0.80
setShadowShiftMethod · 0.80
setBlurRadiusMethod · 0.80
setQualityMethod · 0.80
scaleFunction · 0.70
checkboxFunction · 0.70
getMethod · 0.45
enableMethod · 0.45

Tested by

no test coverage detected