-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
244 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using ACadSharp.Entities; | ||
using ACadSharp.IO; | ||
using ACadSharp.Tests.TestModels; | ||
using System.IO; | ||
using Xunit; | ||
using Xunit.Abstractions; | ||
|
||
namespace ACadSharp.Tests.IO | ||
{ | ||
public class ViewportTests : IOTestsBase | ||
{ | ||
public ViewportTests(ITestOutputHelper output) : base(output) | ||
{ | ||
} | ||
|
||
[Theory] | ||
[MemberData(nameof(DwgFilePaths))] | ||
[MemberData(nameof(DxfAsciiFiles))] | ||
public void ScaleInViewport(FileModel test) | ||
{ | ||
CadDocument doc; | ||
if (Path.GetExtension(test.FileName).Equals(".dxf")) | ||
{ | ||
doc = DxfReader.Read(test.Path); | ||
} | ||
else | ||
{ | ||
doc = DwgReader.Read(test.Path); | ||
} | ||
|
||
ACadSharp.Tables.BlockRecord paper = doc.PaperSpace; | ||
foreach (Viewport v in paper.Viewports) | ||
{ | ||
Assert.NotNull(v.Scale); | ||
} | ||
} | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -1,10 +1,28 @@ | ||
namespace ACadSharp.Objects.Collections | ||
using System.Collections.Generic; | ||
|
||
namespace ACadSharp.Objects.Collections | ||
{ | ||
public class ScaleCollection : ObjectDictionaryCollection<Scale> | ||
{ | ||
private readonly Dictionary<string, Scale> _scales = new Dictionary<string, Scale>(); | ||
|
||
public ScaleCollection(CadDictionary dictionary) : base(dictionary) | ||
{ | ||
this._dictionary = dictionary; | ||
|
||
foreach (Scale item in this._dictionary) | ||
{ | ||
this._scales.Add(item.Name, item); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="entry"></param> | ||
public override void Add(Scale entry) | ||
{ | ||
base.Add(entry); | ||
} | ||
} | ||
} |
Oops, something went wrong.