-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from DomCR/issue-369_pdfdefinition
Issue 369 pdfdefinition
- Loading branch information
Showing
21 changed files
with
402 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,6 @@ public void CreateMapTest(Type t) | |
} | ||
|
||
DxfMap map = DxfMap.Create(t); | ||
|
||
} | ||
|
||
[Fact] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using ACadSharp.Attributes; | ||
|
||
namespace ACadSharp.Entities | ||
{ | ||
/// <summary> | ||
/// Represents a <see cref="PdfUnderlay"/> entity. | ||
/// </summary> | ||
/// <remarks> | ||
/// Object name <see cref="DxfFileToken.EntityPdfUnderlay"/> <br/> | ||
/// Dxf class name <see cref="DxfSubclassMarker.Underlay"/> | ||
/// </remarks> | ||
[DxfName(DxfFileToken.EntityPdfUnderlay)] | ||
[DxfSubClass(DxfSubclassMarker.Underlay)] | ||
public class PdfUnderlay : UnderlayEntity | ||
{ | ||
/// <inheritdoc/> | ||
public override ObjectType ObjectType => ObjectType.UNLISTED; | ||
|
||
/// <inheritdoc/> | ||
public override string ObjectName => DxfFileToken.EntityPdfUnderlay; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
|
||
namespace ACadSharp.Entities | ||
{ | ||
/// <summary> | ||
/// Underlay display options. | ||
/// </summary> | ||
[Flags] | ||
public enum UnderlayDisplayFlags : byte | ||
{ | ||
/// <summary> | ||
/// Clipping is on. | ||
/// </summary> | ||
ClippingOn = 1, | ||
|
||
/// <summary> | ||
/// Underlay is on. | ||
/// </summary> | ||
ShowUnderlay = 2, | ||
|
||
/// <summary> | ||
/// Show as monochrome. | ||
/// </summary> | ||
Monochrome = 4, | ||
|
||
/// <summary> | ||
/// Adjust for background. | ||
/// </summary> | ||
AdjustForBackground = 8, | ||
|
||
/// <summary> | ||
/// Clip is inside mode. | ||
/// </summary> | ||
ClipInsideMode = 16 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
using ACadSharp.Attributes; | ||
using ACadSharp.Objects; | ||
using CSMath; | ||
using System; | ||
|
||
namespace ACadSharp.Entities | ||
{ | ||
/// <summary> | ||
/// Common base class for all underlay entities, like <see cref="PdfUnderlay" />. | ||
/// </summary> | ||
[DxfSubClass(null, true)] | ||
public abstract class UnderlayEntity : Entity | ||
{ | ||
/// <inheritdoc/> | ||
public override string SubclassMarker => DxfSubclassMarker.Underlay; | ||
|
||
/// <summary> | ||
/// Specifies the three-dimensional normal unit vector for the object. | ||
/// </summary> | ||
[DxfCodeValue(210, 220, 230)] | ||
public XYZ Normal { get; set; } = XYZ.AxisZ; | ||
|
||
/// <summary> | ||
/// Insertion point(in WCS) | ||
/// </summary> | ||
[DxfCodeValue(10, 20, 30)] | ||
public XYZ InsertPoint { get; set; } | ||
|
||
/// <summary> | ||
/// X scale factor | ||
/// </summary> | ||
[DxfCodeValue(41)] | ||
public double XScale { get; set; } = 1; | ||
|
||
/// <summary> | ||
/// Y scale factor | ||
/// </summary> | ||
[DxfCodeValue(42)] | ||
public double YScale { get; set; } = 1; | ||
|
||
/// <summary> | ||
/// Z scale factor | ||
/// </summary> | ||
[DxfCodeValue(43)] | ||
public double ZScale { get; set; } = 1; | ||
|
||
/// <summary> | ||
/// Specifies the rotation angle for the object. | ||
/// </summary> | ||
/// <value> | ||
/// The rotation angle in radians. | ||
/// </value> | ||
[DxfCodeValue(DxfReferenceType.IsAngle, 50)] | ||
public double Rotation { get; set; } = 0.0; | ||
|
||
/// <summary> | ||
/// Underlay display options. | ||
/// </summary> | ||
[DxfCodeValue(280)] | ||
public UnderlayDisplayFlags Flags { get; set; } | ||
|
||
/// <summary> | ||
/// Contrast | ||
/// </summary> | ||
/// <remarks> | ||
/// 0-100; default = 50 | ||
/// </remarks> | ||
[DxfCodeValue(281)] | ||
public byte Contrast | ||
{ | ||
get { return this._contrast; } | ||
set | ||
{ | ||
if (value < 0 || value > 100) | ||
{ | ||
throw new ArgumentException($"Invalid Brightness value: {value}, must be in range 0-100"); | ||
} | ||
|
||
this._contrast = value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Fade | ||
/// </summary> | ||
/// <value> | ||
/// Range: 0 - 100 <br/> | ||
/// Default: 0 | ||
/// </value> | ||
[DxfCodeValue(282)] | ||
public byte Fade | ||
{ | ||
get { return this._fade; } | ||
set | ||
{ | ||
if (value < 0 || value > 100) | ||
{ | ||
throw new ArgumentException($"Invalid Brightness value: {value}, must be in range 0-100"); | ||
} | ||
|
||
this._fade = value; | ||
} | ||
} | ||
|
||
[DxfCodeValue(DxfReferenceType.Handle, 340)] | ||
public UnderlayDefinition Definition { get; set; } | ||
|
||
private byte _contrast = 50; | ||
private byte _fade = 0; | ||
|
||
/// <inheritdoc/> | ||
public override BoundingBox GetBoundingBox() | ||
{ | ||
return BoundingBox.Null; | ||
} | ||
} | ||
} |
Oops, something went wrong.