[Development] Move math3d from QtGui to QtCore

Sean Harmer sean.harmer at kdab.com
Thu Jul 5 09:57:41 CEST 2012


On Wednesday 04 July 2012 16:12:59 Charley Bay wrote:
> (Hmm... QVector2D is based on "qreal", would be nice if we had an "integer"
> option, as we often "increment(x,y)" when they represent "2D-histograms".
>  Ours are all implemented as templates.  But, we could go-all-floating as
> long as the performance was there.)

Actually it's more confusing than that. The interface is written in terms of 
qreal but the internal storage is using float as you say. There was a long 
discussion about rationalising this a few months back but no consensus could 
be reached.

If these classes are to be re-targetted at more than OpenGL helpers then they 
really do need to be templated (or manually repeated) for float, double and 
integer types where it makes sense.

OpenGL likes to deal with floats for maximum performance. However, if using 
such classes for serious numerical work the precision of floats is often 
insufficient (highly dependent upon domain and use case of course).

I agree there are a number of use-cases for classes such as these in non-gui 
applications. However, I think there is a non-insignificant amount of work to 
do in order to make them truly useful. I think it would be worth doing and I 
would even volunteer to help with this but I likely do not have the time to do 
all the work myself.

The other question of where should such classes go is down to Thiago as 
maintainer. I think we have reached consensus that having these classes tied 
to QtGui is not ideal. Do they belong in QtCore? It depends upon what QtCore 
is meant for.

If QtCore is for everything below QtGui, then yes. However, I do not think 
this is the case.

If QtCore is meant for only things required by non-gui applications, then no. 
In this case it would indeed make sense to create another library to sit 
alongside QtCore (or even above QtCore if needed) containing these classes. In 
the spirit of modularisation I would suggest a lib specific to this kind of 
linear algebra/3D maths enabler classes.

I'm happy to help once a clear direction emerges.

Cheers,

Sean
--
Dr Sean Harmer | sean.harmer at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions



More information about the Development mailing list