xmakemol-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XMakemol-discuss] Manual adjustment of bounding box


From: Wolfram Quester
Subject: [XMakemol-discuss] Manual adjustment of bounding box
Date: Tue, 30 Mar 2004 00:26:38 +0200
User-agent: Mutt/1.5.5.1+cvs20040105i

Hi alltogether!

Long long time ago, I wrote:

> I want to add a possibility to manually set the bounding box, so it
> can be viewed as our simulation box in which the particles move. For
> this purpose I added amenu item Edit -> Bounding Box where you can
> choose if the manually set bbox or the automatic bbox should be used.
> The borders of the bounding box can be entered there too.
> 
> I hope to finish this work this or the next week.

Well, this was almost a year ago and shortly after I wrote it, I had no
further time to care about it. But now I have a little time and I had a
look into my old doings. I moved to version 5.12 and recompiled xmakemol
with -Wall and got some warnings from the compiler like

rotate.c:161: warning: implicit declaration of function `clear_message_area'
file.c:3442: warning: unused variable `j'
file.c:3442: warning: unused variable `index'
file.c:3443: warning: `images' might be used uninitialized in this function

The first attached patch (xmakemol-5.12.small.changes.diff) contains some small 
cleanups to get rid of these.
It doesn't tackle the following:
gcc -DHAVE_CONFIG_H -I. -I. -I.   -I/usr/X11R6/include     -Wall -g -O2  
-I/usr/X11R6/include -DELEMENTS=\"/usr/local/share/xmakemol/elements\" -c file.c
file.c: In function `open_file':
file.c:1355: warning: char format, different type arg (arg 4)

But this is the only warning that remains.
Then I fixed a typo in the man-page stating -G switches GL rendering on.
I also replaced - with \- to get a proper representation in UTF-8
terminals. 

The second patch tries to add the feature to edit the bbox manually. It
should be applied after the first one, but it should also apply to a
clean 5.12-tree with some offset.
It has one big bug, which makes it rather unusable and I'm not sure how to
handle it: You can't do anything with it when "Rotate about local COM"
is on. Everything works well if one uses "Rotate about origin". 
I tried to be as little invasive as poosible, but every solution I can
think of for this problem is quite big. One would be to treat every
corner of the bbox like an atom. But I guess I've just missed something
obvious. Perhaps you have a hint which line I have to change to
resolve this issue. 
To summarize:
- The patch adds a menu entry "Edit -> Bounding Box" which allows to
  choose if the bounding box is calculated automatically or by hand. You
  can enter the box coordinates here. The manual bbox can be initialized
  from the automatical calculation.
- The thing is only functional when we rotate about the origin. Then it
  is also possible to use center/original orientation/original position
  from the track menu.
- It does not play together with the new scaling and the reflect and
  invert items in the track menu because this is fast done after the
  other big problem is solved.
- It would be nice if the coordinates of the bounding box could be read
  from the .xyz file.
- I'll take care about these two if the rotation about local COM is
  fixed.

Best regards and excuse for the delay,

Wolfi

Attachment: xmakemol-5.12.small.changes.diff
Description: Text document

Attachment: xmakemol-5.12.bbox.diff
Description: Text document

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]