|
@@ -35,6 +35,7 @@ class Application implements IApplication {
|
|
|
|
|
|
late VidUsProbe _probe;
|
|
|
VidUsImage? _frame;
|
|
|
+ VidUsImage? _subFrame;
|
|
|
List<IVisual>? _visuals;
|
|
|
IMeasureItem? _activeMeasureItem;
|
|
|
IAnnotationItem? _activeAnnotationItem;
|
|
@@ -106,7 +107,7 @@ class Application implements IApplication {
|
|
|
IVisualArea get currentVisualArea => currentVisual.activeArea!;
|
|
|
|
|
|
@override
|
|
|
- VidUsImage? get frameData => _frame;
|
|
|
+ VidUsImage? get frameData => _subFrame ?? _frame;
|
|
|
|
|
|
@override
|
|
|
List<IVisual> get visuals => _visuals ?? [];
|
|
@@ -204,6 +205,12 @@ class Application implements IApplication {
|
|
|
_activeMeasureItem!.featureUpdated
|
|
|
.addListener(_onActiveMeasureItemFeatureUpdated);
|
|
|
}
|
|
|
+ if (_subFrame != null) {
|
|
|
+ // 清除附帧并恢复原始帧的Visual状态
|
|
|
+ _subFrame = null;
|
|
|
+ loadVisuals();
|
|
|
+ }
|
|
|
+
|
|
|
// 通知更新事件
|
|
|
activeMeasureItemChanged.emit(this, value);
|
|
|
_updateRender();
|
|
@@ -281,13 +288,15 @@ class Application implements IApplication {
|
|
|
}
|
|
|
|
|
|
if (activeMeasureItem != null && activeMeasureItem! is ITopMeasureItem) {
|
|
|
- if ((activeMeasureItem as ITopMeasureItem).isMultiFrameMode) {
|
|
|
- _frame = VidUsImage(
|
|
|
- _frame!.index,
|
|
|
- frame.width,
|
|
|
- frame.height,
|
|
|
- frame.imageData,
|
|
|
- );
|
|
|
+ if ((activeMeasureItem as ITopMeasureItem).isCrossFrameMode) {
|
|
|
+ // _frame = VidUsImage(
|
|
|
+ // _frame!.index,
|
|
|
+ // frame.width,
|
|
|
+ // frame.height,
|
|
|
+ // frame.imageData,
|
|
|
+ // );
|
|
|
+ // TODO: 暂不支持直接改index
|
|
|
+ _subFrame = frame;
|
|
|
// 仅更新frame数据
|
|
|
loadVisuals();
|
|
|
return;
|
|
@@ -454,6 +463,23 @@ class Application implements IApplication {
|
|
|
return VisualsLoader(frameData!.visuals).load();
|
|
|
}
|
|
|
|
|
|
+ @protected
|
|
|
+ void loadVisuals() {
|
|
|
+ _clearVisuals();
|
|
|
+ _visuals = convertVisuals();
|
|
|
+ // 默认第一个区域为活动域
|
|
|
+ switchVisual(0);
|
|
|
+ visualsLoaded.emit(this, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ @override
|
|
|
+ void loadCarotidVisuals(VidUsImage carotidVid) {
|
|
|
+ _clearVisuals();
|
|
|
+ _visuals = VisualsLoader(carotidVid.visuals).load();
|
|
|
+ switchVisual(0);
|
|
|
+ visualsLoaded.emit(this, null);
|
|
|
+ }
|
|
|
+
|
|
|
void _handleBeforeSwitchItem() {
|
|
|
if (activeMeasureItem == null) return;
|
|
|
final item = activeMeasureItem!;
|
|
@@ -534,23 +560,6 @@ class Application implements IApplication {
|
|
|
_updateRender();
|
|
|
}
|
|
|
|
|
|
- @protected
|
|
|
- void loadVisuals() {
|
|
|
- _clearVisuals();
|
|
|
- _visuals = convertVisuals();
|
|
|
- // 默认第一个区域为活动域
|
|
|
- switchVisual(0);
|
|
|
- visualsLoaded.emit(this, null);
|
|
|
- }
|
|
|
-
|
|
|
- @override
|
|
|
- void loadCarotidVisuals(VidUsImage carotidVid) {
|
|
|
- _clearVisuals();
|
|
|
- _visuals = VisualsLoader(carotidVid.visuals).load();
|
|
|
- switchVisual(0);
|
|
|
- visualsLoaded.emit(this, null);
|
|
|
- }
|
|
|
-
|
|
|
void _clearVisuals() {
|
|
|
_visuals = [];
|
|
|
}
|