Changeset 369


Ignore:
Timestamp:
11/02/05 17:45:25 (19 years ago)
Author:
bittner
Message:

sampling contribution changes

Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.h

    r365 r369  
    161161  } 
    162162   
    163   void AddPassingRay(const Ray &ray, const int contributions) { 
     163  void AddPassingRay(const Ray &ray, 
     164                                                                                 const int contributions) { 
    164165    mPassingRays.AddRay(ray, contributions); 
    165166                //              Debug << "adding passing ray" << endl; 
    166167  } 
    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 
    168178  /** \sa KdNode::IsLeaf() */ 
    169179  virtual bool IsLeaf() const { return true; } 
     
    180190  /** Ray set description of the rays passing through this node */ 
    181191  PassingRaySet mPassingRays; 
    182  
     192         
    183193  /** PVS consisting of visible KdTree nodes */ 
    184194  KdPvs mKdPvs; 
    185    
     195         
     196        /** PVS consisting of visible objects */ 
     197  ViewCellPvs mPvs; 
    186198}; 
    187    
     199 
    188200   
    189201 
     
    227239       
    228240      bool operator()(const TraversalData a, const TraversalData b) { 
    229         return a.mPriority < b.mPriority; 
     241                                return a.mPriority < b.mPriority; 
    230242      } 
    231243       
     
    283295  void 
    284296  CollectObjects(KdNode *n, ObjectContainer &objects); 
    285  
     297         
    286298  void 
    287299  CollectLeaves(vector<KdLeaf *> &leaves); 
    288  
     300         
    289301  AxisAlignedBox3 GetBox(const KdNode *node) const { 
    290302    KdInterior *parent = node->mParent; 
     
    302314    return box; 
    303315  } 
    304  
     316         
    305317  KdNode * 
    306318  FindRandomNeighbor(KdNode *n, 
    307319                                                                                 bool onlyUnmailed 
    308320                                                                                 ); 
    309          
    310321   
    311322  KdNode * 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Makefile

    r364 r369  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (1.07a) (Qt 3.3.3) on: Tue Nov  1 09:17:00 2005 
     3# Generated by qmake (1.07a) (Qt 3.3.2) on: Wed Nov 02 15:58:09 2005 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    99####### Compiler, tools and options 
    1010 
    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 
     11CC              =       cl 
     12CXX             =       cl 
     13LEX             = flex 
     14YACC            = byacc 
     15CFLAGS  =       -nologo -Zm200 -W0 -MD -O2 -G7 -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 
     16CXXFLAGS        =       -nologo -Zm200 -W0 -MD -O2 -G7 -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 
     17LEXFLAGS        = 
     18YACCFLAGS       =-d 
     19INCPATH =        -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" 
     20LINK    =       "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe" 
     21LFLAGS  =       /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" 
     22LIBS    =        "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" 
     23MOC             =       $(QTDIR)\bin\moc.exe 
     24UIC             =       $(QTDIR)\bin\uic.exe 
     25QMAKE           =       qmake 
     26IDC             =       $(QTDIR)\bin\idc.exe 
     27IDL             =       midl 
     28ZIP             =       zip -r -9 
     29COPY_FILE       =       copy 
     30COPY_DIR        =       copy 
     31DEL_FILE        =       del 
     32DEL_DIR =       rmdir 
     33MOVE            =       move 
     34CHK_DIR_EXISTS =        if not exist 
     35MKDIR           =       mkdir 
    3336INSTALL_FILE= $(COPY_FILE) 
    3437INSTALL_DIR = $(COPY_DIR) 
    35 DEL_FILE = rm -f 
    36 SYMLINK  = ln -sf 
    37 DEL_DIR  = rmdir 
    38 MOVE     = mv -f 
    39 CHK_DIR_EXISTS= test -d 
    40 MKDIR    = mkdir -p 
    41  
    42 ####### Output directory 
    43  
    44 OBJECTS_DIR = ./ 
    4538 
    4639####### Files 
    4740 
    48 HEADERS = Halton.h 
    49 SOURCES = Preprocessor.cpp \ 
     41HEADERS =       Halton.h 
     42SOURCES =       Preprocessor.cpp \ 
    5043                SamplingPreprocessor.cpp \ 
    5144                ExactPreprocessor.cpp \ 
     
    7770                ViewCellBsp.cpp \ 
    7871                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 
     72OBJECTS =       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 
     102FORMS =  
     103UICDECLS =       
     104UICIMPLS =       
     105SRCMOC  =        
     106OBJMOC  =        
     107DIST    =        
     108TARGET  =       preprocessor.exe 
     109 
    120110####### Implicit rules 
    121111 
    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<< 
    138138 
    139139####### Build rules 
     
    141141all: Makefile $(TARGET) 
    142142 
    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 
    145148 
    146149mocables: $(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  
     150uicables: $(UICIMPLS) $(UICDECLS) 
     151 
     152Makefile: preprocessor.pro  C:\Qt\3.3.2\mkspecs\win32-msvc.net\qmake.conf C:\Qt\3.3.2\lib\qtmain.prl 
    153153        $(QMAKE) -o Makefile preprocessor.pro 
    154154qmake:  
    155155        @$(QMAKE) -o Makefile preprocessor.pro 
    156156 
    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  
     157dist: 
     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 
     160uiclean: 
    160161mocclean: 
    161  
    162 uiclean: 
    163  
    164 yaccclean: 
    165 lexclean: 
    166 clean: 
    167         -$(DEL_FILE) $(OBJECTS) 
    168         -$(DEL_FILE) *~ core *.core 
    169  
    170  
    171 ####### Sub-libraries 
     162clean: 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 
     196FORCE: 
    172197 
    173198distclean: clean 
    174         -$(DEL_FILE) $(TARGET) $(TARGET) 
    175  
    176  
    177 FORCE: 
     199        -$(DEL_FILE) $(TARGET) 
    178200 
    179201####### Compile 
    180202 
    181 Preprocessor.o: Preprocessor.cpp SceneGraph.h \ 
     203Preprocessor.obj: Preprocessor.cpp  \ 
     204                SceneGraph.h \ 
    182205                Exporter.h \ 
    183206                UnigraphicsParser.h \ 
     
    200223                Intersectable.h \ 
    201224                Pvs.h \ 
    202                 Ray.h 
    203  
    204 SamplingPreprocessor.o: SamplingPreprocessor.cpp SceneGraph.h \ 
     225                Ray.h \ 
     226                 
     227 
     228SamplingPreprocessor.obj: SamplingPreprocessor.cpp  \ 
     229                SceneGraph.h \ 
    205230                KdTree.h \ 
    206231                SamplingPreprocessor.h \ 
     
    224249                Intersectable.h \ 
    225250                Material.h \ 
    226                 Exporter.h 
    227  
    228 ExactPreprocessor.o: ExactPreprocessor.cpp ExactPreprocessor.h \ 
     251                Exporter.h \ 
     252                 
     253 
     254ExactPreprocessor.obj: ExactPreprocessor.cpp  \ 
     255                ExactPreprocessor.h \ 
    229256                Preprocessor.h \ 
    230257                Containers.h \ 
     
    242269                Vector3.h \ 
    243270                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 
     274KdTree.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 
     291Environment.obj: Environment.cpp  \ 
     292                gzstream.h \ 
     293                common.h \ 
     294                Environment.h \ 
     295                Vector3.h \ 
     296                 
     297 
     298gzstream.obj: gzstream.cpp  \ 
     299                gzstream.h \ 
     300                 
     301 
     302common.obj: common.cpp  \ 
     303                common.h \ 
     304                 
     305 
     306UnigraphicsParser.obj: UnigraphicsParser.cpp  \ 
     307                Vector3.h \ 
    271308                Mesh.h \ 
    272309                SceneGraph.h \ 
     
    282319                Rectangle3.h \ 
    283320                Containers.h \ 
    284                 Parser.h 
    285  
    286 X3dExporter.o: X3dExporter.cpp common.h \ 
     321                Parser.h \ 
     322                 
     323 
     324X3dExporter.obj: X3dExporter.cpp  \ 
     325                common.h \ 
    287326                SceneGraph.h \ 
    288327                X3dExporter.h \ 
     
    302341                Intersectable.h \ 
    303342                Pvs.h \ 
    304                 Ray.h 
    305  
    306 SceneGraph.o: SceneGraph.cpp SceneGraph.h \ 
     343                Ray.h \ 
     344                 
     345 
     346SceneGraph.obj: SceneGraph.cpp  \ 
     347                SceneGraph.h \ 
    307348                X3dExporter.h \ 
    308349                Intersectable.h \ 
     
    316357                Exporter.h \ 
    317358                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 
     362Material.obj: Material.cpp  \ 
     363                common.h \ 
     364                Material.h \ 
     365                 
     366 
     367Matrix4x4.obj: Matrix4x4.cpp  \ 
     368                Matrix4x4.h \ 
     369                Vector3.h \ 
     370                common.h \ 
     371                 
     372 
     373Vector3.obj: Vector3.cpp  \ 
     374                Matrix4x4.h \ 
    328375                Vector3.h \ 
    329376                Halton.h \ 
    330                 common.h 
    331  
    332 AxisAlignedBox3.o: AxisAlignedBox3.cpp AxisAlignedBox3.h \ 
     377                common.h \ 
     378                 
     379 
     380AxisAlignedBox3.obj: AxisAlignedBox3.cpp  \ 
     381                AxisAlignedBox3.h \ 
    333382                Ray.h \ 
    334383                Polygon3.h \ 
     
    342391                Intersectable.h \ 
    343392                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 
     396Ray.obj: Ray.cpp  \ 
     397                Ray.h \ 
     398                Plane3.h \ 
     399                Matrix4x4.h \ 
     400                Vector3.h \ 
     401                common.h \ 
     402                 
     403 
     404main.obj: main.cpp  \ 
     405                SamplingPreprocessor.h \ 
    353406                ExactPreprocessor.h \ 
    354407                Parser.h \ 
     
    376429                Vector3.h \ 
    377430                common.h \ 
    378                 Ray.h 
    379  
    380 Mesh.o: Mesh.cpp Ray.h \ 
     431                Ray.h \ 
     432                 
     433 
     434Mesh.obj: Mesh.cpp  \ 
     435                Ray.h \ 
    381436                Mesh.h \ 
    382437                MeshKdTree.h \ 
     
    391446                Pvs.h \ 
    392447                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 
     451Exporter.obj: Exporter.cpp  \ 
     452                X3dExporter.h \ 
     453                Exporter.h \ 
     454                Containers.h \ 
     455                Material.h \ 
     456                 
     457 
     458Camera.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 
     476X3dParser.obj: X3dParser.cpp  \ 
     477                X3dParser.h \ 
    417478                X3dParserXerces.h \ 
    418479                Mesh.h \ 
     
    431492                Vector3.h \ 
    432493                common.h \ 
    433                 Ray.h 
    434  
    435 MeshKdTree.o: MeshKdTree.cpp Environment.h \ 
     494                Ray.h \ 
     495                 
     496 
     497MeshKdTree.obj: MeshKdTree.cpp  \ 
     498                Environment.h \ 
    436499                Mesh.h \ 
    437500                MeshKdTree.h \ 
     
    446509                Vector3.h \ 
    447510                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 
     514Pvs.obj: Pvs.cpp  \ 
     515                Pvs.h \ 
     516                 
     517 
     518MutualVisibility.obj: MutualVisibility.cpp  \ 
     519                KdTree.h \ 
    453520                AxisAlignedBox3.h \ 
    454521                Ray.h \ 
     
    466533                common.h \ 
    467534                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 
     538Triangle3.obj: Triangle3.cpp  \ 
     539                Triangle3.h \ 
     540                Vector3.h \ 
     541                common.h \ 
     542                 
     543 
     544Rectangle3.obj: Rectangle3.cpp  \ 
     545                Rectangle3.h \ 
     546                Vector3.h \ 
     547                common.h \ 
     548                 
     549 
     550Plane3.obj: Plane3.cpp  \ 
     551                Plane3.h \ 
     552                Matrix4x4.h \ 
     553                Vector3.h \ 
     554                common.h \ 
     555                 
     556 
     557Polygon3.obj: Polygon3.cpp  \ 
     558                Polygon3.h \ 
    484559                Mesh.h \ 
    485560                ViewCellBsp.h \ 
     
    494569                Rectangle3.h \ 
    495570                Vector3.h \ 
    496                 common.h 
    497  
    498 ViewCell.o: ViewCell.cpp ViewCell.h \ 
     571                common.h \ 
     572                 
     573 
     574ViewCell.obj: ViewCell.cpp  \ 
     575                ViewCell.h \ 
    499576                Mesh.h \ 
    500577                Intersectable.h \ 
     
    510587                Rectangle3.h \ 
    511588                Vector3.h \ 
    512                 common.h 
    513  
    514 ViewCellBsp.o: ViewCellBsp.cpp Plane3.h \ 
     589                common.h \ 
     590                 
     591 
     592ViewCellBsp.obj: ViewCellBsp.cpp  \ 
     593                Plane3.h \ 
    515594                ViewCellBsp.h \ 
    516595                Mesh.h \ 
     
    528607                Material.h \ 
    529608                Pvs.h \ 
    530                 Rectangle3.h 
    531  
    532 Halton.o: Halton.cpp Halton.h 
     609                Rectangle3.h \ 
     610                 
     611 
     612Halton.obj: Halton.cpp  \ 
     613                Halton.h \ 
     614                 
    533615 
    534616####### Install 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Pvs.h

    r366 r369  
    3131{ 
    3232public: 
    33     Pvs(): mSamples(0), mEntries() {} 
     33        Pvs(): mSamples(0), mEntries() {} 
     34 
    3435        int mSamples; 
    3536 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Ray.cpp

    r367 r369  
    139139} 
    140140 
     141void 
     142PassingRaySet::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 
    141153int 
    142154PassingRaySet::GetEntryIndex(const Vector3 &direction) const 
     
    158170} 
    159171 
    160 int Ray::ClassifyPlane(const Plane3 &plane,  
    161                                            const float minT,  
    162                                            const float maxT) const 
     172int 
     173Ray::ClassifyPlane(const Plane3 &plane,  
     174                                                                         const float minT,  
     175                                                                         const float maxT) const 
    163176{ 
    164177        const Vector3 entp = Extrap(minT); 
     
    169182 
    170183        if (entSide < 0) 
    171         { 
    172                 if (extSide >= 0) 
    173184                { 
    174                         return BACK_FRONT; 
     185                        if (extSide >= 0) 
     186                                { 
     187                                        return BACK_FRONT; 
     188                                } 
     189                        return BACK; 
    175190                } 
    176                 return BACK; 
    177         } 
    178191        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                } 
    185198        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                } 
    192205         
    193206        return COINCIDENT; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Ray.h

    r367 r369  
    2323public: 
    2424  enum RayType { LOCAL_RAY, GLOBAL_RAY, LINE_SEGMENT }; 
    25  
     25         
    2626  enum { NO_INTERSECTION=0, INTERSECTION_OUT_OF_LIMITS, INTERSECTION }; 
    2727 
     
    3636    // can be either mesh or a viewcell 
    3737    Intersectable *mObject; 
    38  
     38                 
    3939    // the face of the intersectable 
    4040    int mFace; 
    4141 
    4242    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                 
    4646    Intersection() {} 
    47  
     47                 
    4848    bool operator<( 
    49                   const Intersection &b) const { 
     49                                                                        const Intersection &b) const { 
    5050      return  
    51         mT 
    52         < 
    53         b.mT; 
     51                                mT 
     52                                < 
     53                                b.mT; 
    5454    } 
    5555     
     
    7070  Ray(const Vector3 &wherefrom, 
    7171      const Vector3 &whichdir, 
    72       const int _type, 
    73       const void *_originCell = NULL) { 
     72      const int _type) { 
    7473    loc = wherefrom; 
    7574    if (_type == LINE_SEGMENT) 
     
    9493  // Inititalize the ray again when already constructed 
    9594  void Init(const Vector3 &wherefrom, 
    96             const Vector3 &whichdir, 
    97             const int _type,  
    98             bool dirNormalized = false) { 
     95                                                const Vector3 &whichdir, 
     96                                                const int _type,  
     97                                                bool dirNormalized = false) { 
    9998    loc = wherefrom; 
    10099    dir = (dirNormalized || _type == LINE_SEGMENT) ? whichdir: Normalize(whichdir) ; 
     
    252251  int mRays; 
    253252  int mContributions; 
    254   PassingRaySet() { 
     253 
     254        PassingRaySet() { 
    255255    Reset(); 
    256256  } 
    257   void 
     257 
     258        void 
    258259  Reset(); 
    259260   
    260261  void AddRay(const Ray &ray, const int contributions); 
     262        void AddRay2(const Ray &ray, 
     263                                                         const int objects, 
     264                                                         const int viewcells); 
     265 
    261266  int GetEntryIndex(const Vector3 &direction) const; 
    262267 
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp

    r367 r369  
    8484 
    8585int 
    86 SamplingPreprocessor::AddNodeSamples(Intersectable *object, 
    87                                                                                                                                                  const Ray &ray 
     86SamplingPreprocessor::AddNodeSamples(const Ray &ray, 
     87                                                                                                                                                 Intersectable *sObject, 
     88                                                                                                                                                 Intersectable *tObject 
    8889                                                                                                                                                 ) 
    8990{ 
    9091  int contributingSamples = 0; 
    9192  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                                                                                                                                                ); 
    100114  } 
    101115   
     
    148162int 
    149163SamplingPreprocessor::CastRay(Intersectable *object, 
    150                                                                                                                         Ray &ray, 
    151                                                                                                                         const bool reverseRay 
     164                                                                                                                        Ray &ray 
    152165                                                                                                                        ) 
    153166{ 
     
    159172        long t2 = GetRealTime(); 
    160173 
    161         if (0 && object->GetId() > 2197) { 
     174        if (0 && object && object->GetId() > 2197) { 
    162175                object->Describe(cout)<<endl; 
    163176                cout<<ray<<endl; 
     
    171184                        mBspTree->CastRay(ray); 
    172185                         
    173                         if (!reverseRay) 
     186                        if (object) 
    174187                                sampleContributions += AddObjectSamples(object, ray); 
    175188                         
     
    184197                { 
    185198                        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                } 
    194207         
    195208        return sampleContributions; 
     
    278291                        // to the mesh 
    279292                        rays++; 
    280                         edgeSamplesContributions += CastRay(object, ray, false); 
     293                        edgeSamplesContributions += CastRay(object, ray); 
    281294                } 
    282295        } 
     
    410423                                for (int k=0; k < mSamplesPerPass; k++) { 
    411424                                        bool reverseSample = false; 
    412  
     425                                         
    413426 
    414427                                        if (nodeToSample) { 
     
    432445                                        SetupRay(ray, point, direction, Ray::LOCAL_RAY); 
    433446                                         
    434                                         sampleContributions = CastRay(object, ray, reverseSample); 
     447                                        sampleContributions = CastRay(reverseSample ? NULL : object, ray); 
    435448                                         
    436449                                        //-- CORR matt: put block inside loop 
     
    576589        } 
    577590   for (int k=0; k < pvsOut; k++) { 
    578       Intersectable *object = objects[k]; 
    579       char s[64]; 
    580       sprintf(s, "sample-pvs%04d.x3d", k); 
    581       Exporter *exporter = Exporter::GetExporter(s); 
    582       exporter->SetWireframe(); 
    583  
    584          
    585           KdPvsMap::iterator i = object->mKdPvs.mEntries.begin(); 
    586           Intersectable::NewMail(); 
    587                    
    588           // avoid adding the object to the list 
    589           object->Mail(); 
    590           ObjectContainer visibleObjects; 
    591  
    592           for (; i != object->mKdPvs.mEntries.end(); i++)  
    593           { 
    594                   KdNode *node = (*i).first; 
    595                   exporter->ExportBox(mKdTree->GetBox(node)); 
    596                   mKdTree->CollectObjects(node, visibleObjects); 
    597           } 
    598  
    599           exporter->ExportRays(rays[k], 1000, RgbColor(0, 1, 0)); 
    600           exporter->SetFilled(); 
    601  
    602           for (int j = 0; j < visibleObjects.size(); j++) 
    603                   exporter->ExportIntersectable(visibleObjects[j]); 
    604          
    605  
    606           Material m; 
    607           m.mDiffuseColor = RgbColor(1, 0, 0); 
    608           exporter->SetForcedMaterial(m); 
    609           exporter->ExportIntersectable(object); 
    610  
    611           delete exporter; 
    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        } 
    613626  } 
    614627   
  • trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h

    r367 r369  
    77#include "Preprocessor.h" 
    88 
    9 struct SimpleRay { 
    10   Vector3 mOrigin; 
    11   Vector3 mDirection; 
    12 }; 
    139 
    1410/** Sampling based visibility preprocessing. The implementation is based on heuristical 
     
    4238  GetNodeForPvs(KdLeaf *leaf); 
    4339 
    44   int 
    45   AddNodeSamples(Intersectable *object, const Ray &ray); 
     40        int 
     41        AddNodeSamples(const Ray &ray, 
     42                                                                 Intersectable *sObject, 
     43                                                                 Intersectable *tObject 
     44                                                                 ); 
    4645 
    4746  void 
     
    4948 
    5049        int 
    51         CastRay(Intersectable *object, Ray &ray, const bool reverseSample); 
    52  
     50        CastRay(Intersectable *object, 
     51                                        Ray &ray); 
     52         
    5353        KdNode * 
    5454        GetNodeToSample(Intersectable *object); 
  • trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.h

    r366 r369  
    3535        */ 
    3636        static void DeriveViewCells(const ObjectContainer &objects,  
    37                                                                 ViewCellContainer &viewCells,  
    38                                                                 const int maxViewCells); 
     37                                                                                                                        ViewCellContainer &viewCells,  
     38                                                                                                                        const int maxViewCells); 
    3939 
    4040         
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r365 r369  
    1111#       filename ../data/vienna/vienna-buildings.x3d 
    1212# filename ../data/vienna/viewcells-25-sel.x3d 
    13 filename ../data/atlanta/atlanta2.x3d 
     13# filename ../data/atlanta/atlanta2.x3d 
    1414#       filename ../data/soda/soda.dat 
    15 #       filename ../data/soda/soda5.dat 
     15filename ../data/soda/soda5.dat 
    1616} 
    1717 
     
    5656 
    5757Sampling { 
    58         totalSamples    500000000 
     58        totalSamples 100000000 
    5959        samplesPerPass  3 
    6060} 
Note: See TracChangeset for help on using the changeset viewer.