public bool Insert(int index, MPPoint item) { int i = index + 1; foreach (MPPoint pt in points) { if (pt.PointNum >= i) { pt.PointNum = pt.PointNum + 1; } if (inTree) { pt.RemoveFromTree(); } } points.Insert(i, item); if (inScene) { item.AddToScene(); } foreach (MPPoint pt in points) { if (inTree) { pt.AddToTree(node); } } OnPointsChanged(); this.UpdateFocus(FocusLocation); return(true); }
public DragMPPointCommand(WorldEditor worldEditor, MPPoint point) { this.app = worldEditor; this.obj = point; this.origPosition = point.Position; this.type = point.Type; this.pointNum = point.PointNum; }
public bool Remove(int pointNum) { MPPoint item = points[pointNum]; bool rv = Remove(item); UpdateFocus(FocusLocation); return(rv); }
public DragMPPointCommandFactory(WorldEditor worldEditor, IWorldObject obj) { app = worldEditor; this.obj = obj; if (obj is MPPoint) { point = obj as MPPoint; } else { return; } }
public bool AddPoint(Vector3 location, out int index) { bool ret = true; index = 0; if (noIntersect) { if (IntersectionHelperClass.BoundaryIntersectionSearch(this.VectorList, location, points.Count)) { ErrorHelper.SendUserError("Adding point to region failed", "Region", app.Config.ErrorDisplayTimeDefault, true, this, app); return(false); } } MPPoint pt = new MPPoint(Count, this, app, markerMeshName, markerMaterialName, location, this.type); Add(pt); index = pt.PointNum; this.UpdateFocus(FocusLocation); return(ret); }
public void Clone(IWorldContainer copyParent) { MPPoint clone = new MPPoint(pointNum, copyParent as PointCollection, app, meshName, meshMaterial, position, type, focusOffset); copyParent.Add(clone); }
public DeletePointCommand(WorldEditor worldEditor, PointCollection parentObject, MPPoint delPt) { app = worldEditor; parent = parentObject; point = delPt; }
public int IndexOf(MPPoint point) { return(points.IndexOf(point)); }