yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #00990
removing PhysicalAction genericity?
-
To:
Yade Development Group <yade-dev@xxxxxxxxxxxxxxxxxxx>
-
From:
Václav Šmilauer <eudoxos@xxxxxxxx>
-
Date:
Sat, 21 Feb 2009 09:57:33 +0100
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.19) Gecko/20090105 Lightning/0.8 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666
Hi,
I would like to have some discussion whether it would be OK to remove
generic PhysicalAction approach and replace it by handful of hard-coded
physical actions. Now, there is just Force and Momentum (and Stiffness,
which doesn't really count) and there was not anything added since I
remember. It would be much simpler to ask PhysicalActionContainer for
Force or Momentum (both Vector3r&) directly instead of the current
approach. If someone wanted to add his own PhysicalAction, he/she would
have to modify the container (easy).
Otherwise, in order to remove unnecessary shared_ptr's, each
PhysicalAction class would define something like dataSize()
(==sizeof(Vector3r) for both Force and Momentum) and the container would
return void* address that the user (or some helper function) would have
to cast to Vector3r*. In this case, the PhysicalAction object would
really only serve as holder of the class index, since the data would be
written directly to the container's arrays.
Which approach is better? Have another idea?
Vaclav
Follow ups