Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
H3D.org Feeds


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Proper way to close a H3D program?
#1
Quite a regular
Quite a regular


See User information
Hi,
I have searched in the documentation now for a while and I have not found a good and proper way to close a H3D program without using the `ESC` button?

I have a some problems I would like to get some answers to :)

1) When pressing `ESC` H3D shuts down, but there is no signal set to the screen that the running 3D program is shut down so the screen is still in 3D mode with the gray-ish color that the 3D mode has.

I'm using a XL2411Z Benq monitor and Nvidia 3D.

2) Is it possible to in the code to override shutdown on the `ESC`-key?

3) It is ok to have the `ESC` key to shut down the whole program, but if I would like to add some functionality at shutdown, as for example saving the exit time or setting active to false in a database, it seems impossible. I have tried to implement some __del__() python functions, tried some python shut down hooks plugins etc. But nothing have worked for me. Is it possible in some way to do this functionality?

I'm currently using 2.3.0 from the windows installer. Would some of this be solved if I change to the nightly builds (2.3.1) and how stable are these? Do you recommend the installer or to compile it myself from the source, if I should use the nightly?

Posted on: 2016/11/17 14:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#2
Webmaster
Webmaster


See User information
Hello,

try the throwQuitAPIException that you can use from python.

1. Are you using H3DLoad or H3DViewer?
Can you try with a much simpler scene (examples/All/Sphere.x3d or something like that) just to see if it is a general problem or just something with your application.
Windows 10 or earlier?

2. Yes it is possible. H3DLoad/H3DViewer handles this differently. It would be much easier in H3DLoad. But you will have to compile yourself of course.

3. Not without modifying the source code and rebuilding h3dapi yourself.


The nightlybuild versions are fairly stable and have a looooot of improvements compared to 2.3.0. Please try it out to see if it solves the stereo issue.
In H3DViewer of trunk there is also a lot of extra functionality which helps with debugging. Such as searching for nodes in the TreeViewer and different tabs in the console to differ between errors and warnings.
You can try the installer if you like,.The full H3D installer comes with source as well. If you want to use VS 2015 then you will need to check out External/trunk/All/vs2015 and replace your installed vs2010 External directory with that one.

Posted on: 2016/11/18 10:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#3
Quite a regular
Quite a regular


See User information
Quote:

Markus wrote:
Hello,

try the throwQuitAPIException that you can use from python.

1. Are you using H3DLoad or H3DViewer?
Can you try with a much simpler scene (examples/All/Sphere.x3d or something like that) just to see if it is a general problem or just something with your application.
Windows 10 or earlier?

2. Yes it is possible. H3DLoad/H3DViewer handles this differently. It would be much easier in H3DLoad. But you will have to compile yourself of course.

3. Not without modifying the source code and rebuilding h3dapi yourself.


The nightlybuild versions are fairly stable and have a looooot of improvements compared to 2.3.0. Please try it out to see if it solves the stereo issue.
In H3DViewer of trunk there is also a lot of extra functionality which helps with debugging. Such as searching for nodes in the TreeViewer and different tabs in the console to differ between errors and warnings.
You can try the installer if you like,.The full H3D installer comes with source as well. If you want to use VS 2015 then you will need to check out External/trunk/All/vs2015 and replace your installed vs2010 External directory with that one.


Thanks for the reply, the throwQuitAPIException() method works great to shut down the program, however the screen is not changing back from 3D mode like `ESC`-button.

1). This happens with H3DLoad with my program and simple examples, I don't seem to be able to start 3D with H3DViewer I open the rendering tab and go to select stereo mode, but the quad buffered stereo alternative is grey'ed out and not clickable.
I'm using Windows 7.

2). Ok, figured that was just curious if there was an easier way :)

3). Ok, then I will continue with the method to force the user to use a exit button instead of `ESC` button to shut the program down.

