Exemple #1
0
        protected override Result RunCommand(RhinoDoc doc, RunMode mode)
        {
            var panel_id = Views.UserStringsPanelControl.PanelId;
            var visible  = Panels.IsPanelVisible(panel_id);

            if (mode == RunMode.Scripted)
            {
                var go = new Rhino.Input.Custom.GetOption();
                go.SetCommandPrompt(LOC.STR("Choose document text option"));
                var hide_index   = go.AddOption("Hide");
                var show_index   = go.AddOption("Show");
                var toggle_index = go.AddOption("Toggle");
                go.Get();
                if (go.CommandResult() != Result.Success)
                {
                    return(go.CommandResult());
                }

                var option = go.Option();
                if (null == option)
                {
                    return(Result.Failure);
                }

                var index = option.Index;
                if (index == hide_index)
                {
                    if (visible)
                    {
                        Panels.ClosePanel(panel_id);
                    }
                }
                else if (index == show_index)
                {
                    if (!visible)
                    {
                        Panels.OpenPanel(panel_id);
                    }
                }
                else if (index == toggle_index)
                {
                    if (visible)
                    {
                        Panels.ClosePanel(panel_id);
                    }
                    else
                    {
                        Panels.OpenPanel(panel_id);
                    }
                }
            }
            else
            {
                Panels.OpenPanel(panel_id);
            }



            return(Result.Success);
        }
Exemple #2
0
        public SampleCsWizardPanelCommand()
        {
            // Rhino only creates one instance of each command class defined in a
            // plug-in, so it is safe to store a reference in a static property.
            Instance = this;

            Panels.RegisterPanel(PlugIn, typeof(MainPanel), LOC.STR("SampleCsWizardPanel"), null);
        }
        private void InitializeComponents()
        {
            m_seed_lb = new Label()
            {
                Text = Localization.LocalizeString("Seed", 4),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_seed = new NumericStepper()
            {
                Value                = 0,
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.Seed,
            };

            m_diffusesamples_lb = new Label()
            {
                Text = Localization.LocalizeString("Diffuse Samples", 10),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_diffusesamples = new NumericStepper()
            {
                Value                = 0,
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.DiffuseSamples,
            };

            m_glossysamples_lb = new Label()
            {
                Text = Localization.LocalizeString("Glossy Samples", 11),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_glossysamples = new NumericStepper()
            {
                Value                = 0,
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.GlossySamples,
            };

            m_transmissionsamples_lb = new Label()
            {
                Text = Localization.LocalizeString("Transmission Samples", 12),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_transmissionsamples = new NumericStepper()
            {
                Value                = 0,
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.TransmissionSamples,
            };

            m_maxbounce_lb = new Label()
            {
                Text = LOC.STR("Maximum bounces"),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_maxbounce = new NumericStepper()
            {
                Value                = 0,
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.MaxBounce,
            };

            m_maxdiffusebounce_lb = new Label()
            {
                Text              = Localization.LocalizeString("Diffuse", 31),
                ToolTip           = Localization.LocalizeString("Maximum Diffuse Bounces", 15),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_maxdiffusebounce = new NumericStepper()
            {
                Value                = 0,
                ToolTip              = Localization.LocalizeString("Maximum Diffuse Bounces", 15),
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.MaxDiffuseBounce,
            };

            m_maxglossybounce_lb = new Label()
            {
                Text              = Localization.LocalizeString("Glossy", 32),
                ToolTip           = Localization.LocalizeString("Maximum Glossy Bounces", 16),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_maxglossybounce = new NumericStepper()
            {
                Value                = 0,
                ToolTip              = Localization.LocalizeString("Maximum Glossy Bounces", 16),
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.MaxGlossyBounce,
            };

            m_maxvolumebounce_lb = new Label()
            {
                Text              = Localization.LocalizeString("Volume", 33),
                ToolTip           = Localization.LocalizeString("Maximum Volume Bounces", 17),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_maxvolumebounce = new NumericStepper()
            {
                Value                = 0,
                ToolTip              = Localization.LocalizeString("Maximum Volume Bounces", 17),
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.MaxVolumeBounce,
            };

            m_maxtransmissionbounce_lb = new Label()
            {
                Text              = LOC.STR("Transmission"),
                ToolTip           = Localization.LocalizeString("Maximum Transmission Bounces", 18),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_maxtransmissionbounce = new NumericStepper()
            {
                Value                = 0,
                ToolTip              = Localization.LocalizeString("Maximum Transmission Bounces", 18),
                MaxValue             = int.MaxValue,
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.MaxTransmissionBounce,
            };

            m_maxtranspbounce_lb = new Label()
            {
                Text              = LOC.STR("Transparency"),
                ToolTip           = LOC.STR("Maximum Transparency Bounces"),
                VerticalAlignment = VerticalAlignment.Center,
            };

            m_maxtranspbounce = new NumericStepper()
            {
                Value                = 0,
                ToolTip              = LOC.STR("Maximum Transparency Bounces"),
                MinValue             = 0,
                MaximumDecimalPlaces = 0,
                Width                = 75,
                Tag = IntegratorSetting.TransparentMaxBounce,
            };
        }
 public RigidBodyRhinoPlugIn()
 {
     Instance = this;
     Panels.RegisterPanel(Instance, typeof(TimePanel), LOC.STR("TimePanel"), null, PanelType.System);
     RigidBodyEvents events = new RigidBodyEvents();
 }
Exemple #5
0
        public GanPlanRhinoPanel()
        {
            _instance = this;

            Panels.RegisterPanel(PlugIn, typeof(MainPanel), LOC.STR("GanPlanRhinoPanel"), null);
        }
Exemple #6
0
 public virtual Rhino.Commands.Result RunScript(RhinoDoc doc, Rhino.Commands.RunMode mode)
 {
     RhinoApp.WriteLine(LOC.STR("Scripting not supported for this option"));
     Rhino.UI.Dialogs.ShowMessageBox(LOC.STR("Scripting not supported for this option"), LOC.STR("Unsupported Option"));
     return(Rhino.Commands.Result.Success);
 }
 public UserStringsDocumentOptionsPage(RhinoDoc doc) : base(LOC.STR("Document Text"))
 {
     Document = doc;
 }