feat: 完善 Face 一级编辑与隔离计算
This commit is contained in:
@@ -22,6 +22,8 @@ from .workers import EditWorker, ScanWorker
|
||||
|
||||
class InfoPanelMixin:
|
||||
def set_info(self, info: dict[str, object]) -> None:
|
||||
if hasattr(self, "_invalidate_selected_action_info_cache"):
|
||||
self._invalidate_selected_action_info_cache()
|
||||
self.current_info_values = dict(info)
|
||||
self.current_info_text = _info_to_text(info)
|
||||
self.info_text.setPlainText(self.current_info_text)
|
||||
@@ -44,6 +46,8 @@ class InfoPanelMixin:
|
||||
self._update_action_states()
|
||||
|
||||
def set_plain_info(self, text: str) -> None:
|
||||
if hasattr(self, "_invalidate_selected_action_info_cache"):
|
||||
self._invalidate_selected_action_info_cache()
|
||||
self.current_info_values = {}
|
||||
self.current_info_text = text
|
||||
self.info_tree.clear()
|
||||
@@ -262,6 +266,14 @@ class InfoPanelMixin:
|
||||
if self.selected_kind == "solid" and self.selected_solid_id is not None:
|
||||
return f"solid {self.selected_solid_id}"
|
||||
if self.selected_kind in {"face", "feature"} and self.selected_face_id is not None:
|
||||
for key in ("selection_display_id", "face_region_logical_id", "logical_face_id"):
|
||||
value = self.current_info_values.get(key)
|
||||
if value in {None, ""}:
|
||||
continue
|
||||
try:
|
||||
return f"face {int(value)}"
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
return f"face {self.selected_face_id}"
|
||||
if self.selected_kind == "edge" and self.selected_edge_id is not None:
|
||||
return f"edge {self.selected_edge_id}"
|
||||
|
||||
Reference in New Issue
Block a user