| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using o0.Geometry2D.Float;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace o0.Project
- {
- public class LineIdentified
- {
- // 属于的识别批次
- public int Batch;
- // 线段
- public Line Line;
- // 线梯度
- public float Gradient;
- // 线梯度方向, 0 - 180度
- public float GradientDegree;
- // 用于绘制的线, 为null就是不绘制
- public Line DrawLine;
- public LineIdentified(int batch, Line line, float gradient, float gradientDegree, bool drawAll = false)
- {
- Batch = batch;
- Line = line;
- Gradient = gradient;
- GradientDegree = gradientDegree;
- if (drawAll)
- DrawLine = line;
- }
- public LineIdentified(int batch, (Line line, float gradient, float gradientDegree) lineParams, bool drawAll = false)
- {
- Batch = batch;
- Line = lineParams.line;
- Gradient = lineParams.gradient;
- GradientDegree = lineParams.gradientDegree;
- if (drawAll)
- DrawLine = lineParams.line;
- }
- public void Offset(Vector offset)
- {
- Line += offset;
- }
- }
- }
|