Merge pull request #19961 from pskowronskiTDx/tdx-integration

Final touches for the CoR visualization
This commit is contained in:
Erwan MATHIEU 2025-02-11 13:11:50 +01:00 committed by GitHub
commit 5de3fe6368
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View File

@ -17,7 +17,7 @@ class NavlibClient(pynav.NavlibNavigationModel):
self._was_pick = False
self._hit_selection_only = False
self._picking_pass = None
self._pivot_node = OverlayNode(node=SceneNode(), image_path=Resources.getPath(Resources.Images, "3dx_pivot.png"), size=3.)
self._pivot_node = OverlayNode(node=SceneNode(), image_path=Resources.getPath(Resources.Images, "cor.png"), size=2.5)
def pick(self, x, y, check_selection = False, radius = 0.):
@ -70,8 +70,8 @@ class NavlibClient(pynav.NavlibNavigationModel):
from UM.Qt.QtApplication import QtApplication
main_window = QtApplication.getInstance().getMainWindow()
x_n = 2. * main_window._mouse_x / self._scene.getActiveCamera().getViewportWidth() - 1.
y_n = 2. * main_window._mouse_y / self._scene.getActiveCamera().getViewportHeight() - 1.
x_n = 2. * main_window._mouse_x / main_window.width() - 1.
y_n = 2. * main_window._mouse_y / main_window.height() - 1.
if self.get_is_view_perspective():
self._was_pick = True
@ -226,8 +226,6 @@ class NavlibClient(pynav.NavlibNavigationModel):
camera_position = active_camera.getWorldPosition()
dist = (camera_position - self._pivot_node.getWorldPosition()).length()
scale = dist / 400.
if scale < 1.:
scale = scale * scale
else:
view_width = active_camera.getViewportWidth()
current_size = view_width + (2. * active_camera.getZoomFactor() * view_width)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
resources/images/cor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB