internal CylinderProperties ToCylinder(DataCylinder dtCylinder) { return(new CylinderProperties( null , dtCylinder.Name, dtCylinder.Description , 0.5 * dtCylinder.Diameter, 0.5 * dtCylinder.InnerDiameter, dtCylinder.Height, dtCylinder.Weight , Color.Gray, Color.LightSkyBlue, Color.Chocolate)); }
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); } }