Changeset 1694 for GTP/trunk/Lib/Vis
- Timestamp:
- 10/28/06 23:39:26 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 4 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp
r1421 r1694 177 177 case Intersectable::TRIANGLE_INTERSECTABLE: 178 178 { 179 180 181 182 179 const Triangle3 triangle = dynamic_cast<TriangleIntersectable *>(object)->GetItem(); 180 Polygon3 poly(triangle); 181 ExportPolygon(&poly); 182 break; 183 183 } 184 184 case Intersectable::BVH_INTERSECTABLE: -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.cpp
r1692 r1694 2 2 #include "Mesh.h" 3 3 #include "Triangle3.h" 4 #include "KdTree.h" 4 5 5 6 … … 88 89 return GetRandomSurfacePoint(point, normal); 89 90 } 90 91 92 93 KdIntersectable::KdIntersectable(KdNode *item, const AxisAlignedBox3 &box) : 94 IntersectableWrapper<KdNode *>(item) 95 { 96 mBox = box; 91 97 } 98 99 } -
GTP/trunk/Lib/Vis/Preprocessing/src/IntersectableWrapper.h
r1686 r1694 16 16 class Ray; 17 17 struct Triangle3; 18 18 class KdTree; 19 19 20 20 … … 147 147 { 148 148 public: 149 KdIntersectable(KdNode *item): 150 IntersectableWrapper<KdNode *>(item) {} 151 152 int Type() const 149 AxisAlignedBox3 mBox; 150 151 KdIntersectable(KdNode *item, const AxisAlignedBox3 &box); 152 153 154 int Type() const 153 155 { 154 156 return Intersectable::KD_INTERSECTABLE; 155 157 } 156 158 157 AxisAlignedBox3 GetBox() const { return mBbox; } 158 AxisAlignedBox3 mBbox; 159 160 AxisAlignedBox3 GetBox() const { 161 return mBox; 162 } 159 163 }; 160 164 -
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r1633 r1694 1410 1410 1411 1411 // not in map => create new entry 1412 KdIntersectable *kdObj = new KdIntersectable(node );1412 KdIntersectable *kdObj = new KdIntersectable(node, GetBox(node)); 1413 1413 mKdIntersectables[node] = kdObj; 1414 1414 -
GTP/trunk/Lib/Vis/Preprocessing/src/Makefile
r1613 r1694 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (2.00a) (Qt 4.1.2) on: s t 11. X 21:13:40 20063 # Generated by qmake (2.00a) (Qt 4.1.2) on: so 28. X 21:20:40 2006 4 4 # Project: preprocessor.pro 5 5 # Template: app -
GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp
r1654 r1694 1830 1830 1831 1831 // not in map => create new entry 1832 KdIntersectable *kdObj = new KdIntersectable(node );1832 KdIntersectable *kdObj = new KdIntersectable(node, GetBoundingBox(node)); 1833 1833 mKdIntersectables[node] = kdObj; 1834 1834 -
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1673 r1694 192 192 193 193 return pvsReduction + pvsEnlargement; 194 } 194 } 195 196 int Size() { return mEntries.size(); } 195 197 196 198 /// Map of PVS entries -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.cpp
r1613 r1694 985 985 986 986 if (mRenderVisibilityEstimates) { 987 float visibility = log10((*it).second.mSumPdf + 1)/5.0f;987 float visibility = mTransferFunction*log10((*it).second.mSumPdf + 1); // /5.0f 988 988 glColor3f(visibility, 0.0f, 0.0f); 989 989 mUseForcedColors = true; … … 1001 1001 glPushMatrix(); 1002 1002 glTranslatef(mViewPoint.x, mViewPoint.y, mViewPoint.z); 1003 glScalef(5.0f,5.0f,5.0f); 1004 glPushAttrib(GL_CURRENT_BIT); 1005 glColor3f(1.0f, 0.0f, 0.0f); 1003 1006 gluSphere((::GLUquadric *)mSphere, 1004 1007 1e-3*Magnitude(mViewCellsManager->GetViewSpaceBox().Size()), 6, 6); 1008 glPopAttrib(); 1005 1009 glPopMatrix(); 1006 1010 mWireFrame = false; … … 1378 1382 mRenderFilter = true; 1379 1383 mRenderVisibilityEstimates = false; 1380 1384 mTransferFunction = 0.2f; 1381 1385 mManipulatorScale = 1.0f; 1382 1386 trackball(mManipulatorLastQuat, 0.0f, 0.0f, 0.0f, 0.0f); … … 1400 1404 1401 1405 connect(mControlWidget, SIGNAL(SetViewCellGranularity(int)), this, SLOT(SetViewCellGranularity(int))); 1406 connect(mControlWidget, 1407 SIGNAL(SetTransferFunction(int)), 1408 this, 1409 SLOT(SetTransferFunction(int))); 1402 1410 connect(mControlWidget, SIGNAL(UpdateAllPvs()), this, SLOT(UpdateAllPvs())); 1403 1411 connect(mControlWidget, SIGNAL(ComputeVisibility()), this, SLOT(ComputeVisibility())); … … 1721 1729 { 1722 1730 ViewCell *vc = viewcells[i]; 1723 const int p = vc->GetPvs().CountObjectsInPvs(); 1731 1732 //const int p = vc->GetPvs().CountObjectsInPvs(); 1733 const int p = vc->GetPvs().Size(); 1724 1734 if (p > maxPvs) 1725 1735 maxPvs = p; … … 1734 1744 RgbColor c; 1735 1745 1736 if (!mShowPvsSizes) 1746 if (!mShowPvsSizes) { 1747 mWireFrame = true; 1737 1748 c = vc->GetColor(); 1738 else { 1739 const float importance = (float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs; 1749 } else { 1750 // const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs); 1751 const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().Size() / (float)maxPvs); 1740 1752 c = RgbColor(importance, 1.0f - importance, 0.0f); 1741 1753 } … … 1745 1757 } 1746 1758 1759 mUseFalseColors = false; 1760 mWireFrame = false; 1747 1761 1748 1762 glPopAttrib(); 1749 1763 1750 1764 } 1751 1765 … … 1805 1819 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetViewCellGranularity(int))); 1806 1820 1821 label = new QLabel("Transfer function"); 1822 vbox->layout()->addWidget(label); 1823 1824 slider = new QSlider(Qt::Horizontal, vbox); 1825 vl->addWidget(slider); 1826 slider->show(); 1827 slider->setRange(1, 1000); 1828 slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); 1829 slider->setValue(100); 1830 1831 1832 connect(slider, SIGNAL(valueChanged(int)), SIGNAL(SetTransferFunction(int))); 1833 1807 1834 { 1808 1835 QPushButton *button = new QPushButton("Update all PVSs", vbox); … … 1875 1902 1876 1903 1904 cb = new QCheckBox("Cut view cells", vbox); 1905 vbox->layout()->addWidget(cb); 1906 cb->setChecked(false); 1907 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetCutViewCells(bool))); 1908 1909 1877 1910 slider = new QSlider(Qt::Horizontal, vbox); 1878 1911 vbox->layout()->addWidget(slider); … … 1885 1918 1886 1919 1920 cb = new QCheckBox("Cut scene", vbox); 1921 vbox->layout()->addWidget(cb); 1922 cb->setChecked(false); 1923 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetCutScene(bool))); 1924 1887 1925 cb = new QCheckBox("Render boxes", vbox); 1888 1926 vbox->layout()->addWidget(cb); … … 1924 1962 1925 1963 1926 cb = new QCheckBox("Cut view cells", vbox);1927 vbox->layout()->addWidget(cb);1928 cb->setChecked(false);1929 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetCutViewCells(bool)));1930 1931 cb = new QCheckBox("Cut scene", vbox);1932 vbox->layout()->addWidget(cb);1933 cb->setChecked(false);1934 connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetCutScene(bool)));1935 1964 1936 1965 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer.h
r1613 r1694 149 149 void UpdateAllPvs(); 150 150 void SetViewCellGranularity(int); 151 void SetTransferFunction(int); 151 152 void SetSceneCut(int); 152 153 void SetTopDistance(int); … … 200 201 int mPvsSize; 201 202 float mRenderError; 202 203 float mTransferFunction; 203 204 204 205 float mManipulatorLastQuat[4]; … … 310 311 void 311 312 SetViewCellGranularity(int number); 312 313 314 void 315 SetTransferFunction(int number) { 316 mTransferFunction = number/1000.0f; 317 updateGL(); 318 } 319 313 320 void 314 321 SetVisibilityFilterSize(int number); -
GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
r1613 r1694 394 394 Randomize(0); 395 395 396 const bool useRayBuffer = false; 397 396 398 vector<VssRayContainer> rayBuffer(50); 397 399 … … 461 463 ExportRays(filename, mVssRays, mExportNumRays); 462 464 463 mVssRays.SelectRays(mExportNumRays, rayBuffer[0], true); 465 if (useRayBuffer) 466 mVssRays.SelectRays(mExportNumRays, rayBuffer[0], true); 464 467 465 468 } … … 723 726 724 727 725 vssRays.SelectRays(mExportNumRays, rayBuffer[mPass], true); 728 if (useRayBuffer) 729 vssRays.SelectRays(mExportNumRays, rayBuffer[mPass], true); 726 730 727 731 ExportRays(filename, vssRays, mExportNumRays); … … 805 809 806 810 807 if ( mExportRays && mUseImportanceSampling) {811 if (useRayBuffer&& mExportRays && mUseImportanceSampling) { 808 812 char filename[64]; 809 813 sprintf(filename, "rss-rays-i.x3d"); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1692 r1694 31 31 // $$JB HACK 32 32 #define USE_KD_PVS 0 33 #define KD_PVS_AREA 1e-3f33 #define KD_PVS_AREA (5*1e-4f) 34 34 35 35 namespace GtpVisibilityPreprocessor { -
GTP/trunk/Lib/Vis/Preprocessing/src/default.env
r1613 r1694 6 6 Scene { 7 7 8 #filename ../data/arena/export.obj 8 #filename ../data/Arena/arena-low-lods.obj 9 # filename ../data/Arena/arena-high-lods.obj 9 10 # filename ../data/City4M/City4M.obj 10 11 # filename ../data/CityModel/CityModel.obj … … 15 16 # filename ../data/vienna/vienna-buildings.x3d 16 17 #filename ../data/vienna/city1500_flat_1.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d 17 filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d18 19 #;../data/vienna/vienna-plane.x3d; 18 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d;../data/vienna/vienna-plane.x3d 19 filename ../data/vienna/vienna.obj 20 20 21 # filename ../data/vienna/viewcells-25-sel.x3d 21 22 #filename ../data/atlanta/atlanta2.x3d 22 # 23 #filename ../data/soda/soda.dat 23 24 #filename ../data/test1/test2.x3d 24 25 #filename ../data/soda/soda5.dat … … 41 42 # 0 = INTERNAL 1 = MLRT 42 43 43 rayCastMethod 044 rayCastMethod 1 44 45 45 46 # type sampling … … 48 49 # type render 49 50 detectEmptyViewSpace true 50 #pvsRenderErrorSamples 051 pvsRenderErrorSamples 500051 pvsRenderErrorSamples 0 52 # pvsRenderErrorSamples 5000 52 53 quitOnFinish true 53 54 computeVisibility true … … 79 80 samplesPerPass 1000 80 81 initialSamples 1000000 81 vssSamples 20000000 82 vssSamplesPerPass 500000 82 vssSamples 50000000 83 # vssSamples 1000000 84 vssSamplesPerPass 1000000 83 85 useImportanceSampling true 84 86 … … 89 91 pvs false 90 92 rssTree false 91 rays true93 rays false 92 94 numRays 2000 93 95 } … … 146 148 sahUseFaces false 147 149 Termination { 148 minCost 4150 minCost 1 149 151 maxDepth 30 150 maxCostRatio 1.1152 maxCostRatio 0.95 151 153 ct_div_ci 0.5 152 maxNodes 500000154 maxNodes 200000 153 155 #500000 154 156 } … … 181 183 182 184 #number of active view cells 183 active 5000184 maxViewCells 5000185 active 20000 186 maxViewCells 20000 185 187 186 188 maxStaticMemory 40 … … 192 194 #type vspKdTree 193 195 #type bspTree 194 #type vspBspTree195 type vspOspTree196 type vspBspTree 197 #type vspOspTree 196 198 #type sceneDependent 197 199 … … 218 220 useRaysForMerge false 219 221 compress false 220 merge true222 merge false 221 223 } 222 224 … … 236 238 } 237 239 238 showVisualization true240 showVisualization false 239 241 evaluateViewCells false 240 242 … … 249 251 } 250 252 251 # filename ../data/arena/viewcells-5000.xml 253 # filename ../data/Arena/viewcells-5000.xml 254 # filename ../data/Arena/viewcells-20000.xml 252 255 253 256 # filename ../data/atlanta/atlanta_viewcells_large.x3d … … 279 282 # filename ../data/vienna/viewcells_vienna2.xml 280 283 # filename ../data/vienna/vienna_simple-21-04-avs2-viewCells.xml 281 # filename ../data/vienna/vienna-viewcells-5000.xml 284 # filename ../data/vienna/vienna-viewcells-5000.xml.gz 282 285 filename ../data/vienna/vienna-viewcells-1000.xml.zip 283 286 # filename ../data/vienna/vsposp-seq-viewCells.xml.gz … … 350 353 # minGlobalCostRatio 0.0001 351 354 # $$MAXVIEWCELLS 352 maxViewCells 1000355 maxViewCells 20000 353 356 354 357 -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1658 r1694 23 23 24 24 #include "PreprocessorThread.h" 25 #include "ObjExporter.h" 26 #include "SceneGraph.h" 27 28 25 29 26 30 #if !USE_QT && USE_THREADS … … 205 209 } 206 210 211 if (1) { 212 // export obj file 213 Exporter *exporter = new ObjExporter("scene.obj"); 214 exporter->ExportScene(preprocessor->mSceneGraph->GetRoot()); 215 delete exporter; 216 } 217 218 207 219 const string externKdTree = ReplaceSuffix(filename, ".obj", ".kdf"); 208 220 const string internKdTree = GetInternKdTreeName(filename); -
GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro
r1581 r1694 117 117 BvHierarchy.cpp \ 118 118 BoostPreprocessorThread.cpp InternalRayCaster.cpp IntelRayCaster.cpp \ 119 RayCaster.cpp PreprocessorFactory.cpp GvsPreprocessor.cpp Trackball.cpp 119 RayCaster.cpp PreprocessorFactory.cpp GvsPreprocessor.cpp \ 120 Trackball.cpp ObjExporter.cpp SubdivisionCandidate.cpp 120 121 121 122
Note: See TracChangeset
for help on using the changeset viewer.