private static CutSubcurve FromReshapeLineMsg(ReshapeLineMsg reshapeLineMsg) { var path = (Polyline)ProtobufConversionUtils.FromShapeMsg(reshapeLineMsg.Path); var targetSegmentAtFrom = (Polyline)ProtobufConversionUtils.FromShapeMsg(reshapeLineMsg.TargetSegmentAtFrom); var targetSegmentAtTo = (Polyline)ProtobufConversionUtils.FromShapeMsg(reshapeLineMsg.TargetSegmentAtTo); var extraInsertPoints = ProtobufConversionUtils.FromShapeMsg(reshapeLineMsg.ExtraTargetInsertPoints); var result = new CutSubcurve(Assert.NotNull(path), reshapeLineMsg.CanReshape, reshapeLineMsg.IsCandidate, reshapeLineMsg.IsFiltered, targetSegmentAtFrom, targetSegmentAtTo, extraInsertPoints); return(result); }
private static CutSubcurve FromReshapeLineMsg([NotNull] ReshapeLineMsg reshapeLineMsg) { IPath path = Assert.NotNull(GetPath(reshapeLineMsg.Path), "Reshapeline's path is null"); var result = new CutSubcurve( path, reshapeLineMsg.CanReshape, reshapeLineMsg.IsCandidate, reshapeLineMsg.IsFiltered, GetSegment(reshapeLineMsg.TargetSegmentAtFrom), GetSegment(reshapeLineMsg.TargetSegmentAtTo), PointsFromShapeMsg(reshapeLineMsg.ExtraTargetInsertPoints)); if (reshapeLineMsg.Source != null) { result.Source = new GdbObjectReference( reshapeLineMsg.Source.ClassHandle, reshapeLineMsg.Source.ObjectId); } return(result); }
private static ReshapeLineMsg ToReshapeLineMsg([NotNull] CutSubcurve cutSubcurve) { var result = new ReshapeLineMsg(); result.Path = ProtobufGeometryUtils.ToShapeMsg(cutSubcurve.Path); result.CanReshape = cutSubcurve.CanReshape; result.IsCandidate = cutSubcurve.IsReshapeMemberCandidate; result.IsFiltered = cutSubcurve.IsFiltered; result.TargetSegmentAtFrom = cutSubcurve.FromPointIsStitchPoint ? ProtobufGeometryUtils.ToShapeMsg(cutSubcurve.TargetSegmentAtFromPoint) : null; result.TargetSegmentAtTo = cutSubcurve.ToPointIsStitchPoint ? ProtobufGeometryUtils.ToShapeMsg(cutSubcurve.TargetSegmentAtToPoint) : null; if (cutSubcurve.ExtraTargetInsertPoints != null) { result.ExtraTargetInsertPoints = ProtobufGeometryUtils.ToShapeMsg( GeometryFactory.CreateMultipoint(cutSubcurve.ExtraTargetInsertPoints)); } if (cutSubcurve.Source != null) { GdbObjectReference sourceObjRef = cutSubcurve.Source.Value; result.Source = new GdbObjRefMsg { ClassHandle = sourceObjRef.ClassId, ObjectId = sourceObjRef.ObjectId }; } return(result); }
private static ReshapeLineMsg ToReshapeLineMsg(CutSubcurve subcurve) { var result = new ReshapeLineMsg(); result.Path = ProtobufConversionUtils.ToShapeMsg(subcurve.Path); result.CanReshape = subcurve.CanReshape; result.IsCandidate = subcurve.IsReshapeMemberCandidate; result.IsFiltered = subcurve.IsFiltered; if (subcurve.Source != null) { result.Source = ProtobufConversionUtils.ToGdbObjRefMsg(subcurve.Source); } result.TargetSegmentAtFrom = ProtobufConversionUtils.ToShapeMsg(subcurve.TargetSegmentAtFromPoint); result.TargetSegmentAtTo = ProtobufConversionUtils.ToShapeMsg(subcurve.TargetSegmentAtToPoint); result.ExtraTargetInsertPoints = ProtobufConversionUtils.ToShapeMsg(subcurve.ExtraTargetInsertPoints); return(result); }