public void InitializeDimensions() { textBlockDimensionHeight.Text = measurementUnit.ToString(); textBlockDimensionWidth.Text = measurementUnit.ToString(); textBlockDimensionLength.Text = measurementUnit.ToString(); float height, width, length; height = currentObject.Height * (1 / scaleFactor); length = currentObject.Length * (1 / scaleFactor); width = currentObject.Width * (1 / scaleFactor); textBlockLength.Text = Math.Round(length, 1).ToString(); textBlockHeight.Text = Math.Round(height, 1).ToString(); textBlockWidth.Text = Math.Round(width, 1).ToString(); }
public EditObject(WorldObject currentObject, List <Category <Material> > materials, float sceneHeight, Decimal actualPrice, Decimal projectBudget, Project.UnitOfMeasurement measurementUnit, HouseDesign.Classes.Scene scene) { InitializeComponent(); this.currentObject = currentObject.Clone(); this.scene = scene; this.currentObject.Translate = new Point3d(0, 0, 0); this.currentObject.Scale = new Point3d(1, 1, 1); this.oldObject = currentObject; selectedObjectMaterials = new List <WorldObjectMaterial>(); this.materials = materials; ChosenHeight = 0; this.sceneHeight = sceneHeight * 0.0025f; this.actualPrice = actualPrice; this.projectBudget = projectBudget; this.measurementUnit = measurementUnit; textBlockMeasurementUnit.Text = measurementUnit.ToString(); currentTradeAllowance = GetTradeAllowance(currentObject); selectedObjectMaterials.AddRange(currentObject.GetMaterials()); InitializeScaleFactors(); if (currentObject != null) { groupBoxPrices.Visibility = Visibility.Visible; InitializeMaterials(); InitializePrices(); InitializeDimensions(); } if (currentObject.IsSuspendable) { checkBoxIsSuspendable_Checked(this, new RoutedEventArgs()); checkBoxIsSuspendable.IsChecked = true; textBoxChosenHeight.Text = (currentObject.Translate.Y / (realHeightScaleFactor * 50)).ToString(); } WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; }
public GenericCategory(Category <FurnitureObject> category, List <Category <Material> > materials, float sceneHeight, Decimal actualPrice, Decimal projectBudget, Project.UnitOfMeasurement measurementUnit) { InitializeComponent(); this.category = category; this.materials = materials; addPermission = true; selectedObjectMaterials = new List <WorldObjectMaterial>(); TreeViewItem mainTreeViewItem = new TreeViewItem(); mainTreeViewItem.IsExpanded = true; this.measurementUnit = measurementUnit; textBlockMeasurementUnit.Text = measurementUnit.ToString(); InitializeScaleFactors(); treeViewCategory.Items.Add(mainTreeViewItem); PopulateTreeView(category, mainTreeViewItem); ChosenHeight = 0; this.sceneHeight = sceneHeight * 0.0025f; WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; this.Title = category.Name; currentTradeAllowance = Convert.ToDecimal(category.TradeAllowance); this.actualPrice = actualPrice; this.projectBudget = projectBudget; }