Re: [info-performer] Lost nodes through pfflt

Date view Thread view Subject view Author view

From: Paolo Farinelli (paolo++at++sgi.com)
Date: 09/05/2003 14:17:06


Hi Tony,

it is likely that your database is getting 'cleaned' after being loaded.

 From pfdCleanTree man page:

     pfdCleanTree traverses the scene graph rooted at node and removes
     redundant and empty pfGroups from the scene graph. It also
converts any
     pfSCS with an identity transformation into a pfGroup.

     By default, pfGroups are eliminated if they have one or fewer children.
     Any children are reparented to the parent of the pfGroup being
     eliminated. The one exception is a pfSwitch node with one child, which
     is not eliminated. An optional function func can be provided to alter
     this determination during the traversal. At each candidate
pfGroup, func
     is passed a pfuTraverser which includes the current node. If func
     returns TRUE, the current node is eliminated. If func returns
FALSE, the
     current node is retained.

You may want to avoid calling pfdCleanTree altogether, or you may want to
work around this problem and still call pfdCleanTree (as this does improve
the efficiency of your db representation)..

For example you could try assigning names to object beads (instead of group
beads) in Creator, and then look for pfGeodes instead of pfGroups through
pfFindNode..

Alternatively you could add a second child bead to each of your named
objects
in the flt file, to prevent them from being removed by pfdCleanTree..
you could
then remove these additional nodes yourself after 'finding' each group..

Hope this helps.

Best Regards,
Paolo

Anthony Clare wrote:

> Hi,
>
> I am using Performer 3.0.2 on Linux but have previously used Performer
> through Vega on IRIX. The problem I have now does not occur when using
> the same calls and method under Vega on IRIX.
>
> I am calling pfFindNode to find nodes whose information was stored as
> a .flt file was loaded. The nodes show up as pfGroup (they were
> objects in the OpenFlight file) when the information is printed
> (format: name/type/comments) during the loader callback:
>
> -> AJC Note: Load database file.
> -> AJC Note: CB_HEADER node - MKF_Cubes.flt
> Top_Level_Comment pfGroup
> -> AJC Note: CB_GROUP node - Odd_Cubes
> Odd_Group_Comment pfGroup
> -> AJC Note: CB_OBJECT node - CubeA
> Object1_Comment pfGroup nodeIndex = 0
> -> AJC Note: CB_OBJECT node - CubeC
> Object3_Comment pfGroup nodeIndex = 1
> -> AJC Note: CB_GROUP node - Even_Cubes
> Even_Group_Comment pfGroup
> -> AJC Note: CB_OBJECT node - CubeB
> Object2_Comment pfGroup nodeIndex = 2
> -> AJC Note: CB_OBJECT node - CubeD
> Object4_Comment pfGroup nodeIndex = 3
>
> However after the file is loaded I cannot find the nodes.
> Experimenting on a small file I noticed that the nodes I am trying to
> find are converted from pfGroups to pfGeodes (or removed all
> together). If I pfPrint the scene graph below say "Odd_Cubes" above I
> would expect to find it has two children called "CubeA" and "CubeC".
> But that it not what I get. Removing the modes/attrs/binding etc the
> pfPrint looks like:
>
> [0:0]pfGroup pfId=130 0x42166cf8 {
> path: /Odd_Cubes
> trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
> bsphere: ctr(25.000000, 5.000000, 5.000000) rad=28.660255
> Num Parents : 1
> "MKF_Cubes.flt"=0x0x421661e0
> Num Children: 2
> [1:0]pfGeode pfId=132 0x421699b8 {
> trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
> bsphere: ctr(5.000000, 5.000000, 5.000000) rad=8.660254
> Num Parents : 1
> "Odd_Cubes"=0x0x42166cf8
> Num pfGeoSets: 1
> [2:0]
> GeoSet: 0x421696f8 {
> GeoState: 0x0x421677c8
> pfGeoState: 0x421677c8
> Modified mask: 0x115400637
> Modes:
> ...removed all the modes/attrs/bindings etc to be
> consice...
> } GeoSet: 0x421696f8
> [2:0]
> [1:0]} pfGeode 132 0x421699b8
> [1:1]pfGeode pfId=134 0x4216a2a0 {
> trav masks: cull=0xffffffff draw=0xffffffff isect=0xffffffff
> bsphere: ctr(45.000000, 5.000000, 5.000000) rad=8.660254
> Num Parents : 1
> "Odd_Cubes"=0x0x42166cf8
> Num pfGeoSets: 1
> [2:0]
> GeoSet: 0x42169ff8 {
> GeoState: 0x0x421677c8
> pfGeoState: 0x421677c8
> Modified mask: 0x115400637
> Modes:
> ...removed all the modes/attrs/bindings etc to be
> consice...
> } GeoSet: 0x42169ff8
> [2:0]
> [1:1]} pfGeode 134 0x4216a2a0
> [0:0]} pfGroup 130 0x42166cf8
>
> The node "Obb_Cubes" does have two children which are now pfGeodes but
> which have NO name (the path: is missing from the printout). Is this a
> difference with the loader under Linux or a newer version of
> Performer? I have seen references to node name problems before but
> they relate to names of 8 characters. Does anyone know what this may be?
>
> Regards,
> Tony Clare.

-- 
Paolo Farinelli                                           paolo++at++sgi.com
Member of Technical Staff, OpenGL Performer              1-650-933-1808
Silicon Graphics        1600 Amphitheatre Pkwy, Mountain View, CA 94043


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Sep 05 2003 - 14:17:39 PDT