- Timestamp:
- 02/15/07 14:45:30 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/IVReader/src/IVReader.vcproj
r2100 r2119 73 73 Name="VCCLCompilerTool" 74 74 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\Samples\Common\include";..\include" 75 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE "75 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;IVREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 76 76 RuntimeLibrary="2" 77 77 UsePrecompiledHeader="0" -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/include/OgreOcclusionCullingSceneManager.h
r1823 r2119 142 142 void VisualizeViewCells(const bool visualize); 143 143 144 /** Load an iv scene. 145 */ 144 146 bool LoadSceneIV(const String &filename, 145 147 SceneNode *root, 146 148 const int index); 147 149 148 bool LoadScene(const String &filename); 150 /** Load obj scene. 151 */ 152 bool LoadSceneObj(const String &filename, 153 const String &viewCellsFile, 154 SceneNode *root); 155 156 /** Load a scene. 157 */ 158 bool LoadScene(const String &filename, const String &viewCellsFilename); 149 159 150 160 void loadConfig(DataStreamPtr& stream); -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionCullingSceneManager.cpp
r2115 r2119 23 23 #include "IntersectableWrapper.h" 24 24 #include "IVReader.h" 25 #include "ObjReader.h" 26 25 27 26 28 … … 154 156 155 157 // load the scene 156 LoadScene(mFilename );157 158 // load view cells 159 //mViewCellsLoaded = LoadViewCells(mViewCellsFilename);158 LoadScene(mFilename, mViewCellsFilename); 159 160 // load view cells: load later ... 161 if (0) mViewCellsLoaded = LoadViewCells(mViewCellsFilename); 160 162 161 163 if (mShowTerrain) … … 1592 1594 } 1593 1595 //----------------------------------------------------------------------- 1594 bool OcclusionCullingSceneManager::LoadScene(const String &filename) 1596 bool OcclusionCullingSceneManager::LoadScene(const String &filename, 1597 const String &viewCellsFilename) 1595 1598 { 1596 1599 using namespace std; … … 1620 1623 const string fn = *fit; 1621 1624 1622 if (strstr(fn.c_str(), ".iv") || strstr(fn.c_str(), ".wrl")) 1625 if (strstr(fn.c_str(), ".obj")) 1626 { 1627 // load iv files 1628 if (!LoadSceneObj(filename, viewCellsFilename, getRootSceneNode())) 1629 { 1630 LogManager::getSingleton().logMessage("error loading file"); 1631 return false; 1632 } 1633 } 1634 else if (strstr(fn.c_str(), ".iv") || strstr(fn.c_str(), ".wrl")) 1623 1635 { 1624 1636 // load iv files … … 1682 1694 } 1683 1695 //----------------------------------------------------------------------- 1696 bool OcclusionCullingSceneManager::LoadSceneObj(const String &filename, 1697 const String &viewCellsFile, 1698 SceneNode *root) 1699 { 1700 ObjReader objReader(this); 1701 1702 Timer *timer = PlatformManager::getSingleton().createTimer(); 1703 timer->reset(); 1704 1705 if (!objReader.LoadFile(filename.c_str(), viewCellsFile, root)) 1706 { 1707 PlatformManager::getSingleton().destroyTimer(timer); 1708 return false; 1709 } 1710 1711 SceneNode *node = root->createChildSceneNode("ObjSceneNode"); 1712 1713 std::stringstream d; 1714 d << "loaded " << filename << " in " << timer->getMilliseconds() * 1e-3 << " secs"; 1715 LogManager::getSingleton().logMessage(d.str()); 1716 1717 PlatformManager::getSingleton().destroyTimer(timer); 1718 1719 return true; 1720 } 1721 //----------------------------------------------------------------------- 1684 1722 const String OcclusionCullingSceneManagerFactory::FACTORY_TYPE_NAME = "OcclusionCullingSceneManager"; 1685 1723 //----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/Plugin_VisibilitySceneManager.vcproj
r2111 r2119 89 89 OptimizeForProcessor="3" 90 90 OptimizeForWindowsApplication="TRUE" 91 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\Preprocessing\src\Timer "92 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE "91 AdditionalIncludeDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";..\include;..\..\..\OnlineCullingCHC\include;..\..\..\Preprocessing\src;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\Preprocessing\src\Timer;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\include" 92 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PLUGIN_KD_TERRAIN_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 93 93 StringPooling="TRUE" 94 94 RuntimeLibrary="2" … … 105 105 Name="VCLinkerTool" 106 106 IgnoreImportLibrary="TRUE" 107 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib glew32.lib glew32s.lib IVReader.lib "107 AdditionalDependencies="OgreMain.lib CEGUIBase.lib OgreGUIRenderer.lib Plugin_OctreeSceneManager.lib GtpVisibility.lib zdll.lib zziplib.lib Preprocessor.lib xerces-c_2.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib glew32.lib glew32s.lib IVReader.lib ObjReader.lib" 108 108 OutputFile="$(OutDir)/Plugin_VisibilitySceneManager.dll" 109 109 Version="0.99" 110 110 LinkIncremental="1" 111 111 SuppressStartupBanner="TRUE" 112 AdditionalLibraryDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"..\..\..\Preprocessing\lib\$(ConfigurationName)";..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;"..\..\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)" "112 AdditionalLibraryDirectories=""$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"$(OGRE_PATH)\Dependencies\lib\$(ConfigurationName)";"..\..\..\Preprocessing\lib\$(ConfigurationName)";..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\Preprocessing\src\GL;..\..\..\..\..\..\..\NonGTP\Zlib\lib;"..\..\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\ObjReader\lib\$(ConfigurationName)"" 113 113 ModuleDefinitionFile="..\misc\OgreVisibilitySceneManager.def" 114 114 GenerateDebugInformation="FALSE" -
GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/include/ObjReader.h
r2115 r2119 2 2 #define __ObjReader_H__ 3 3 4 //#include <stdlib>5 4 #include <string> 6 5 #include <vector> 7 6 #include <Ogre.h> 8 7 #include "Containers.h" 9 /*#include "ObjNode.h"10 #include "ObjMeshData.h"11 #include "ObjManualMeshLoader.h"12 */13 8 14 15 namespace GtpVisibilityPreprocessor {16 17 struct Triangle3;18 19 }20 21 //typedef std::vector<GtpVisibilityPreprocessor::Triangle3 *> TriangleContainer;22 9 23 10 class __declspec(dllexport) ObjReader 24 11 { 25 12 public: 26 ObjReader( );13 ObjReader(Ogre::SceneManager *sceneManager); 27 14 ~ObjReader(); 28 15 29 bool LoadFile(const std::string &filename, 30 GtpVisibilityPreprocessor::ObjectContainer &objects) const; 16 bool LoadFile(const string &sceneName, 17 const string &visibilitySolution, 18 Ogre::SceneNode *root); 31 19 32 const std::vector<Ogre::Entity *> &GetObjects() const; 33 34 Ogre::Entity *CreateEntity(const std::string &name); 20 Ogre::Entity *CreateEntity(const std::string &name, 21 GtpVisibilityPreprocessor::Intersectable *object); 35 22 36 23 protected: 37 24 38 std::vector<Ogre::Entity *> mObjects;25 Ogre::SceneManager *mSceneManager; 39 26 }; 40 27 -
GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.cpp
r2115 r2119 3 3 #include "Triangle3.h" 4 4 #include "IntersectableWrapper.h" 5 #include "BvHierarchy.h" 6 #include "Preprocessor.h" 7 #include "OgreEntity.h" 8 #include "PreprocessorFactory.h" 9 #include "OgreLogManager.h" 5 10 6 11 7 ObjReader::ObjReader() 12 13 ObjReader::ObjReader(Ogre::SceneManager *sceneManager): 14 mSceneManager(sceneManager) 8 15 {} 9 16 … … 13 20 14 21 15 bool ObjReader::LoadFile(const string &filename, 16 GtpVisibilityPreprocessor::ObjectContainer &objects) const 22 bool ObjReader::LoadFile(const string &sceneName, 23 const string &visibilitySolution, 24 Ogre::SceneNode *root) 17 25 { 18 igzstream samplesIn(filename.c_str()); 19 20 if (!samplesIn.is_open()) 26 GtpVisibilityPreprocessor::Debug.open("debug.log"); 27 // HACK: get any preprocessor to load file 28 GtpVisibilityPreprocessor::Preprocessor *preprocessor = 29 GtpVisibilityPreprocessor::PreprocessorFactory::CreatePreprocessor("vss"); 30 31 // hack 32 preprocessor->mLoadMeshes = false; 33 GtpVisibilityPreprocessor::ObjectContainer pvsObjects; 34 35 Ogre::LogManager::getSingleton().logMessage("loading obj scene!!"); 36 37 if (preprocessor->LoadScene(sceneName)) 38 { 39 Ogre::LogManager::getSingleton().logMessage("scene loaded, loading objects"); 40 // form objects from the scene triangles 41 if (!preprocessor->LoadObjects(visibilitySolution, pvsObjects, preprocessor->mObjects)) 42 { 43 Ogre::LogManager::getSingleton().logMessage("objects cannot be loaded"); 44 return false; 45 } 46 } 47 else 48 { 49 Ogre::LogManager::getSingleton().logMessage("scene cannot be loaded"); 21 50 return false; 22 23 // read in triangle size 24 int numTriangles; 51 } 25 52 26 samplesIn.read(reinterpret_cast<char *>(&numTriangles), sizeof(int)); 27 objects.reserve(numTriangles); 28 29 while (1) 30 { 31 GtpVisibilityPreprocessor::Triangle3 tri; 32 33 samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 0), 34 sizeof(GtpVisibilityPreprocessor::Vector3)); 35 samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 1), 36 sizeof(GtpVisibilityPreprocessor::Vector3)); 37 samplesIn.read(reinterpret_cast<char *>(tri.mVertices + 2), 38 sizeof(GtpVisibilityPreprocessor::Vector3)); 53 std::stringstream d; 54 d << "successfully loaded " << pvsObjects.size() << " objects"; 39 55 40 // end of file reached 41 if (samplesIn.eof()) 42 break; 56 Ogre::LogManager::getSingleton().logMessage(d.str()); 43 57 44 GtpVisibilityPreprocessor::TriangleIntersectable *obj = 45 new GtpVisibilityPreprocessor::TriangleIntersectable(tri); 46 objects.push_back(obj); 58 GtpVisibilityPreprocessor::ObjectContainer::const_iterator oit, oit_end = pvsObjects.end(); 59 60 int i = 0; 61 for (oit = pvsObjects.begin(); oit != oit_end; ++ oit, ++ i) 62 {Ogre::LogManager::getSingleton().logMessage("r"); 63 const Ogre::String entname = "Object" + i; 64 65 Ogre::Entity *ent = CreateEntity(entname, *oit); 66 67 const Ogre::String nodeName = entname + "/Node"; 68 root->createChildSceneNode(nodeName); 47 69 } 48 49 return true; 70 71 delete preprocessor; 72 73 return false; 50 74 } 51 75 52 76 53 const std::vector<Ogre::Entity *> &ObjReader::GetObjects() const 54 { 55 return mObjects; 56 } 57 58 59 Ogre::Entity *ObjReader::CreateEntity(const std::string &name) 60 // ObjMeshData *mData, 61 // Ogre::Vector3 *translation) 77 Ogre::Entity *ObjReader::CreateEntity(const std::string &name, 78 GtpVisibilityPreprocessor::Intersectable *object) 62 79 { 63 80 using namespace Ogre; 81 //using namespace GtpVisibilityPreprocessor; 82 64 83 Entity *entity; 65 84 66 67 std::string meshName = name.substr(name.find('/',0), name.length()) + "/Mesh"; 85 GtpVisibilityPreprocessor::BvhLeaf *bvhObj = 86 static_cast<GtpVisibilityPreprocessor::BvhLeaf *>(object); 87 88 std::string meshName = name + "/Mesh"; 68 89 std::string entityName = name + "/Entity"; 69 90 70 91 MeshPtr mesh = MeshManager::getSingleton().createManual(meshName, "ObjGroup"); 71 92 SubMesh* submesh = mesh->createSubMesh(); 72 int nbVertices = 99992; 93 73 94 // We must create the vertex data, indicating how many vertices there will be 74 95 submesh->useSharedVertices = false; 75 96 submesh->vertexData = new VertexData(); 76 97 submesh->vertexData->vertexStart = 0; 77 submesh->vertexData->vertexCount = nbVertices;98 submesh->vertexData->vertexCount = (int)bvhObj->mObjects.size() * 3; 78 99 79 100 static const unsigned short source = 0; … … 82 103 VertexDeclaration* declaration = HardwareBufferManager::getSingleton().createVertexDeclaration(); 83 104 84 offset += declaration->addElement(source, offset,VET_FLOAT3,VES_POSITION).getSize();105 offset += declaration->addElement(source, offset, VET_FLOAT3,VES_POSITION).getSize(); 85 106 // offset += declaration->addElement(source,offset,VET_FLOAT3,VES_NORMAL).getSize(); 86 107 // offset += declaration->addElement(source,offset,VET_FLOAT2,VES_TEXTURE_COORDINATES).getSize(); … … 89 110 int numVertices = 0; 90 111 91 HardwareVertexBufferSharedPtr vbuffer = 92 HardwareBufferManager::getSingleton().createVertexBuffer(declaration->getVertexSize(source), // size of one whole vertex93 submesh->vertexData->vertexCount, // number of vertices94 HardwareBuffer::HBU_STATIC_WRITE_ONLY, // usage95 false); // no shadow buffer112 HardwareVertexBufferSharedPtr vbuffer = HardwareBufferManager::getSingleton(). 113 createVertexBuffer(declaration->getVertexSize(source), 114 submesh->vertexData->vertexCount, 115 HardwareBuffer::HBU_STATIC_WRITE_ONLY, 116 false); 96 117 97 98 // No we get access to the buffer to fill it. During so we record the bounding box. 118 // No we get access to the buffer to fill it. During so we record the bounding box. 99 119 AxisAlignedBox aabox; 100 120 101 121 float* vdata = static_cast<float*>(vbuffer->lock(HardwareBuffer::HBL_DISCARD)); 102 122 103 for (size_t i = 0; i < nbVertices; ++ i) 123 GtpVisibilityPreprocessor::ObjectContainer::const_iterator oit, oit_end = bvhObj->mObjects.end(); 124 125 for (oit = bvhObj->mObjects.begin(); oit != oit_end; ++ oit) 104 126 { 105 // Position 106 Vector3 position;// = 20.0f*positions[i]; 107 *vdata++ = position.x; 108 *vdata++ = position.y; 109 *vdata++ = position.z; 110 aabox.merge(position); 111 // Normal 112 Vector3 normal = position.normalisedCopy(); 113 *vdata++ = normal.x; 114 *vdata++ = normal.y; 115 *vdata++ = normal.z; 127 GtpVisibilityPreprocessor::TriangleIntersectable *tObj = 128 static_cast<GtpVisibilityPreprocessor::TriangleIntersectable *>(*oit); 129 130 GtpVisibilityPreprocessor::Triangle3 tri = tObj->GetItem(); 116 131 117 // Texture coordinate118 Vector2 tcoordinate;// = tcoordinates[i];119 *vdata ++ = tcoordinate.x;132 for (int i = 0; i < 3; ++ i) 133 { 134 Vector3 vtx(tri.mVertices[i]); 120 135 121 *vdata ++ = tcoordinate.y; 136 *vdata ++ = vtx.x; 137 *vdata ++ = vtx.y; 138 *vdata ++ = vtx.z; 122 139 140 aabox.merge(vtx); 141 } 123 142 } 124 143 … … 126 145 127 146 // We must indicate the bounding box 128 //mesh->_setBounds(aabox);147 mesh->_setBounds(aabox); 129 148 130 //mesh->_setBoundingSphereRadius((aabox.getMaximum()-aabox.getMinimum()).length()/2.0); 131 149 mesh->_setBoundingSphereRadius((aabox.getMaximum()-aabox.getMinimum()).length()/2.0); 132 150 mesh->load(); 133 151 134 152 // Create an entity with the mesh 135 //entity = mSceneManager->createEntity(meshName, entityName);153 entity = mSceneManager->createEntity(meshName, entityName); 136 154 137 155 return entity; -
GTP/trunk/Lib/Vis/OnlineCullingCHC/ObjReader/src/ObjReader.vcproj
r2112 r2119 73 73 Name="VCCLCompilerTool" 74 74 AdditionalIncludeDirectories=""$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\Samples\Common\include";..\include;..\..\..\Preprocessing\src" 75 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE "75 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;OBJREADER_EXPORTS;GTP_VISIBILITY_MODIFIED_OGRE;GAMETOOLS_ILLUMINATION_MODULE1" 76 76 RuntimeLibrary="2" 77 77 UsePrecompiledHeader="0" -
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.h
r2115 r2119 365 365 { 366 366 friend class ViewCellsParseHandlers; 367 friend class ObjectsParseHandlers; 367 368 friend class HierarchyManager; 368 369 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r2042 r2119 236 236 237 237 while (fgets(str, 1000, file) != NULL) 238 {++ line; 238 { 239 ++ line; 239 240 switch (str[0]) 240 241 { 241 242 case 'v': // vertex or normal 242 243 { 243 switch (str[1]) { 244 switch (str[1]) 245 { 244 246 case 'n' : 245 246 247 // normal do nothing 248 break; 247 249 default: 248 249 250 251 //cout << "vertex: " << vertices.back() << endl;250 float x, y, z; //cout << "v"; 251 sscanf(str + 1, "%f %f %f", &x, &y, &z); 252 vertices.push_back(Vector3(x,y,z)); 253 252 254 } 253 255 break; … … 258 260 { 259 261 Face *face = LoadFace(str, vertices, hashTable); 262 260 263 if (!face) break; 261 264 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.cpp
r2115 r2119 88 88 //if (!is_sorted(mPvsObjects.begin(), mPvsObjects.end(), ilt)) 89 89 sort(mPvsObjects.begin(), mPvsObjects.end(), ilt); 90 90 Debug << "here333"; 91 91 //if (!is_sorted(mPreprocessorObjects.begin(), mPreprocessorObjects.end(), ilt)) 92 92 //sort(mPreprocessorObjects.begin(), mPreprocessorObjects.end(), ilt); … … 133 133 if (element == "Leaf") 134 134 { 135 //cout << "l";136 135 StartBvhLeaf(attributes); 137 136 } … … 196 195 } 197 196 197 198 198 void ObjectsParseHandlers::StartBvhLeaf(AttributeList& attributes) 199 199 { … … 217 217 sscanf(ptr, "%f %f %f", &maxBox.x, &maxBox.y, &maxBox.z); 218 218 } 219 /*if (attrName == "objects")219 if (attrName == "objects") 220 220 { 221 221 StartBvhLeafObjects(objects, ptr); 222 } */222 } 223 223 } 224 224 … … 227 227 BvhLeaf *leaf = new BvhLeaf(box, NULL, (int)objects.size()); 228 228 229 //leaf->mObjects = objects;230 //BvHierarchy::AssociateObjectsWithLeaf(leaf);229 leaf->mObjects = objects; 230 BvHierarchy::AssociateObjectsWithLeaf(leaf); 231 231 232 232 // new pvs object … … 370 370 371 371 GzFileInputSource isource(myFilePath); 372 Debug<<"here93" << endl; 372 373 parser->parse(isource); 373 374 #else … … 375 376 376 377 #endif 377 378 Debug<<"here932" << endl; 378 379 const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis(); 379 380 duration = endMillis - startMillis; -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParser.h
r2115 r2119 15 15 { 16 16 public: 17 ObjectsParser(): Parser() {} 17 18 ObjectsParser(): Parser() {} 18 19 19 20 ObjectContainer &pvsObjects,21 const ObjectContainer &preprocessorObjects);20 bool ParseObjects(const string &filename, 21 ObjectContainer &pvsObjects, 22 const ObjectContainer &preprocessorObjects); 22 23 }; 23 24 -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjectsParserXerces.h
r2115 r2119 25 25 { 26 26 public: 27 28 friend class BvHierarchy; 27 29 28 30 // ----------------------------------------------------------------------- -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r2117 r2119 479 479 const int files = SplitFilenames(filename, filenames); 480 480 cout << "number of input files: " << files << endl; 481 481 482 bool result = false; 482 483 bool isObj = false; … … 533 534 534 535 result = parser->ParseFile(filename, 535 mSceneGraph->GetRoot(),536 mLoadMeshes,537 fi);538 536 mSceneGraph->GetRoot(), 537 mLoadMeshes, 538 fi); 539 539 540 cout << "loaded " << (int)mSceneGraph->GetRoot()->mGeometry.size() << " entities" << endl; 541 540 542 // only works for triangles 541 543 if (result && !mLoadMeshes) 542 544 { 543 545 cout << "exporting binary obj to " << bnFile << "... " << endl; 546 544 547 ExportBinaryObj(bnFile, mSceneGraph->GetRoot()); 548 545 549 cout << "finished" << endl; 546 550 } 547 551 548 552 delete parser; 549 }550 else if (0)551 {552 ExportBinaryObj("../data/test.bn", mSceneGraph->GetRoot());553 553 } 554 554 } … … 741 741 742 742 Environment::GetSingleton()->GetStringValue("ViewCells.filename", buf); 743 744 743 cout << "loading objects from " << buf << endl; 745 744 746 745 // load objects which will be used as pvs entries 747 746 ObjectContainer pvsObjects; 748 749 LoadObjects(buf, pvsObjects, mObjects); 747 if (0) LoadObjects(buf, pvsObjects, mObjects); 750 748 751 749 cout << "loading view cells from " << buf << endl; … … 1649 1647 { 1650 1648 ObjectsParser parser; 1651 1649 Debug << "here322 " << filename << endl; 1652 1650 const bool success = parser.ParseObjects(filename, 1653 1651 pvsObjects, -
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorFactory.cpp
r1942 r2119 14 14 Preprocessor *PreprocessorFactory::CreatePreprocessor(const string &preprocessorType) 15 15 { 16 Debug << "here9191" << endl; 16 17 if (preprocessorType == "vss") 17 { 18 {Debug << "here21112" << endl; 18 19 return new VssPreprocessor(); 19 20 } -
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r2105 r2119 2264 2264 2265 2265 int startIndex = (int)rays.size(); 2266 // Debug<<"B"<<flush; 2267 2266 2268 2267 AxisAlignedBox3 box = GetBBox(leaf); 2269 2268 AxisAlignedBox3 dirBox = GetDirBBox(leaf); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2117 r2119 2609 2609 } 2610 2610 #else 2611 cout<<"b";2612 2611 pvs.AddSample(obj, pdf); 2613 2612 #endif -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp
r2115 r2119 464 464 if (element == "BoundingBox") 465 465 { 466 // cout << "b";467 466 StartBoundingBox(attributes); 468 467 }
Note: See TracChangeset
for help on using the changeset viewer.