Hello,

I am loading an obj file using OpenSG build-in loader and then using several
graph operator as follows:

    SplitGraphOp *spo = new SplitGraphOp;

        spo->setMaxPolygons(1000);


    /*
    To optimize  the geometry we create a graph operator
    */
    GraphOpSeq *graphOperator = new GraphOpSeq;

    //first we verify the geometry
    graphOperator->addGraphOp(new VerifyGeoGraphOp);
    //merge geometry and transformations
    graphOperator->addGraphOp(new MergeGraphOp);
    //merge identical field containers
    graphOperator->addGraphOp(new SharePtrGraphOp);

    //split graph operator
    graphOperator->addGraphOp(spo);

    //verify again
    graphOperator->addGraphOp(new VerifyGeoGraphOp);

    /*
    After  the loading the
    resulting graph will be
    modified using the
    specified graph operator
    */
    NodePtr utah_teapot =
SceneFileHandler::the().read("bunnySmall.obj",graphOperator);

    /*
    Check if the data loading
    operation was ok or not
    */
    if(utah_teapot == NullFC)
    {
        cout << "Loading the specified file was not possible." << endl;
        return NullFC;
    }

    //set  a string name for that node
    //we shall use that string to search
    setName(utah_teapot,"UTAH_TEAPOT");


    //create a plane at the origin
    NodePtr bottom = makePlane(25.0, 25.0, 128, 128);


    GeometryPtr geoUtah = GeometryPtr::dcast(utah_teapot->getCore());

    /*
    Check if the dyamic-casting was successful
    */
    if(!geoUtah)
    {
        cout << "The dynamaic casting was not successful" << endl;
        return NullFC;
    }





The program crashes saying "The dynamaic casting was not successful". I
checked that if i disable the SplitGraphoperator the program runs fine.
By  the way the model that i m loading is large.


Any idea from any one how to how to get around that problem?



Cheers
Sajjad
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to