info-inventor
[Top] [All Lists]

Re: getClassTypeId problem...

To: Jarek Rzepecki <jarekr@xxxxxxxx>
Subject: Re: getClassTypeId problem...
From: Doug Dempster <ddempster@xxxxxxx>
Date: Mon, 17 Sep 2001 17:22:31 -0400
Cc: info-inventor@xxxxxxxxxxx
References: <Pine.GSO.4.20.0109171603590.9676-100000@xxxxxxxxxxxxxx>
Sender: owner-inventor@xxxxxxxxxxx
I think the issue is that you are calling:

    tmp_sep->getClassTypeId()

when you meant to call:

    tmp_sep->getTypeId()

The first one probably resolves to SoNode::getClassTypeId() which isn't what 
you want at all.

Cheers,

Doug


Jarek Rzepecki wrote:

> Hi!
>   I have a problem with getClassTypeId. Below is a piece of code. It
> compiles well but it doesn't work well...
>
> void create_trace(SoSeparator* OIVparent){
>   SoNode* tmp_sep;
>   int num_child = OIVparent->getNumChildren();
>   for (int i = 0; i<num_child; i++){
>     tmp_sep = OIVparent->getChild(i);
>     if (tmp_sep->getClassTypeId() == SoCube::getClassTypeId()){
>         //do something...
>     }
>   }
> }
> num_child is ok, but the tmp_sep = OIVparent->getChild(i) act strange (i
> think...) looking in debug tmp_sep is always "incomplate type" , what is
> more the compareation in "if" line is always false.
> What am i doeing wrong?
> In general i would like to extract information about all children (are
> thay separator, shape , transformation etc...) i need it to build another
> geometry tree.
> Thank you.
>                                          - jarek
>
>
>                                         Jaroslaw Rzepecki
>                                         Fermilab
>                                         23 Neuqua
>                                         P O Box 500
>                                         Batavia, IL 60510
>                                         USA
>
>                                         BD/Beam Physics Dept.
>                                         630-840-4309 (office)
>                                         630-840-4239 (home)
>                                         e-mail: jarekr@xxxxxxxx
>                                         or    : jarekr@xxxxxxxxxxxxxxxxx
>

--
ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸¸¸,ø¤°`°¤ø,¸,ø

Doug Dempster         WSI           dgdempster@xxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>