private void VP3D_MouseDown(object sender, MouseButtonEventArgs e) { try { tempPoint = Mouse.GetPosition(e.Source as FrameworkElement); VP3D.Focus(); tempPoint = e.GetPosition(VP3D); PointHitTestParameters hitTestParameters = new PointHitTestParameters(tempPoint); if (e.ClickCount == 2) { VisualTreeHelper.HitTest(VP3D, null, ResultCallback_DoubleClick, hitTestParameters);//单击 } else if (e.ClickCount == 1) { VisualTreeHelper.HitTest(VP3D, null, ResultCallback_Click, hitTestParameters);//双击 } } catch (Exception ex) { HintEvent(string.Format("WareHouseModel_ResultCallback has exception:" + ex.ToString())); } }
private void ACTmodelSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { RobotLaunchStoryboard.Stop(this); String s = ((TextBlock)(e.AddedItems[0])).Tag.ToString(); switch (s) { case "F": PlaceSoleObjOnTurntable("GM3D_Camel_FOOT"); break; case "S": PlaceSoleObjOnTurntable("GM3D_Camel_SHIN"); break; case "T": PlaceSoleObjOnTurntable("GM3D_Camel_THIGH"); break; case "B": PlaceSoleObjOnTurntable("GM3D_Camel_TRUNK"); break; case "H": PlaceSoleObjOnTurntable("GM3D_Camel_HEAD"); break; case "HB+": { Model3DGroup cam = CreateCamel(); AutoCompositeHeadTrunk(cam); ModelsOnTurntable.Children.Clear(); ModelsOnTurntable.Children.Add(cam); TRVU_model.Items.Clear(); TRVU_model.Items.Add(new TRVU_Model3DGroup(cam)); } break; case "FS": { Model3DGroup thelowerleg = CreateLowerLeg(); ModelsOnTurntable.Children.Clear(); ModelsOnTurntable.Children.Add(thelowerleg); TRVU_model.Items.Clear(); TRVU_model.Items.Add(new TRVU_Model3DGroup(thelowerleg)); } break; case "FST": { Model3DGroup theleg = CreateLeg(); ModelsOnTurntable.Children.Clear(); ModelsOnTurntable.Children.Add(theleg); TRVU_model.Items.Clear(); TRVU_model.Items.Add(new TRVU_Model3DGroup(theleg)); } break; case "FST+": { Model3DGroup theleg = CreateLeg(); AutoCompositeLeg(theleg); ModelsOnTurntable.Children.Clear(); ModelsOnTurntable.Children.Add(theleg); TRVU_model.Items.Clear(); TRVU_model.Items.Add(new TRVU_Model3DGroup(theleg)); } break; case "HBLeg_fr_left": { Model3DGroup cam = CreateEntireCamel(1, false); TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(cam); TRVU_model.Items.Clear(); TRVU_model.Items.Add(xyz); } break; case "HBLegs_fr": { Model3DGroup cam = CreateEntireCamel(2, false); TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(cam); TRVU_model.Items.Clear(); TRVU_model.Items.Add(xyz); } break; case "HBLegs_fr+": { Model3DGroup cam = CreateEntireCamel(2, true); TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(cam); TRVU_model.Items.Clear(); TRVU_model.Items.Add(xyz); } break; case "WHOLE+": { Model3DGroup cam = CreateEntireCamel(4, true); TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(cam); TRVU_model.Items.Clear(); TRVU_model.Items.Add(xyz); } break; case "WHOLE+ANIM": { Model3DGroup cam = CreateEntireCamel(4, true); AddAnimationEnablers(); TRVU_Model3DGroup xyz = new TRVU_Model3DGroup(cam); TRVU_model.Items.Clear(); TRVU_model.Items.Add(xyz); RobotLaunchStoryboard.Stop(this); RobotLaunchStoryboard.Seek(this, TimeSpan.Zero, TimeSeekOrigin.BeginTime); RobotLaunchStoryboard.Begin(this, true); VP3D.Focus(); ACTcamerareset(sender, e); } break; } ComputeXAML(); }