ansys-pyensight-core 0.10.8__py3-none-any.whl → 0.10.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansys-pyensight-core might be problematic. Click here for more details.
- ansys/pyensight/core/utils/views.py +39 -10
- {ansys_pyensight_core-0.10.8.dist-info → ansys_pyensight_core-0.10.9.dist-info}/METADATA +1 -1
- {ansys_pyensight_core-0.10.8.dist-info → ansys_pyensight_core-0.10.9.dist-info}/RECORD +5 -5
- {ansys_pyensight_core-0.10.8.dist-info → ansys_pyensight_core-0.10.9.dist-info}/WHEEL +0 -0
- {ansys_pyensight_core-0.10.8.dist-info → ansys_pyensight_core-0.10.9.dist-info}/licenses/LICENSE +0 -0
|
@@ -209,7 +209,7 @@ class _Simba:
|
|
|
209
209
|
return camera_position, focal_point, self.views._normalize_vector(view_up), parallel_scale
|
|
210
210
|
|
|
211
211
|
def set_camera(
|
|
212
|
-
self, orthographic, view_up=None, position=None, focal_point=None, view_angle=None
|
|
212
|
+
self, orthographic, view_up=None, position=None, focal_point=None, view_angle=None, pan=None
|
|
213
213
|
):
|
|
214
214
|
"""Set the EnSight camera settings from the VTK input."""
|
|
215
215
|
self.ensight.view_transf.function("global")
|
|
@@ -221,15 +221,18 @@ class _Simba:
|
|
|
221
221
|
vport.PERSPECTIVEANGLE = view_angle / 2
|
|
222
222
|
|
|
223
223
|
if view_up and position and focal_point:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
self.
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
224
|
+
if not pan:
|
|
225
|
+
q_current = self.normalize(np.array(vport.ROTATION.copy()))
|
|
226
|
+
q_target = self.normalize(
|
|
227
|
+
self.compute_model_rotation_quaternion(position, focal_point, view_up)
|
|
228
|
+
)
|
|
229
|
+
q_relative = self.quaternion_multiply(
|
|
230
|
+
q_target, np.array([-q_current[0], -q_current[1], -q_current[2], q_current[3]])
|
|
231
|
+
)
|
|
232
|
+
angles = self.quaternion_to_euler(q_relative)
|
|
233
|
+
self.ensight.view_transf.rotate(*angles)
|
|
234
|
+
else:
|
|
235
|
+
self.ensight.view_transf.translate(*pan)
|
|
233
236
|
self.render()
|
|
234
237
|
|
|
235
238
|
def set_perspective(self, value):
|
|
@@ -257,9 +260,35 @@ class _Simba:
|
|
|
257
260
|
return {"model_point": model_point, "camera": self.get_camera()}
|
|
258
261
|
|
|
259
262
|
def render(self):
|
|
263
|
+
"""Force render update in EnSight."""
|
|
264
|
+
self.ensight.view_transf.zoom(1)
|
|
260
265
|
self.ensight.render()
|
|
261
266
|
self.ensight.refresh(1)
|
|
262
267
|
|
|
268
|
+
def drag_allowed(self, mousex, mousey, invert_y=False):
|
|
269
|
+
"""Return True if the picked object is allowed dragging in the interactor."""
|
|
270
|
+
mousex = int(mousex)
|
|
271
|
+
mousey = int(mousey)
|
|
272
|
+
if isinstance(self.ensight, ModuleType):
|
|
273
|
+
part_id, tool_id = self.ensight.objs.core.VPORTS[0].simba_what_is_picked(
|
|
274
|
+
mousex, mousey, invert_y
|
|
275
|
+
)
|
|
276
|
+
else:
|
|
277
|
+
part_id, tool_id = self.ensight._session.cmd(
|
|
278
|
+
f"ensight.objs.core.VPORTS[0].simba_what_is_picked({mousex}, {mousey}, {invert_y})"
|
|
279
|
+
)
|
|
280
|
+
if tool_id > -1:
|
|
281
|
+
return True
|
|
282
|
+
part_types_allowed = [
|
|
283
|
+
self.ensight.objs.enums.PART_CLIP_PLANE,
|
|
284
|
+
self.ensight.objs.enums.PART_ISO_SURFACE,
|
|
285
|
+
self.ensight.objs.enums.PART_CONTOUR,
|
|
286
|
+
]
|
|
287
|
+
if part_id > -1:
|
|
288
|
+
part_obj = self.ensight.objs.core.PARTS.find(part_id, "PARTNUMBER")[0]
|
|
289
|
+
return part_obj.PARTTYPE in part_types_allowed
|
|
290
|
+
return False
|
|
291
|
+
|
|
263
292
|
|
|
264
293
|
class Views:
|
|
265
294
|
"""Controls the view in the current EnSight ``Session`` instance."""
|
|
@@ -29,9 +29,9 @@ ansys/pyensight/core/utils/query.py,sha256=OXKDbf1sOTX0sUvtKcp64LhVl-BcrEsE43w8u
|
|
|
29
29
|
ansys/pyensight/core/utils/readers.py,sha256=_IluAWz8mmoe5SM3hAewHIqlhtKMfEqrUJoQOlJ4U4I,12138
|
|
30
30
|
ansys/pyensight/core/utils/support.py,sha256=QI3z9ex7zJxjFbkCPba9DWqWgPFIThORqr0nvRfVjuc,4089
|
|
31
31
|
ansys/pyensight/core/utils/variables.py,sha256=ZUiJdDIeRcowrnLXaJQqGwA0RbrfXhc1s4o4v9A4PiY,95133
|
|
32
|
-
ansys/pyensight/core/utils/views.py,sha256=
|
|
32
|
+
ansys/pyensight/core/utils/views.py,sha256=YyTv7F7g6ixf8xFf0fUKXe7s1pbSgbXGzKrFNIMUH5A,22845
|
|
33
33
|
ansys/pyensight/core/utils/resources/Materials/000_sky.exr,sha256=xAR1gFd2uxPZDnvgfegdhEhRaqKtZldQDiR_-1rHKO0,8819933
|
|
34
|
-
ansys_pyensight_core-0.10.
|
|
35
|
-
ansys_pyensight_core-0.10.
|
|
36
|
-
ansys_pyensight_core-0.10.
|
|
37
|
-
ansys_pyensight_core-0.10.
|
|
34
|
+
ansys_pyensight_core-0.10.9.dist-info/licenses/LICENSE,sha256=K6LiJHOa9IbWFelXmXNRzFr3zG45SOGZIN7vdLdURGU,1097
|
|
35
|
+
ansys_pyensight_core-0.10.9.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
36
|
+
ansys_pyensight_core-0.10.9.dist-info/METADATA,sha256=yV4oBGTFEw5MiNzPVnfN6kkrY9NXQHkJpeAb1X7KV_I,12228
|
|
37
|
+
ansys_pyensight_core-0.10.9.dist-info/RECORD,,
|
|
File without changes
|
{ansys_pyensight_core-0.10.8.dist-info → ansys_pyensight_core-0.10.9.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|