- Timestamp:
- 11/02/05 17:45:25 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.h
r365 r369 161 161 } 162 162 163 void AddPassingRay(const Ray &ray, const int contributions) { 163 void AddPassingRay(const Ray &ray, 164 const int contributions) { 164 165 mPassingRays.AddRay(ray, contributions); 165 166 // Debug << "adding passing ray" << endl; 166 167 } 167 168 169 170 void AddPassingRay2(const Ray &ray, 171 const int objects, 172 const int viewcells 173 ) { 174 mPassingRays.AddRay2(ray, objects, viewcells); 175 // Debug << "adding passing ray" << endl; 176 } 177 168 178 /** \sa KdNode::IsLeaf() */ 169 179 virtual bool IsLeaf() const { return true; } … … 180 190 /** Ray set description of the rays passing through this node */ 181 191 PassingRaySet mPassingRays; 182 192 183 193 /** PVS consisting of visible KdTree nodes */ 184 194 KdPvs mKdPvs; 185 195 196 /** PVS consisting of visible objects */ 197 ViewCellPvs mPvs; 186 198 }; 187 199 188 200 189 201 … … 227 239 228 240 bool operator()(const TraversalData a, const TraversalData b) { 229 return a.mPriority < b.mPriority;241 return a.mPriority < b.mPriority; 230 242 } 231 243 … … 283 295 void 284 296 CollectObjects(KdNode *n, ObjectContainer &objects); 285 297 286 298 void 287 299 CollectLeaves(vector<KdLeaf *> &leaves); 288 300 289 301 AxisAlignedBox3 GetBox(const KdNode *node) const { 290 302 KdInterior *parent = node->mParent; … … 302 314 return box; 303 315 } 304 316 305 317 KdNode * 306 318 FindRandomNeighbor(KdNode *n, 307 319 bool onlyUnmailed 308 320 ); 309 310 321 311 322 KdNode * -
trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
r364 r369 1 1 ############################################################################# 2 2 # Makefile for building: preprocessor 3 # Generated by qmake (1.07a) (Qt 3.3. 3) on: Tue Nov 1 09:17:0020053 # Generated by qmake (1.07a) (Qt 3.3.2) on: Wed Nov 02 15:58:09 2005 4 4 # Project: preprocessor.pro 5 5 # Template: app … … 9 9 ####### Compiler, tools and options 10 10 11 CC = gcc 12 CXX = g++ 13 LEX = flex 14 YACC = yacc 15 CFLAGS = -pipe -O2 -fmessage-length=0 -Wall -w -O2 -fmessage-length=0 -Wall -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 16 CXXFLAGS = -pipe -O2 -fmessage-length=0 -Wall -w -O2 -fmessage-length=0 -Wall -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT 17 LEXFLAGS = 18 YACCFLAGS= -d 19 INCPATH = -I/usr/lib/qt3/mkspecs/default -I. -I../support/src/xerces-c-src_2_7_0/include -I../src -I../support/xerces/include -I../support/zlib/include -I../support/boost -I../support/devil/include -I/usr/include -I$(QTDIR)/include 20 LINK = g++ 21 LFLAGS = 22 LIBS = $(SUBLIBS) -L/usr/lib64/ -L../support/src/xerces-c-src_2_7_0/lib -L../support/devil/lib -L/usr/lib/qt3/lib64 -L$(QTDIR)/lib64/ -L/usr/X11R6/lib64/ -lxerces-c -lIL -lILU -lILUT -lqt-mt -lXext -lX11 -lm -lpthread 23 AR = ar cqs 24 RANLIB = 25 MOC = $(QTDIR)/bin/moc 26 UIC = $(QTDIR)/bin/uic 27 QMAKE = qmake 28 TAR = tar -cf 29 GZIP = gzip -9f 30 COPY = cp -f 31 COPY_FILE= $(COPY) 32 COPY_DIR = $(COPY) -r 11 CC = cl 12 CXX = cl 13 LEX = flex 14 YACC = byacc 15 CFLAGS = -nologo -Zm200 -W0 -MD -O2 -G7 -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 16 CXXFLAGS = -nologo -Zm200 -W0 -MD -O2 -G7 -GX -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 17 LEXFLAGS = 18 YACCFLAGS =-d 19 INCPATH = -I"..\src" -I"..\support\xerces\include" -I"..\support\zlib\include" -I"..\support\boost" -I"..\support\devil\include" -I"$(QTDIR)\include" -I"d:\gametools\svn\trunk\VUT\GtpVisibilityPreprocessor\src" -I"C:\Qt\3.3.2\mkspecs\win32-msvc.net" 20 LINK = "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe" 21 LFLAGS = /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIBPATH:"../support/xerces/lib" /LIBPATH:"../support/devil/lib" /LIBPATH:"$(QTDIR)\lib" 22 LIBS = "qt-mt332.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "delayimp.lib" "xerces-c_2.lib" "devil.lib" "ilu.lib" "ilut.lib" "opengl32.lib" "glu32.lib" 23 MOC = $(QTDIR)\bin\moc.exe 24 UIC = $(QTDIR)\bin\uic.exe 25 QMAKE = qmake 26 IDC = $(QTDIR)\bin\idc.exe 27 IDL = midl 28 ZIP = zip -r -9 29 COPY_FILE = copy 30 COPY_DIR = copy 31 DEL_FILE = del 32 DEL_DIR = rmdir 33 MOVE = move 34 CHK_DIR_EXISTS = if not exist 35 MKDIR = mkdir 33 36 INSTALL_FILE= $(COPY_FILE) 34 37 INSTALL_DIR = $(COPY_DIR) 35 DEL_FILE = rm -f36 SYMLINK = ln -sf37 DEL_DIR = rmdir38 MOVE = mv -f39 CHK_DIR_EXISTS= test -d40 MKDIR = mkdir -p41 42 ####### Output directory43 44 OBJECTS_DIR = ./45 38 46 39 ####### Files 47 40 48 HEADERS = 49 SOURCES = 41 HEADERS = Halton.h 42 SOURCES = Preprocessor.cpp \ 50 43 SamplingPreprocessor.cpp \ 51 44 ExactPreprocessor.cpp \ … … 77 70 ViewCellBsp.cpp \ 78 71 Halton.cpp 79 OBJECTS = Preprocessor.o \ 80 SamplingPreprocessor.o \ 81 ExactPreprocessor.o \ 82 KdTree.o \ 83 Environment.o \ 84 gzstream.o \ 85 common.o \ 86 UnigraphicsParser.o \ 87 X3dExporter.o \ 88 SceneGraph.o \ 89 Material.o \ 90 Matrix4x4.o \ 91 Vector3.o \ 92 AxisAlignedBox3.o \ 93 Ray.o \ 94 main.o \ 95 Mesh.o \ 96 Exporter.o \ 97 Camera.o \ 98 X3dParser.o \ 99 MeshKdTree.o \ 100 Pvs.o \ 101 MutualVisibility.o \ 102 Triangle3.o \ 103 Rectangle3.o \ 104 Plane3.o \ 105 Polygon3.o \ 106 ViewCell.o \ 107 ViewCellBsp.o \ 108 Halton.o 109 FORMS = 110 UICDECLS = 111 UICIMPLS = 112 SRCMOC = 113 OBJMOC = 114 DIST = preprocessor.pro 115 QMAKE_TARGET = preprocessor 116 DESTDIR = 117 TARGET = preprocessor 118 119 first: all 72 OBJECTS = Preprocessor.obj \ 73 SamplingPreprocessor.obj \ 74 ExactPreprocessor.obj \ 75 KdTree.obj \ 76 Environment.obj \ 77 gzstream.obj \ 78 common.obj \ 79 UnigraphicsParser.obj \ 80 X3dExporter.obj \ 81 SceneGraph.obj \ 82 Material.obj \ 83 Matrix4x4.obj \ 84 Vector3.obj \ 85 AxisAlignedBox3.obj \ 86 Ray.obj \ 87 main.obj \ 88 Mesh.obj \ 89 Exporter.obj \ 90 Camera.obj \ 91 X3dParser.obj \ 92 MeshKdTree.obj \ 93 Pvs.obj \ 94 MutualVisibility.obj \ 95 Triangle3.obj \ 96 Rectangle3.obj \ 97 Plane3.obj \ 98 Polygon3.obj \ 99 ViewCell.obj \ 100 ViewCellBsp.obj \ 101 Halton.obj 102 FORMS = 103 UICDECLS = 104 UICIMPLS = 105 SRCMOC = 106 OBJMOC = 107 DIST = 108 TARGET = preprocessor.exe 109 120 110 ####### Implicit rules 121 111 122 .SUFFIXES: .c .o .cpp .cc .cxx .C 123 124 .cpp.o: 125 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 126 127 .cc.o: 128 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 129 130 .cxx.o: 131 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 132 133 .C.o: 134 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< 135 136 .c.o: 137 $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< 112 .SUFFIXES: .c .cpp .cc .cxx .C 113 114 {.}.cpp{}.obj:: 115 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 116 $< 117 << 118 119 {.}.cc{}.obj:: 120 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 121 $< 122 << 123 124 {.}.cxx{}.obj:: 125 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 126 $< 127 << 128 129 {.}.C{}.obj:: 130 $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<< 131 $< 132 << 133 134 {.}.c{}.obj:: 135 $(CC) -c $(CFLAGS) $(INCPATH) -Fo @<< 136 $< 137 << 138 138 139 139 ####### Build rules … … 141 141 all: Makefile $(TARGET) 142 142 143 $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) 144 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS) 143 $(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) 144 $(LINK) $(LFLAGS) /OUT:$(TARGET) @<< 145 $(OBJECTS) $(OBJMOC) $(LIBS) 146 << 147 145 148 146 149 mocables: $(SRCMOC) 147 uicables: $(UICDECLS) $(UICIMPLS) 148 149 $(MOC): 150 ( cd $(QTDIR)/src/moc && $(MAKE) ) 151 152 Makefile: preprocessor.pro /usr/lib/qt3/mkspecs/default/qmake.conf 150 uicables: $(UICIMPLS) $(UICDECLS) 151 152 Makefile: preprocessor.pro C:\Qt\3.3.2\mkspecs\win32-msvc.net\qmake.conf C:\Qt\3.3.2\lib\qtmain.prl 153 153 $(QMAKE) -o Makefile preprocessor.pro 154 154 qmake: 155 155 @$(QMAKE) -o Makefile preprocessor.pro 156 156 157 dist: 158 @mkdir -p .tmp/preprocessor && $(COPY_FILE) --parents $(SOURCES) $(HEADERS) $(FORMS) $(DIST) .tmp/preprocessor/ && ( cd `dirname .tmp/preprocessor` && $(TAR) preprocessor.tar preprocessor && $(GZIP) preprocessor.tar ) && $(MOVE) `dirname .tmp/preprocessor`/preprocessor.tar.gz . && $(DEL_FILE) -r .tmp/preprocessor 159 157 dist: 158 $(ZIP) preprocessor.zip $(SOURCES) $(HEADERS) $(DIST) $(FORMS) d:/gametools/svn/trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro C:\Qt\3.3.2\lib\qtmain.prl 159 160 uiclean: 160 161 mocclean: 161 162 uiclean: 163 164 yaccclean: 165 lexclean: 166 clean: 167 -$(DEL_FILE) $(OBJECTS) 168 -$(DEL_FILE) *~ core *.core 169 170 171 ####### Sub-libraries 162 clean: uiclean mocclean 163 -$(DEL_FILE) Preprocessor.obj 164 -$(DEL_FILE) SamplingPreprocessor.obj 165 -$(DEL_FILE) ExactPreprocessor.obj 166 -$(DEL_FILE) KdTree.obj 167 -$(DEL_FILE) Environment.obj 168 -$(DEL_FILE) gzstream.obj 169 -$(DEL_FILE) common.obj 170 -$(DEL_FILE) UnigraphicsParser.obj 171 -$(DEL_FILE) X3dExporter.obj 172 -$(DEL_FILE) SceneGraph.obj 173 -$(DEL_FILE) Material.obj 174 -$(DEL_FILE) Matrix4x4.obj 175 -$(DEL_FILE) Vector3.obj 176 -$(DEL_FILE) AxisAlignedBox3.obj 177 -$(DEL_FILE) Ray.obj 178 -$(DEL_FILE) main.obj 179 -$(DEL_FILE) Mesh.obj 180 -$(DEL_FILE) Exporter.obj 181 -$(DEL_FILE) Camera.obj 182 -$(DEL_FILE) X3dParser.obj 183 -$(DEL_FILE) MeshKdTree.obj 184 -$(DEL_FILE) Pvs.obj 185 -$(DEL_FILE) MutualVisibility.obj 186 -$(DEL_FILE) Triangle3.obj 187 -$(DEL_FILE) Rectangle3.obj 188 -$(DEL_FILE) Plane3.obj 189 -$(DEL_FILE) Polygon3.obj 190 -$(DEL_FILE) ViewCell.obj 191 -$(DEL_FILE) ViewCellBsp.obj 192 -$(DEL_FILE) Halton.obj 193 194 195 196 FORCE: 172 197 173 198 distclean: clean 174 -$(DEL_FILE) $(TARGET) $(TARGET) 175 176 177 FORCE: 199 -$(DEL_FILE) $(TARGET) 178 200 179 201 ####### Compile 180 202 181 Preprocessor.o: Preprocessor.cpp SceneGraph.h \ 203 Preprocessor.obj: Preprocessor.cpp \ 204 SceneGraph.h \ 182 205 Exporter.h \ 183 206 UnigraphicsParser.h \ … … 200 223 Intersectable.h \ 201 224 Pvs.h \ 202 Ray.h 203 204 SamplingPreprocessor.o: SamplingPreprocessor.cpp SceneGraph.h \ 225 Ray.h \ 226 227 228 SamplingPreprocessor.obj: SamplingPreprocessor.cpp \ 229 SceneGraph.h \ 205 230 KdTree.h \ 206 231 SamplingPreprocessor.h \ … … 224 249 Intersectable.h \ 225 250 Material.h \ 226 Exporter.h 227 228 ExactPreprocessor.o: ExactPreprocessor.cpp ExactPreprocessor.h \ 251 Exporter.h \ 252 253 254 ExactPreprocessor.obj: ExactPreprocessor.cpp \ 255 ExactPreprocessor.h \ 229 256 Preprocessor.h \ 230 257 Containers.h \ … … 242 269 Vector3.h \ 243 270 common.h \ 244 Ray.h 245 246 KdTree.o: KdTree.cpp Environment.h \ 247 Mesh.h \ 248 KdTree.h \ 249 common.h \ 250 Intersectable.h \ 251 Plane3.h \ 252 Matrix4x4.h \ 253 AxisAlignedBox3.h \ 254 Material.h \ 255 Pvs.h \ 256 Rectangle3.h \ 257 Vector3.h \ 258 Containers.h \ 259 Ray.h 260 261 Environment.o: Environment.cpp gzstream.h \ 262 common.h \ 263 Environment.h \ 264 Vector3.h 265 266 gzstream.o: gzstream.cpp gzstream.h 267 268 common.o: common.cpp common.h 269 270 UnigraphicsParser.o: UnigraphicsParser.cpp Vector3.h \ 271 Ray.h \ 272 273 274 KdTree.obj: KdTree.cpp \ 275 Environment.h \ 276 Mesh.h \ 277 KdTree.h \ 278 common.h \ 279 Intersectable.h \ 280 Plane3.h \ 281 Matrix4x4.h \ 282 AxisAlignedBox3.h \ 283 Material.h \ 284 Pvs.h \ 285 Rectangle3.h \ 286 Vector3.h \ 287 Containers.h \ 288 Ray.h \ 289 290 291 Environment.obj: Environment.cpp \ 292 gzstream.h \ 293 common.h \ 294 Environment.h \ 295 Vector3.h \ 296 297 298 gzstream.obj: gzstream.cpp \ 299 gzstream.h \ 300 301 302 common.obj: common.cpp \ 303 common.h \ 304 305 306 UnigraphicsParser.obj: UnigraphicsParser.cpp \ 307 Vector3.h \ 271 308 Mesh.h \ 272 309 SceneGraph.h \ … … 282 319 Rectangle3.h \ 283 320 Containers.h \ 284 Parser.h 285 286 X3dExporter.o: X3dExporter.cpp common.h \ 321 Parser.h \ 322 323 324 X3dExporter.obj: X3dExporter.cpp \ 325 common.h \ 287 326 SceneGraph.h \ 288 327 X3dExporter.h \ … … 302 341 Intersectable.h \ 303 342 Pvs.h \ 304 Ray.h 305 306 SceneGraph.o: SceneGraph.cpp SceneGraph.h \ 343 Ray.h \ 344 345 346 SceneGraph.obj: SceneGraph.cpp \ 347 SceneGraph.h \ 307 348 X3dExporter.h \ 308 349 Intersectable.h \ … … 316 357 Exporter.h \ 317 358 Material.h \ 318 Pvs.h 319 320 Material.o: Material.cpp common.h \ 321 Material.h 322 323 Matrix4x4.o: Matrix4x4.cpp Matrix4x4.h \ 324 Vector3.h \ 325 common.h 326 327 Vector3.o: Vector3.cpp Matrix4x4.h \ 359 Pvs.h \ 360 361 362 Material.obj: Material.cpp \ 363 common.h \ 364 Material.h \ 365 366 367 Matrix4x4.obj: Matrix4x4.cpp \ 368 Matrix4x4.h \ 369 Vector3.h \ 370 common.h \ 371 372 373 Vector3.obj: Vector3.cpp \ 374 Matrix4x4.h \ 328 375 Vector3.h \ 329 376 Halton.h \ 330 common.h 331 332 AxisAlignedBox3.o: AxisAlignedBox3.cpp AxisAlignedBox3.h \ 377 common.h \ 378 379 380 AxisAlignedBox3.obj: AxisAlignedBox3.cpp \ 381 AxisAlignedBox3.h \ 333 382 Ray.h \ 334 383 Polygon3.h \ … … 342 391 Intersectable.h \ 343 392 Material.h \ 344 Pvs.h 345 346 Ray.o: Ray.cpp Ray.h \ 347 Plane3.h \ 348 Matrix4x4.h \ 349 Vector3.h \ 350 common.h 351 352 main.o: main.cpp SamplingPreprocessor.h \ 393 Pvs.h \ 394 395 396 Ray.obj: Ray.cpp \ 397 Ray.h \ 398 Plane3.h \ 399 Matrix4x4.h \ 400 Vector3.h \ 401 common.h \ 402 403 404 main.obj: main.cpp \ 405 SamplingPreprocessor.h \ 353 406 ExactPreprocessor.h \ 354 407 Parser.h \ … … 376 429 Vector3.h \ 377 430 common.h \ 378 Ray.h 379 380 Mesh.o: Mesh.cpp Ray.h \ 431 Ray.h \ 432 433 434 Mesh.obj: Mesh.cpp \ 435 Ray.h \ 381 436 Mesh.h \ 382 437 MeshKdTree.h \ … … 391 446 Pvs.h \ 392 447 Rectangle3.h \ 393 Containers.h 394 395 Exporter.o: Exporter.cpp X3dExporter.h \ 396 Exporter.h \ 397 Containers.h \ 398 Material.h 399 400 Camera.o: Camera.cpp Camera.h \ 401 Ray.h \ 402 KdTree.h \ 403 Mesh.h \ 404 Exporter.h \ 405 Vector3.h \ 406 AxisAlignedBox3.h \ 407 common.h \ 408 Rectangle3.h \ 409 Matrix4x4.h \ 410 Plane3.h \ 411 Containers.h \ 412 Pvs.h \ 413 Intersectable.h \ 414 Material.h 415 416 X3dParser.o: X3dParser.cpp X3dParser.h \ 448 Containers.h \ 449 450 451 Exporter.obj: Exporter.cpp \ 452 X3dExporter.h \ 453 Exporter.h \ 454 Containers.h \ 455 Material.h \ 456 457 458 Camera.obj: Camera.cpp \ 459 Camera.h \ 460 Ray.h \ 461 KdTree.h \ 462 Mesh.h \ 463 Exporter.h \ 464 Vector3.h \ 465 AxisAlignedBox3.h \ 466 common.h \ 467 Rectangle3.h \ 468 Matrix4x4.h \ 469 Plane3.h \ 470 Containers.h \ 471 Pvs.h \ 472 Intersectable.h \ 473 Material.h \ 474 475 476 X3dParser.obj: X3dParser.cpp \ 477 X3dParser.h \ 417 478 X3dParserXerces.h \ 418 479 Mesh.h \ … … 431 492 Vector3.h \ 432 493 common.h \ 433 Ray.h 434 435 MeshKdTree.o: MeshKdTree.cpp Environment.h \ 494 Ray.h \ 495 496 497 MeshKdTree.obj: MeshKdTree.cpp \ 498 Environment.h \ 436 499 Mesh.h \ 437 500 MeshKdTree.h \ … … 446 509 Vector3.h \ 447 510 Containers.h \ 448 Ray.h 449 450 Pvs.o: Pvs.cpp Pvs.h 451 452 MutualVisibility.o: MutualVisibility.cpp KdTree.h \ 511 Ray.h \ 512 513 514 Pvs.obj: Pvs.cpp \ 515 Pvs.h \ 516 517 518 MutualVisibility.obj: MutualVisibility.cpp \ 519 KdTree.h \ 453 520 AxisAlignedBox3.h \ 454 521 Ray.h \ … … 466 533 common.h \ 467 534 Material.h \ 468 Intersectable.h 469 470 Triangle3.o: Triangle3.cpp Triangle3.h \ 471 Vector3.h \ 472 common.h 473 474 Rectangle3.o: Rectangle3.cpp Rectangle3.h \ 475 Vector3.h \ 476 common.h 477 478 Plane3.o: Plane3.cpp Plane3.h \ 479 Matrix4x4.h \ 480 Vector3.h \ 481 common.h 482 483 Polygon3.o: Polygon3.cpp Polygon3.h \ 535 Intersectable.h \ 536 537 538 Triangle3.obj: Triangle3.cpp \ 539 Triangle3.h \ 540 Vector3.h \ 541 common.h \ 542 543 544 Rectangle3.obj: Rectangle3.cpp \ 545 Rectangle3.h \ 546 Vector3.h \ 547 common.h \ 548 549 550 Plane3.obj: Plane3.cpp \ 551 Plane3.h \ 552 Matrix4x4.h \ 553 Vector3.h \ 554 common.h \ 555 556 557 Polygon3.obj: Polygon3.cpp \ 558 Polygon3.h \ 484 559 Mesh.h \ 485 560 ViewCellBsp.h \ … … 494 569 Rectangle3.h \ 495 570 Vector3.h \ 496 common.h 497 498 ViewCell.o: ViewCell.cpp ViewCell.h \ 571 common.h \ 572 573 574 ViewCell.obj: ViewCell.cpp \ 575 ViewCell.h \ 499 576 Mesh.h \ 500 577 Intersectable.h \ … … 510 587 Rectangle3.h \ 511 588 Vector3.h \ 512 common.h 513 514 ViewCellBsp.o: ViewCellBsp.cpp Plane3.h \ 589 common.h \ 590 591 592 ViewCellBsp.obj: ViewCellBsp.cpp \ 593 Plane3.h \ 515 594 ViewCellBsp.h \ 516 595 Mesh.h \ … … 528 607 Material.h \ 529 608 Pvs.h \ 530 Rectangle3.h 531 532 Halton.o: Halton.cpp Halton.h 609 Rectangle3.h \ 610 611 612 Halton.obj: Halton.cpp \ 613 Halton.h \ 614 533 615 534 616 ####### Install -
trunk/VUT/GtpVisibilityPreprocessor/src/Pvs.h
r366 r369 31 31 { 32 32 public: 33 Pvs(): mSamples(0), mEntries() {} 33 Pvs(): mSamples(0), mEntries() {} 34 34 35 int mSamples; 35 36 -
trunk/VUT/GtpVisibilityPreprocessor/src/Ray.cpp
r367 r369 139 139 } 140 140 141 void 142 PassingRaySet::AddRay2(const Ray &ray, 143 const int objects, 144 const int viewcells 145 ) 146 { 147 int i = GetEntryIndex(ray.GetDir()); 148 mRays++; 149 mContributions += objects*viewcells; 150 mDirectionalContributions[i] += objects*viewcells; 151 } 152 141 153 int 142 154 PassingRaySet::GetEntryIndex(const Vector3 &direction) const … … 158 170 } 159 171 160 int Ray::ClassifyPlane(const Plane3 &plane, 161 const float minT, 162 const float maxT) const 172 int 173 Ray::ClassifyPlane(const Plane3 &plane, 174 const float minT, 175 const float maxT) const 163 176 { 164 177 const Vector3 entp = Extrap(minT); … … 169 182 170 183 if (entSide < 0) 171 {172 if (extSide >= 0)173 184 { 174 return BACK_FRONT; 185 if (extSide >= 0) 186 { 187 return BACK_FRONT; 188 } 189 return BACK; 175 190 } 176 return BACK;177 }178 191 else if (entSide > 0) 179 {180 if (extSide <= 0)181 return FRONT_BACK;182 183 return FRONT;184 }192 { 193 if (extSide <= 0) 194 return FRONT_BACK; 195 196 return FRONT; 197 } 185 198 else if (entSide == 0) 186 {187 if (extSide > 0)188 return BACK_FRONT;189 else if (extSide < 0)190 return FRONT_BACK;191 }199 { 200 if (extSide > 0) 201 return BACK_FRONT; 202 else if (extSide < 0) 203 return FRONT_BACK; 204 } 192 205 193 206 return COINCIDENT; -
trunk/VUT/GtpVisibilityPreprocessor/src/Ray.h
r367 r369 23 23 public: 24 24 enum RayType { LOCAL_RAY, GLOBAL_RAY, LINE_SEGMENT }; 25 25 26 26 enum { NO_INTERSECTION=0, INTERSECTION_OUT_OF_LIMITS, INTERSECTION }; 27 27 … … 36 36 // can be either mesh or a viewcell 37 37 Intersectable *mObject; 38 38 39 39 // the face of the intersectable 40 40 int mFace; 41 41 42 42 Intersection(const float t, 43 Intersectable *object,44 const int face):mT(t), mObject(object), mFace(face) {}45 43 Intersectable *object, 44 const int face):mT(t), mObject(object), mFace(face) {} 45 46 46 Intersection() {} 47 47 48 48 bool operator<( 49 49 const Intersection &b) const { 50 50 return 51 mT52 <53 b.mT;51 mT 52 < 53 b.mT; 54 54 } 55 55 … … 70 70 Ray(const Vector3 &wherefrom, 71 71 const Vector3 &whichdir, 72 const int _type, 73 const void *_originCell = NULL) { 72 const int _type) { 74 73 loc = wherefrom; 75 74 if (_type == LINE_SEGMENT) … … 94 93 // Inititalize the ray again when already constructed 95 94 void Init(const Vector3 &wherefrom, 96 97 98 95 const Vector3 &whichdir, 96 const int _type, 97 bool dirNormalized = false) { 99 98 loc = wherefrom; 100 99 dir = (dirNormalized || _type == LINE_SEGMENT) ? whichdir: Normalize(whichdir) ; … … 252 251 int mRays; 253 252 int mContributions; 254 PassingRaySet() { 253 254 PassingRaySet() { 255 255 Reset(); 256 256 } 257 void 257 258 void 258 259 Reset(); 259 260 260 261 void AddRay(const Ray &ray, const int contributions); 262 void AddRay2(const Ray &ray, 263 const int objects, 264 const int viewcells); 265 261 266 int GetEntryIndex(const Vector3 &direction) const; 262 267 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r367 r369 84 84 85 85 int 86 SamplingPreprocessor::AddNodeSamples(Intersectable *object, 87 const Ray &ray 86 SamplingPreprocessor::AddNodeSamples(const Ray &ray, 87 Intersectable *sObject, 88 Intersectable *tObject 88 89 ) 89 90 { 90 91 int contributingSamples = 0; 91 92 int j; 92 for (j=0; j < ray.kdLeaves.size(); j++) { 93 KdNode *node = GetNodeForPvs( ray.kdLeaves[j] ); 94 contributingSamples += object->mKdPvs.AddSample(node); 95 } 96 97 if (mPass > 10) 98 for (j=1; j < ((int)ray.kdLeaves.size() - 1); j++) { 99 ray.kdLeaves[j]->AddPassingRay(ray, contributingSamples ? 1 : 0); 93 int objects = 0; 94 if (sObject) 95 objects++; 96 if (tObject) 97 objects++; 98 99 if (objects) { 100 for (j=0; j < ray.kdLeaves.size(); j++) { 101 KdNode *node = GetNodeForPvs( ray.kdLeaves[j] ); 102 if (sObject) 103 contributingSamples += sObject->mKdPvs.AddSample(node); 104 if (tObject) 105 contributingSamples += tObject->mKdPvs.AddSample(node); 106 } 107 } 108 109 for (j=1; j < ((int)ray.kdLeaves.size() - 1); j++) { 110 ray.kdLeaves[j]->AddPassingRay2(ray, 111 objects, 112 ray.kdLeaves.size() 113 ); 100 114 } 101 115 … … 148 162 int 149 163 SamplingPreprocessor::CastRay(Intersectable *object, 150 Ray &ray, 151 const bool reverseRay 164 Ray &ray 152 165 ) 153 166 { … … 159 172 long t2 = GetRealTime(); 160 173 161 if (0 && object ->GetId() > 2197) {174 if (0 && object && object->GetId() > 2197) { 162 175 object->Describe(cout)<<endl; 163 176 cout<<ray<<endl; … … 171 184 mBspTree->CastRay(ray); 172 185 173 if ( !reverseRay)186 if (object) 174 187 sampleContributions += AddObjectSamples(object, ray); 175 188 … … 184 197 { 185 198 if (ray.kdLeaves.size()) { 186 if (!reverseRay)187 sampleContributions += AddNodeSamples(object, ray);188 189 if (ray.intersections.size()) {190 sampleContributions += AddNodeSamples(ray.intersections[0].mObject, ray);191 }192 } 193 } 199 Intersectable *terminator = 200 ray.intersections.size() ? ray.intersections[0].mObject: NULL; 201 202 sampleContributions += AddNodeSamples(ray, 203 object, 204 terminator); 205 } 206 } 194 207 195 208 return sampleContributions; … … 278 291 // to the mesh 279 292 rays++; 280 edgeSamplesContributions += CastRay(object, ray , false);293 edgeSamplesContributions += CastRay(object, ray); 281 294 } 282 295 } … … 410 423 for (int k=0; k < mSamplesPerPass; k++) { 411 424 bool reverseSample = false; 412 425 413 426 414 427 if (nodeToSample) { … … 432 445 SetupRay(ray, point, direction, Ray::LOCAL_RAY); 433 446 434 sampleContributions = CastRay( object, ray, reverseSample);447 sampleContributions = CastRay(reverseSample ? NULL : object, ray); 435 448 436 449 //-- CORR matt: put block inside loop … … 576 589 } 577 590 for (int k=0; k < pvsOut; k++) { 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 591 Intersectable *object = objects[k]; 592 char s[64]; 593 sprintf(s, "sample-pvs%04d.x3d", k); 594 Exporter *exporter = Exporter::GetExporter(s); 595 exporter->SetWireframe(); 596 597 598 KdPvsMap::iterator i = object->mKdPvs.mEntries.begin(); 599 Intersectable::NewMail(); 600 601 // avoid adding the object to the list 602 object->Mail(); 603 ObjectContainer visibleObjects; 604 605 for (; i != object->mKdPvs.mEntries.end(); i++) 606 { 607 KdNode *node = (*i).first; 608 exporter->ExportBox(mKdTree->GetBox(node)); 609 mKdTree->CollectObjects(node, visibleObjects); 610 } 611 612 exporter->ExportRays(rays[k], 1000, RgbColor(0, 1, 0)); 613 exporter->SetFilled(); 614 615 for (int j = 0; j < visibleObjects.size(); j++) 616 exporter->ExportIntersectable(visibleObjects[j]); 617 618 619 Material m; 620 m.mDiffuseColor = RgbColor(1, 0, 0); 621 exporter->SetForcedMaterial(m); 622 exporter->ExportIntersectable(object); 623 624 delete exporter; 625 } 613 626 } 614 627 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h
r367 r369 7 7 #include "Preprocessor.h" 8 8 9 struct SimpleRay {10 Vector3 mOrigin;11 Vector3 mDirection;12 };13 9 14 10 /** Sampling based visibility preprocessing. The implementation is based on heuristical … … 42 38 GetNodeForPvs(KdLeaf *leaf); 43 39 44 int 45 AddNodeSamples(Intersectable *object, const Ray &ray); 40 int 41 AddNodeSamples(const Ray &ray, 42 Intersectable *sObject, 43 Intersectable *tObject 44 ); 46 45 47 46 void … … 49 48 50 49 int 51 CastRay(Intersectable *object, Ray &ray, const bool reverseSample); 52 50 CastRay(Intersectable *object, 51 Ray &ray); 52 53 53 KdNode * 54 54 GetNodeToSample(Intersectable *object); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h
r366 r369 35 35 */ 36 36 static void DeriveViewCells(const ObjectContainer &objects, 37 ViewCellContainer &viewCells,38 const int maxViewCells);37 ViewCellContainer &viewCells, 38 const int maxViewCells); 39 39 40 40 -
trunk/VUT/GtpVisibilityPreprocessor/src/default.env
r365 r369 11 11 # filename ../data/vienna/vienna-buildings.x3d 12 12 # filename ../data/vienna/viewcells-25-sel.x3d 13 filename ../data/atlanta/atlanta2.x3d13 # filename ../data/atlanta/atlanta2.x3d 14 14 # filename ../data/soda/soda.dat 15 #filename ../data/soda/soda5.dat15 filename ../data/soda/soda5.dat 16 16 } 17 17 … … 56 56 57 57 Sampling { 58 totalSamples 50000000058 totalSamples 100000000 59 59 samplesPerPass 3 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.