123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- import 'package:fis_common/event/event_type.dart';
- import 'package:fis_measure/interfaces/enums/items.dart';
- import '../calculators/calculator.dart';
- import '../workspace/point_info.dart';
- import 'item_feature.dart';
- import 'item_metas.dart';
- abstract class IMeasureItem {
- /// 标签信息
- ItemMeta get meta;
- /// 外显名称
- String get displayName;
- /// 描述
- String get description;
- /// 简短描述
- String get briefAnnotation;
- /// 测量快照
- IMeasureItemFeature? get feature;
- /// 已完成测量记录
- List<IMeasureItemFeature> get measuredFeatures;
- /// 计算器
- ICalculator? get calculator;
- /// 父级
- IMeasureItem? get parent;
- /// 测量状态
- ItemStates get state;
- /// 显示像素/图片像素 缩放比例
- double get scaleRatio;
- /// 失活(切换到其他)后取消当前操作还是完成一次测量
- bool get finishAfterUnactive;
- /// 完成一次测量后是否还能编辑(是否切换到下一次测量)
- bool get repeatableEditable;
- /// 处理输入
- bool execute(PointInfo args);
- /// 清空
- void clear();
- /// 完成一次测量
- void finishOnce();
- /// 取消一次测量
- void cancelOnce();
- /// 分配新序号
- int assignId();
- /// 触发一次刷新
- void update();
- /// 快照变化事件
- late final FEventHandler<IMeasureItemFeature?> featureUpdated;
- /// 快照变化事件
- late final FEventHandler<ItemStates?> onItemStatesChanged;
- }
- /// 组合(包含子项)测量项
- abstract class ITopMeasureItem implements IMeasureItem {
- /// 子项集合
- List<IMeasureItem> get childItems;
- /// 工作中子项
- IMeasureItem get workingChild;
- /// 工作中子项索引
- int get workingChildIndex;
- /// 是否跨帧测量模式
- bool get isCrossFrameMode;
- /// 是否允许子项自行输出
- bool get canChildOutputSelf;
- /// 是否跨区域测量模式
- bool get isCrossAreaMode;
- /// 工作子项变更事件
- late final FEventHandler<int> workingChildChanged;
- /// 切换制定子项为工作状态
- void switchChild(int index);
- /// 根据名称获取子项
- IMeasureItem findChildByName(String name);
- }
|