Exemplo n.º 1
0
        // Engaging
        public override void OnEngage()
        {
            base.OnEngage();

            if (BuilderPlug.Me.SlopeDataSector == null || BuilderPlug.Me.SlopeDataSector.IsDisposed)
            {
                SlopeDataSectorDialog sdsd = new SlopeDataSectorDialog();
                DialogResult          dr   = sdsd.ShowDialog();

                if (dr == DialogResult.Cancel)
                {
                    General.Editing.ChangeMode(General.Editing.PreviousStableMode.Name);
                }

                if (dr == DialogResult.OK)
                {
                    BuilderPlug.Me.SlopeDataSector = General.Map.Map.GetSelectedSectors(true).ToList()[0];
                    BuilderPlug.Me.StoreSlopeVertexGroupsInSector();
                }
            }

            EnableAutoPanning();
            renderer.SetPresentation(Presentation.Standard);

            // Convert geometry selection to sectors only
            General.Map.Map.ConvertSelection(SelectionType.Sectors);

            General.Interface.AddButton(BuilderPlug.Me.MenusForm.FloorSlope);
            General.Interface.AddButton(BuilderPlug.Me.MenusForm.CeilingSlope);
            General.Interface.AddButton(BuilderPlug.Me.MenusForm.FloorAndCeilingSlope);

            BuilderPlug.Me.MenusForm.FloorSlope.Checked           = false;
            BuilderPlug.Me.MenusForm.CeilingSlope.Checked         = false;
            BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = false;

            if (slopedrawingmode == SlopeDrawingMode.Floor)
            {
                BuilderPlug.Me.MenusForm.FloorSlope.Checked = true;
            }
            else if (slopedrawingmode == SlopeDrawingMode.Ceiling)
            {
                BuilderPlug.Me.MenusForm.CeilingSlope.Checked = true;
            }
            else
            {
                BuilderPlug.Me.MenusForm.FloorAndCeilingSlope.Checked = true;
            }

            // Make text labels for sectors
            SetupLabels();
            updateOverlaySurfaces();
            Update();

            // Set cursor
            General.Interface.SetCursor(Cursors.Cross);
        }