private static void ModelActionToolbar_MAGSAISelectedModelContainsLinkedClones(object sender, EventArgs e) { var tt = new SceneControlManualToolTip(); tt.SetText("No model selected"); var btnSupport = ModelActionsToolbar.ModelSupportButton; var btnToolTipStartPoint = new Point(btnSupport.Left + btnSupport.Width + ModelActionsToolbar.Left + 16, btnSupport.Top + ModelActionsToolbar.Top); btnToolTipStartPoint.Y += (btnSupport.Height / 2) - (tt.Height / 2); tt.ShowToolTip(btnToolTipStartPoint); }
private static void ModelActionToolbar_ScaleSelectedModelContainsLinkedClones(object sender, EventArgs e) { var tt = new SceneControlManualToolTip(); tt.SetText("Unavailable for duplicated model"); var btnScale = ModelActionsToolbar.ModelScaleButton; var btnToolTipStartPoint = new Point(btnScale.Left + btnScale.Width + ModelActionsToolbar.Left + 16, btnScale.Top + ModelActionsToolbar.Top); btnToolTipStartPoint.Y += (btnScale.Height / 2) - (tt.Height / 2); tt.ShowToolTip(btnToolTipStartPoint); }
internal void RefreshCurrentDuplicates() { if (ObjectView.Objects3D.Count > 1) { _packModelsRequest = PackingHelper.CreatePackModelsRequest(null); var solutions = PackingHelper.CalculatePackingSolutions(_packModelsRequest); this.spcModelControls.Panel1.Controls.Clear(); int i = 0; var summaryHeight = 0; this.Height = 215; foreach (var model in ObjectView.Objects3D) { if (model != null && (!(model is GroundPane))) { var stlModel = model as STLModel3D; ModelFootprint modelFootprint = null; if (solutions.BestSolution == null) { modelFootprint = new ModelFootprint(stlModel.RightPoint - stlModel.LeftPoint, stlModel.FrontPoint - stlModel.BackPoint); modelFootprint.Model = stlModel; } else { modelFootprint = solutions.BestSolution.Footprints.First(f => f.Model == stlModel); } if (i > 0) { this.Height += defaultItemHeight; } DuplicateModelControl duplicateModelControl = new DuplicateModelControl(modelFootprint); if (i % 2 != 0) { duplicateModelControl.BackgroundColor = Color.FromArgb(237, 237, 237); } else { duplicateModelControl.BackgroundColor = Color.FromArgb(224, 224, 224); } duplicateModelControl.Left = 0; duplicateModelControl.Top = summaryHeight; duplicateModelControl.DuplicatesCount_KeyUp += DuplicateModelControl_DuplicatesCount_KeyPress; duplicateModelControl.DuplicatesMinus_Click += DuplicateModelControl_DuplicatesMinus_Click; duplicateModelControl.DuplicatesPlus_Click += DuplicateModelControl_DuplicatesPlus_Click; this.spcModelControls.Panel1.Controls.Add(duplicateModelControl); summaryHeight += defaultItemHeight; i++; } } } else { this.Visible = false; //show message var tt = new SceneControlManualToolTip(); tt.SetText("No models available"); var modelActionsToolbar = SceneControlToolbarManager.ModelActionsToolbar; var btnDuplicationButton = modelActionsToolbar.ModelDuplicateButton; var duplicationButtonPoint = new Point(btnDuplicationButton.Left + btnDuplicationButton.Width + modelActionsToolbar.Left + 16, btnDuplicationButton.Top + modelActionsToolbar.Top); duplicationButtonPoint.Y += (btnDuplicationButton.Height / 2) - (tt.Height / 2); tt.ShowToolTip(duplicationButtonPoint); ToolbarActionsManager.Update(Core.Enums.MainFormToolStripActionType.btnSelectPressed, frmStudioMain.SceneControl, null); } }