/// <summary> /// Creates a copy of the given object or the default object when given <c>null</c>. /// </summary> /// <param name="options">The object to clone.</param> /// <returns>A new object.</returns> public static PolygonBinaryOperationOptions CloneOrDefault(PolygonBinaryOperationOptions options) { Contract.Ensures(Contract.Result <PolygonBinaryOperationOptions>() != null); return(null == options ? new PolygonBinaryOperationOptions() : new PolygonBinaryOperationOptions(options)); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="options">The object to copy.</param> public PolygonBinaryOperationOptions(PolygonBinaryOperationOptions options) : base(options) { if (null == options) throw new ArgumentNullException("options"); Contract.EndContractBlock(); InvertLeftHandSide = options.InvertLeftHandSide; InvertRightHandSide = options.InvertRightHandSide; }
static PolygonUnionOperation() { DefaultInverseIntersectionOptions = new PolygonBinaryOperationOptions { InvertLeftHandSide = true, InvertRightHandSide = true, InvertResult = true }; DefaultInverseIntersectionOperation = new PolygonIntersectionOperation(DefaultInverseIntersectionOptions); }
static PolygonDifferenceOperation() { DefaultInverseRightIntersectionOptions = new PolygonBinaryOperationOptions { InvertLeftHandSide = false, InvertRightHandSide = true, InvertResult = false }; DefaultInverseRightIntersectionOperation = new PolygonIntersectionOperation(DefaultInverseRightIntersectionOptions); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="options">The object to copy.</param> public PolygonBinaryOperationOptions(PolygonBinaryOperationOptions options) : base(options) { if (null == options) { throw new ArgumentNullException("options"); } Contract.EndContractBlock(); InvertLeftHandSide = options.InvertLeftHandSide; InvertRightHandSide = options.InvertRightHandSide; }
/// <summary> /// Creates a copy of the given object or the default object when given <c>null</c>. /// </summary> /// <param name="options">The object to clone.</param> /// <returns>A new object.</returns> public static PolygonBinaryOperationOptions CloneOrDefault(PolygonBinaryOperationOptions options) { Contract.Ensures(Contract.Result<PolygonBinaryOperationOptions>() != null); return null == options ? new PolygonBinaryOperationOptions() : new PolygonBinaryOperationOptions(options); }
/// <summary> /// Constructs a new polygon intersection operation using the given options. /// </summary> /// <param name="options">The operation options to apply.</param> /// <remarks> /// Using this constructor can help optimize other operators that /// rely on intersection operations, such as union or difference. /// </remarks> internal PolygonIntersectionOperation(PolygonBinaryOperationOptions options) { Options = PolygonBinaryOperationOptions.CloneOrDefault(options); }