- Timestamp:
- 05/10/06 08:05:24 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r931 r938 108 108 /** Loads view cells for this particular scene. 109 109 */ 110 void LoadViewCells(std::stringfilename);110 bool LoadViewCells(const String &filename); 111 111 112 112 protected: … … 210 210 bool mUseViewCells; 211 211 212 213 212 /// if the view cells are filtered 214 213 bool mUseVisibilityFilter; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgrePlatformHierarchyInterface.h
r897 r938 20 20 @remark also provides methods for using occlusion queries on the hierarchy nodes 21 21 */ 22 typedef std::vector<PlatformOcclusionQuery *> OcclusionQueryContainer; 23 22 24 class PlatformHierarchyInterface: public GtpVisibility::HierarchyInterface 23 25 { … … 151 153 AxisAlignedBox mBox; 152 154 153 std::vector<PlatformOcclusionQuery *>mOcclusionQueries;155 OcclusionQueryContainer mOcclusionQueries; 154 156 155 157 Vector3 mCameraPosition; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreBoundingBoxConverter.cpp
r933 r938 19 19 GtpVisibilityPreprocessor::IndexedBoundingBoxContainer:: 20 20 const_iterator iit, iit_end = iboxes.end(); 21 21 std::stringstream d; d << "here75557\n"; 22 LogManager::getSingleton().logMessage(d.str()); 22 23 for (iit = iboxes.begin(); iit != iit_end; ++ iit) 23 24 { 24 25 const GtpVisibilityPreprocessor::AxisAlignedBox3 box = (*iit).second; 25 26 const AxisAlignedBox currentBox = OgreTypeConverter::ConvertToOgre(box); 26 27 std::stringstream d; d << "here77\n"; 28 LogManager::getSingleton().logMessage(d.str()); 27 29 Entity *ent = FindCorrespondingObject(currentBox); 28 30 … … 51 53 AxisAlignedBox mybox = EnlargeBox(box); 52 54 //AxisAlignedBox dummy(Vector3(-50000, -50000, -50000), Vector3(50000, 50000, 50000)); 53 55 std::stringstream d; d << "here3 idenbtiy 8888\n"; 56 LogManager::getSingleton().logMessage(d.str()); 54 57 //-- get intersecting scene nodes 55 58 mSceneMgr->findNodesIn(mybox, sceneNodeList, NULL); … … 58 61 list<SceneNode *>::const_iterator sit, sit_end = sceneNodeList.end(); 59 62 60 float overlap = 0;//GtpVisibilityPreprocessor::Limits::Small; 63 // minimal overlap 64 float overlap = 0;//1e-6; 61 65 62 66 Entity *bestFittingObj = NULL; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r931 r938 66 66 // TODO: set maxdepth to reasonable value 67 67 mMaxDepth = 50; 68 69 //loadVisibilityConfig("GtpVisibility.cfg");70 //LoadViewCells("");71 //mViewCellsLoaded = true;72 68 } 73 69 //----------------------------------------------------------------------- … … 137 133 mTerrainPages.clear(); 138 134 // Load the configuration 139 loadConfig( stream);135 loadConfig(stream); 140 136 initLevelIndexes(); 141 137 … … 555 551 if (!mViewCellsLoaded) 556 552 { 557 LoadViewCells(static_cast<const char *>(val));558 mViewCellsLoaded = true;559 } 560 561 return true;553 String filename(static_cast<const char *>(val)); 554 mViewCellsLoaded = LoadViewCells(filename); 555 } 556 557 return mViewCellsLoaded; 562 558 } 563 559 if (key == "UseViewCells") 564 560 { 565 mUseViewCells = *static_cast<const bool *>(val); 566 567 // reset view cell 568 OGRE_DELETE(mCurrentViewCell); 569 if (mUseViewCells) 570 mCurrentViewCell = mViewCellsManager->GenerateViewCell(); 571 mElementaryViewCell = NULL; 572 // if using view cells, all objects are set to false initially 573 SetObjectsVisible(!mUseViewCells); 574 561 if (mViewCellsLoaded) 562 { 563 LogManager::getSingleton().logMessage("here3"); 564 mUseViewCells = *static_cast<const bool *>(val); 565 566 // reset view cell 567 OGRE_DELETE(mCurrentViewCell); 568 569 if (mUseViewCells) 570 mCurrentViewCell = mViewCellsManager->GenerateViewCell(); 571 572 mElementaryViewCell = NULL; 573 574 // if using view cells, all objects are set to false initially 575 SetObjectsVisible(!mUseViewCells); 576 } 577 575 578 return true; 576 579 } … … 1011 1014 OgreMeshInstance *omi = static_cast<OgreMeshInstance *>(*it); 1012 1015 Entity *ent = omi->GetMesh(); 1016 LogManager::getSingleton().logMessage("here999"); 1013 1017 ent->setVisible(visible); 1014 1018 } 1015 1019 } 1016 1020 //----------------------------------------------------------------------- 1017 void OcclusionCullingSceneManager::LoadViewCells(stringfilename)1018 { 1019 // the objects are set to invisible a prioriy1021 bool OcclusionCullingSceneManager::LoadViewCells(const String &filename) 1022 { 1023 // objects are set to invisible initially 1020 1024 SetObjectsVisible(false); 1021 1025 1022 1026 const string bboxesFilename = mVisibilityManager->GetVisibilityEnvironment()->getViewCellsFileName(); 1023 1027 1028 // converter between view cell ids and Ogre entites 1024 1029 GtpVisibilityPreprocessor::IndexedBoundingBoxContainer iboxes; 1025 1030 OgreBoundingBoxConverter bconverter(this); 1026 1031 1032 1033 GtpVisibilityPreprocessor::Environment *env = 1034 mVisibilityManager->GetVisibilityEnvironment()->GetPreprocessorEnvironment(); 1035 1027 1036 // load the view cells assigning the found objects to the pvss 1028 1037 mViewCellsManager = 1029 GtpVisibilityPreprocessor::ViewCellsManager::LoadViewCells(filename, &mObjects, &bconverter); 1030 1031 std::stringstream d; 1032 d << "view cells loaded" << endl; 1033 Ogre::LogManager::getSingleton().logMessage(d.str()); 1038 GtpVisibilityPreprocessor::ViewCellsManager::LoadViewCells(filename, &mObjects, env, &bconverter); 1039 1040 if (!mViewCellsManager) 1041 { 1042 std::stringstream d; 1043 d << "error loading view cells" << endl; 1044 LogManager::getSingleton().logMessage(d.str()); 1045 } 1046 1047 return (mViewCellsManager != NULL); 1034 1048 } 1035 1049 //------------------------------------------------------------------------- … … 1041 1055 // set everything visible for savety 1042 1056 SetObjectsVisible(true); 1043 1057 LogManager::getSingleton().logMessage("here7"); 1044 1058 return; 1045 1059 } 1046 1060 LogManager::getSingleton().logMessage("here8"); 1047 1061 GtpVisibilityPreprocessor::ObjectPvsMap::const_iterator oit, 1048 1062 oit_end = vc->GetPvs().mEntries.end(); … … 1055 1069 OgreMeshInstance *omi = dynamic_cast<OgreMeshInstance*>((*oit).first); 1056 1070 omi->GetMesh()->setVisible(load); 1057 //GtpVisibilityPreprocessor::Debug << "here45 " << omi->GetId() << endl;1071 GtpVisibilityPreprocessor::Debug << "here45 " << omi->GetId() << endl; 1058 1072 } 1059 1073 } … … 1061 1075 void OcclusionCullingSceneManager::updatePvs(Camera *cam) 1062 1076 { 1063 if (mViewCellsLoaded && mUseViewCells) 1064 { 1065 const GtpVisibilityPreprocessor::Vector3 viewPoint = 1066 OgreTypeConverter::ConvertFromOgre(cam->getDerivedPosition()); 1067 1068 GtpVisibilityPreprocessor::ViewCell *newElementary = 1069 mViewCellsManager->GetViewCell(viewPoint); 1070 1071 // elementary view cell did not change => apply same pvs 1072 if (mElementaryViewCell == newElementary) 1073 return; 1074 1075 mElementaryViewCell = newElementary; 1076 1077 //-- unload old pvs 1078 applyViewCellPvs(mCurrentViewCell, false); 1079 1080 1081 //-- the new view cell 1077 if (!(mViewCellsLoaded && mUseViewCells)) 1078 return; 1079 1080 const GtpVisibilityPreprocessor::Vector3 viewPoint = 1081 OgreTypeConverter::ConvertFromOgre(cam->getDerivedPosition()); 1082 1083 GtpVisibilityPreprocessor::ViewCell *newElementary = 1084 mViewCellsManager->GetViewCell(viewPoint); 1085 1086 // elementary view cell did not change => apply same pvs 1087 if (mElementaryViewCell == newElementary) 1088 return; 1089 1090 mElementaryViewCell = newElementary; 1091 LogManager::getSingleton().logMessage("unloading"); 1092 //-- unload old pvs 1093 applyViewCellPvs(mCurrentViewCell, false); 1094 1095 1096 //-- the new view cell 1082 1097 1083 1098 GtpVisibilityPreprocessor::ViewCell *viewCell; 1084 1099 1085 1100 1086 if (mUseVisibilityFilter) 1087 { 1088 //-- compute new filtered cell 1089 GtpVisibilityPreprocessor::PrVs prvs; 1090 mViewCellsManager->GetPrVS(viewPoint, prvs, 5); 1091 viewCell = prvs.mViewCell; 1092 } 1093 else 1094 { 1095 viewCell = newElementary; 1096 } 1097 1098 //-- load new pvs 1099 applyViewCellPvs(viewCell, true); 1100 1101 // store pvs 1102 mCurrentViewCell->SetPvs(viewCell->GetPvs()); 1103 1104 // delete merge tree of filtered view cell 1105 if (mUseVisibilityFilter) 1106 mViewCellsManager->DeleteLocalMergeTree(viewCell); 1107 } 1101 if (mUseVisibilityFilter) 1102 { 1103 //-- compute new filtered cell 1104 GtpVisibilityPreprocessor::PrVs prvs; 1105 mViewCellsManager->GetPrVS(viewPoint, prvs, 5); 1106 viewCell = prvs.mViewCell; 1107 } 1108 else 1109 { 1110 viewCell = newElementary; 1111 } 1112 LogManager::getSingleton().logMessage("loading"); 1113 //-- load new pvs 1114 if (0)applyViewCellPvs(viewCell, true); 1115 1116 // store pvs 1117 mCurrentViewCell->SetPvs(viewCell->GetPvs()); 1118 1119 // delete merge tree of filtered view cell 1120 if (mUseVisibilityFilter) 1121 mViewCellsManager->DeleteLocalMergeTree(viewCell); 1108 1122 } 1109 1123 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOctreeHierarchyInterface.cpp
r925 r938 112 112 octant->setLastRendered(mFrameId); 113 113 OctreeSceneManager *ocm = 114 //dynamic_cast<OctreeSceneManager *>(mSceneManager);115 114 dynamic_cast<OctreeSceneManager *>(mSceneManager); 115 116 116 ocm->_renderOctant(mCamera, octant, mOnlyShadowCasters, mLeavePassesInQueue); 117 117 … … 144 144 // reuse box if node is the same 145 145 // only create renderable bounding box for new node 146 if ( 1 || (node != mSavedNode))146 if (node != mSavedNode) 147 147 { 148 148 mSavedNode = node; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformHierarchyInterface.cpp
r925 r938 81 81 void PlatformHierarchyInterface::ResetQueries() 82 82 { 83 for (int i = 0; i < (int)mOcclusionQueries.size(); ++ i) OGRE_DELETE(mOcclusionQueries[i]); 83 OcclusionQueryContainer::iterator it, it_end = mOcclusionQueries.end(); 84 for (it = mOcclusionQueries.begin(); it != it_end; ++ it) 85 { 86 PlatformOcclusionQuery *query = *it; 87 OGRE_DELETE(query); 88 } 84 89 85 90 mCurrentTestIdx = 0; … … 121 126 { 122 127 // create new query if there is no query left 123 if (mCurrentTestIdx >= (int)mOcclusionQueries.size()) 124 { 125 mCurrentTestIdx = (int)mOcclusionQueries.size(); 128 if (mCurrentTestIdx == mOcclusionQueries.size()) 129 { 126 130 mOcclusionQueries.push_back(new PlatformOcclusionQuery(mRenderSystem)); 127 131 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgrePlatformOcclusionQuery.cpp
r925 r938 35 35 { 36 36 isAvailable = !mHardwareOcclusionQuery->isStillOutstanding(); 37 //std::stringstream d; d << "available: " << isAvailable;38 //Ogre::LogManager::getSingleton().logMessage(d.str());39 37 } 38 39 //std::stringstream d; d << mHardwareOcclusionQuery << ", available: " << isAvailable << ", waitforresult: " << waitForResult; 40 // Ogre::LogManager::getSingleton().logMessage(d.str()); 40 41 41 42 if (isAvailable) -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilitySceneManagerDll.cpp
r925 r938 47 47 extern "C" void __declspec(dllexport) dllStartPlugin(void) 48 48 { 49 // load visibility environment 49 50 visEnv = new GtpVisibility::VisibilityEnvironment(); 50 visEnv->LoadEnvironment("simple.env");51 //visEnv->LoadEnvironment("simple.env"); 51 52 visManager = new GtpVisibility::VisibilityManager(visEnv); 52 53 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/include/VisibilityEnvironment.h
r925 r938 3 3 4 4 #include <string> 5 6 7 namespace GtpVisibilityPreprocessor { 8 class Environment; 9 } 5 10 6 11 namespace GtpVisibility { … … 20 25 NUM_CULLING_MANAGERS}; 21 26 27 22 28 /** Loads an environment from disk. 23 29 */ 24 voidLoadEnvironment(std::string filename);30 bool LoadEnvironment(std::string filename); 25 31 /** Returns filename of scene. 26 32 */ … … 29 35 */ 30 36 std::string getViewCellsFileName(); 37 38 GtpVisibilityPreprocessor::Environment *GetPreprocessorEnvironment(); 39 40 41 protected: 42 GtpVisibilityPreprocessor::Environment *mEnvironment; 31 43 }; 32 44 } // namespace GtpVisibility -
GTP/trunk/Lib/Vis/OnlineCullingCHC/scripts/GtpVisibility.vcproj
r897 r938 139 139 RelativePath="..\src\VisibilityManager.cpp"> 140 140 </File> 141 <Filter142 Name="Header Files"143 Filter="h;hpp;hxx;hm;inl;inc;xsd"144 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">145 <File146 RelativePath="..\include\BatchedQueriesCullingManager.h">147 </File>148 <File149 RelativePath="..\include\CoherentHierarchicalCullingManager.h">150 </File>151 <File152 RelativePath="..\include\CullingManager.h">153 </File>154 <File155 RelativePath="..\include\DistanceQueue.h">156 </File>157 <File158 RelativePath="..\include\DummyPreprocessingManager.h">159 </File>160 <File161 RelativePath="..\include\DummyQueryManager.h">162 </File>163 <File164 RelativePath="..\include\FrustumCullingManager.h">165 </File>166 <File167 RelativePath="..\include\HierarchyInterface.h">168 </File>169 <File170 RelativePath="..\include\OcclusionQuery.h">171 </File>172 <File173 RelativePath="..\include\PreprocessingManager.h">174 </File>175 <File176 RelativePath="..\include\StopAndWaitCullingManager.h">177 </File>178 <File179 RelativePath="..\include\VisibilityEnvironment.h">180 </File>181 <File182 RelativePath="..\include\VisibilityInfo.h">183 </File>184 <File185 RelativePath="..\include\VisibilityManager.h">186 </File>187 <File188 RelativePath="..\include\VisibilityMesh.h">189 </File>190 </Fil ter>141 </Filter> 142 <Filter 143 Name="Header Files" 144 Filter="h;hpp;hxx;hm;inl;inc;xsd" 145 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 146 <File 147 RelativePath="..\include\BatchedQueriesCullingManager.h"> 148 </File> 149 <File 150 RelativePath="..\include\CoherentHierarchicalCullingManager.h"> 151 </File> 152 <File 153 RelativePath="..\include\CullingManager.h"> 154 </File> 155 <File 156 RelativePath="..\include\DistanceQueue.h"> 157 </File> 158 <File 159 RelativePath="..\include\DummyPreprocessingManager.h"> 160 </File> 161 <File 162 RelativePath="..\include\DummyQueryManager.h"> 163 </File> 164 <File 165 RelativePath="..\include\FrustumCullingManager.h"> 166 </File> 167 <File 168 RelativePath="..\include\HierarchyInterface.h"> 169 </File> 170 <File 171 RelativePath="..\include\OcclusionQuery.h"> 172 </File> 173 <File 174 RelativePath="..\include\PreprocessingManager.h"> 175 </File> 176 <File 177 RelativePath="..\include\StopAndWaitCullingManager.h"> 178 </File> 179 <File 180 RelativePath="..\include\VisibilityEnvironment.h"> 181 </File> 182 <File 183 RelativePath="..\include\VisibilityInfo.h"> 184 </File> 185 <File 186 RelativePath="..\include\VisibilityManager.h"> 187 </File> 188 <File 189 RelativePath="..\include\VisibilityMesh.h"> 190 </File> 191 191 </Filter> 192 192 <File -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/BatchedQueriesCullingManager.cpp
r726 r938 21 21 QueryQueue queryQueue; 22 22 unsigned int visiblePixels = 0; 23 bool isAvailable = false;24 23 25 24 //Ogre::LogManager::getSingleton().logMessage("Batched Culling"); … … 131 130 } 132 131 } 133 // add rest of queries 132 133 // issue rest of queries 134 134 IssueMultipleQueries(pendingQueue, queryQueue); 135 135 } -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/CoherentHierarchicalCullingManager.cpp
r925 r938 24 24 QueryQueue queryQueue; 25 25 unsigned int visiblePixels = 0; 26 bool isAvailable = false;27 26 28 27 //Ogre::LogManager::getSingleton().logMessage("chc"); 29 28 //-- PART 1: process finished occlusion queries 30 29 while (!mHierarchyInterface->GetQueue()->empty() || !queryQueue.empty()) 31 30 { 32 // only wait for result if queue is empty 31 //if (mHierarchyInterface->GetQueue()->empty()) 32 // Ogre::LogManager::getSingleton().logMessage("distance queue empty!!"); 33 34 // only wait for result if there are no nodes to process 33 35 while (!queryQueue.empty() && 34 36 queryQueue.front().second->GetQueryResult(visiblePixels, … … 65 67 if (!mHierarchyInterface->GetQueue()->empty()) 66 68 { 69 //Ogre::LogManager::getSingleton().logMessage("traversal"); 67 70 HierarchyNode *node = mHierarchyInterface->GetQueue()->top(); 68 71 mHierarchyInterface->GetQueue()->pop(); … … 141 144 if (mAssumedVisibility > 0) 142 145 { 143 mThreshold = RAND_MAX - RAND_MAX / mAssumedVisibility; 146 mThreshold = RAND_MAX - RAND_MAX / mAssumedVisibility; 147 if (mAssumedVisibility > 100) // fix visibility 148 mThreshold = RAND_MAX; 144 149 } 145 150 //std::stringstream d; d << "*** setting assumed vis: " << mAssumedVisibility; Ogre::LogManager::getSingleton().logMessage(d.str()); -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/HierarchyInterface.cpp
r925 r938 29 29 void HierarchyInterface::InitTraversal() 30 30 { 31 // initialise for front-to-back rendering31 //-- initialise for front-to-back rendering 32 32 33 33 ++ mFrameId; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/src/VisibilityEnvironment.cpp
r925 r938 11 11 // load debug stream 12 12 GtpVisibilityPreprocessor::Debug.open("debug.log"); 13 13 14 // load environment 15 mEnvironment = new GtpVisibilityPreprocessor::Environment(); 14 16 } 17 //----------------------------------------------------------------------- 15 18 VisibilityEnvironment::~VisibilityEnvironment() 16 19 { 17 // load debug stream 18 DEL_PTR(GtpVisibilityPreprocessor::environment); 19 20 DEL_PTR(mEnvironment); 20 21 } 21 22 //----------------------------------------------------------------------- 22 void VisibilityEnvironment::LoadEnvironment(string filename) 23 { 24 // todo matt: 25 GtpVisibilityPreprocessor::environment = new GtpVisibilityPreprocessor::Environment; 26 27 char argc = 2; 23 bool VisibilityEnvironment::LoadEnvironment(string filename) 24 { 25 //-- parse filename into c-style argument list 26 /*char argc = 2; 28 27 char *argv[2]; 29 28 argv[0] = ""; … … 33 32 argv[1] = fname; 34 33 35 GtpVisibilityPreprocessor::Debug << "filename: " << argv[1] << endl; 36 37 GtpVisibilityPreprocessor::environment->Parse(argc, argv, false); 38 //MeshKdTree::ParseEnvironment(); 34 GtpVisibilityPreprocessor::Debug << "here4 loading environment from: " << argv[1] << endl; 35 */ 36 //-- parse environment 37 return mEnvironment->ReadEnvFile(filename.c_str()); 38 //return GtpVisibilityPreprocessor::environment->Parse(argc, argv, false); 39 39 } 40 40 //----------------------------------------------------------------------- … … 42 42 { 43 43 char str[200]; 44 GtpVisibilityPreprocessor::environment->GetStringValue("Scene.filename", str);44 mEnvironment->GetStringValue("Scene.filename", str); 45 45 return str; 46 46 } … … 49 49 { 50 50 char str[200]; 51 GtpVisibilityPreprocessor::environment->GetStringValue("ViewCells.filename", str);51 mEnvironment->GetStringValue("ViewCells.filename", str); 52 52 return str; 53 53 } 54 54 //----------------------------------------------------------------------- 55 GtpVisibilityPreprocessor::Environment *VisibilityEnvironment::GetPreprocessorEnvironment() 56 { 57 return mEnvironment; 58 } 55 59 } // namespace GtpVisibility -
GTP/trunk/Lib/Vis/Preprocessing/scripts/TestPreprocessor.vcproj
r833 r938 80 80 <Tool 81 81 Name="VCLinkerTool" 82 AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib d.lib devil.lib qtmain.lib QtOpenGL4.lib QtCored4.lib QtGuid4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib"82 AdditionalDependencies="xerces-c_2.lib zdll.lib zziplib.lib devil.lib qtmain.lib QtOpenGL4.lib QtCored4.lib QtGuid4.lib Qt3Support4.lib QAxContainer.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib" 83 83 OutputFile="$(OutDir)/Preprocessor.exe" 84 84 LinkIncremental="1" -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
r904 r938 49 49 50 50 if (optionalParams != NULL) 51 delete optionalParams;51 DEL_PTR(optionalParams); 52 52 } 53 53 … … 312 312 313 313 int 314 Environment::FindOption(const char *name, 315 const bool isFatal) const 314 Environment::FindOption(const char *name, const bool isFatal) const 316 315 { 317 316 int i; … … 2183 2182 } 2184 2183 2185 void 2184 bool 2186 2185 Environment::Parse(const int argc, char **argv, bool useExePath) 2187 2186 { 2188 2187 bool result = true; 2189 2188 // Read the names of the scene, environment and output files 2190 2189 ReadCmdlineParams(argc, argv, ""); … … 2217 2216 // error - bad input file name specified ? 2218 2217 cerr<<"Error parsing environment file "<<envFilename<<endl; 2218 result = false; 2219 2219 } 2220 2220 delete envFilename; … … 2231 2231 exit(0); 2232 2232 } 2233 2234 } 2235 2236 } 2233 2234 return true; 2235 } 2236 2237 } -
GTP/trunk/Lib/Vis/Preprocessing/src/Environment.h
r860 r938 336 336 //@} 337 337 338 voidParse(const int argc, char **argv, bool useExePath);338 bool Parse(const int argc, char **argv, bool useExePath); 339 339 340 340 void -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r931 r938 356 356 { 357 357 environment->GetStringValue("ViewCells.filename", buf); 358 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects );358 mViewCellsManager = ViewCellsManager::LoadViewCells(buf, &mObjects, environment); 359 359 } 360 360 else … … 395 395 if (strcmp(name, "kdTree") == 0) 396 396 { 397 mViewCellsManager = new KdViewCellsManager(mKdTree );397 mViewCellsManager = new KdViewCellsManager(mKdTree, environment); 398 398 } 399 399 else if (strcmp(name, "bspTree") == 0) … … 402 402 403 403 mBspTree = new BspTree(); 404 mViewCellsManager = new BspViewCellsManager(mBspTree );404 mViewCellsManager = new BspViewCellsManager(mBspTree, environment); 405 405 } 406 406 else if (strcmp(name, "vspBspTree") == 0) … … 409 409 410 410 mVspBspTree = new VspBspTree(environment); 411 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree );411 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, environment); 412 412 } 413 413 else if (strcmp(name, "vspKdTree") == 0) … … 415 415 mVspKdTree = new VspKdTree(); 416 416 417 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree );417 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, environment); 418 418 } 419 419 else if (strcmp(name, "sceneDependent") == 0) … … 424 424 Debug << "view cell type: Bsp" << endl; 425 425 426 mViewCellsManager = new BspViewCellsManager(mBspTree );426 mViewCellsManager = new BspViewCellsManager(mBspTree, environment); 427 427 } 428 428 else -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
r883 r938 371 371 372 372 373 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm ):373 ViewCellsTree::ViewCellsTree(ViewCellsManager *vcm, Environment *env): 374 374 mRoot(NULL), 375 375 mUseAreaForPvs(false), … … 381 381 #endif 382 382 { 383 env ironment->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells);384 env ironment->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory);383 env->GetBoolValue("ViewCells.Visualization.exportMergedViewCells", mExportMergedViewCells); 384 env->GetFloatValue("ViewCells.maxStaticMemory", mMaxMemory); 385 385 386 386 //-- merge options 387 environment->GetFloatValue("ViewCells.PostProcess.renderCostWeight", mRenderCostWeight); 388 environment->GetIntValue("ViewCells.PostProcess.minViewCells", mMergeMinViewCells); 389 environment->GetFloatValue("ViewCells.PostProcess.maxCostRatio", mMergeMaxCostRatio); 390 environment->GetBoolValue("ViewCells.PostProcess.refine", mRefineViewCells); 391 392 393 Debug << "========= view cell tree options ================\n"; 387 env->GetFloatValue("ViewCells.PostProcess.renderCostWeight", mRenderCostWeight); 388 env->GetIntValue("ViewCells.PostProcess.minViewCells", mMergeMinViewCells); 389 env->GetFloatValue("ViewCells.PostProcess.maxCostRatio", mMergeMaxCostRatio); 390 env->GetBoolValue("ViewCells.PostProcess.refine", mRefineViewCells); 391 392 env->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", mMaxMergesPerPass); 393 env->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", mAvgCostMaxDeviation); 394 395 Debug << "============= view cell tree options ================\n"; 394 396 Debug << "minimum view cells: " << mMergeMinViewCells << endl; 395 397 Debug << "max cost ratio: " << mMergeMaxCostRatio << endl; 396 398 Debug << "max memory: " << mMaxMemory << endl; 397 399 Debug << "refining view cells: " << mRefineViewCells << endl; 398 Debug << " ********* view cell tree options ***************\n";400 Debug << "============= view cell tree options ================\n"; 399 401 400 402 MergeCandidate::sRenderCostWeight = mRenderCostWeight; … … 555 557 // maximal ratio of old expected render cost to expected render 556 558 // when the the render queue has to be reset. 557 float avgCostMaxDeviation;558 int maxMergesPerPass;559 559 int numMergedViewCells = 0; 560 561 environment->GetIntValue("ViewCells.PostProcess.maxMergesPerPass", maxMergesPerPass); 562 environment->GetFloatValue("ViewCells.PostProcess.avgCostMaxDeviation", avgCostMaxDeviation); 560 563 561 564 562 cout << "actual merge starts now ... " << endl; … … 570 568 //-- reset merge queue if the ratio of current expected cost / real expected cost 571 569 // too small or after a given number of merges 572 if ((mergedPerPass > m axMergesPerPass) ||573 ( avgCostMaxDeviation > mAvgRenderCost / realAvgRenderCost))570 if ((mergedPerPass > mMaxMergesPerPass) || 571 (mAvgCostMaxDeviation > mAvgRenderCost / realAvgRenderCost)) 574 572 { 575 573 Debug << "************ reset queue *****************\n" 576 << "ratios: " << avgCostMaxDeviation574 << "ratios: " << mAvgCostMaxDeviation 577 575 << " real avg render cost " << realAvgRenderCost << " average render cost " << mAvgRenderCost 578 << " merged per pass : " << mergedPerPass << " of maximal " << m axMergesPerPass << endl;576 << " merged per pass : " << mergedPerPass << " of maximal " << mMaxMergesPerPass << endl; 579 577 580 578 Debug << "Values before reset: " -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r881 r938 23 23 class ViewCellsManager; 24 24 class ViewCellLeaf; 25 class Environment; 25 26 26 27 /** Statistics for a view cell partition. … … 346 347 347 348 public: 348 ViewCellsTree(ViewCellsManager *vcm );349 ViewCellsTree(ViewCellsManager *vcm, Environment *env); 349 350 ~ViewCellsTree(); 350 351 … … 588 589 float mMaxMemory; 589 590 591 int mMaxMergesPerPass; 592 float mAvgCostMaxDeviation; 590 593 }; 591 594 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r931 r938 41 41 42 42 43 ViewCellsManager::ViewCellsManager( ):43 ViewCellsManager::ViewCellsManager(Environment *env): 44 44 mRenderer(NULL), 45 45 mInitialSamples(0), … … 54 54 mMaxPvsRatio(1.0), 55 55 mViewCellPvsIsUpdated(false) 56 ,mEnvironment(env) 56 57 { 57 58 mViewSpaceBox.Initialize(); 58 59 ParseEnvironment(); 59 60 60 mViewCellsTree = new ViewCellsTree(this );61 mViewCellsTree = new ViewCellsTree(this, env); 61 62 } 62 63 … … 65 66 { 66 67 // visualization stuff 67 environment->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays);68 environment->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry);69 environment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio);70 71 environment->GetBoolValue("ViewCells.pruneEmptyViewCells", mPruneEmptyViewCells);68 mEnvironment->GetBoolValue("ViewCells.Visualization.exportRays", mExportRays); 69 mEnvironment->GetBoolValue("ViewCells.Visualization.exportGeometry", mExportGeometry); 70 mEnvironment->GetFloatValue("ViewCells.maxPvsRatio", mMaxPvsRatio); 71 72 mEnvironment->GetBoolValue("ViewCells.pruneEmptyViewCells", mPruneEmptyViewCells); 72 73 73 74 // HACK … … 77 78 mMinPvsSize = 0; 78 79 79 environment->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells);80 81 environment->GetIntValue("ViewCells.Construction.samples", mConstructionSamples);82 environment->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples);83 environment->GetBoolValue("ViewCells.PostProcess.useRaysForMerge", mUseRaysForMerge);84 85 environment->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples);86 87 environment->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass);88 environment->GetBoolValue("ViewCells.exportToFile", mExportViewCells);89 90 environment->GetIntValue("ViewCells.active", mNumActiveViewCells);91 environment->GetBoolValue("ViewCells.PostProcess.compress", mCompressViewCells);92 environment->GetBoolValue("ViewCells.Visualization.useClipPlane", mUseClipPlaneForViz);93 environment->GetBoolValue("ViewCells.PostProcess.merge", mMergeViewCells);94 environment->GetBoolValue("ViewCells.evaluateViewCells", mEvaluateViewCells);95 environment->GetBoolValue("ViewCells.showVisualization", mShowVisualization);96 environment->GetIntValue("ViewCells.Filter.maxSize", mMaxFilterSize);97 environment->GetFloatValue("ViewCells.Filter.width", mFilterWidth);98 environment->GetIntValue("ViewCells.renderCostEvaluationType", mRenderCostEvaluationType);99 100 environment->GetBoolValue("ViewCells.exportBboxesForPvs", mExportBboxesForPvs);101 environment->GetBoolValue("ViewCells.exportPvs", mExportPvs);80 mEnvironment->GetBoolValue("ViewCells.processOnlyValidViewCells", mOnlyValidViewCells); 81 82 mEnvironment->GetIntValue("ViewCells.Construction.samples", mConstructionSamples); 83 mEnvironment->GetIntValue("ViewCells.PostProcess.samples", mPostProcessSamples); 84 mEnvironment->GetBoolValue("ViewCells.PostProcess.useRaysForMerge", mUseRaysForMerge); 85 86 mEnvironment->GetIntValue("ViewCells.Visualization.samples", mVisualizationSamples); 87 88 mEnvironment->GetIntValue("ViewCells.Construction.samplesPerPass", mSamplesPerPass); 89 mEnvironment->GetBoolValue("ViewCells.exportToFile", mExportViewCells); 90 91 mEnvironment->GetIntValue("ViewCells.active", mNumActiveViewCells); 92 mEnvironment->GetBoolValue("ViewCells.PostProcess.compress", mCompressViewCells); 93 mEnvironment->GetBoolValue("ViewCells.Visualization.useClipPlane", mUseClipPlaneForViz); 94 mEnvironment->GetBoolValue("ViewCells.PostProcess.merge", mMergeViewCells); 95 mEnvironment->GetBoolValue("ViewCells.evaluateViewCells", mEvaluateViewCells); 96 mEnvironment->GetBoolValue("ViewCells.showVisualization", mShowVisualization); 97 mEnvironment->GetIntValue("ViewCells.Filter.maxSize", mMaxFilterSize); 98 mEnvironment->GetFloatValue("ViewCells.Filter.width", mFilterWidth); 99 mEnvironment->GetIntValue("ViewCells.renderCostEvaluationType", mRenderCostEvaluationType); 100 101 mEnvironment->GetBoolValue("ViewCells.exportBboxesForPvs", mExportBboxesForPvs); 102 mEnvironment->GetBoolValue("ViewCells.exportPvs", mExportPvs); 102 103 103 104 char buf[100]; 104 environment->GetStringValue("ViewCells.samplingType", buf);105 mEnvironment->GetStringValue("ViewCells.samplingType", buf); 105 106 106 107 … … 119 120 } 120 121 121 environment->GetStringValue("ViewCells.Evaluation.samplingType", buf);122 mEnvironment->GetStringValue("ViewCells.Evaluation.samplingType", buf); 122 123 123 124 if (strcmp(buf, "box") == 0) … … 135 136 } 136 137 137 environment->GetStringValue("ViewCells.renderCostEvaluationType", buf);138 mEnvironment->GetStringValue("ViewCells.renderCostEvaluationType", buf); 138 139 139 140 if (strcmp(buf, "perobject") == 0) … … 151 152 } 152 153 153 environment->GetStringValue("ViewCells.Visualization.colorCode", buf);154 mEnvironment->GetStringValue("ViewCells.Visualization.colorCode", buf); 154 155 155 156 if (strcmp(buf, "PVS") == 0) … … 719 720 char s[64]; 720 721 721 environment->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass);722 environment->GetIntValue("ViewCells.Evaluation.samples", numSamples);722 mEnvironment->GetIntValue("ViewCells.Evaluation.samplesPerPass", samplesPerPass); 723 mEnvironment->GetIntValue("ViewCells.Evaluation.samples", numSamples); 723 724 724 725 char statsPrefix[100]; 725 environment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix);726 mEnvironment->GetStringValue("ViewCells.Evaluation.statsPrefix", statsPrefix); 726 727 727 728 Debug << "view cell evaluation samples per pass: " << samplesPerPass << endl; … … 813 814 int histoPasses; 814 815 815 environment->GetBoolValue("ViewCells.Evaluation.histogram", useHisto);816 environment->GetIntValue("ViewCells.Evaluation.histoPasses", histoPasses);816 mEnvironment->GetBoolValue("ViewCells.Evaluation.histogram", useHisto); 817 mEnvironment->GetIntValue("ViewCells.Evaluation.histoPasses", histoPasses); 817 818 818 819 const int numLeaves = mViewCellsTree->GetNumInitialViewCells(mViewCellsTree->GetRoot()); … … 1162 1163 X3dParser parser; 1163 1164 1164 environment->GetFloatValue("ViewCells.height", parser.mViewCellHeight);1165 mEnvironment->GetFloatValue("ViewCells.height", parser.mViewCellHeight); 1165 1166 1166 1167 bool success = parser.ParseFile(filename, *this); … … 1588 1589 float pos; 1589 1590 1590 environment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos);1591 mEnvironment->GetFloatValue("ViewCells.Visualization.clipPlanePos", pos); 1591 1592 1592 1593 Vector3 point = mViewSpaceBox.Min() + mViewSpaceBox.Size() * pos; 1593 1594 1594 1595 if (mUseClipPlaneForViz) 1595 environment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis);1596 mEnvironment->GetIntValue("ViewCells.Visualization.clipPlaneAxis", axis); 1596 1597 1597 1598 Vector3 normal(0,0,0); … … 2063 2064 2064 2065 2065 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree ):2066 ViewCellsManager( ), mBspTree(bspTree)2067 { 2068 environment->GetIntValue("BspTree.Construction.samples", mInitialSamples);2066 BspViewCellsManager::BspViewCellsManager(BspTree *bspTree, Environment *env): 2067 ViewCellsManager(env), mBspTree(bspTree) 2068 { 2069 mEnvironment->GetIntValue("BspTree.Construction.samples", mInitialSamples); 2069 2070 mBspTree->SetViewCellsManager(this); 2070 2071 mBspTree->mViewCellsTree = mViewCellsTree; … … 2234 2235 { 2235 2236 char mstats[100]; 2236 environment->GetStringValue("ViewCells.mergeStats", mstats);2237 mEnvironment->GetStringValue("ViewCells.mergeStats", mstats); 2237 2238 mViewCellsTree->ExportStats(mstats); 2238 2239 } … … 2318 2319 { 2319 2320 char filename[100]; 2320 environment->GetStringValue("ViewCells.filename", filename);2321 mEnvironment->GetStringValue("ViewCells.filename", filename); 2321 2322 ExportViewCells(filename, mExportPvs, objects); 2322 2323 } … … 2326 2327 { 2327 2328 char filename[100]; 2328 environment->GetStringValue("ViewCells.boxesFilename", filename);2329 mEnvironment->GetStringValue("ViewCells.boxesFilename", filename); 2329 2330 ExportBoundingBoxes(filename, objects); 2330 2331 } … … 2386 2387 //-- visualization of the BSP splits 2387 2388 bool exportSplits = false; 2388 environment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits);2389 mEnvironment->GetBoolValue("BspTree.Visualization.exportSplits", exportSplits); 2389 2390 2390 2391 if (exportSplits) … … 2933 2934 2934 2935 2935 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree ):2936 ViewCellsManager( ), mKdTree(kdTree), mKdPvsDepth(100)2936 KdViewCellsManager::KdViewCellsManager(KdTree *kdTree, Environment *env): 2937 ViewCellsManager(env), mKdTree(kdTree), mKdPvsDepth(100) 2937 2938 { 2938 2939 } … … 3237 3238 3238 3239 3239 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree ):3240 ViewCellsManager( ), mVspKdTree(vspKdTree)3241 { 3242 environment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples);3240 VspKdViewCellsManager::VspKdViewCellsManager(VspKdTree *vspKdTree, Environment *env): 3241 ViewCellsManager(env), mVspKdTree(vspKdTree) 3242 { 3243 mEnvironment->GetIntValue("VspKdTree.Construction.samples", mInitialSamples); 3243 3244 mVspKdTree->SetViewCellsManager(this); 3244 3245 } … … 3598 3599 3599 3600 3600 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree ):3601 ViewCellsManager( ), mVspBspTree(vspBspTree)3602 { 3603 environment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples);3601 VspBspViewCellsManager::VspBspViewCellsManager(VspBspTree *vspBspTree, Environment *env): 3602 ViewCellsManager(env), mVspBspTree(vspBspTree) 3603 { 3604 mEnvironment->GetIntValue("VspBspTree.Construction.samples", mInitialSamples); 3604 3605 mVspBspTree->SetViewCellsManager(this); 3605 3606 mVspBspTree->mViewCellsTree = mViewCellsTree; … … 3756 3757 ObjectPvs pvs; 3757 3758 3758 environment->GetStringValue("ViewCells.mergeStats", mstats);3759 mEnvironment->GetStringValue("ViewCells.mergeStats", mstats); 3759 3760 mViewCellsTree->ExportStats(mstats); 3760 3761 } … … 4010 4011 { 4011 4012 char filename[100]; 4012 environment->GetStringValue("ViewCells.filename", filename);4013 mEnvironment->GetStringValue("ViewCells.filename", filename); 4013 4014 ExportViewCells(filename, mExportPvs, objects); 4014 4015 } … … 4019 4020 { 4020 4021 char filename[100]; 4021 environment->GetStringValue("ViewCells.boxesFilename", filename);4022 mEnvironment->GetStringValue("ViewCells.boxesFilename", filename); 4022 4023 4023 4024 ExportBoundingBoxes(filename, objects); … … 4320 4321 //-- visualization of the BSP splits 4321 4322 bool exportSplits = false; 4322 environment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits);4323 mEnvironment->GetBoolValue("VspBspTree.Visualization.exportSplits", exportSplits); 4323 4324 4324 4325 if (exportSplits) … … 4723 4724 4724 4725 4725 ViewCellsManager *ViewCellsManager::LoadViewCells(const string filename,4726 ViewCellsManager *ViewCellsManager::LoadViewCells(const string &filename, 4726 4727 ObjectContainer *objects, 4728 Environment *env, 4727 4729 BoundingBoxConverter *bconverter) 4728 4730 { … … 4731 4733 ViewCellsManager *vm = NULL; 4732 4734 4733 Debug << "vc filename: " << filename << endl; 4734 4735 Debug << "here23 filename: " << filename << endl; 4735 4736 //BoundingBoxConverter bconverter; 4736 4737 4737 if (parser.ParseFile(filename, &vm, objects, bconverter ))4738 { 4738 if (parser.ParseFile(filename, &vm, objects, bconverter, env)) 4739 {Debug << "here25 filename: " << filename << endl; 4739 4740 //vm->PrepareLoadedViewCells(); 4740 4741 vm->ResetViewCells(); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h
r931 r938 33 33 class MergeCandidate; 34 34 class BoundingBoxConverter; 35 35 class Environment; 36 36 37 37 struct BspRay; … … 72 72 enum {PER_OBJECT, PER_TRIANGLE}; 73 73 74 /** Constructor taking the initial and construction samples. 75 @param initialSamples the maximal number of samples used for creating the hierarchy 76 of view cells 77 @param constructionSamples the maximal number of samples used for construction 78 */ 79 ViewCellsManager(const int initialSamples, const int constructionSamples); 80 81 ViewCellsManager(); 74 /** default constructor taking an environment file. 75 */ 76 ViewCellsManager(Environment *env); 82 77 83 78 virtual ~ViewCellsManager(); … … 434 429 @returns the view cells manager if loading was successful, false otherwise 435 430 */ 436 static ViewCellsManager *LoadViewCells(const string filename,431 static ViewCellsManager *LoadViewCells(const string &filename, 437 432 ObjectContainer *objects, 433 Environment *env, 438 434 BoundingBoxConverter *bconverter = NULL); 439 435 … … 559 555 bool mExportBboxesForPvs; 560 556 561 557 Environment *environment; 562 558 Plane3 mClipPlane; 563 559 … … 638 634 /// if pvs should be exported with view cells 639 635 bool mExportPvs; 636 637 Environment *mEnvironment; 640 638 }; 641 639 … … 652 650 used to construct the bsp tree. 653 651 */ 654 BspViewCellsManager(BspTree *tree );652 BspViewCellsManager(BspTree *tree, Environment *env); 655 653 656 654 ~BspViewCellsManager(); … … 739 737 public: 740 738 741 KdViewCellsManager(KdTree *tree );739 KdViewCellsManager(KdTree *tree, Environment *env); 742 740 743 741 int ConstructSubdivision(const ObjectContainer &objects, … … 795 793 /// depth of the KD tree nodes with represent the view cells 796 794 int mKdPvsDepth; 795 796 797 797 }; 798 798 … … 806 806 public: 807 807 808 VspKdViewCellsManager(VspKdTree *vspKdTree );808 VspKdViewCellsManager(VspKdTree *vspKdTree, Environment *env); 809 809 810 810 int ConstructSubdivision(const ObjectContainer &objects, … … 870 870 public: 871 871 872 VspBspViewCellsManager(VspBspTree *tree );872 VspBspViewCellsManager(VspBspTree *tree, Environment *env); 873 873 ~VspBspViewCellsManager(); 874 874 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r931 r938 65 65 // StdInParseHandlers: Constructors and Destructor 66 66 // --------------------------------------------------------------------------- 67 ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter): 67 ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects, 68 BoundingBoxConverter *bconverter, 69 Environment *env): 68 70 mElementCount(0) 69 71 , mAttrCount(0) … … 79 81 , mObjects(objects) 80 82 , mBoundingBoxConverter(bconverter) 83 , mEnvironment(env) 81 84 { 82 85 // mObjects = objects; … … 102 105 EndViewCells(); 103 106 107 if (element == "BoundingBoxes") 108 EndBoundingBoxes(); 109 110 // inside the view cell description 104 111 if (mParseViewCells) 105 112 { … … 150 157 void ViewCellsParseHandlers::EndBoundingBoxes() 151 158 { 152 // bounding boxes gathered: associate object ids with bounding boxes 159 // all bounding boxes gathered in this step => 160 // associate object ids with bounding boxes 153 161 if (mBoundingBoxConverter) 154 162 mBoundingBoxConverter->IdentifyObjects(mIBoundingBoxes, *mObjects); … … 605 613 //mCurrentBspNode = mBspTree->GetRoot(); 606 614 607 mViewCellsManager = new BspViewCellsManager(mBspTree );615 mViewCellsManager = new BspViewCellsManager(mBspTree, mEnvironment); 608 616 } 609 617 else if (strcmp(name, "vspBspTree") == 0) … … 613 621 mVspBspTree = new VspBspTree(); 614 622 //mCurrentBspNode = mVspBspTree->GetRoot(); 615 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree );623 mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment); 616 624 617 625 mVspBspTree->mBox = mViewSpaceBox; … … 622 630 // TODO 623 631 mVspKdTree = new VspKdTree(); 624 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree );632 mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, mEnvironment); 625 633 } 626 634 else … … 692 700 ViewCellsManager **viewCells, 693 701 ObjectContainer *objects, 694 BoundingBoxConverter *bconverter) 702 BoundingBoxConverter *bconverter, 703 Environment *env) 695 704 { 696 705 // Initialize the XML4C system … … 724 733 // to do. 725 734 // 726 ViewCellsParseHandlers handler(objects, bconverter );735 ViewCellsParseHandlers handler(objects, bconverter, env); 727 736 parser->setDocumentHandler(&handler); 728 737 parser->setErrorHandler(&handler); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.h
r931 r938 10 10 class VspBspTree; 11 11 class BoundingBoxConverter; 12 class Environment; 12 13 13 14 class ViewCellsParser : public Parser … … 20 21 ViewCellsManager **viewCells, 21 22 ObjectContainer *objectsm, 22 BoundingBoxConverter *bconverter); 23 BoundingBoxConverter *bconverter, 24 Environment *env); 23 25 }; 24 26 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParserXerces.h
r931 r938 28 28 // Constructors and Destructor 29 29 // ----------------------------------------------------------------------- 30 ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter );30 ViewCellsParseHandlers(ObjectContainer *objects, BoundingBoxConverter *bconverter, Environment *env); 31 31 ~ViewCellsParseHandlers(); 32 32 … … 84 84 85 85 IndexedBoundingBoxContainer mIBoundingBoxes; 86 Environment *mEnvironment; 86 87 87 88 bool mParseViewCells;
Note: See TracChangeset
for help on using the changeset viewer.