Changeset 1278 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
- Timestamp:
- 08/24/06 18:05:30 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r1264 r1278 34 34 #include "KdTree.h" 35 35 #include "BvHierarchy.h" 36 #include "HierarchyManager.h" 36 37 37 38 … … 91 92 , mObjects(objects) 92 93 , mBoundingBoxConverter(bconverter) 94 , mHierarchyManager(NULL) 93 95 { 94 96 std::stable_sort(mObjects->begin(), mObjects->end(), ilt); … … 354 356 if (element == "ViewCells") 355 357 { 356 cout << " parsing view cells" << endl;358 cout << "\nparsing view cells" << endl; 357 359 358 360 mCurrentState = PARSE_VIEWCELLS; … … 372 374 if (element == "ViewSpaceHierarchy") 373 375 { 374 cout << " parsing view space hierarchy" << endl;376 cout << "\nparsing view space hierarchy" << endl; 375 377 mCurrentState = PARSE_VIEWSPACE_HIERARCHY; 376 378 StartViewSpaceHierarchy(attributes); … … 380 382 if (element == "ObjectSpaceHierarchy") 381 383 { 382 cout << " parsing object space hierarchy" << endl;384 cout << "\nparsing object space hierarchy" << endl; 383 385 mCurrentState = PARSE_OBJECTSPACE_HIERARCHY; 384 386 StartObjectSpaceHierarchy(attributes); … … 565 567 if (attrName == "type") 566 568 { 567 if (strcmp(ptr, " bsp") == 0)569 if (strcmp(ptr, "osp") == 0) 568 570 { 569 Debug << " view space hierarchy: Bsp" << endl;570 m ViewSpaceHierarchyType = BSP;571 Debug << "object space hierarchy: Osp" << endl; 572 mHierarchyManager = new HierarchyManager(mVspTree, HierarchyManager::KD_BASED_OBJ_SUBDIV); 571 573 } 572 else if (strcmp(ptr, " vsp") == 0)574 else if (strcmp(ptr, "bvh") == 0) 573 575 { 574 Debug << " view space hierarchy: Vsp" << endl;575 m ViewSpaceHierarchyType = VSP;576 Debug << "object space hierarchy: Bvh" << endl; 577 mHierarchyManager = new HierarchyManager(mVspTree, HierarchyManager::BV_BASED_OBJ_SUBDIV); 576 578 } 577 579 } … … 778 780 779 781 mVspTree = new VspTree(); 782 780 783 // set view space box 781 784 mVspTree->mBoundingBox = mViewSpaceBox; 785 786 // object space hierarchy already constructed 787 if (mHierarchyManager) 788 { 789 mHierarchyManager->mVspTree = mVspTree; 790 mVspTree->mHierarchyManager = mHierarchyManager; 791 } 782 792 } 783 793 784 794 cout << "\nview space box: " << mViewSpaceBox << endl; 785 }786 787 788 void ViewCellsParseHandlers::CreateObjectSpaceHierarchy()789 {790 if (mViewSpaceHierarchyType == OSP)791 {792 Debug << "object hierarchy type: Osp" << endl;793 794 mOspTree = new OspTree();795 }796 else if (mViewSpaceHierarchyType == VSP)797 {798 Debug << "object hierarchy type: Vsp" << endl;799 800 mVspTree = new VspTree();801 }802 795 } 803 796 … … 814 807 else if (mViewSpaceHierarchyType == VSP) 815 808 { 816 Debug << " vcreating view cells manager: VsOspp" << endl;809 Debug << "creating view cells manager: VspOsp" << endl; 817 810 818 811 // hack 819 mViewCellsManager = new VspOspViewCellsManager(mViewCellsTree, m VspTree, mOspTree);812 mViewCellsManager = new VspOspViewCellsManager(mViewCellsTree, mHierarchyManager); 820 813 } 821 814 … … 978 971 else 979 972 { 980 m OspTree->mRoot = interior;973 mHierarchyManager->mOspTree->mRoot = interior; 981 974 } 982 975 … … 996 989 else 997 990 { 998 m OspTree->mRoot = leaf;991 mHierarchyManager->mOspTree->mRoot = leaf; 999 992 } 1000 993 } … … 1002 995 1003 996 void ViewCellsParseHandlers::StartBvhLeaf(AttributeList& attributes) 1004 { 997 {/* 1005 998 KdLeaf * leaf = 1006 999 new KdLeaf(dynamic_cast<KdInterior *>(mCurrentKdNode), NULL); … … 1012 1005 else 1013 1006 { 1014 m OspTree->mRoot = leaf;1015 } 1007 mHierarchyManager->mBvHierarchy->mRoot = leaf; 1008 }*/ 1016 1009 } 1017 1010 1018 1011 1019 1012 void ViewCellsParseHandlers::StartBvhInterior(AttributeList& attributes) 1020 { 1013 {/* 1021 1014 AxisAlignedPlane plane; 1022 1015 int len = attributes.getLength(); … … 1051 1044 } 1052 1045 1053 mCurrentKdNode = interior; 1046 mCurrentKdNode = interior;*/ 1054 1047 } 1055 1048
Note: See TracChangeset
for help on using the changeset viewer.