SF.net SVN: avogadro: trunk/libavogadro/src/tools

On Monday 07 May 2007 23:05:25 Donald Ephraim Curtis wrote:

Another solution might be that we add a flag in the primitive class
“selectNew” that does the selection in the NewAtom function rather than
in +=.

This is OT in this discussion, but it just occured to me that there is a
drawback in calling this method operator+= :
operator+= is regarded as an ‘assignment operator’ and thus is NOT inherited
in subclasses. Is that really what you want (maybe Molecule is not meant to
be subclassed, I don’t know. Just giving my 2c).

Another thing is that it feels strange to have an operator+= when there is no
operator+. On the other hand, an operator+ returning a molecule by value
would be inefficient because of the overhead of copying the return value on
the stack.

Since this thread was discussing future OB changes, I’d like to suggest adding
copy-on-write to OB classes (as in Qt) so that we can freely return molecules
by value without causing deep copies on the stack. Then we could have an
operator+ in Avogadro::Molecule if we want to.

Cheers,
Benoit

That way in Molecule::operator+= we can setSelectNew(true) and
when NewAtom gets called the newly created atoms will be selected and
wouldn’t have to worry about the index thing.

Anyways, just my 2c. I wouldn’t want to do it anytime soon if we’re
going to to try to release Avo. Needs to be linked against the stable
version of OB.


Donald

(Mon, May 07, 2007 at 11:23:22AM -0700) ghutchis@users.sourceforge.net:

Revision: 340
http://svn.sourceforge.net/avogadro/?rev=340&view=rev
Author: ghutchis
Date: 2007-05-07 11:22:15 -0700 (Mon, 07 May 2007)

Log Message:

Initial “manipulate mode” for select tool.
Hold down the shift key: left button rotates (needs work) right
translates

Modified Paths:

trunk/libavogadro/src/tools/selectrotatetool.cpp
trunk/libavogadro/src/tools/selectrotatetool.h

This was sent by the SourceForge.net collaborative development platform,
the world’s largest Open Source development site.


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


Avogadro-updates mailing list
Avogadro-updates@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-updates


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options