Norman Vine wrote:
The following change allows FlightGear to compile with the PLIB CVS
...yes - but if DummySphereEntity didn't inherit an implementation
of getStats from either ssgLeaf or ssgBranch then it must be derived
directly from an ssgEntity.
That's really a BIG no-no because every time I add something to the
abstract base class 'ssgEntity', FGFS will have to add the corresponding
function into DummySphereEntity and it'll be very hard to keep FGFS working
over more than one version of PLIB.
Inheriting from an abstract base class of code you don't own is considered
to be bad programming practice.
In the SSG documentation, it says:
"It is presumed that applications will add new kinds of leaves,
branches, states and textures to customise SSG to their needs."
...it doesn't say anything about adding new kinds of ssgEntity.
What is particularly dangerous is that in many places in SSG, we do things
like:
ssgEntity *e = something ;
if ( e -> isAKindOf ( ssgTypeBranch () ) )
{
ssgBranch *b = (ssgBranch *) e ;
...do something branch-like (probably recursively)...
}
else
{
ssgLeaf *l = (ssgLeaf *) e ;
...do something leaf-like...
}
This code will crash if there is a DummySphereEntity in the scene.
There can only be two kinds of node in a tree-like data graph - there
are leaves and branches - there are no other kinds of nodes that you
could possibly imagine.
Hence, your DummySphereEntity really should derive from either ssgLeaf
or ssgBranch. I suspect ssgLeaf is the right choice - but I don't know
for sure.
If there is something wrong with the implementation of either ssgLeaf
or ssgBranch that prevents you from using one of them as the base
class for DummySphereEntity - then let's talk about fixing the problem
at the root cause.
Persisting with the present mechanism will bring FGFS no end of problems
down the line as SSG expands it's functionality.
---------------------------- Steve Baker -------------------------
HomeEmail: <[EMAIL PROTECTED]> WorkEmail: <[EMAIL PROTECTED]>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sf.net http://tuxaqfh.sf.net
http://tuxkart.sf.net http://prettypoly.sf.net
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel