WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Licence (https://forum.worldviz.com/showthread.php?t=4873)

javadi 11-12-2013 04:24 AM

Licence
 
Hello,

I am wondering whether there is any way to query whether the installed Vizard is a Lite version or not? This is necessary to make the program adaptable, running in full-screen when it is a full-licence and small window when it is a lite. Very many thanks.

Greetings
Amir

Frank Verberne 11-13-2013 06:17 AM

Hi Amir,

You could just put viz.go(viz.FULLSCREEN) in your code. Then Vizard will try to run fullscreen and if you have the Lite license, it will automatically render a small window (I think with resolution size 800*600).

Frank

javadi 11-13-2013 01:27 PM

Hi Frank

Thanks for your response. It could be a solution indeed. But, I cannot use this method, as I adjust some measurements based on the screen size at the beginning of the program. Change of the screen size destroys all my adjustments. Any other solution you might think of? Thanks again.

Greetings :-)
Amir

Frank Verberne 11-13-2013 02:58 PM

Hi Amir,

I don't really get your problem, perhaps some example code could explain your problem better.

There are several options for a window:
- either use standard height & width (800 x 600)
- set your own height & width for the window
Code:

#Set these options before viz.go()
viz.setOption('viz.window.width','1280')
viz.setOption('viz.window.height','1024')
viz.go()

Beware, if you set the window to fullscreen this way with a Lite license, Vizard will automatically resize the window after some time (I think it's 30 sec).

If you want to get the resolution of the current screen you're running your application in (size of your fullscreen program with full license), you can use:
Code:

viz.getOption('viz.monitor.width')
viz.getOption('viz.monitor.height')

If you run into problems with some measurements if your screen size is changed, then consider making your measurements adapt to your screen size. That would make it most flexible, and easy to use no matter what the screen size. Again, some sample code showing your problems would be useful.

javadi 11-13-2013 04:11 PM

Hi Frank

Thanks for your detailed response. Here it is a sample code,

Code:


import viz

#viz.setOption('viz.fullscreen', '1')

viz.go()

[WindowWidth, WindowHeight] = viz.window.getSize()

SignSize        =  WindowWidth * 0.0625
SignCentre        = [WindowWidth / 2.0, WindowHeight / 2.0]
SignRadius        =  WindowHeight / 4.0

...

As my model is extremely big and already pushing the computer to its extreme, I cannot keep an eye on the size of the window and readjust my measurements whenever it changes size.

Yes, the screen changes back to a 600 x 800 window after 30s when it is a Lite version. By then, I have adjusted everything and rendered the first screen.

This is a very basic query that one would expect from such applications to be able to support. For a work-around I have specified a flag at the beginning of my code to adjust the screen according to the computer. I might later change it to a more elaborated solution querying an identification ID such as MAC.

Thanks again for your suggestions.

Greetings
Amir

Frank Verberne 11-14-2013 04:02 AM

If I understand correctly, you want your code to handle different screen sizes, so that you can test your code on with a Lite license and a full license. Furthermore, you only seem to have a problem when the window size changes. So would your problem be solved when the window does not change size (as in a fixed size window, or fullscreen). If so, this code should help you out:
Code:

import viz
import viztask

viz.go(viz.FULLSCREEN)

def getSceenSize():
        yield viztask.waitDraw()
        [WindowWidth, WindowHeight] = viz.window.getSize()
        print WindowWidth
        print WindowHeight

viztask.schedule(getSceenSize)

The code first tries to go fullscreen. With a full license, WindowWidth & WindowHeight should be your screen resolution. With a Lite license, WindowWidth and WindowHeight should be the windowed resolution (standard 800 x 600). Furthermore, this screen does not change in size afterwards. Then, you could create SignSize, SignCentre, and SignRadius based on these values.

javadi 11-14-2013 08:23 AM

Hi,

Yes. Thanks.

Greetings
Amir


All times are GMT -7. The time now is 09:32 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC