straightline_group.dart 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'package:fis_measure/interfaces/process/items/item.dart';
  2. import 'package:fis_measure/interfaces/process/items/item_metas.dart';
  3. import 'package:fis_measure/interfaces/process/items/types.dart';
  4. import 'package:fis_measure/process/calcuators/lv_study.dart';
  5. import 'package:fis_measure/process/items/top_item.dart';
  6. import 'package:fis_measure/process/items/top_item_feature.dart';
  7. import 'package:fis_measure/process/primitives/straightline.dart';
  8. class StraightLineGroup extends TopMeasureItem<StraightLineGroupFeature> {
  9. StraightLineGroup(ItemMeta meta) : super(meta) {
  10. for (final childMeta in meta.childItems) {
  11. final childItem = StraightLine.createDistance(childMeta, this);
  12. childItems.add(childItem);
  13. }
  14. }
  15. @override
  16. StraightLineGroupFeature buildFeature() => StraightLineGroupFeature(this);
  17. static StraightLineGroup createLvStudy(ItemMeta meta,
  18. [IMeasureItem? parent]) {
  19. if (meta.measureType != MeasureTypes.LvGroupByLineGroup) {
  20. throw ArgumentError();
  21. }
  22. var ins = StraightLineGroup(meta);
  23. ins.isCrossFrameMode = true;
  24. ins.calculator = LvStudyDistanceGroupCal(ins);
  25. return ins;
  26. }
  27. }
  28. class StraightLineGroupFeature extends TopMeasureItemFeature {
  29. StraightLineGroupFeature(
  30. ITopMeasureItem refItem,
  31. ) : super(refItem);
  32. }