|
@@ -29,6 +29,12 @@ class StraightLine extends MeasureItem<StraightLineFeature> {
|
|
|
return sraightLine;
|
|
|
}
|
|
|
|
|
|
+ static StraightLine createSlope(ItemMeta meta, [IMeasureItem? parent]) {
|
|
|
+ StraightLine sraightLine = StraightLine(meta, parent);
|
|
|
+ sraightLine.calculator = SlopeCal(sraightLine);
|
|
|
+ return sraightLine;
|
|
|
+ }
|
|
|
+
|
|
|
static StraightLine createVerticalDistance(ItemMeta meta,
|
|
|
[IMeasureItem? parent]) {
|
|
|
StraightLine sraightLine = StraightLine(meta, parent);
|
|
@@ -131,6 +137,9 @@ class StraightLine extends MeasureItem<StraightLineFeature> {
|
|
|
mouseState.crossIndicatorStyleChanged
|
|
|
.emit(this, CrossIndicatorStyle.horizontal);
|
|
|
break;
|
|
|
+ case MeasureTypes.Slope:
|
|
|
+ feature = StraightLineSlopeFeature(this, point, point);
|
|
|
+ break;
|
|
|
default:
|
|
|
}
|
|
|
} else {
|
|
@@ -200,3 +209,23 @@ class StraightLineTimeMotionFeature extends StraightLineFeature {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+class StraightLineSlopeFeature extends StraightLineFeature {
|
|
|
+ StraightLineSlopeFeature(
|
|
|
+ IMeasureItem refItem, DPoint startPoint, DPoint endPoint)
|
|
|
+ : super(refItem, startPoint, endPoint);
|
|
|
+ @override
|
|
|
+ void paint(Canvas canvas, Size size) {
|
|
|
+ if (startPoint == endPoint) return;
|
|
|
+
|
|
|
+ var idText = '$id';
|
|
|
+ drawId(canvas, size, idText);
|
|
|
+
|
|
|
+ final startOffset = convert2ViewPoint(size, startPoint).toOffset();
|
|
|
+ drawVertex(canvas, startOffset);
|
|
|
+
|
|
|
+ final endOffset = convert2ViewPoint(size, endPoint).toOffset();
|
|
|
+ canvas.drawDashLine(startOffset, endOffset, 1, 10, paintPan);
|
|
|
+ drawVertex(canvas, endOffset, isActive);
|
|
|
+ }
|
|
|
+}
|