-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathLine.cs
72 lines (63 loc) · 2.73 KB
/
Line.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System;
using System.Text;
using System.Globalization;
namespace BppLib.CIDFile
{
///<summary>Class <c>Line</c> represents the line geometry.</summary>
public class Line
{
/// <value>Property <c>StartPoint</c> represents the start point of the geometry element.</value>
public Point StartPoint {get; set;} = new Point();
/// <value>Property <c>EndPoint</c> represents the end point of the geometry element.</value>
public Point EndPoint {get; set;} = new Point();
/// <value>Property <c>Xs</c> represents the X-axis co-ordinate of the start point of the geometry element.</value>
public double Xs
{
get { return StartPoint.X; }
set { StartPoint.X = value;}
}
/// <value>Property <c>Ys</c> represents the Y-axis co-ordinate of the start point of the geometry element.</value>
public double Ys
{
get { return StartPoint.Y; }
set { StartPoint.Y = value;}
}
/// <value>Property <c>Zs</c> represents the Z-axis co-ordinate of the start point of the geometry element.</value>
public double Zs
{
get { return StartPoint.Z; }
set { StartPoint.Z = value;}
}
/// <value>Property <c>Xe</c> represents the X-axis co-ordinate of the endpoint of the geometry element.</value>
public double Xe
{
get { return EndPoint.X; }
set { EndPoint.X = value;}
}
/// <value>Property <c>Ye</c> represents the Y-axis co-ordinate of the endpoint of the geometry element.</value>
public double Ye
{
get { return EndPoint.Y; }
set { EndPoint.Y = value;}
}
/// <value>Property <c>Ze</c> represents the Z-axis co-ordinate of the endpoint of the geometry element.</value>
public double Ze
{
get { return EndPoint.Z; }
set { EndPoint.Z = value;}
}
/// <summary>This method serializes an object as Cid code.</summary>
/// <returns>A string is coded as Cid code.</returns>
public virtual string AsCidCode()
{
StringBuilder sb = new StringBuilder();
sb.Append("\tLINE,XS=" + Xs.ToString("F4", CultureInfo.InvariantCulture));
sb.Append(",YS=" + Ys.ToString("F4", CultureInfo.InvariantCulture));
sb.Append(",ZS=" + Zs.ToString("F4", CultureInfo.InvariantCulture));
sb.Append(",XE=" + Xe.ToString("F4", CultureInfo.InvariantCulture));
sb.Append(",YE=" + Ye.ToString("F4", CultureInfo.InvariantCulture));
sb.Append(",ZE=" + Ze.ToString("F4", CultureInfo.InvariantCulture));
return sb.ToString();
}
}
}