netgen/python/__init__.py
Matthias Hochsteger b694b4667a rework build system, separate gui and non-gui code
move fieldlines code to meshing dir

move visualization function pointers to meshing directory

DLL_HEADER -> NGGUI_API in visualization lib

move soldata.hpp to meshing

update occ, no freetype necessary anymore
2022-05-05 14:39:31 +02:00

39 lines
1.0 KiB
Python

import os
import sys
from . import config
_netgen_bin_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..',config.NETGEN_PYTHON_RPATH_BIN))
_netgen_lib_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..',config.NETGEN_PYTHON_RPATH))
if sys.platform.startswith('win'):
if sys.version >= '3.8':
os.add_dll_directory(_netgen_bin_dir)
else:
os.environ['PATH'] += ';'+_netgen_bin_dir
del sys
del os
from . import libngpy
if config.USE_GUI:
from . import libngguipy
global _Redraw, Redraw
_Redraw = libngguipy.meshvis._Redraw
def RedrawWithEventHandling(*args, **kwargs):
try:
if libngguipy.meshvis._Redraw(*args, **kwargs):
import netgen
import tkinter
cnt = 0
while(netgen.gui.win.tk.dooneevent(tkinter._tkinter.DONT_WAIT) and cnt < 100):
cnt += 1
except:
pass
Redraw = RedrawWithEventHandling
else:
def Redraw(*args, **kwargs):
pass