8000 Add numpy support to OCC array types; fixes in Qt backend by jnwalther · Pull Request #1381 · tpaviot/pythonocc-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add numpy support to OCC array types; fixes in Qt backend #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
skips: ['B101']
9 changes: 5 additions & 4 deletions src/Display/SimpleGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from typing import Any, Callable, List, Optional, Tuple

from OCC import VERSION
from OCC.Display.backend import load_backend, get_qt_modules
from OCC.Display.backend import get_qt_modules, load_backend
from OCC.Display.OCCViewer import OffscreenRenderer

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -86,6 +86,7 @@ def call_function(s, func: Callable) -> None:
# tkinter SimpleGui
if used_backend == "tk":
import tkinter as tk

from OCC.Display.tkDisplay import tkViewer3d

root = tk.Tk()
Expand Down Expand Up @@ -145,7 +146,7 @@ def add_function_to_menu(self, menu_name: str, _callable: Callable) -> None:
# point on curve
_id = wx.NewId()
check_callable(_callable)
if not menu_name in self._menus:
if menu_name not in self._menus:
raise ValueError(f"the menu item {menu_name} does not exist")
self._menus[menu_name].Append(
_id, _callable.__name__.replace("_", " ").lower()
Expand Down Expand Up @@ -215,7 +216,7 @@ def add_menu(self, menu_name: str) -> None:

def add_function_to_menu(self, menu_name: str, _callable: Callable) -> None:
check_callable(_callable)
if not menu_name in self._menus:
if menu_name not in self._menus:
raise ValueError(f"the menu item {menu_name} does not exist")
qaction = (
QtGui.QAction
Expand All @@ -227,7 +228,7 @@ def add_function_to_menu(self, menu_name: str, _callable: Callable) -> None:
self._menus[menu_name].addAction(_action)

# following couple of lines is a tweak to enable ipython --gui='qt'
app = QtWidgets.QApplication(sys.argv)
app = QtWidgets.QApplication.instance() or QtWidgets.QApplication(sys.argv)
win = MainWindow()
win.resize(size[0] - 1, size[1] - 1)
win.show()
Expand Down
3 changes: 1 addition & 2 deletions src/Display/qtDisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import logging
import os
import sys

from OCC.Core.AIS import AIS_Manipulator
from OCC.Core.gp import gp_Trsf
Expand All @@ -28,8 +27,8 @@

QtCore, QtGui, QtWidgets, QtOpenGL = get_qt_modules()

logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)


class qtBaseViewer(QtWidgets.QWidget):
Expand Down
Loading
0