3D tooth chart under linux

For complex topics that regular users would not be interested in. For power users and database administrators.
Post Reply
mattclar
Posts: 3
Joined: Tue Jun 23, 2009 9:48 am

3D tooth chart under linux

Post by mattclar » Sun Jun 28, 2009 10:17 am

I have got Open Dental working under Ubuntu linux using mono 2.4. But my problem is that I cant enable the 3D tooth chart, yes I know it doesn't work on Linux but wouldnt it be nice just to try it out at least? see if new versions of mono that have been released such as 2.4 which was released only a few months ago have resolved the problem? I see that mono has OpenGl support http://mono-project.com/Tao but Im not a coder so maybe I am missing a vital point but to me it seems that with Tao the 3D tooth chart should be able to function on linux/mac.

Thanks
Matt Clarke

User avatar
jordansparks
Site Admin
Posts: 5751
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: 3D tooth chart under linux

Post by jordansparks » Sun Jun 28, 2009 9:19 pm

We have used Tao since the beginning and continue to use it in order to make OpenGL work with Windows. But that's not the same as making OpenGL work with Winforms on Linux. There's a hardware interface here and nobody has been willing to go to the effort to make OpenGL work with Winforms. It won't work. I'm 99% sure. So I don't have time to turn on that feature to let you try. Sorry.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: 3D tooth chart under linux

Post by drtech » Mon Jun 29, 2009 1:13 am

If only we could get it working under linux...the days of rebuilding my windows boxes every year would be over....
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

mattclar
Posts: 3
Joined: Tue Jun 23, 2009 9:48 am

Re: 3D tooth chart under linux

Post by mattclar » Mon Jun 29, 2009 12:57 pm

Did some further searching not sure if this addresses your problem but perhaps it does ...again Im not a programer lol

http://go-mono.com/forums/#nabble-td20831321

User avatar
jordansparks
Site Admin
Posts: 5751
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: 3D tooth chart under linux

Post by jordansparks » Thu Jul 02, 2009 9:55 am

OpenTK seems to be a new development since I last looked. But I'm not going to bother with something that still has a major version number of 0. Not worth my time.
Jordan Sparks, DMD
http://www.opendental.com

mattclar
Posts: 3
Joined: Tue Jun 23, 2009 9:48 am

Re: 3D tooth chart under linux

Post by mattclar » Fri Jul 03, 2009 7:54 pm

seems to be pretty close to hitting the 1.0 mile stone to me 0.9.9-0 seems very close to a major release and there seems to be talk about compatibility of this version with the 1.0 release. Seems worthwhile

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Sat Oct 09, 2010 7:12 pm

So it looks like we need to switch from using GraphicalToothChartControl:CodeBase.OpenGLWinFormsControl{//.SimpleOpenGlControl

I notice SimpleOpenGLControl is written only for Windows with GetDC and AutoFinish, etc... So we need to switch to OpenTK.GLControl....

I would say its stable in its 1.X version but I dont know... Maybe "The Fiddler" would like to rewrite SimpleOpenGLControl for X11.. =)

And then.. would this work in OSX? Would we need X11 or could we use OpenTK.Platform.OSX?

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Sat Oct 09, 2010 11:49 pm

Awesome! I will try it!
http://www.opentk.com/node/424
Re: Existing OpenGL program
Posted Sunday, 10 October, 2010 - 07:07 by the Fiddler (new) .Use the SimpleOpenGLControl and Tao.OpenGL found in OpenTK.Compatibility.dll. The first is a clone of Tao's SimpleOpenGLControl layered on top of OpenTK.GLControl (so it supports Windows, Linux, Mac OS X), while the latter is a full copy of Tao's OpenGL bindings that work well with OpenTK.

You will need to get rid of Tao.Platform.Windows, obviously, but that should be possible if you are using SimpleOpenGLControl.

Edit: It is possible to modify OpenGLWinFormsControl to run on either Tao.SimpleOpenGlControl or OpenTK.GLControl. You will need to modify it to inherit from those (instead of plain Control) and remove all references to GDI and WGL (these are handled by OpenTK internally). The rest of the public API should work with little or no modification.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Wed Oct 13, 2010 10:42 am

Pretty sure I just got this working without VMWare, etc... I am testing in VMWare and right now I am in linux and Open Dental detects my DirectX and OpenGL... give you a hint.. not using Mono..... Time to take this out of VMWare..

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Wed Oct 13, 2010 11:24 am

Got the Tooth Chart working for DirectX in Linux! =) Thanks Jordan!

It works PERFECTLY. I think.. Dont use it in vmware though or its slow...

