Q: why I cant see SoLabel node during scan of a SoPath object?

Q: why I cant see SoLabel node during scan of a SoPath object?

Post by alexander chupee » Fri, 25 Apr 2003 22:43:40



I have a following scene graph:
  SoSeparator
     |---SoSeparator
     |       |---SoLabel
     |       |---SoTransform
     |       |---SoCylinder
     ....  the same as above a few thousand times

then I get a SoPath object in mouse button callback handler

  const SoPickedPoint* pickedPoint = pickAction.getPickedPoint();
  if (!pickedPoint) return FALSE;
  SoPath* p = pickedPoint->getPath();

When I apply SoWriteAction to the same SoPath object I got a correct *.iv
representation of a brunch from my graph. It looks like as following:

SoSeparator
{
  SoLabel
  {
    ...
  }
  SoTransform
  {
    ...
  }
  SoCylinder
  {
     ...
  }

Quote:}

when I dump all objects in SoPath with following code

  int n = p->getLength();
  for (int i = 0; i < n; ++i)
    std::cout << p->getNode(i)->getTypeId().getName().getString() << '\n';

I got following listing:
  SoSeparator
  SoSeparator
  SoSeparator
  SoCylinder

why?

 
 
 

Q: why I cant see SoLabel node during scan of a SoPath object?

Post by Mike He » Sun, 27 Apr 2003 03:16:52



> when I dump all objects in SoPath with following code

>   int n = p->getLength();
>   for (int i = 0; i < n; ++i)
>     std::cout << p->getNode(i)->getTypeId().getName().getString() << '\n';

> I got following listing:
>   SoSeparator
>   SoSeparator
>   SoSeparator
>   SoCylinder

> why?

That is the correct result.  An SoPath is literally a "path"
through the scene graph from the "head" node to the "tail"
node.  In other words, it's like driving directions from
Mapquest :-) in the sense that it records which way to turn
(which child to traverse) at each intersection (group node)
as you descend the scene graph until you reach the tail node.
This is an efficient way to encode the identity of a specific
instance of a node (there may be multiple instances of the
same node).

When you ask an Inventor action to traverse an SoPath, it
minimally visits each node that is specifically in the path,
but some actions visit additional nodes.  For example an
SoGLRenderAction applied to a path will automatically visit
siblings that might affect the rendering state.

-Mike
 TGS Inc, http://www.tgs.com

 
 
 

1. Why Can't I Figure This Out - Creating Objects During Runtime

I have this silly idea in my head to write an application that allows
a user to place text or graphics on in a window during runtime.

However, I can't seem to find a book or reference on how to do it.

The application would work something like this:

User left-clicks mouse to make a marquee.

Up pops window asking what kind of object it is supposed to be.

User pastes graphic or text into marquee.

User is then happy to send programer money for such a cool piece of
software.

OK, so

1.  How do I set the application up?  

2.  What kind of control do I use?

3.  What is the air speed velocity of a coconut-laden swallow?

Any help would be greatly appreciated.  All I need is a hint or two
and I can figure the rest of it out....

Thanks in advance.

Tony

2. Polygon-Outline vs. Holes

3. Qs on digitizing objects, motion capture, and texturing

4. Help! Need to convert between graphic file types.

5. Why do you see multiple images during animation?

6. LOGO CONTEST Radikal Records WIN $$$

7. Bevel Modifier in Max 4......why cant i use

8. 2D API Suggestions?

9. Baseball Texture, I cant find it..why??

10. autodesk 3d studio ver 2 (student edition) why cant I render with Phong or Gourard

11. Why cant spline patched polys have UV coordinates?

12. If Kinetik could do it, why cant you?