RE: bufferClone questions

New Message Reply Date view Thread view Subject view Author view

Jim Durbin (durbin++at++ait.nrl.navy.mil)
Mon, 27 Oct 1997 15:10:00 -0500 (EST)


Jeremy and Jason (and all Performerers):

Thanks for your reply to Brad's question below.

I have tried to duplicate what the man pages say in terms of using
three buffers:
        one for APP process created by pfConfig
        one created by me to hold "source" tree
        one created by me to use as the dbase buffer to clone into

My code looks something like this:

void dBaseFunc(void *data)
{
  if (!buf) {
    // create the cloneBuf and cloneTree
    cloneBuf = new pfBuffer();
    cloneBuf->select();

    cloneTree = new pfGroup();
    cloneTree->setName("Clone Tree");

    // create buffer in which to do all ops and eventually merge
    // results into main APP buffer
    buf = new pfBuffer();
    buf->select();
  }

[...]

        case EVA_CLONE:
          cloneBuf->select();

        // this loads an object from filename and returns a pfNode
              geometry = loadObject(head->obj->getTravMask(PFTRAV_ISECT),
                                    fileName);
        // add to clone tree
              cloneTree->addChild(geometry);

        // actual cloning takes place here
          buf->select();
          if (pTempNode = geometry->bufferClone(0, cloneBuf))
            {
            head->obj->bufferAddChild(pTempNode);
            }
          else
            {
              cout << "dBaseFunc EVA_CLONE: WARNING! clone tree obj >"
                   << geometry->getName()
                   << "< did not succesfully clone" << endl;
              cout << " : WARNING! clone tree obj "
                   << "mem address: " << (int) geometry << endl;
            }

          break;

[....]

  buf->merge();
  pfDBase();
}

This is very close to the code in the man pages for pfBuffer.
However, my code appears to "crash" during the bufferClone call.

Any hints? What am I doing wrong? I found an old info-performer
email from a Jeremy Friesner asking a very similar question. He
finally found a solution (thanks to help from Tim Moore) that did NOT
use the bufferClone.

Has anyone find a solution for bufferClone?

Thanks!

-Jim

Jason Williams writes:
| From: "Jason Williams" <deliverator.sgi.com!holodeck.csd.sgi.com!rock.csd.sgi.com!sgi.com!uunet.uu.net!ds9!cerebus!jason>
| To: uunet.uu.net!uunet!sgi.com!info-performer
| Subject: Re: bufferClone questions
| Date: Wed, 24 Sep 1997 08:45:07 -0400
|
| On Sep 23, 1:00pm, Brad Colbert wrote:
| > Subject: bufferClone questions
| >
| > Hi folks,
| >
| > I'm having some problems using the bufferClone method in my
| > dBase process.
| >
| > We are writing a DIS "Stealth like" application that is
| > multi-processing (PFMP_APP_CULL_DRAW | PFMP_FORK_DBASE
| > ... etc). We use the dBase process to asynchronously load
| > models in as they are needed. There are many duplicates
| > (similar vehicles), and it would be nice to clone them.
| > I've been exploring the bufferClone method, but I don't
| > understand where I store the original models.
| >
| > 1. Do I store the models in the dBase process and
| > bufferClone from a tree stored there?
| >
| > 2. I'm not quite sure where I set up the storage pfBuffer.
| >
| > 3. The pfDCS that I attach the model to is allocated in the
| > APP process. Is this still doable?
| >
| > I'm sure I'm missing some points here. Any help will be
| > greatly appreciated.
| >
| > Brad
|
| I had a similiar problem and decided to create a third buffer
| area where I stored the root model list. You have to clone from
| that buffer to the DBase buffer, and then merge to your App
| buffer when you want to see your models.

-- 
_________________________________________________________________________
|	Jim Durbin			     durbin++at++ait.nrl.navy.mil	|
|	ITD Virtual Reality Lab		     (202) 404-8066		|
|	Naval Research Laboratory	     (202) 767-1122 (fax)	|
|		http://www.ait.nrl.navy.mil/people/durbin		|
_________________________________________________________________________
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:56:08 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.