Commit graph

24 commits

Author SHA1 Message Date
a86ac40e4a
Fix incorrect use of glBitmap
The intent of this use of glBitmap is to move the raster position
without drawing anything. However, it may be required to use None
instead of the empty bytes object for this. I couldn't quite verify
this as I don't have an affected system.

The final argument is the 'bitmap' argument. The use of a NULL bitmap
together with nonzero xmove/ymove parameters is explicitly
documented as a valid way to move the raster position
(including to offscreen positions); doing it with a zero byte bitmap
is apparently unsupported in some OpenGL implementation even if the
width×height of the bitmap is 0 pixels.

https://docs.gl/gl3/glBitmap specifically documents that negative width
and height are errors, but doesn't document that a height or width of 0
is invalid.
2023-01-15 20:52:07 -06:00
Dewey Garrett
b5301718e8 glnav.py:GlNavBase:set_viewangle() add forcerotate
commit c44c029d5
"glnav -don't rotate view unless in perspective mode"

didn't consider vismach.py usage of set_viewangle()

affects numerous vismach guis that use lat,lon settings:
  5axisgui.py, hbmgui.py, hexagui.py, melfagui.py,
  millturngui.py, puma560gui.py, pumagui.py, scaragui.py,
  xyzac-trt-gui.py, xyzbc-trt-gui.py,
2023-01-03 12:12:19 -07:00
12deb01cbf
Merge pull request #1275 from LinuxCNC/jepler/opengl-without-numpy
Fix "object has no attribute 'tolist'"
2021-09-26 19:30:37 -05:00
eb62efcaed Fix "object has no attribute 'tolist'"
This occurs since the switch to pyopengl (yay!) but only if python3-numpy
is not also installed.

I was able to eliminate the conversion of the matrix to its 1D / list form
entirely.

I think I got pretty good coverage of everything _except_ qt vismach
in my testing, both with and without python3-numpy installed.  qt vismach
should be the same as tk vismach, as I made edits with the same intended
effect.
2021-09-25 17:15:26 -05:00
ChrisM
c44c029d50 glnav -don't rotate view unless in perspective mode
I don't think this function was used in linuxcnc.
In lathe mode we don't want the scene rotated.
2021-09-17 23:41:11 -07:00
ChrisM
c7a193dc24 qtvcp -add ability to record/set a user view on graphics display
ocationally you don't quite get the view you asked for.
Not sure why - but very useful otherwise
2021-09-06 16:11:56 -07:00
Rene Hopf
6cc2fdd091 removes minigl and replaces it with libepoxy 2021-08-27 17:13:37 +02:00
Rene Hopf
e0c3d05aa8 remove various python2 workarounds 2021-08-01 12:36:41 +02:00
Rene Hopf
997174b2f5 change tostring to tobytes, to fix error with py3 2021-04-25 14:40:39 +02:00
Rene Hopf
ba74f07be0 glnav.py: python3 compatibility 2020-05-03 01:09:38 +02:00
Phillip Carter
3f3d206704 glnav.py variable 2020-04-25 10:23:50 +10:00
andy pugh
12d892e9d4 glnav.py address #775
Avoid a divide-by-zero


Signed-off-by: andy pugh <andy@bodgesoc.org>
2020-04-24 21:27:30 +01:00
Chris Morley
352ab7ca0e glnav -add access to zoom distance
now you can get and set the zoom distance directly
2012-11-25 16:58:39 -08:00
Chris Morley
cf4b6c79a2 glnav.py -add lathe backtool display code
needs a few tweaks yet - tool is not displayed (wrong depth)
Z axis text is printed backwards
2012-11-04 20:39:30 -08:00
Jeff Epler
17b1011aa5 axis/gremlin: restore transparency under small DRO
this was probably lost with the switch to pango fonts.

pango_font_{pre,post} are factored out in anticipation of a smarter
use of this code where the overhead of the opengl state changes is
amortized over more than one letter.
2012-03-12 14:17:04 -05:00
Pavel Shramov
e01c51ad4b axis: Move setup code for set_view_x to GlNavBase
In commit 6d0b2ca7 some code was not copied to glnav.py file
so Gremlin is not able to use set_view_x.
2010-12-02 02:30:01 +03:00
Jeff Epler
81a7b0c428 rotate should snap into perspective mode
this behavior was inadvertently lost with the merge of glrefactor
2010-03-11 22:06:04 -06:00
Jeff Epler
c9e4da6230 move methods to base class 2010-03-11 22:06:04 -06:00
Jeff Epler
ddc50bd79d make my editor use the right settings 2010-03-11 22:06:04 -06:00
Jeff Epler
9110af6b2b work around absent ImageSurface.get_data
Ubuntu 6.06's python-cairo does not have get_data.  We don't
officially support 6.06 anymore, but this fix is easy.
2010-02-09 10:00:15 -06:00
Jeff Epler
93cc81e5e6 refactor pango font handling 2009-12-18 21:42:48 -06:00
Jeff Epler
09d5eb0de2 factor out zooming 2009-12-18 21:03:49 -06:00
Jeff Epler
9c51028c75 put more useful defaults in glNavBase
all subclasses need to set or define these, but most will be happy
with the defaults.
2009-12-18 21:02:57 -06:00
Jeff Epler
1aa8339e88 factor behavior code out of Togl classes
this will allow other programs to navigate using mostly the same
navigation code as Axis
2009-12-18 21:02:49 -06:00