예제 #1
0
 public void Store(PersistentSettings settings)
 {
     settings.SetBool("WriteSerialized", writeSerialized);
     settings.SetString("RendererDirectory", rendererDirectory);
     settings.SetInteger("XResolution", xres);
     settings.SetInteger("YResolution", yres);
     settings.SetInteger("PathLength", pathLength);
     settings.SetInteger("SamplesPerPixel", samplesPerPixel);
     settings.SetInteger("Integrator", (int)integrator);
 }
예제 #2
0
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            // Get persistent settings (from Registry)
            PersistentSettings settings = this.PlugIn.Settings;
            bool save_settings          = false;
            bool enabled = settings.GetBool("enabled", true);
            bool new_layer_visible_in_layout = settings.GetBool("new_layer_visible_in_layout", false);

            GetOption    go = new GetOption();
            OptionToggle option_toggle_enabled = new OptionToggle(enabled, "off", "on");
            OptionToggle option_toggle_newLayerLayoutVisible = new OptionToggle(new_layer_visible_in_layout, "off", "on");

            go.AddOptionToggle("enabled", ref option_toggle_enabled);
            go.AddOptionToggle("new_layer_visible_in_layout", ref option_toggle_newLayerLayoutVisible);
            go.SetCommandPrompt("Safe Layout Settings");

            Rhino.Input.GetResult get_rc = go.Get();
            Result rc = go.CommandResult();

            if (enabled != option_toggle_enabled.CurrentValue)
            {
                enabled = option_toggle_enabled.CurrentValue;
                settings.SetBool("enabled", enabled);
                save_settings = true;
            }
            if (new_layer_visible_in_layout != option_toggle_newLayerLayoutVisible.CurrentValue)
            {
                new_layer_visible_in_layout = option_toggle_newLayerLayoutVisible.CurrentValue;
                settings.SetBool("new_layer_visible_in_layout", new_layer_visible_in_layout);
                save_settings = true;
            }

            if (save_settings)
            {
                this.PlugIn.SaveSettings();
            }

            return(rc);
        }
예제 #3
0
 public void OnApply()
 {
     m_Settings.SetBool(KEY_MESH, meshCheckBox.Checked.GetValueOrDefault(false));
     m_Settings.SetBool(KEY_POINTCLOUD, pointCloudCheckBox.Checked.GetValueOrDefault(false));
 }