|
From: Dair G. <da...@re...> - 2004-04-07 14:20:34
|
Roger Holmes wrote:
>Oops, I meant viewMode not viewState throughout my original e-mail.
>They both get set at the same time and I clicked (and copied) the
>wrong one in the source before pasting multiple times into the e-mail.
Ah, OK, I understand now. I knew I must be missing something... :-)
>The test of instanceData->pickDecomposeCount =3D=3D 0 gets put into the
>picking routines, as does the call to E3View_PickStack_SaveObject.
OK, got it.
>and call, but I rejected this as I was not ABSOLUTELY sure that
>pickDecomposeCount could not change in the submit method itself.
At the moment it won't, but it's probably better not to require that: I
suppose it's possible that we may want to allow it at some point in the
future, so it'd be good not to rule it out if we don't have to.
>No, a lot more than that. The switch, several tests, the call to
>E3ClassTree_GetClassByType and for me it seems a lot cleaner way of
>coding it, though there is nothing wrong with the original, its just
>that things have got tacked on afterwards.
Yes, it really comes down to which way is most likely to grow: are we
more likely to add new submit methods (picking, rendering, etc) than
ways (retained vs immediate) of submitting.
At the time it was written we were still adding the methods, so having 2
routines with a switch that could be extended felt simpler than N
routines with no switch.
>When I step through it whilst debugging, I keep thinking "Oh, get on
>with it, why is there so much overhead before actually doing the real
>work?". The fact that it shows up in 'Shark' is a good reason too!
If it shows up as significant in a profiler then it makes sense to
improve it: it will mean adding a new submit method is a bit more
involved, but not terribly so (and like you say, both sides are fairly
stable now).
I guess my main objection to more routines is that E3View.c is big
enough as it is - but at some point we should probably try breaking the
bigger objects down into some kind of sub-categories:
View/
E3View.c
E3View_Submit.c
E3View_State.c
Math/
E3Math.c
E3Math_Matrix.c
E3Math_Vector.c
=20
The divison will be pretty arbitrary, but even splitting it in 3 say
would be handy.
So, go ahead - feel free to check this in.
-dair
___________________________________________________
mailto:dair+refnum.com http://www.refnum.com/
|