I didnt have to do much to make this work. But I will get back to you guys.. I am comparing running this with wine and dotnet20 or wine and mono26

Oh yeah if you do want to compile EDIT: (with monodevelop), use Visual Studio 2008 in Windows and dont forget to install Adobe Acrobat Reader 8.. or thats what I used.. And I think you may need DirectX SDK.

=)
Image
Last edited by Justin Shafer on Thu Oct 28, 2010 10:45 am, edited 3 times in total.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Wed Oct 13, 2010 12:03 pm

Okay Here is a rough draft on how to get it working in Wine. You dont need to compile anything as of 7.2.46 Havent tried anything below that and I am not going too. :lol:

1. Install Wine.
2. get winetricks and install dotnet20 d3dx9 gdiplus glut vcrun2008 ddr=opengl
3. Run the program in a path wine can recognize.. .wine/drive_c/ or set it up in winecfg
edit: 4. if you get an SDCard\SmartCard error anywhere you may have to look at winsdcard.dll (I think thats what its called) but last I tried I didnt have too.. I think.
Ummmm thats it.. :mrgreen: My family will be soooo happy.

4. Get winscard.dll from xp sp2 or sp3 and throw it in system32 for wine and run winecfg and tell it in libraries that winscard.dll is native.
Last edited by Justin Shafer on Thu Oct 28, 2010 11:06 am, edited 1 time in total.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Sun Oct 24, 2010 10:53 pm

Got 7.4.4 to run under wine...

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: 3D tooth chart under linux

Post by drtech » Mon Oct 25, 2010 10:01 am

great!
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

murmsk
Posts: 177
Joined: Mon Jun 18, 2007 11:14 am
Location: Monmouth IL

Re: 3D tooth chart under linux

Post by murmsk » Mon Oct 25, 2010 7:38 pm

WOW!!!!! Thanks all

steve

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Thu Oct 28, 2010 10:41 am

Yes but I didnt tell you guys how to get 7.4.4 to run... but its still in beta so I will wait for it to be stable... You shouldnt be running 7.4.4.. be sure you have direct rendering enabled with opengl and linux... glxinfo is the command..

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Sat Jan 01, 2011 11:44 pm

Dang! I almost forgot who I got that working. You have to install the DirectXSDK in winetricks for it too work! Its a large download from Microsoft.

JrGong
Posts: 10
Joined: Thu Jan 13, 2011 10:55 am

Re: 3D tooth chart under linux

Post by JrGong » Thu Jan 13, 2011 11:41 am

I like your style Justin, persistance in gettin OD to work in linux. I am looking at helping my mothers office run as a linux only shop......hope you don't mind me picking your brain when I get to that point!

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Sun Jul 01, 2012 7:18 am

Well I decided to play with this some more... I used PlayOnMac... Good wine program..

OpenDental draws slowly because of gdiplus. Wine needs gdiplus builtin to wine, is not good enough for dotnet and opendental. The gdiplus native option are the files from windows which works, but its slow.

As soon as wine does more work on gdiplus, then open dental will be faster in wine...

Very fast with virtualbox, vmware, etc.. of course. :D

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Wed Feb 20, 2013 5:09 am

Let's see if OD can be compiled under Mono... Just for fun. No 3d Tooth Chart. I want to remove the libraries that won't work on arm.. and see if it will run.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Tue Jan 23, 2018 12:56 am

This works pretty well on 17.2...

WINEPREFIX="$HOME/.wine" WINEARCH=win32 winetricks dotnet45 d3dx9 gdiplus glut vcrun2015 ddr=opengl

Once you get OpenDentImages mounted over smb.. etc..

Toothchart worked.

User avatar
Justin Shafer
Posts: 596
Joined: Sat Jul 28, 2007 7:34 pm
Location: Fort Worth, TX.

Re: 3D tooth chart under linux

Post by Justin Shafer » Sun Jan 28, 2018 10:31 am

For 17.3 I got a black box at the choose database window... So... SharpDX issue.

WINEPREFIX="$HOME/.wine" WINEARCH=win32 winetricks dotnet45 win10

Setting the windows version to Windows 10 fixes that...

dhanson358
Posts: 3
Joined: Tue Feb 21, 2023 12:09 pm

Re: 3D tooth chart under linux

Post by dhanson358 » Fri Nov 03, 2023 1:16 pm

Resurrecting this topic -- have been doing some experimentation with getting OD to run in Linux (not specifically the 3d tooth chart, but just in general).

It seems like using the latest stable Wine (8.0.2) with mono, it *kind of* works. In a 64bit prefix it will load, but the UI is not great... fonts render kind of oddly and the tooth chart isn't shaded/colored right. It also seems to be burning a lot of CPU (60-80% of the system at idle), and throwing a lot of FIXMEs about wine d2d libraries. Even setting the renderer to gl doesn't seem to make a big difference.

