MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/MaterialX / createAdvancedSettings

Method createAdvancedSettings

source/MaterialXView/Viewer.cpp:758–1189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758void Viewer::createAdvancedSettings(ng::ref<Widget> parent)
759{
760 ng::ref<ng::PopupButton> advancedButton = new ng::PopupButton(parent, "Advanced Settings");
761 advancedButton->set_icon(FA_TOOLS);
762 advancedButton->set_chevron_icon(-1);
763 advancedButton->set_tooltip("Asset and rendering options.");
764 ng::ref<ng::Popup> advancedPopupParent = advancedButton->popup();
765 advancedPopupParent->set_layout(new ng::GroupLayout());
766
767 ng::ref<ng::VScrollPanel> scrollPanel = new ng::VScrollPanel(advancedPopupParent);
768 scrollPanel->set_fixed_height(500);
769 ng::ref<ng::Widget> advancedPopup = new ng::Widget(scrollPanel);
770 advancedPopup->set_layout(new ng::BoxLayout(ng::Orientation::Vertical));
771
772 ng::ref<ng::Widget> settingsGroup = new ng::Widget(advancedPopup);
773 settingsGroup->set_layout(new ng::GroupLayout(13));
774 ng::ref<ng::Label> viewLabel = new ng::Label(settingsGroup, "Viewing Options");
775 viewLabel->set_font_size(20);
776 viewLabel->set_font("sans-bold");
777
778 ng::ref<ng::CheckBox> drawEnvironmentBox = new ng::CheckBox(settingsGroup, "Draw Environment");
779 drawEnvironmentBox->set_checked(_drawEnvironment);
780 drawEnvironmentBox->set_callback([this](bool enable)
781 {
782 _drawEnvironment = enable;
783 });
784
785 ng::ref<ng::CheckBox> outlineSelectedGeometryBox = new ng::CheckBox(settingsGroup, "Outline Selected Geometry");
786 outlineSelectedGeometryBox->set_checked(_outlineSelection);
787 outlineSelectedGeometryBox->set_callback([this](bool enable)
788 {
789 _outlineSelection = enable;
790 });
791
792 ng::ref<ng::Label> renderLabel = new ng::Label(settingsGroup, "Render Options");
793 renderLabel->set_font_size(20);
794 renderLabel->set_font("sans-bold");
795
796 ng::ref<ng::CheckBox> transparencyBox = new ng::CheckBox(settingsGroup, "Render Transparency");
797 transparencyBox->set_checked(_renderTransparency);
798 transparencyBox->set_callback([this](bool enable)
799 {
800 _renderTransparency = enable;
801 });
802
803 ng::ref<ng::CheckBox> doubleSidedBox = new ng::CheckBox(settingsGroup, "Render Double-Sided");
804 doubleSidedBox->set_checked(_renderDoubleSided);
805 doubleSidedBox->set_callback([this](bool enable)
806 {
807 _renderDoubleSided = enable;
808 });
809
810 ng::ref<ng::CheckBox> importanceSampleBox = new ng::CheckBox(settingsGroup, "Environment FIS");
811 importanceSampleBox->set_checked(_genContext.getOptions().hwSpecularEnvironmentMethod == mx::SPECULAR_ENVIRONMENT_FIS);
812 _lightHandler->setUsePrefilteredMap(_genContext.getOptions().hwSpecularEnvironmentMethod != mx::SPECULAR_ENVIRONMENT_FIS);
813 importanceSampleBox->set_callback([this](bool enable)
814 {
815 _genContext.getOptions().hwSpecularEnvironmentMethod = enable ? mx::SPECULAR_ENVIRONMENT_FIS : mx::SPECULAR_ENVIRONMENT_PREFILTER;

Callers

nothing calls this directly

Calls 13

to_stringFunction · 0.85
createValueFunction · 0.85
createFloatWidgetFunction · 0.85
createIntWidgetFunction · 0.85
updateAlbedoTableMethod · 0.80
push_backMethod · 0.80
getUnitAsIntegerMethod · 0.80
set_valueMethod · 0.80
log2Function · 0.50
powFunction · 0.50
whatMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected