Example #1
0
int main(int argc, char **argv)
{
    OSG::NodePtr pRoot;

    int i = 0;

    OSG::osgInit(i, NULL);

    OSG::Node::create();

    if((argc > 2) && (OSG::stringcmp(argv[2], "pushNames") == 0))
    {    
        OSG::SceneFileHandler::the().setOptions("wrl", "pushNames=true");
    }
    
    pRoot = OSG::SceneFileHandler::the().read(argv[1]);

    std::cerr << "Tree : " << std::endl;

    if(pRoot == OSG::NullFC)
    {
        std::cerr << "\t Empty" << std::endl;
    }
    else
    {
        pRoot->dump();
    }

//    char *szFilename = "stirnwand.wrl";

    OSG::osgExit();

    return 0;
}
void testRefCount(void)
{
#if 0
    OSG::NodePtr pNode = OSG::Node::create();

    OSG::NodePtr pNode1 = OSG::Node::create();

    fprintf(stderr, "1\n");

//XX
#if 0
    pNode.dump();
    pNode1.dump();
#endif

    pNode->addChild(pNode1);

    fprintf(stderr, "2\n");

//XX
#if 0
    pNode.dump();
    pNode1.dump();
#endif

    fprintf(stderr, "3\n");

//XX
#if 0
    pNode.dump();
    pNode1.dump();
#endif

    applyToAspect(1, false);
    applyToAspect(2);

    fprintf(stderr, "4\n");

//XX
#if 0
    pNode.dump();
    pNode1.dump();
#endif
    
    fprintf(stderr, "5\n");

//XX
#if 0
    pNode.dump();
    pNode1.dump();
#endif

    applyToAspect(1, false);

    fprintf(stderr, "6\n");

//XX
#if 0
    pNode.dump();
    pNode1.dump();
#endif

    applyToAspect(2);

    fprintf(stderr, "7\n");
#endif
}