Please help: problem in deriving new inventor node

Please help: problem in deriving new inventor node

Post by Michelle Zh » Thu, 05 Oct 1995 04:00:00



Hi,

   I am trying to derive a subclass of SoShape. I followed the method
used in /usr/share/src/Inventor/nodes/SoBarChart.C. But I changed
the order of some calls:

  because I want to know the bounding box of the current shape node

  inside computeBBox(), I call generateChildren(), then
  use generated children to compute the bounding box:

  I know I cannot apply SoGetBoundingBoxAction on children (which is
  a SoChildList), so I applied the action to different parts separately,
  then put those together as my current bounding box... IT seems
ok inside computeBBox(), but before it calls GLRender(), I got
the error (using dbx)

  Process 23357 (list) stopped on signal SIGSEGV: Segmentation
violation (default) [SoBoundingBoxCache::set(const
SbXfBox3f&,int,const SbVec3f&):59 +0x8,0x5e5f08a0]

How did this happen?

I found if I didn't call generateChildren() inside computeBBox
it seems fine... (but how can I know the what the bounding box
for current new shape is?)

Thanks!!!

Michelle

inside generateChildren() like this:
{
       SoSeparator *sep1 = new SoSeparator;
       sep1->ref();

       // Add font, text3 to sep1

       children->append(sep1);

       SoTransform *transform = new SoTransform;
       children->append(transform);

       SoCube *cube = new SoCube;
       children->append(cube);

Quote:}

stack looks like:

     (dbx) where

Quote:>  0 SoBoundingBoxCache::set(const SbXfBox3f&,int,const SbVec3f&)(0x0, 0x7fffa90c, 0x1, 0x7fffa900) ["SoBoundingBoxCache.c++":59, 0x5e5f08a0]

   1 SoSeparator::getBoundingBox(SoGetBoundingBoxAction*)(0x10029648, 0x7fffabac, 0x1, 0x7fffa900) ["SoSeparator.c++":374, 0x5e6cd928]
   2 SoNode::getBoundingBoxS(SoAction*,SoNode*)(0x7fffabac, 0x10029648, 0x1, 0x7fffa900) ["SoNode.c++":595, 0x5e67a5b4]
   3 SoGetBoundingBoxAction::beginTraversal(SoNode*)(0x7fffabac, 0x10029648, 0x1, 0x100) ["SoGetBoundingBoxAction.c++":317, 0x5e5ea0f8]
   4 SoAction::apply(SoNode*)(0x7fffabac, 0x10029648, 0x1, 0x7fffa900) ["SoAction.c++":402, 0x5e5e4a50]
   5 SoCamera::viewAll(SoNode*,const SbViewportRegion&,float)(0x10045c80, 0x10029648, 0x7fffad50, 0x3f800000) ["SoCamera.c++":131, 0x5e685f3c]
   6 SoXtViewer::setSceneGraph(SoNode*)(0x1002a1b0, 0x10029648, 0x5e4ffcf0, 0x10045c80) ["SoXtViewer.c++":297, 0x5e4ae9c4]
   7 main(__P273114248 = 1, argv = 0x7fffaebc) ["/n/monet/u/monet/zhou/Projects/src/Inventor/mainHier.C":37, 0x410ad0]
   8 __start() ["crt1text.s":133, 0x40594c]
 
 
 

1. Open inventor derived shape node question...

Hi,
   I use a very simple scene graph such as
 Selection
  {
   ShapeKit {
        shape    BarChart {
                    fields []
        }
   }
 }

  I want to test the selection on a derived inventor shape node.
BarChart is a derived inventor shape node. (it is from /usr/share/
src/Inventor/nodes/BarChart). When I select the bar chart
then print out the path:
   SoWriteAction wa;
   wa.apply(((SoFullPath *)path)->getTail());

The object written out is the object I picked (e.g. the plate
in the bar chart) rather than BarChart itself. That means
it returns the path to the internal child of BarChart, should
it do this? If it does return the path to the internal child,
how can I ever get the tail node which is BarChart itself?

Thanks for your help in advance!

Michelle

--
Michelle Zhou

2. Info wanted on commercial products started at a university

3. questions about deriving inventor shape node

4. what's best machine/card to run Max 3.1 on?

5. Please help: How to retrieve the information which affects the shape node in Open Inventor

6. Create a new SoGroup Node...

7. Problem with derived node kit in OI 2.1

8. Any batch-renamer around?

9. Stick the projection node with object..problem..please help

10. Those new nodes in Inventor 2.2

11. new nodes and elements in Open Inventor

12. Limitation in creating new node in Inventor

13. Creation of new Inventor Nodes