I switched to using a 32 bit prefix like Justin had suggested here, but that had much less success -- it throws an error:

System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'.

Which is dismissible, but then I get a bunch of errors about not being able to find system DLLs. I'm assuming this is some disagreement with the dotnet libraries?

Curious if anyone else has tried this in the past few years.

User avatar
jordansparks
Site Admin
Posts: 5751
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: 3D tooth chart under linux

Post by jordansparks » Sat Nov 11, 2023 7:29 am

As we move to WPF, issues like the fonts should get better. We've already been able to reduce the number of calls to the Windows API, and I can see us being able to get rid of those completely some day. We're still on 32 bit because of all the bridges we have with other software. We'll have to build some sort of intermediate layer before we can switch the main program over to 64 bit. I expect within 5 years that we will start pushing to convert from .net framework to modern .net 8+. Mono was merged into .net, so that should make it run fine on Linux, Mac, and ARM tablets. We'll see. I haven't quite seen a migration strategy that would let us migrate one window at a time, which is what we will really need. I have some ideas how this might work, but it's going to take a lot of creativity and tooling.
Jordan Sparks, DMD
http://www.opendental.com

dhanson358
Posts: 3
Joined: Tue Feb 21, 2023 12:09 pm

Re: 3D tooth chart under linux

Post by dhanson358 » Thu Nov 16, 2023 10:52 am

Good info! Getting to .NET Core would certainly open a lot of possibilities for running cross platform.

I was able to get this working quite a bit better by tinkering with a lot of various Wine settings. Interestingly it seems to draw better using the Direct3D libraries in Wine than it goes using OpenGL, which isn't what I would have expected.

The fonts are still a little weird but not terrible. I suspect that's fixable with some better font pages in Wine.

The main hangup I'm still having is high CPU usage which is causing some input lag when typing or clicking around the UI. I turned on the Mono debug logs and it seems like it's spending a lot of cycles constantly redrawing the ToolBarOD. I see that has a timer in it to redraw (I assume in case another machine edits the toolbar config?), but it seems to be disposing and recreating the toolbar components more or less non-stop.

User avatar
jordansparks
Site Admin
Posts: 5751
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: 3D tooth chart under linux

Post by jordansparks » Sat Nov 18, 2023 7:03 pm

I would expect it to draw better in DirectX than in OpenGL. We switched away from OpenGL about 10 years ago after a good solid attempt. Since we're using MS, DirectX is just a better fit.

Thank you so much for tracking down that CPU usage in the ToolBar. I have a little down time at the moment, and I've been meaning to look at that, so I'll see what I can do. It just needs a little love. I think someone added the timer as a bug fix instead of fixing the underlying issue. The main issue that I want to work on is the SwallowAnyException in the OnPaint. The painting code should simply be robust enough that it never crashes, but we also don't want it running very often.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
jordansparks
Site Admin
Posts: 5751
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: 3D tooth chart under linux

Post by jordansparks » Sat Nov 18, 2023 7:47 pm

I looked into it. The ToolBarOD is pretty solid. I verified that it only repainted when it needed to, like if the mouse is moved to a new hover button. It doesn't repaint if you just move the mouse around on the same button. So that was my main concern. The timer seems harmless, since it's a pretty long interval. The new WPF toolbar doesn't use anything like that. Even the SwallowAnyException seems harmless since I can't make it hit, and it would just skip drawing for that time. I suspect someone might have added another thread someplace that calls the ToolBar somehow, but I can't find it. We've been removing quite a few threads to improve maintenance. So I shouldn't touch the ToolBarOD or I will break it. If I could verify that it was running something it a loop and misbehaving, then it might be worth it to swap all toolbars out for the new WPF, but that would be a lot of work.
Jordan Sparks, DMD
http://www.opendental.com

dhanson358
Posts: 3
Joined: Tue Feb 21, 2023 12:09 pm

Re: 3D tooth chart under linux

Post by dhanson358 » Mon Nov 20, 2023 9:48 am

Thanks for taking some time to look at that -- I think you're right, this may just be a place where the Mono debug logging is super chatty, to the point the log output itself is causing performance issues.

I'm narrowing down on a combo that performs well... so far this combination seems to be showing promise:
  • wine 8.0.02
  • mono version that wine auto-installs
  • run in WINEARCH=win32
  • Use dxvk 2.3 to hand off d3d to GPU
  • Use official nvidia drivers, not the linux open source versions (assuming nvidia GPU of course)

Post Reply