|
@@ -154,6 +154,11 @@ class StraightLine extends MeasureItem<StraightLineFeature> {
|
|
|
case MeasureTypes.SlopeDoppler:
|
|
|
feature = StraightLineSlopeFeature(this, point, point);
|
|
|
break;
|
|
|
+ case MeasureTypes.Pht:
|
|
|
+ feature = StraightLinePhtFeature(this, point, point);
|
|
|
+ mouseState.crossIndicatorStyleChanged
|
|
|
+ .emit(this, CrossIndicatorStyle.vertical);
|
|
|
+ break;
|
|
|
default:
|
|
|
}
|
|
|
} else {
|
|
@@ -243,3 +248,27 @@ class StraightLineSlopeFeature extends StraightLineFeature {
|
|
|
drawVertex(canvas, endOffset, isActive);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+class StraightLinePhtFeature extends StraightLineFeature {
|
|
|
+ StraightLinePhtFeature(
|
|
|
+ IMeasureItem refItem, DPoint startPoint, DPoint endPoint)
|
|
|
+ : super(refItem, startPoint, endPoint);
|
|
|
+ DPoint get regionCenter => hostVisualArea!.displayRegion.center;
|
|
|
+
|
|
|
+ @override
|
|
|
+ void paint(Canvas canvas, Size size) {
|
|
|
+ if (startPoint == endPoint) return;
|
|
|
+ var idText = '$id';
|
|
|
+ drawId(canvas, size, idText);
|
|
|
+ final distanceToCenter = (startPoint.y - regionCenter.y);
|
|
|
+ //TODO:[Gavin] 偏移量比例系数待精确
|
|
|
+ final endPointY = startPoint.y - distanceToCenter / 4;
|
|
|
+
|
|
|
+ final startOffset = convert2ViewPoint(size, startPoint).toOffset();
|
|
|
+ final endOffset =
|
|
|
+ convert2ViewPoint(size, DPoint(endPoint.x, endPointY)).toOffset();
|
|
|
+ drawVertex(canvas, startOffset, false);
|
|
|
+ canvas.drawDashLine(startOffset, endOffset, 1, 10, paintPan);
|
|
|
+ drawVertex(canvas, endOffset, isActive);
|
|
|
+ }
|
|
|
+}
|