Changeset 1272
- Timestamp:
- 08/24/06 12:13:34 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r1261 r1272 499 499 if ((int)(leaf->mObjects.size()) > mBvhStats.maxObjectRefs) 500 500 mBvhStats.maxObjectRefs = (int)leaf->mObjects.size(); 501 501 502 } 502 503 … … 1593 1594 } 1594 1595 1595 1596 } 1596 } 1597 -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r1248 r1272 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: po 21. VIII 11:15:0820063 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 22. VIII 22:47:13 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
r1233 r1272 15 15 16 16 17 17 18 namespace GtpVisibilityPreprocessor { 18 19 … … 48 49 map<int, Vector3> &hashTable) 49 50 { 50 cout << "f";51 // cout << "f"; 51 52 52 53 char *pch; … … 156 157 157 158 SceneGraphNode *root = new SceneGraphNode; 158 159 cout<<"HERE2!\n"; 159 160 int meshGrouping; 160 161 Environment::GetSingleton()->GetIntValue("ObjParser.meshGrouping", meshGrouping); … … 167 168 { 168 169 float x,y,z; 169 cout << "v";170 //cout << "v"; 170 171 171 172 // vertex -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
r1264 r1272 238 238 239 239 if (mRayCastMethod == Preprocessor::INTEL_RAYCASTER) 240 result = parser->ParseFile(filename, &mSceneGraph->mRoot, mLoadPolygonsAsMeshes, &mFaceParents); 240 result = parser->ParseFile(filename, &mSceneGraph->mRoot, 241 mLoadPolygonsAsMeshes, 242 &mFaceParents); 241 243 else 242 243 244 result = parser->ParseFile(filename, &mSceneGraph->mRoot, mLoadPolygonsAsMeshes); 245 244 246 delete parser; 245 247 … … 248 250 mSceneGraph->mRoot = new SceneGraphNode; 249 251 for (int i= 0; i < filenames.size(); i++) { 250 if (strstr(filenames[i].c_str(), ".x3d")) 251 parser = new X3dParser; 252 else 253 parser = new UnigraphicsParser; 254 255 SceneGraphNode *node; 256 if (parser->ParseFile(filenames[i], &node)) { 257 mSceneGraph->mRoot->mChildren.push_back(node); 258 // at least one file parsed 259 result = true; 260 } 261 delete parser; 252 if (strstr(filenames[i].c_str(), ".x3d")) 253 parser = new X3dParser; 254 else 255 parser = new UnigraphicsParser; 256 257 SceneGraphNode *node; 258 bool success; 259 260 if (mRayCastMethod == Preprocessor::INTEL_RAYCASTER) 261 success = parser->ParseFile(filename, &node, 262 mLoadPolygonsAsMeshes, 263 &mFaceParents); 264 else 265 success = parser->ParseFile(filename, &node, mLoadPolygonsAsMeshes); 266 267 if (success) { 268 mSceneGraph->mRoot->mChildren.push_back(node); 269 // at least one file parsed 270 result = true; 271 } 272 273 delete parser; 262 274 } 263 275 } 264 276 265 277 266 278 if (result) 267 {279 { 268 280 // HACK 269 281 if (ADDITIONAL_GEOMETRY_HACK) … … 769 781 case INTEL_RAYCASTER: 770 782 #ifdef GTP_INTERNAL 771 return mlrtaLoadAS(externKdTree.c_str()); 783 cout<<"Ray Cast file: "<<externKdTree<<endl; 784 return mlrtaLoadAS(externKdTree.c_str()); 772 785 #endif 773 786 case INTERNAL_RAYCASTER: … … 851 864 float pforg[3]; 852 865 float pfdir[3]; 853 //double pfnorm[3];866 double pfnorm[3]; 854 867 855 868 pforg[0] = viewPoint[0]; pforg[1] = viewPoint[1]; pforg[2] = viewPoint[2]; … … 895 908 ) 896 909 { 897 int hits = 0; 898 static Ray ray; 899 900 AxisAlignedBox3 sbox = box; 901 sbox.Enlarge(Vector3(-Limits::Small)); 902 903 if (!sbox.IsInside(viewPoint)) 910 911 int hits = 0; 912 static Ray ray; 913 Intersectable *objectA, *objectB; 914 Vector3 pointA, pointB; 915 916 // AxisAlignedBox3 box = Union(mKdTree->GetBox(), mViewCellsManager->GetViewSpaceBox()); 917 918 919 AxisAlignedBox3 sbox = box; 920 sbox.Enlarge(Vector3(-Limits::Small)); 921 if (!sbox.IsInside(viewPoint)) 922 return 0; 923 924 SetupRay(ray, viewPoint, direction); 925 ray.mFlags &= ~Ray::CULL_BACKFACES; 926 927 // cast ray to KD tree to find intersection with other objects 928 float bsize = Magnitude(box.Size()); 929 930 931 if (mKdTree->CastRay(ray)) { 932 objectA = ray.intersections[0].mObject; 933 pointA = ray.Extrap(ray.intersections[0].mT); 934 if (mDetectEmptyViewSpace) 935 if (DotProd(ray.intersections[0].mNormal, direction) >= 0) { 936 // discard the sample 904 937 return 0; 905 906 SetupRay(ray, viewPoint, direction); 907 908 // cast ray to KD tree to find intersection with other objects 909 Intersectable *objectA, *objectB; 910 911 Vector3 pointA; 912 Vector3 pointB; 913 914 //float bsize = Magnitude(box.Size()); 915 if (!mDetectEmptyViewSpace) 916 ray.mFlags &= ~Ray::CULL_BACKFACES; 938 } 939 940 } else { 941 objectA = NULL; 942 // compute intersection with the scene bounding box 943 float tmin, tmax; 944 if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax) 945 pointA = ray.Extrap(tmax); 917 946 else 918 ray.mFlags |= Ray::CULL_BACKFACES; 919 920 if (mKdTree->CastRay(ray)) 921 { 922 objectA = ray.intersections[0].mObject; 923 pointA = ray.Extrap(ray.intersections[0].mT); 924 } 925 else 926 { 927 objectA = NULL; 928 // compute intersection with the scene bounding box 929 float tmin, tmax; 930 if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax) 931 pointA = ray.Extrap(tmax); 932 else 933 return 0; 934 } 935 936 // matt: point A could be undefined? 937 938 // cast ray into opposite direction 939 if (1 && mDetectEmptyViewSpace) { 940 SetupRay(ray, pointA, -direction); 941 } else 942 SetupRay(ray, viewPoint, -direction); 943 944 if (!mDetectEmptyViewSpace) 945 ray.mFlags &= ~Ray::CULL_BACKFACES; 947 return 0; 948 } 949 950 951 SetupRay(ray, viewPoint, -direction); 952 ray.mFlags &= ~Ray::CULL_BACKFACES; 953 954 if (mKdTree->CastRay(ray)) { 955 objectB = ray.intersections[0].mObject; 956 pointB = ray.Extrap(ray.intersections[0].mT); 957 if (mDetectEmptyViewSpace) 958 if (DotProd(ray.intersections[0].mNormal, direction) <= 0) { 959 // discard the sample 960 return 0; 961 } 962 } else { 963 objectB = NULL; 964 float tmin, tmax; 965 if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax) 966 pointB = ray.Extrap(tmax); 946 967 else 947 ray.mFlags |= Ray::CULL_BACKFACES; 948 949 if (mKdTree->CastRay(ray)) 950 { 951 objectB = ray.intersections[0].mObject; 952 pointB = ray.Extrap(ray.intersections[0].mT); 953 } 954 else 955 { 956 objectB = NULL; 957 float tmin, tmax; 958 959 if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax) 960 pointB = ray.Extrap(tmax); 961 else 962 return 0; 963 } 964 965 //bool thesame = objectA && (objectA == objectB); 966 967 // if (objectA == NULL && objectB != NULL) { 968 if (1 && mDetectEmptyViewSpace) 969 { 970 // cast again to ensure that there is no objectA 971 SetupRay(ray, pointB, direction); 972 ray.mFlags |= Ray::CULL_BACKFACES; 973 974 if (mKdTree->CastRay(ray)) 975 { 976 objectA = ray.intersections[0].mObject; 977 pointA = ray.Extrap(ray.intersections[0].mT); 978 } 979 } 980 981 982 VssRay *vssRay = NULL; 983 984 bool validSample = (objectA != objectB); 985 986 //if (validSample && thesame) Debug << "warning!!" << endl; 987 988 if (0 && mDetectEmptyViewSpace) 989 { 990 // consider all samples valid 991 // check if the viewpoint lies on the line segment AB 992 if (Distance(pointA, pointB) < 993 Distance(viewPoint, pointA) + Distance(viewPoint, pointB) - Limits::Small) 994 { 995 validSample = false; 996 } 997 } 998 999 if (validSample) 1000 { 1001 if (objectA) 1002 { 1003 vssRay = new VssRay(pointB, 1004 pointA, 1005 objectB, 1006 objectA, 1007 probability, 1008 mPass); 1009 vssRays.push_back(vssRay); 1010 hits ++; 1011 } 1012 1013 if (objectB) 1014 { 1015 vssRay = new VssRay(pointA, 1016 pointB, 1017 objectA, 1018 objectB, 1019 probability, 1020 mPass); 1021 vssRays.push_back(vssRay); 1022 hits ++; 1023 } 1024 //Debug << "internal ray: " << *vssRay << endl << endl; 1025 } 1026 //cout << "b"; 1027 return hits; 968 return 0; 969 } 970 971 972 VssRay *vssRay = NULL; 973 bool validSample = (objectA != objectB); 974 if (validSample) { 975 if (objectA) { 976 vssRay = new VssRay(pointB, 977 pointA, 978 objectB, 979 objectA, 980 mPass, 981 probability 982 ); 983 vssRays.push_back(vssRay); 984 hits ++; 985 } 986 987 if (objectB) { 988 vssRay = new VssRay(pointA, 989 pointB, 990 objectA, 991 objectB, 992 mPass, 993 probability 994 ); 995 vssRays.push_back(vssRay); 996 hits ++; 997 } 998 } 999 1000 return hits; 1028 1001 } 1029 1002 -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
r1264 r1272 134 134 135 135 enum { 136 INTERNAL_RAYCASTER ,136 INTERNAL_RAYCASTER = 0, 137 137 INTEL_RAYCASTER 138 138 }; … … 146 146 147 147 virtual void CastRays(SimpleRayContainer &rays, 148 148 VssRayContainer &vssRays) {}; 149 149 150 150 /** Returns a view cells manager with respect to the given name. -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r1261 r1272 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost \"22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_LIB;" 24 24 MinimalRebuild="TRUE" … … 107 107 <Tool 108 108 Name="VCCLCompilerTool" 109 Optimization="0" 109 Optimization="3" 110 GlobalOptimizations="TRUE" 110 111 InlineFunctionExpansion="0" 111 FavorSizeOrSpeed="0" 112 FavorSizeOrSpeed="1" 113 OptimizeForProcessor="3" 112 114 OptimizeForWindowsApplication="TRUE" 113 AdditionalIncludeDirectories="..\include;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";..\src; "$(CG_INC_PATH)";..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(BOOST_INCLUDE)";..\..\Preprocessing\MultiLevelRayTracing"114 PreprocessorDefinitions="WIN32;NDEBUG;_LIB "115 AdditionalIncludeDirectories="..\include;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\..\Preprocessing\MultiLevelRayTracing" 116 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL" 115 117 ExceptionHandling="TRUE" 116 118 RuntimeLibrary="2" … … 199 201 <Tool 200 202 Name="VCCLCompilerTool" 201 Optimization=" 0"203 Optimization="3" 202 204 InlineFunctionExpansion="0" 203 205 FavorSizeOrSpeed="0" 206 OptimizeForProcessor="3" 204 207 OptimizeForWindowsApplication="TRUE" 205 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces; "$(BOOST_INCLUDE)";..\MultiLevelRayTracing"208 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing" 206 209 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL" 207 210 ExceptionHandling="TRUE" -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1251 r1272 86 86 { 87 87 for (int i=0; i < rays.size(); i++) { 88 CastRay(rays[i].mOrigin, rays[i].mDirection, rays[i].mPdf, vssRays, mViewCellsManager->GetViewSpaceBox()); 88 CastRay(rays[i].mOrigin, 89 rays[i].mDirection, 90 rays[i].mPdf, 91 vssRays, 92 mViewCellsManager->GetViewSpaceBox()); 89 93 if (i % 10000 == 0) 90 94 cout<<"."; -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r1264 r1272 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="..\include;..\src; "$(CG_INC_PATH)";..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(BOOST_INCLUDE)""22 AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" 24 24 MinimalRebuild="TRUE" … … 122 122 <Tool 123 123 Name="VCCLCompilerTool" 124 Optimization="0" 125 AdditionalIncludeDirectories="..\include;"$(BOOST_INCLUDE)";"$(QTDIR)\include\QtOpenGl";..\src;"$(CG_INC_PATH)";..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing" 126 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 124 Optimization="3" 125 GlobalOptimizations="TRUE" 126 FavorSizeOrSpeed="1" 127 OptimizeForProcessor="3" 128 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;"$(QTDIR)\include\QtOpenGl";..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\MultiLevelRayTracing" 129 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL" 127 130 RuntimeLibrary="2" 128 131 RuntimeTypeInfo="TRUE" … … 135 138 <Tool 136 139 Name="VCLinkerTool" 137 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib "140 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib RTWorld.lib RTScene.lib" 138 141 OutputFile="$(OutDir)/Preprocessor.exe" 139 142 LinkIncremental="1" 140 AdditionalLibraryDirectories="..\s upport\xercesc\lib\;..\support\zlib\lib\;..\support\devil\lib;..\include;..\src\GL;"$(CG_LIB_PATH)";..\lib\release;..\..\Preprocessing\lib\release;"$(BOOST_LIB)";..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\..\Preprocessing\MultiLevelRayTracing\RTScene\Release;..\..\Preprocessing\MultiLevelRayTracing\RTWorld\Release"143 AdditionalLibraryDirectories="..\src\mlrt;"$(CG_LIB_PATH)";..\src\GL;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\..\Preprocessing\MultiLevelRayTracing\RTScene\Release;..\..\Preprocessing\MultiLevelRayTracing\RTWorld\Release" 141 144 GenerateDebugInformation="FALSE" 142 145 SubSystem="1" … … 174 177 <Tool 175 178 Name="VCCLCompilerTool" 176 Optimization=" 0"177 AdditionalIncludeDirectories="..\include; "$(BOOST_INCLUDE)";"$(QTDIR)\include\QtOpenGl";..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces"179 Optimization="3" 180 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;"$(QTDIR)\include\QtOpenGl";..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces" 178 181 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL" 179 182 RuntimeLibrary="2" … … 190 193 OutputFile="../bin/release/Preprocessor.exe" 191 194 LinkIncremental="1" 192 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release; "$(BOOST_LIB)";..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release"195 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release" 193 196 GenerateDebugInformation="FALSE" 194 197 SubSystem="1" -
GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
r1221 r1272 224 224 } 225 225 226 226 227 //-- each polygon is one single mesh 227 228 if (mLoadPolygonsAsMeshes) -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r1248 r1272 6 6 Scene { 7 7 8 filename ../data/CityModel/CityModel.obj 9 # filename ../data/GrandCanyon/grandcanyon1_RotXmin90.obj 8 10 # filename ../data/glasgow/glasgow1.x3d 9 11 # filename vienna.x3d … … 11 13 #filename ../data/vienna/vienna-buildings.x3d 12 14 #filename ../data/vienna/city1500_flat_1.x3d 13 filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d15 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d 14 16 #;../data/vienna/vienna-plane.x3d;../data/vienna/vienna-roads.x3d 15 17 # filename ../data/vienna/viewcells-25-sel.x3d … … 31 33 # stored sample rays 32 34 samplesFilename rays.out 33 useGlRenderer true35 useGlRenderer false 34 36 useGlDebugger false 37 # 0 = INTERNAL 1 = MLRT 38 39 rayCastMethod 1 40 35 41 # type sampling 36 42 # type vss … … 46 52 visibilityFilterWidth 0.01 47 53 visibilityFile visibility.xml 48 loadPolygonsAsMeshes false54 loadPolygonsAsMeshes true 49 55 } 50 56 … … 103 109 RssPreprocessor { 104 110 samplesPerPass 1000 105 initialSamples 2000000106 vssSamples 30000000107 vssSamplesPerPass 1000000111 initialSamples 1000000 112 vssSamples 10000000 113 vssSamplesPerPass 500000 108 114 useImportanceSampling true 109 115 … … 143 149 maxStaticMemory 100 144 150 145 splitType regular151 # splitType regular 146 152 # splitType heuristic 147 #splitType hybrid153 splitType hybrid 148 154 hybridDepth 10 149 155 splitUseOnlyDrivingAxis false … … 187 193 MeshKdTree { 188 194 Termination { 189 minCost 8195 minCost 32 190 196 maxDepth 18 191 197 maxCostRatio 0.9 … … 291 297 # filename ../data/soda/soda5-viewcell-single.xm 292 298 # filename ../data/soda/vienna-viewcell-single.xml 299 filename ../data/CityModel/CityModel-viewcells-5000.xml 293 300 294 301 … … 298 305 # filename ../data/vienna/viewcells_vienna2.xml 299 306 # filename ../data/vienna/vienna_simple-21-04-avs2-viewCells.xml 300 filename ../data/vienna/vienna-viewcells-5000.xml307 # filename ../data/vienna/vienna-viewcells-5000.xml 301 308 302 309 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1264 r1272 1 #ifdef GTP_INTERNAL 2 //#define USE_QT 0 3 #endif 4 5 #define USE_BOOST 1 6 1 7 #ifdef UNICODE 2 8 #undef UNICODE … … 20 26 #include "ViewCell.h" 21 27 #include "SceneGraph.h" 28 29 #if USE_BOOST 22 30 #include "BoostPreprocessorThread.h" 31 #endif 32 23 33 #include "RenderSampler.h" 24 34 #include "ResourceManager.h" 25 35 #include "GlRenderer.h" 36 37 #if USE_QT 38 #include "QtRenderer/QtGlRenderer.h" 39 #endif 26 40 27 41 #define USE_EXE_PATH false … … 92 106 93 107 108 string ReplaceSuffix(string filename, 109 string a, 110 string b) 111 { 112 string result = filename; 113 114 int pos = filename.rfind(a, filename.size()-1); 115 if (pos == filename.size() - a.size()) { 116 result.replace(pos, a.size(), b); 117 } 118 return result; 119 } 120 94 121 int 95 122 main(int argc, char **argv) … … 101 128 //be ignored. Use it as you will! 102 129 //note: from GDNet Direct [3.8.04 - 3.14.04] void detectMemoryLeaks() { 103 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); 104 _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE); 105 _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR); 106 130 #if 0 131 _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); 132 _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE); 133 _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR); 134 #endif 135 136 cerr<<"HERE!\n"; 107 137 int returnCode = 0; 108 138 … … 163 193 string filename(buff); 164 194 preprocessor->LoadScene(filename); 165 195 196 string rayCastFile = ReplaceSuffix(filename, ".obj", ".kdf"); 197 166 198 //-- initialize external ray casters 167 if (preprocessor->InitRayCast( "../data/grandcanyon1_RotXmin90.kdf"))168 {199 if (preprocessor->InitRayCast(rayCastFile)) 200 { 169 201 cout << "ray casting initialized!" << endl; 170 }202 } 171 203 else 172 204 { … … 213 245 214 246 // create a preprocessor thread (note: capsulates calls to boost fuctions!) 247 //PreprocessorThread *pt = PreprocessorThreadFactory::Create(preprocessor); 248 #if USE_BOOST 215 249 BoostPreprocessorThread pt(preprocessor); 216 217 //PreprocessorThread *pt = PreprocessorThreadFactory::Create(preprocessor); 218 250 #endif 251 219 252 bool guiSupported = false; 220 253 if (preprocessor->mUseGlRenderer || preprocessor->mUseGlDebugger) … … 222 255 cout << "using gl widget" << endl; 223 256 // create and run the preprocessor application in a parallel thread 257 #if USE_BOOST 224 258 pt.InitThread(); 259 #endif 225 260 //pt.RunThread(); 226 261 227 262 // display the render widget 228 if (!rendererWidget) 263 if (!rendererWidget) { 264 265 #if !USE_QT 229 266 guiSupported = LoadMyDll(); 267 #else 268 rendererWidget = new QtGlRendererWidget(preprocessor->mSceneGraph, 269 preprocessor->mViewCellsManager, 270 preprocessor->mKdTree); 271 #endif 272 } 273 230 274 } 231 275 … … 237 281 if (!(preprocessor->mUseGlRenderer || preprocessor->mUseGlDebugger)) { 238 282 // just call the mail method -> will be executed in the main thread 283 #if USE_BOOST 239 284 pt.Main(); 285 #endif 240 286 } 241 287 -
GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
r1248 r1272 3 3 4 4 TEMPLATE = app 5 5 6 6 7 TARGET = preprocessor … … 31 32 CONFIG(qt) { 32 33 win32:LIBPATH += "d:/Programs/NVIDIA Corporation/Cg/lib" 34 CONFIG(debug) { 35 LIBPATH += QtRenderer/debug 36 } 37 38 CONFIG(release) { 39 LIBPATH += QtRenderer/release 40 } 33 41 } 34 42 … … 46 54 } 47 55 48 win32:LIBS += xerces-c_2.lib devil.lib ilu.lib ilut.lib \ 49 glew32.lib zlib.lib 56 win32:LIBS += devil.lib ilu.lib ilut.lib glew32.lib zlib.lib zdll.lib zziplibd.lib 57 58 CONFIG(release) { 59 win32:LIBS += xerces-c_2.lib 60 } 61 62 CONFIG(debug) { 63 win32:LIBS += xerces-c_2D.lib 64 } 50 65 51 66 QMAKE_LFLAGS_CONSOLE=/NODEFAULTLIB:LIBCMT 52 67 53 68 CONFIG(qt) { 54 win32:LIBS += cg.lib cgGL.lib 69 win32:LIBS += cg.lib cgGL.lib 70 LIBS += QtRenderer.lib 55 71 } 56 72 … … 76 92 GzBinFileInputStream.cpp GzFileInputSource.cpp \ 77 93 LogManager.cpp \ 78 SamplingStrategy.cpp KdIntersectable.cpp BoostPreprocessorThread.cpp \ 79 OspTree.cpp HierarchyManager.cpp ObjParser.cpp VspTree.cpp BvHierarchy.cpp 80 94 SamplingStrategy.cpp KdIntersectable.cpp \ 95 OspTree.cpp HierarchyManager.cpp ObjParser.cpp VspTree.cpp \ 96 BvHierarchy.cpp \ 97 BoostPreprocessorThread.cpp 81 98 82 99 … … 85 102 } 86 103 87 #VspKdTree.cpp ResourceManager.cpp
Note: See TracChangeset
for help on using the changeset viewer.