public void GenerateModelEventHandler(ModelControl sender, GenerateModelEventArgs args) { if (args.Type == GenerateModelEventArgs.ModelType.SuperquadricToroid) { _toroid.SetPhiResolParam(args.PhiParam); _toroid.SetThetaResolParam(args.ThetaParam); _toroid.SetXCompParam(args.XScale); _toroid.SetYCompParam(args.YScale); _toroid.SetZCompParam(args.ZScale); _toroid.ReconstructModel(); SceneElements.Clear(); SceneElements.Add(_toroid); } else { _hyperboloid.SetPhiResolParam(args.PhiParam); _hyperboloid.SetThetaResolParam(args.ThetaParam); _hyperboloid.SetXCompParam(args.XScale); _hyperboloid.SetYCompParam(args.YScale); _hyperboloid.SetZCompParam(args.ZScale); _hyperboloid.ReconstructModel(); SceneElements.Clear(); SceneElements.Add(_hyperboloid); } }
public AssignmentThreeWindow(int width, int height, string title) : base(new AssignmentThreeScene(), width, height, title) { this._modelControl = new ModelControl(); this._cameraControl = new CameraControl(); this._update = new Timer(); base.WidthOff = _widthOff; this._modelControl.Location = new System.Drawing.Point(this.Size.Width - base.WidthOff, 0); this._modelControl.generate += (base.Scene as AssignmentThreeScene).GenerateModelEventHandler; this._cameraControl.Location = new System.Drawing.Point(this.Size.Width - base.WidthOff, this._modelControl.Size.Height); this._cameraControl.zoom += (base.Scene as AssignmentThreeScene).ZoomEventHandler; this._cameraControl.rotate += RotateEventHandler; this.Controls.Add(this._modelControl); this.Controls.Add(this._cameraControl); }