Re: pfType oddness

New Message Reply Date view Thread view Subject view Author view

From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 02/22/2000 13:47:10


Hi Chris !

When subclassing Performer nodes, please observe that Performer maintains
multiple copies of each node. After you create your new node, Performer clones
your node for use by the CULL and ISECT processes. The cloned node is of the
PARENT class (!). Not the new subclass that you created. In your case, the CULL
and ISECT copies of the node are of type pfDCS. So, it is impossible to replace
methods on your new node in non-APP processes.

This is true when you fork CULL/ISECT. When not forking, CULL and ISECT
use the APP copy of the node and therefore they see your subclassed node.

Take a look at Chapter 20 of the Performer Programmer's Guide. It talks about
subclassing Performer classes. The last page of that chapter describes the
above limitation in more detail.

-yair

>
> Hi Performers,
>
> I'm having some trouble trying to use some Performer type checking.
> I have made a networked pfDCS class called pfNetDCS--a bit of a pain
> since none of the functions in pfDCS are virtual, but that's another
> matter. Anyhow, I have a node obtained through intersection tests.
> I need to cast it as a pfNetDCS if it's of that type, but for some
> reason the test fails.
>
> if (item->isOfType( pfNetDCS::getClassType ))
> {
> ((pfNetDCS *) item)->setMat( newMatrix );
> }
> else
> {
> cout << "It's just a " << item->getClassName() << endl;
> }
>
> When this check runs during execution, I get the line "It's just a
> NetDCS". Well, that's obviously what I expected it to be, so why is
> the correct class name being returned but isOfType is failing its
> check? Any idea what I'm not doing correctly?
>
> Thanks,
> Chris
> __________________________________________________________________________
> Chris Scharver EECS Graduate Student
> Electronic Visualization Laboratory EVL Phone: 312-996-3002
> The University of Illinois at Chicago EVL FAX: 312-413-7585
> 1998-1999 UIC Men's Swimming and Diving
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>

-- 
\_________  \_____  \__    \__  \_____         Yair Kurzion
\_________  \_____   \__   \__  \_____         yair++at++sgi.com
       \__     \__   \____\__      \__   http://reality.sgi.com/yair
       \__          \__  \__                Work: (650) 933-6502
       \__          \__   \__               Home: (408) 226-9771
       \__          \__    \__             


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Feb 22 2000 - 13:49:48 PST

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