internal InterlayerProperties ToInterlayer(DataInterlayer dtInterlayer) { return(new InterlayerProperties( null , dtInterlayer.Name, dtInterlayer.Description , dtInterlayer.Dimensions[0], dtInterlayer.Dimensions[1], dtInterlayer.Dimensions[2] , dtInterlayer.Weight, Color.Beige)); }
private void bnInsert_Click(object sender, EventArgs e) { if (null == _dt || null == _document) { return; } // Case DataCase dtCase = _dt as DataCase; if (null != dtCase) { _document.CreateNewCase(ToCase(dtCase)); } DataBox dtBox = _dt as DataBox; if (null != dtBox) { _document.CreateNewBox(ToBox(dtBox)); } DataCylinder dtCylinder = _dt as DataCylinder; if (null != dtCylinder) { _document.CreateNewCylinder(ToCylinder(dtCylinder)); } DataPallet dtPallet = _dt as DataPallet; if (null != dtPallet) { _document.CreateNewPallet(ToPallet(dtPallet)); } DataInterlayer dtInterlayer = _dt as DataInterlayer; if (null != dtInterlayer) { _document.CreateNewInterlayer(ToInterlayer(dtInterlayer)); } DataPalletCap dtPalletCap = _dt as DataPalletCap; if (null != dtPalletCap) { _document.CreateNewPalletCap(ToPalletCap(dtPalletCap)); } DataPalletFilm dtPalletFilm = _dt as DataPalletFilm; if (null != dtPalletFilm) { _document.CreateNewPalletFilm(ToPalletFilm(dtPalletFilm)); } }
public void Draw(Graphics3DControl ctrl, Graphics3D graphics) { if (null == _dt) { return; } DataCase dtCase = _dt as DataCase; if (null != dtCase) { Box b = new Box(0, ToCase(dtCase)); graphics.AddBox(b); graphics.AddDimensions(new DimensionCube(dtCase.OuterDimensions)); } DataBox dtBox = _dt as DataBox; if (null != dtBox) { Box b = new Box(0, ToBox(dtBox)); graphics.AddBox(b); graphics.AddDimensions(new DimensionCube(dtBox.Dimensions)); } DataPallet dtPallet = _dt as DataPallet; if (null != dtPallet) { Pallet pallet = new Pallet(ToPallet(dtPallet)); pallet.Draw(graphics, Sharp3D.Math.Core.Transform3D.Identity); graphics.AddDimensions(new DimensionCube(dtPallet.Dimensions)); } DataInterlayer dtInterlayer = _dt as DataInterlayer; if (null != dtInterlayer) { graphics.AddBox(new Box(0, ToInterlayer(dtInterlayer))); graphics.AddDimensions(new DimensionCube(dtInterlayer.Dimensions)); } DataPalletCap dtPalletCap = _dt as DataPalletCap; if (null != dtPalletCap) { PalletCap palletCap = new PalletCap(0, ToPalletCap(dtPalletCap), Sharp3D.Math.Core.Vector3D.Zero); palletCap.Draw(graphics); graphics.AddDimensions(new DimensionCube(dtPalletCap.Dimensions)); } DataCylinder dtCylinder = _dt as DataCylinder; if (null != dtCylinder) { Cylinder cyl = new Cylinder(0, ToCylinder(dtCylinder)); graphics.AddCylinder(cyl); } }