|
@@ -1,7 +1,4 @@
|
|
|
-import 'package:fis_measure/interfaces/date_types/point.dart';
|
|
|
-import 'package:fis_measure/interfaces/process/calculators/output.dart';
|
|
|
-import 'package:fis_measure/interfaces/process/items/types.dart';
|
|
|
-import 'package:vid/us/vid_us_unit.dart';
|
|
|
+import 'package:fis_measure/process/calcuators/formulas/general.dart';
|
|
|
|
|
|
import '../primitives/straightline.dart';
|
|
|
import 'calculator.dart';
|
|
@@ -26,3 +23,26 @@ class DistanceCal extends Calculator<StraightLine, double> {
|
|
|
floatValue!.name = ref.displayName;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+class VolumeOneDistanceCal extends Calculator<StraightLine, double> {
|
|
|
+ VolumeOneDistanceCal(StraightLine ref) : super(ref);
|
|
|
+
|
|
|
+ @override
|
|
|
+ void calculate() {
|
|
|
+ if (ref.feature == null) return;
|
|
|
+
|
|
|
+ final feature = ref.feature!;
|
|
|
+ // TODO:xxx
|
|
|
+ final viewport = feature.hostVisualArea!.viewport!;
|
|
|
+ final p1 = feature.startPoint;
|
|
|
+ final p2 = feature.endPoint;
|
|
|
+ final pp1 = viewport.convert(p1);
|
|
|
+ final pp2 = viewport.convert(p2);
|
|
|
+
|
|
|
+ final value = (pp2 - pp1).length.abs();
|
|
|
+ double volume = GeneralFormulas.volume(value);
|
|
|
+
|
|
|
+ final floatValue = updateFloatValue(volume);
|
|
|
+ floatValue!.name = ref.displayName;
|
|
|
+ }
|
|
|
+}
|