Hmm. Right, this is what we won't be doing!
The call you need is to

  public int getScreenWidth() {
    return dimScreen.width;
  }

  public int getScreenHeight() {
    return dimScreen.height;
  }

in Viewer. That is, use

 int screenWidth = viewer.getScreenWidth();
 int screenHeight = viewer.getScreenHeight();


If you are doing this via the command line, all you would do is set the 
screen width ahead of time. Still, I see your point - that it could be 
part of the WRITE command. We do that already for images, of course. In 
any case, Eval will take care of that if we need it to.

Regarding Exporter.initialize() --- I think where you want this is in 
PovrayExporter.getHeader():

    Date now = new Date();
    SimpleDateFormat sdf =
      new SimpleDateFormat("EEE, MMMM dd, yyyy 'at' h:mm aaa");

    String now_st = sdf.format(now);

Etc. All this stuff will go in getHeader() in a slightly different form:

    out("//******************************************************\n");
    out("// Jmol generated povray script.\n");
    out("//\n");
    out("// This script was generated on :\n");
    out("// " + now_st + "\n");
    out("//******************************************************\n");
    out("\n");
    out("\n");
    out("//******************************************************\n");
    out("// Declare the resolution, camera, and light sources.\n");
    out("//******************************************************\n");
    out("\n");
    out("// NOTE: if you plan to render at a different resolution,\n");
    out("// be sure to update the following two lines to maintain\n");
    out("// the correct aspect ratio.\n" + "\n");
    out("#declare Width = "+ screenWidth + ";\n");
    out("#declare Height = "+ screenHeight + ";\n");
    out("#declare minScreenDimension = " + minScreenDimension + ";\n");
    out("#declare Ratio = Width / Height;\n");
    out("#declare zoom = " + zoom + ";\n");

In fact, you could just add to PovrayExporter:

private void out(String line) {
 output.append(line);
}

if you like.

You can get the zoom setting from viewer.getZoomPercentFloat();

etc. So this is your job! :)

Bob


pim schravendijk wrote:

>I changed the thread title to avoid confusement :)
>
>Thanks for the info, I understand the mechanism a bit better now. I
>already have a request:
>
>Exporter.initialize gets the information from Viewer passed to it.
>Povray needs to get its default window size from there, it's currently
>done like this:
>
>    float zoom = viewer.getRotationRadius() * 2;
>    zoom *= 1.1f; // for some reason I need a little more margin
>    zoom /= viewer.getZoomPercentFloat() / 100f;
>
>    transformMatrix = viewer.getUnscaledTransformMatrix();
>    if ((screenWidth <= 0) || (screenHeight <= 0)) {
>        screenWidth = viewer.getScreenWidth();
>        screenHeight = viewer.getScreenHeight();
>    }
>    int minScreenDimension =
>      screenWidth < screenHeight ? screenWidth : screenHeight;
>
>Could you put a similar call in Exporter.initialize? Later on one
>would also like to give the output picture size as an option to the
>export command, of course.
>
>And could you add a function to get the date string as well, just to
>print in the header of the exported files?
>
>  
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get. 

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to