Changeset 1175 for GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
- Timestamp:
- 08/01/06 16:55:06 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreKdTreeSceneManager.cpp
r1173 r1175 9 9 10 10 #include <OgreCamera.h> 11 #include <OgreSubEntity.h> 11 12 #include "OgreKdTreeSceneManager.h" 12 13 #include "OgreKdTreeSceneNode.h" 13 14 #include "OgreKdTree.h" 15 #include "OgreVisibilityOptionsManager.h" 14 16 15 17 #include <OgreLogManager.h> … … 19 21 { 20 22 KdTreeSceneManager::KdTreeSceneManager(const String& name, GtpVisibility::VisibilityManager *vm): 21 SceneManager(name), mKdTree(0), mVisibilityManager(vm) 23 SceneManager(name), 24 mVisibilityManager(vm), 25 mKdTree(0), 26 mMaxDepth(KDTREE_MAX_DEPTH), 27 mShowBoxes(false), 28 #ifdef KDTREE_DEBUG 29 mHighlighLevel(0), 30 mShowAllBoxes(false), 31 #endif 32 mBuildMethod(KdTree::KDBM_PRIORITYQUEUE), 33 mRenderMethod(KdTree::KDRM_RECURSE), 34 mLeavePassesInQueue(0), 35 mCurrentEntityId(1) 22 36 { 23 37 // Replace root node with my node … … 26 40 mSceneRoot = new KdTreeSceneNode(this, "root node"); 27 41 mSceneRoot->_notifyRootNode(); 28 29 mMaxDepth = KDTREE_MAX_DEPTH;30 mShowBoxes = false;31 32 // kill the old kd-tree if exists33 OGRE_DELETE(mKdTree);34 35 mRenderMethod = KdTree::KDRM_RECURSE;36 37 //mBuildMethod = KdTree::KDBM_RECURSIVE;38 mBuildMethod = KdTree::KDBM_PRIORITYQUEUE;39 #ifdef KDTREE_DEBUG40 mHighlighLevel = 0;41 mShowAllBoxes = false;42 #endif43 42 44 43 mHierarchyInterface = new KdTreeHierarchyInterface(this, mDestRenderSystem); … … 197 196 } 198 197 199 return SceneManager::setOption(strKey, pValue); 198 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 199 .setOption(strKey, pValue) || SceneManager::setOption(strKey, pValue); 200 200 } 201 201 … … 269 269 } 270 270 271 return SceneManager::getOption(strKey, pDestValue); 271 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 272 .getOption(strKey, pDestValue) || SceneManager::getOption(strKey, pDestValue); 273 } 274 275 bool KdTreeSceneManager::getOptionKeys(StringVector &refKeys) 276 { 277 refKeys.push_back("BuildMethod"); 278 refKeys.push_back("KI"); 279 refKeys.push_back("KT"); 280 refKeys.push_back("KdTreeMaxDepth"); 281 refKeys.push_back("RebuildKdTree"); 282 refKeys.push_back("RenderMethod"); 283 refKeys.push_back("ShowKdTree"); 284 refKeys.push_back("TreeBox"); 285 #ifdef KDTREE_DEBUG 286 refKeys.push_back("HighlightLevel"); 287 refKeys.push_back("ShowAllBoxes"); 288 #endif 289 return VisibilityOptionsManager(mVisibilityManager, mHierarchyInterface) 290 .getOptionKeys(refKeys); 291 } 292 293 bool KdTreeSceneManager::getOptionValues(const String & key, StringVector &refValueList) 294 { 295 return SceneManager::getOptionValues(key, refValueList); 296 } 297 298 void KdTreeSceneManager::setVisibilityManager(GtpVisibility::VisibilityManager *visManager) 299 { 300 mVisibilityManager = visManager; 301 } 302 303 GtpVisibility::VisibilityManager * KdTreeSceneManager::getVisibilityManager() 304 { 305 return mVisibilityManager; 306 } 307 308 GtpVisibility::VisibilityManager * KdTreeSceneManager::GetVisibilityManager() 309 { 310 return mVisibilityManager; 311 } 312 313 KdTreeHierarchyInterface * KdTreeSceneManager::GetHierarchyInterface() 314 { 315 return mHierarchyInterface; 272 316 } 273 317 … … 294 338 mSceneNodes[sn->getName()] = sn; 295 339 return sn; 340 } 341 342 Entity * KdTreeSceneManager::createEntity(const String& entityName, const String& meshName) 343 { 344 Entity *ent = SceneManager::createEntity(entityName, meshName); 345 346 for (int i = 0; i < (int)ent->getNumSubEntities(); ++i) 347 { 348 ent->getSubEntity(i)->setId(mCurrentEntityId); 349 } 350 351 // increase counter of entity id values 352 ++ mCurrentEntityId; 353 354 return ent; 296 355 } 297 356 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreVisibilityOptionsManager.cpp
r903 r1175 82 82 refKeys.push_back("NumQueryCulledNodes"); 83 83 refKeys.push_back("NumFrustumCulledNodes"); 84 refKeys.push_back("NumQueriesIssued"); 84 85 85 86 return true;
Note: See TracChangeset
for help on using the changeset viewer.