개정판 06b40010
dev issue #497 : Snap Grid 기능 추가 (SPPID 도면만 현재 가능)
Change-Id: If1fd23c7e22a18f95054160fe12914ed0384bc4b
DTI_PID/SPPIDConverter/Util/SPPIDUtil.cs | ||
---|---|---|
138 | 138 |
dY = Convert.ToDouble(calcY); |
139 | 139 |
} |
140 | 140 |
|
141 |
public static void ConvertGridPoint(ref double x, ref double y) |
|
142 |
{ |
|
143 |
GridSetting _GridSetting = GridSetting.GetInstance(); |
|
144 |
if (_GridSetting.UseSnapGrid) |
|
145 |
{ |
|
146 |
if (_GridSetting.Unit == GridUnit.Inch) |
|
147 |
{ |
|
148 |
double length = _GridSetting.Density * 0.0254; |
|
149 |
double tempX = x; |
|
150 |
double tempY = y; |
|
151 |
x = Math.Round(tempX / length) * length; |
|
152 |
y = Math.Round(tempY / length) * length; |
|
153 |
} |
|
154 |
} |
|
155 |
} |
|
156 |
|
|
141 | 157 |
public static SlopeType CalcSlope(double x1, double y1, double x2, double y2) |
142 | 158 |
{ |
143 | 159 |
if (x1 - x2 == 0) |
내보내기 Unified diff