Ignore:
Timestamp:
09/11/06 00:29:47 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1299 r1328  
    3838static void AddGeometry(SceneGraph *scene) 
    3939{ 
    40         scene->mRoot->UpdateBox(); 
     40        scene->GetRoot()->UpdateBox(); 
    4141 
    4242        AxisAlignedBox3 sceneBox = scene->GetBox(); 
     
    6262 
    6363                                MeshInstance *mi = new MeshInstance(mesh); 
    64                                 scene->mRoot->mGeometry.push_back(mi); 
     64                                scene->GetRoot()->mGeometry.push_back(mi); 
    6565                        } 
    6666                } 
     
    8181 
    8282                                MeshInstance *mi = new MeshInstance(mesh); 
    83                                 scene->mRoot->mGeometry.push_back(mi); 
     83                                scene->GetRoot()->mGeometry.push_back(mi); 
    8484                        } 
    8585                } 
     
    100100 
    101101                        MeshInstance *mi = new MeshInstance(mesh); 
    102                         scene->mRoot->mGeometry.push_back(mi); 
     102                        scene->GetRoot()->mGeometry.push_back(mi); 
    103103                } 
    104104 
    105                 scene->mRoot->UpdateBox(); 
     105                scene->GetRoot()->UpdateBox(); 
    106106        } 
    107107 
     
    122122 
    123123                MeshInstance *planeMi = new MeshInstance(planeMesh); 
    124                 scene->mRoot->mGeometry.push_back(planeMi); 
     124                scene->GetRoot()->mGeometry.push_back(planeMi); 
    125125        }        
    126126} 
     
    136136mRenderSimulator(NULL), 
    137137mPass(0), 
    138 mRayCastMethod(0) 
     138mRayCastMethod(0), 
     139mSceneGraph(NULL) 
    139140{ 
    140141        Environment::GetSingleton()->GetBoolValue("Preprocessor.useGlRenderer", mUseGlRenderer); 
     
    242243                          parser = new UnigraphicsParser; 
    243244 
    244                 cout<<filename<<endl; 
     245                cout << filename << endl; 
     246 
     247                SceneGraphNode *sroot = mSceneGraph->GetRoot(); 
    245248 
    246249                if (mRayCastMethod == Preprocessor::INTEL_RAYCASTER) 
    247                   result = parser->ParseFile(filename, &mSceneGraph->mRoot, 
    248                                                                          mLoadPolygonsAsMeshes, 
    249                                                                          &mFaceParents); 
     250                { cout << "here5800" << endl; 
     251                        result = parser->ParseFile( 
     252                                filename,  
     253                                &sroot, 
     254                                mLoadPolygonsAsMeshes, 
     255                                &mFaceParents); 
     256                } 
    250257                else 
    251                   result = parser->ParseFile(filename, &mSceneGraph->mRoot, mLoadPolygonsAsMeshes); 
    252                  
     258                { cout << "here776645" << endl; 
     259                        result = parser->ParseFile(filename, &sroot, mLoadPolygonsAsMeshes); 
     260                } 
     261                 cout << "here98809845" << endl; 
    253262                delete parser; 
    254263 
    255264        } else { 
    256265                // root for different files 
    257                 mSceneGraph->mRoot = new SceneGraphNode; 
     266                mSceneGraph->SetRoot(new SceneGraphNode()); 
    258267                for (int i= 0; i < filenames.size(); i++) { 
    259268                  if (strstr(filenames[i].c_str(), ".x3d")) 
     
    266275                   
    267276                  if (mRayCastMethod == Preprocessor::INTEL_RAYCASTER) 
    268                         success = parser->ParseFile(filename, &node, 
    269                                                                                 mLoadPolygonsAsMeshes, 
    270                                                                                 &mFaceParents); 
     277                  { cout << "here4500" << endl; 
     278                          success = parser->ParseFile( 
     279                                  filename,  
     280                                  &node, 
     281                                  mLoadPolygonsAsMeshes, 
     282                                  &mFaceParents); 
     283                  } 
    271284                  else 
    272                         success = parser->ParseFile(filename, &node, mLoadPolygonsAsMeshes); 
    273                    
    274                   if (success) { 
    275                         mSceneGraph->mRoot->mChildren.push_back(node); 
    276                         // at least one file parsed 
    277                         result = true; 
     285                  { 
     286                          cout << "here45" << endl; 
     287                          success = parser->ParseFile(filename, &node, mLoadPolygonsAsMeshes); 
     288                  } 
     289 
     290                  if (success)  
     291                  { cout << "here4509999" << endl; 
     292                          mSceneGraph->GetRoot()->mChildren.push_back(node); 
     293                          // at least one file parsed 
     294                          result = true; 
    278295                  } 
    279296                   
     
    281298                } 
    282299        } 
    283          
    284          
     300         cout << "here8888" << endl; 
     301 
    285302        if (result)  
    286           { 
     303        { cout << "here199" << endl; 
    287304                // HACK  
    288305                if (ADDITIONAL_GEOMETRY_HACK) 
    289306                        AddGeometry(mSceneGraph); 
    290                  
     307 
    291308                mSceneGraph->AssignObjectIds(); 
    292          
     309 cout << "here99" << endl; 
    293310                int intersectables, faces; 
    294311                mSceneGraph->GetStatistics(intersectables, faces); 
    295          
     312 cout << "here999" << endl; 
    296313                cout<<filename<<" parsed successfully."<<endl; 
    297314                cout<<"#NUM_OBJECTS (Total numner of objects)\n"<<intersectables<<endl; 
    298315                cout<<"#NUM_FACES (Total numner of faces)\n"<<faces<<endl; 
    299316                mSceneGraph->CollectObjects(&mObjects); 
    300                 mSceneGraph->mRoot->UpdateBox(); 
    301  
     317                mSceneGraph->GetRoot()->UpdateBox(); 
     318 cout << "here9999" << endl; 
    302319                if (0) 
    303320                { 
    304321                        Exporter *exporter = Exporter::GetExporter("testload.x3d"); 
    305  
    306322                        if (exporter) 
    307323                        { 
     
    311327                } 
    312328        } 
    313          
    314          
     329 
    315330        return result; 
    316331} 
     
    356371  // add mesh instances of the scene graph to the root of the tree 
    357372  KdLeaf *root = (KdLeaf *)mKdTree->GetRoot(); 
     373        cout << "here3.95" << endl; 
    358374  mSceneGraph->CollectObjects(&root->mObjects); 
    359    
     375        cout << "here3.97" << endl; 
    360376  long startTime = GetTime(); 
    361377 
     
    389405  if (exporter) { 
    390406    if (scene) 
    391       exporter->ExportScene(mSceneGraph->mRoot); 
     407      exporter->ExportScene(mSceneGraph->GetRoot()); 
    392408 
    393409    if (kdtree) { 
Note: See TracChangeset for help on using the changeset viewer.