public CLoadedObject addNonSelectModel(CLoadedObject model) { models.Add(model); model.Selectable = false; model.modelChange += new EventHandler(this.onModelChange); this.ModelsChange(this, new ModelsEventErgs(model)); return(model); }
public void SelectModel(int selection_number) { if (!selection_dict.ContainsKey(selection_number)) { return; } CLoadedObject model = selection_dict[selection_number]; model.changeState(new Jusin.ObjectModel.State.ModelStateSelected()); selected_models.Add(selection_dict[selection_number]); }
public CLoadedObject addModel(CLoadedObject model) { int key = getNewId(); model.name = (uint)key; models.Add(model); model.Selectable = true; selection_dict.Add(key, model); model.modelChange += new EventHandler(this.onModelChange); this.ModelsChange(this, new ModelsEventErgs(model)); return(model); }
public void SelectModel(int selection_number) { if (!selection_dict.ContainsKey(selection_number)) { return; } CLoadedObject model = selection_dict[selection_number]; model.changeState(new Jusin.ObjectModel.State.ModelStateSelected()); selected_models.Add(selection_dict[selection_number]); if (tree_nodes.Nodes.ContainsKey(selection_number.ToString())) { tree_nodes.TreeView.SelectedNode = tree_nodes.Nodes[selection_number.ToString()]; } }
public void removeModel(CLoadedObject model) { if (!models.Contains(model)) { return; } models.Remove(model); if (model.Selectable) { selection_dict.Remove((int)model.name); } if (selected_models.Contains(model)) { selected_models.Remove(model); } this.tree_nodes.Nodes.Remove(tree_nodes.Nodes[model.name.ToString()]); model.clearCallList(); this.ModelsChange(this, new ModelsEventErgs(model)); }
/** * カメラを正面からの視点に変更する * * **/ public static void setToShoumen(CCamera camera, CLoadedObject target = null, bool isAnimation = true) { ParallelAnimation pAnimation = new ParallelAnimation(); TimeSpan duration = TimeSpan.FromSeconds(0.5); double zoom = CameraControl.calcWindowFitZoomShoumen(camera, target); if (isAnimation) { if (target == null) { pAnimation.AddChild(new DoubleAnimation(camera, "eye_x", 0.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "eye_y", 100.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "eye_z", 200.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "center_x", 0.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "center_y", 100.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "center_z", 0.0, duration)); } else { pAnimation.AddChild(new DoubleAnimation(camera, "eye_x", target.getBBox().getCenter().x + target.vx, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "eye_y", target.getBBox().getCenter().y + target.vy, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "eye_z", target.getBBox().getCenter().z + 200.0 + target.vz, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "center_x", target.getBBox().getCenter().x + target.vx, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "center_y", target.getBBox().getCenter().y + target.vy, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "center_z", target.getBBox().getCenter().z + target.vz, duration)); } pAnimation.AddChild(new DoubleAnimation(camera, "up_x", 0.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "up_y", 1.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "up_z", 0.0, duration)); pAnimation.AddChild(new DoubleAnimation(camera, "zoom", zoom, duration)); pAnimation.Begin(); } else { camera.set(0.0, 100.0, 200.0, 0.0, 100.0, 0.0, 0.0, 1.0, 0.0); } }
protected static double calcWindowFitZoomShoumen(CCamera camera, CLoadedObject target) { double width = 200.0; double height = 200.0; double view_width = camera.width; double view_height = camera.height; if (target != null) { width = target.getBBox().getSize().x; height = target.getBBox().getSize().y; } width = width * 1.05 / camera.base_zoom / 2; height = height * 1.05 / camera.base_zoom / 2; double tmp_zoom = width / view_width; if (tmp_zoom * view_height <= height) { tmp_zoom = height / view_height; } return(tmp_zoom); }
public ModelsEventErgs(CLoadedObject target_model) { this.target_model = target_model; }
protected void AddModelToNode(CLoadedObject model) { tree_nodes.Nodes.Add(model.name.ToString(), model.name.ToString()); }