/// <summary> /// Overrides <see cref="CADability.GeoObject.ISurfaceImpl.CopyData (ISurface)"/> /// </summary> /// <param name="CopyFrom"></param> public override void CopyData(ISurface CopyFrom) { RuledSurface other = CopyFrom as RuledSurface; this.firstCurve = other.firstCurve; this.secondCurve = other.secondCurve; }
/// <summary> /// Overrides <see cref="CADability.GeoObject.ISurfaceImpl.GetModified (ModOp)"/> /// </summary> /// <param name="m"></param> /// <returns></returns> public override ISurface GetModified(ModOp m) { RuledSurface res = this.Clone() as RuledSurface; res.Modify(m); res.usedArea = usedArea; return(res); }
public override bool SameGeometry(BoundingRect thisBounds, ISurface other, BoundingRect otherBounds, double precision, out ModOp2D firstToSecond) { if (other is RuledSurface) { RuledSurface rsother = other as RuledSurface; if ((firstCurve.SameGeometry(rsother.firstCurve, precision) && secondCurve.SameGeometry(rsother.secondCurve, precision)) || (firstCurve.SameGeometry(rsother.secondCurve, precision) && secondCurve.SameGeometry(rsother.firstCurve, precision))) { GeoPoint2D[] srcPoints = new GeoPoint2D[] { GeoPoint2D.Origin, new GeoPoint2D(1, 0), new GeoPoint2D(0, 1) }; GeoPoint2D[] dstPoints = new GeoPoint2D[3]; for (int i = 0; i < dstPoints.Length; i++) { dstPoints[i] = rsother.PositionOf(this.PointAt(srcPoints[i])); } firstToSecond = ModOp2D.Fit(srcPoints, dstPoints, true); return(true); } firstToSecond = ModOp2D.Null; return(false); } return(base.SameGeometry(thisBounds, other, otherBounds, precision, out firstToSecond)); }