From: christopher.g.dorosky++at++lmco.com
Date: 08/31/2000 07:27:03
pfHi,
I am confused about the rules of scope for a pfBuffer.
I have a small program that looks like this.
main()
{
pfDBaseProc(dbase);
// set up channel, pipe and a scene, pass scene data to dbase
while(1) {
pfFrame();
pfSync();
}
}
dbase(void **scene_p)
{
static int count=0;
// set up the pfBuffer and select it
count++;
if(myscene->getNumChildren())
{
pfGeode *g = myscene->getChild(0);
// it doesn't seem like I should be able to call getChild
myscene->bufferRemoveChild(g);
buf->merge();
}
pfGeode *geode = new pfGeode;
// set the geode up with a gset to make a small square
// if count%2, make it green, else red
myscene->bufferAddChild(geode);
}
This results in alternating red and green squares. Trouble is, I am
completely screwing up the removal process.
So my question is this:
If you add a new node through the dbase process, how can you successfully
remove it and delete it without violating scope issues? Do I need to
setScope to zero in the app?
The man page shows an example with the geode created in shared memory in the
app. Is it possible to do this with a geode created in the Dbase?
Chris
Christopher Dorosky
Lead Electronic Systems Engineer - Real Time Simulation
Lockheed Martin Missiles and Fire Control - Dallas
christopher.g.dorosky++at++lmco.com
972-603-2349
This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 07:32:34 PDT