Skip to content

Commit

Permalink
Replace togl3 by TkGL
Browse files Browse the repository at this point in the history
  • Loading branch information
culler committed Jan 27, 2024
1 parent d5c5cff commit e7e953c
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 32 deletions.
19 changes: 10 additions & 9 deletions opengl/CyOpenGL.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include "CySnapPyfont.pxi"
include "CySnapPyimages.pxi"

from .infowindow import InfoWindow
from . import togl3
from . import tkgl

from cpython cimport array

Expand All @@ -22,7 +22,7 @@ from math import sqrt, ceil, floor, pi, sin, cos, tan
from random import random
import time

Togl_dir = os.path.abspath(os.path.dirname(togl3.__file__))
TkGL_dir = os.path.abspath(os.path.dirname(tkgl.__file__))

import tkinter as Tk_

Expand Down Expand Up @@ -110,20 +110,21 @@ class RawOpenGLWidget(Tk_.Widget, Tk_.Misc):
curr_platform = 'linux'
elif curr_platform == 'win32':
curr_platform = 'windows'
Togl_path = os.path.join(Togl_dir, curr_platform)
if not os.path.exists(Togl_path):
raise RuntimeError('Togl directory "%s" missing.' % Togl_path)
TkGL_path = os.path.join(TkGL_dir, curr_platform)
if not os.path.exists(TkGL_path):
raise RuntimeError('TkGL directory "%s" missing.' % TkGL_path)

master.tk.call('lappend', 'auto_path', Togl_path)
master.tk.call('lappend', 'auto_path', TkGL_path)
try:
master.tk.call('package', 'require', 'Togl')
master.tk.call('package', 'require', 'Tkgl')
except Tk_.TclError:
raise RuntimeError('Tcl can not find Togl even though directory %s exists' % Togl_path)
raise RuntimeError(
'Tcl can not find TkGL even though directory %s exists' % TkGL_path)

if self.profile:
kw['profile'] = self.profile

Tk_.Widget.__init__(self, master, 'togl', cnf, kw)
Tk_.Widget.__init__(self, master, 'tkgl', cnf, kw)
self.root = master
self.bind('<Map>', self.tkMap_expose_or_configure)
self.bind('<Expose>', self.tkMap_expose_or_configure)
Expand Down
File renamed without changes.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions python/tkgl/darwin/Tkgl1.0/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded Tkgl 1.0 \
[list load [file join $dir libtcl9Tkgl1.0.dylib] [string totitle Tkgl]]
} else {
package ifneeded Tkgl 1.0 \
[list load [file join $dir libTkgl1.0.dylib] [string totitle Tkgl]]
}
Binary file not shown.
Binary file added python/tkgl/linux/Tkgl1.0/libtcl9Tkgl1.0.so
Binary file not shown.
10 changes: 10 additions & 0 deletions python/tkgl/linux/Tkgl1.0/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded Tkgl 1.0 \
[list load [file join $dir libtcl9Tkgl1.0.so] [string totitle Tkgl]]
} else {
package ifneeded Tkgl 1.0 \
[list load [file join $dir libTkgl1.0.so] [string totitle Tkgl]]
}
Binary file added python/tkgl/windows/TkGL1.0/Tkgl10t.dll
Binary file not shown.
Binary file added python/tkgl/windows/TkGL1.0/Tkgl10t.lib
Binary file not shown.
5 changes: 5 additions & 0 deletions python/tkgl/windows/TkGL1.0/pkgIndex.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded Tkgl 1.0 [list load [file join $dir tcl9Tkgl10.dll]]
} else {
package ifneeded Tkgl 1.0 [list load [file join $dir Tkgl10.dll]]
}
Binary file added python/tkgl/windows/TkGL1.0/tcl9Tkgl10.dll
Binary file not shown.
Binary file added python/tkgl/windows/TkGL1.0/tcl9Tkgl10.lib
Binary file not shown.
File renamed without changes.
File renamed without changes.
10 changes: 0 additions & 10 deletions python/togl3/darwin/Togl3.0/pkgIndex.tcl

This file was deleted.

10 changes: 0 additions & 10 deletions python/togl3/linux/Togl3.0/pkgIndex.tcl

This file was deleted.

6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ def add(self, source_file, dependency_mod_time=0.0):
'snappy/raytracing',
'snappy/raytracing/shaders',
'snappy/raytracing/zoom_slider',
'snappy/togl3',
'snappy/tkgl',
'snappy/dev',
'snappy/dev/extended_ptolemy',
'snappy/dev/vericlosed',
Expand All @@ -583,7 +583,7 @@ def add(self, source_file, dependency_mod_time=0.0):
'doc/_static/js/*',
'doc/_static/css/*',
'doc/_static/css/fonts/*'],
'snappy/togl3': ['*/Togl3.0/*'],
'snappy/tkgl': ['*/TkGL1.0/*'],
'snappy/manifolds' : ['HTWKnots/*.gz'],
'snappy/twister' : ['surfaces/*'],
'snappy/ptolemy':['magma/*.magma_template',
Expand Down Expand Up @@ -620,7 +620,7 @@ def add(self, source_file, dependency_mod_time=0.0):
'snappy/raytracing':'python/raytracing',
'snappy/raytracing/shaders':'python/raytracing/shaders',
'snappy/raytracing/zoom_slider':'python/raytracing/zoom_slider',
'snappy/togl3': 'python/togl3',
'snappy/tkgl': 'python/tkgl',
'snappy/dev':'dev/python',
'snappy/dev/extended_ptolemy':'dev/extended_ptolemy',
'snappy/dev/vericlosed':'dev/vericlosed',
Expand Down

0 comments on commit e7e953c

Please sign in to comment.