public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseDown(mouseDownPos, button); if (StartMoving() == false) { return; } Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break; } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public void UpdateMeshSelection(TriMesh mesh) { var selected = MGlobal.activeSelectionList; var it = new MItSelectionList(selected, MFn.Type.kMeshVertComponent); MObject vertice = new MObject(); for (; !it.isDone; it.next()) { var path = new MDagPath(); it.getDagPath(path, vertice); MGlobal.displayInfo(path.fullPathName); if (!vertice.isNull) { MItMeshVertex itvertex = new MItMeshVertex(path, vertice); for (; !itvertex.isDone; itvertex.next()) { int index = itvertex.index(); mesh.Vertices[index].Traits.SelectedFlag = 1; } } } TriMeshUtil.GroupVertice(mesh); }
public List <TriMesh> AddSelectionVertex(TriMesh mesh) { List <TriMesh> meshes = new List <TriMesh>(); int count = TriMeshUtil.GroupVertice(mesh); for (int i = 1; i <= count + 1; i++) { meshes.Add(AddSelectionVertex(mesh, i)); } return(meshes); }
public override void MouseMove(Vector2D mouseMovePos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseMove(mouseMovePos, button); SelectByCircle(); TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public static List <TriMesh.Vertex> RetrieveVertexGroup(TriMesh mesh, int groupIndex) { TriMeshUtil.GroupVertice(mesh); List <TriMesh.Vertex> group = new List <TriMesh.Vertex>(); for (int i = 0; i < mesh.Vertices.Count; i++) { if (mesh.Vertices[i].Traits.SelectedFlag == groupIndex) { group.Add(mesh.Vertices[i]); } } return(group); }
public override void MouseUp(Vector2D mouseUpPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseUp(mouseUpPos, button); if (button == EnumMouseButton.Left) { selectedEdge = SelectByPoint(); } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
public override void MouseDown(Vector2D mouseDownPos, EnumMouseButton button) { if (mesh == null) { return; } base.MouseDown(mouseDownPos, button); bool haveSelected = false; for (int i = 0; i < mesh.Vertices.Count; i++) { if (mesh.Vertices[i].Traits.SelectedFlag == (byte)1) { haveSelected = true; } } if (button == EnumMouseButton.Left && !haveSelected) { selectedPoint = SelectByPoint(); } if (StartMoving() == false) { return; } Vector2D p = mouseDownPos - new Vector2D(projectedCenter.x, projectedCenter.y); p.x += 100; p.y += 100; switch (button) { case EnumMouseButton.Middle: movingBall.Click(p, ArcBall.MotionType.Rotation); break; case EnumMouseButton.Left: movingBall.Click(p / this.ScaleRatio, ArcBall.MotionType.Pan); break; case EnumMouseButton.Right: movingBall.Click(p, ArcBall.MotionType.Scale); break; } TriMeshUtil.GroupVertice(mesh); OnChanged(EventArgs.Empty); }
private void reverseToolStripMenuItem_Click(object sender, EventArgs e) { TriMeshUtil.SelectedVertexReverse(Mesh); TriMeshUtil.GroupVertice(Mesh); OnChanged(EventArgs.Empty); }