Yes i figured it would have massive improvements since 2.3.0 is 2+years old release. Are there some release scheduled that you can talk about in the near future (like 6 months)?

Posted on: 2016/11/18 12:56
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#4
Webmaster
Webmaster


See User information
Quote:
Thanks for the reply, the throwQuitAPIException() method works great to shut down the program, however the screen is not changing back from 3D mode like `ESC`-button.


Ok that is a bit weird. If you do have a debug build of H3DAPI could you please check if the destructors for H3DWindowNode and GLUTWindow are being run properly.
If they are then maybe there is simply just some new command that needs to be run which we do not use. Or maybe the glut version is to old to do it properly.

1. Windows 7. I have never seen this issue on windows 7. Only after a certain update on windows 10. To bad it happens in simple examples. The reason I asked about simple examples is because I thought it could be that your particular examples had some kind of circular reference through python which means destructors were not called properly for the gl window. Please try latest nightly build to see if it behaves differently with regards to stereo.

We are working on a new version of H3DAPI which will bump up version to 3.0 and we have not yet decided if we will do a 2.x series release as well. We will probably have to do both. But none of them will arrive this year as they are still in early testing phases.

Posted on: 2016/11/22 10:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#5
Quite a regular
Quite a regular


See User information
Quote:

Markus wrote:
Quote:
Thanks for the reply, the throwQuitAPIException() method works great to shut down the program, however the screen is not changing back from 3D mode like `ESC`-button.


Ok that is a bit weird. If you do have a debug build of H3DAPI could you please check if the destructors for H3DWindowNode and GLUTWindow are being run properly.
If they are then maybe there is simply just some new command that needs to be run which we do not use. Or maybe the glut version is to old to do it properly.

1. Windows 7. I have never seen this issue on windows 7. Only after a certain update on windows 10. To bad it happens in simple examples. The reason I asked about simple examples is because I thought it could be that your particular examples had some kind of circular reference through python which means destructors were not called properly for the gl window. Please try latest nightly build to see if it behaves differently with regards to stereo.

We are working on a new version of H3DAPI which will bump up version to 3.0 and we have not yet decided if we will do a 2.x series release as well. We will probably have to do both. But none of them will arrive this year as they are still in early testing phases.


Thank you for the response, I will try to find some time next week to test this and reply back after it has been done.

Posted on: 2016/11/25 13:08
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#6
Quite a regular
Quite a regular


See User information
Hi,
I've now compiled the trunk version and when i exit my application I now get an exception, see attached image, when calling the throwQuitAPIException() method.

Is there a new method to close a H3D-application now?

Attach file:



png  2.3.1_exit_error.png (27.33 KB)
11257571_58ff3013aae54.png 677X342 px

Posted on: 4/25 13:17
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#7
Webmaster
Webmaster


See User information
Is the code
raise throwQuitAPIException?
or throwQuitAPIException()

Posted on: 4/25 14:03
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#8
Quite a regular
Quite a regular


See User information
raise throwQuitAPIExeption() by some reason... no exception if I remove the "raise" keyword.

But the problem with the screen not changing back to "normal state" is still present. (With trunk version)

Posted on: 4/25 14:23
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#9
Webmaster
Webmaster


See User information
Please try the following:
In H3DLoad.cpp (which I think you are using, correct me if you are not) add the following line:
scene->window->clear();

after the lines that look like this:
scene->setSceneRoot ( NULL );

I just want to know if the fact that the window destruction is done very late in the destruction sequence matters.

Also please update your trunk code since there was recently and update that concerns throwQuitAPIException.

Posted on: 4/26 7:41
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top


Re: Proper way to close a H3D program?
#10
Quite a regular
Quite a regular


See User information
That did not fix the problem switch back problem. With the trunk code from today.

Posted on: 4/26 11:44
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong Top




(1) 2 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create pdf.
You cannot get print page.

[Advanced Search]





(C) 2012 SenseGraphics AB    ---    Powered by XOOPS