Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp	(revision 352)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCell.cpp	(revision 359)
@@ -48,5 +48,6 @@
 ViewCell *ViewCell::ExtrudeViewCell(const Triangle3 &baseTri, const float height)
 {
-	// one mesh per view cell
+ int i; 
+ // one mesh per view cell
 	Mesh *mesh = new Mesh();
 	
@@ -68,9 +69,9 @@
 
 	// add base vertices and calculate top vertices
-	for (int i = 0; i < 3; ++ i)
+		for (i = 0; i < 3; ++ i)
 		 mesh->mVertices.push_back(baseTri.mVertices[i]);
 	
 	// add top vertices	
-	for (i = 0; i < 3; ++ i)
+																for (i = 0; i < 3; ++ i)
 		mesh->mVertices.push_back(baseTri.mVertices[i] + height * triNorm);
 	
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.h
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.h	(revision 245)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.h	(revision 359)
@@ -88,8 +88,8 @@
 
   MutualVisibilitySampler(SceneGraph *sceneGraph,
-			  KdTree *kdTree,
-			  AxisAlignedBox3 &source,
-			  AxisAlignedBox3 &target,
-			  const float solidAngleThreshold);
+													KdTree *kdTree,
+													const AxisAlignedBox3 &source,
+													const AxisAlignedBox3 &target,
+													const float solidAngleThreshold);
   int
   ComputeVisibility();
@@ -97,67 +97,67 @@
   void
   ConstructInitialSamples(
-			  const AxisAlignedBox3 &source,
-			  const AxisAlignedBox3 &target,
-			  vector<RayShaft *> &samples
-			  );
-
+													const AxisAlignedBox3 &source,
+													const AxisAlignedBox3 &target,
+													vector<RayShaft *> &samples
+													);
+	
   void
   ConstructInitialSamples2(
-			  const AxisAlignedBox3 &source,
-			  const AxisAlignedBox3 &target,
-			  vector<RayShaft *> &samples
-			  );
-
+													 const AxisAlignedBox3 &source,
+													 const AxisAlignedBox3 &target,
+													 vector<RayShaft *> &samples
+													 );
+	
   void
   ConstructInitialSamples3(
-			   const AxisAlignedBox3 &source,
-			   const AxisAlignedBox3 &target,
-			   vector<RayShaft *> &samples
-			   );
-
+													 const AxisAlignedBox3 &source,
+													 const AxisAlignedBox3 &target,
+													 vector<RayShaft *> &samples
+													 );
+	
   void
   AddInitialSamples(
-		    const Rectangle3 &sourceRect,
-		    const Rectangle3 &targetRect,
-		    vector<RayShaft *> &samples
-		    );
-
+										const Rectangle3 &sourceRect,
+										const Rectangle3 &targetRect,
+										vector<RayShaft *> &samples
+										);
+	
   void
   AddInitialSamples2(
-		     const Rectangle3 &sourceRect,
-		     const Rectangle3 &targetRect,
-		     vector<RayShaft *> &samples
-		     );
-
+										 const Rectangle3 &sourceRect,
+										 const Rectangle3 &targetRect,
+										 vector<RayShaft *> &samples
+										 );
+	
   // the split sample method contains a methodology to create new samples
   // or terminate the sampling
   bool
   SplitSample(
-	      const RayShaft &source,
-	      RayShaft &sample1,
-	      RayShaft &sample2
-	      );
+							const RayShaft &source,
+							RayShaft &sample1,
+							RayShaft &sample2
+							);
   void
   PerformSplit(
-	       const RayShaft &sample,
-	       const bool splitSource,
-	       const int axis,
-	       RayShaft &sample1,
-	       RayShaft &sample2
-	       );
+							 const RayShaft &sample,
+							 const bool splitSource,
+							 const int axis,
+							 RayShaft &sample1,
+							 RayShaft &sample2
+							 );
   
-
+	
   bool
   SampleTerminationCriteriaMet(
-			       const RayShaft &sample);
+															 const RayShaft &sample);
   
   float
   GetSpatialAngle(const RayShaft &sample,
-		  const Vector3 &point
-		  );
-
+									const Vector3 &point
+									);
+	
   int
   CastRays(RayShaft &shaft);
-
+	
   void
   ComputeError(RayShaft &sample);
@@ -172,7 +172,7 @@
 ComputeBoxVisibility(SceneGraph *sceneGraph,
 		     KdTree *kdTree,
-		     AxisAlignedBox3 &source,
-		     AxisAlignedBox3 &target,
-		     float solidAngleThreshold);
+		     const AxisAlignedBox3 &source,
+		     const AxisAlignedBox3 &target,
+		     const float solidAngleThreshold);
 
 
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h	(revision 352)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h	(revision 359)
@@ -98,5 +98,5 @@
 class BspNode 
 {
-	friend BspTree;
+	friend class BspTree;
 
 public:
@@ -143,5 +143,5 @@
 class BspInterior : public BspNode 
 {
-	friend BspTree;
+	friend class BspTree;
 public:
 	/** Standard contructor taking split plane as argument.
@@ -200,5 +200,5 @@
 class BspLeaf : public BspNode 
 {
-	friend BspTree;
+	friend class BspTree;
 
 public:
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/Makefile
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/Makefile	(revision 354)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/Makefile	(revision 359)
@@ -1,5 +1,5 @@
 #############################################################################
 # Makefile for building: preprocessor
-# Generated by qmake (1.07a) (Qt 3.3.2) on: Wed Oct 26 17:55:30 2005
+# Generated by qmake (1.07a) (Qt 3.3.3) on: Fri Oct 28 16:08:05 2005
 # Project:  preprocessor.pro
 # Template: app
@@ -9,36 +9,43 @@
 ####### Compiler, tools and options
 
-CC		=	cl
-CXX		=	cl
-LEX		= flex
-YACC		= byacc
-CFLAGS	=	-nologo -Zm200 -W0 -MD -O2 -G7 -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
-CXXFLAGS	=	-nologo -Zm200 -W0 -MD -O2 -G7 -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
-LEXFLAGS	=
-YACCFLAGS	=-d
-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"
-LINK	=	"c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe"
-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"
-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"
-MOC		=	$(QTDIR)\bin\moc.exe
-UIC		=	$(QTDIR)\bin\uic.exe
-QMAKE		=	qmake
-IDC		=	$(QTDIR)\bin\idc.exe
-IDL		=	midl
-ZIP		=	zip -r -9
-COPY_FILE	=       copy
-COPY_DIR	=       copy
-DEL_FILE	=       del
-DEL_DIR	=       rmdir
-MOVE		=       move
-CHK_DIR_EXISTS =	if not exist
-MKDIR		=	mkdir
+CC       = gcc
+CXX      = g++
+LEX      = flex
+YACC     = yacc
+CFLAGS   = -pipe -O2 -fmessage-length=0 -Wall -w -O2 -fmessage-length=0 -Wall -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT
+CXXFLAGS = -pipe -O2 -fmessage-length=0 -Wall -w -O2 -fmessage-length=0 -Wall -D_REENTRANT  -DQT_NO_DEBUG -DQT_THREAD_SUPPORT
+LEXFLAGS = 
+YACCFLAGS= -d
+INCPATH  = -I/usr/lib/qt3/mkspecs/default -I. -I../src -I../support/xerces/include -I../support/zlib/include -I../support/boost -I../support/devil/include -I/usr/include -I$(QTDIR)/include
+LINK     = g++
+LFLAGS   = 
+LIBS     = $(SUBLIBS) -L/usr/lib64/ -L$(QTDIR)/lib64/ -L/usr/X11R6/lib64/ -lqt-mt -lXext -lX11 -lm -lpthread
+AR       = ar cqs
+RANLIB   = 
+MOC      = $(QTDIR)/bin/moc
+UIC      = $(QTDIR)/bin/uic
+QMAKE    = qmake
+TAR      = tar -cf
+GZIP     = gzip -9f
+COPY     = cp -f
+COPY_FILE= $(COPY)
+COPY_DIR = $(COPY) -r
 INSTALL_FILE= $(COPY_FILE)
 INSTALL_DIR = $(COPY_DIR)
+DEL_FILE = rm -f
+SYMLINK  = ln -sf
+DEL_DIR  = rmdir
+MOVE     = mv -f
+CHK_DIR_EXISTS= test -d
+MKDIR    = mkdir -p
+
+####### Output directory
+
+OBJECTS_DIR = ./
 
 ####### Files
 
-HEADERS =	Halton.h
-SOURCES =	Preprocessor.cpp \
+HEADERS = Halton.h
+SOURCES = Preprocessor.cpp \
 		SamplingPreprocessor.cpp \
 		ExactPreprocessor.cpp \
@@ -70,70 +77,63 @@
 		ViewCellBsp.cpp \
 		Halton.cpp
-OBJECTS =	Preprocessor.obj \
-		SamplingPreprocessor.obj \
-		ExactPreprocessor.obj \
-		KdTree.obj \
-		Environment.obj \
-		gzstream.obj \
-		common.obj \
-		UnigraphicsParser.obj \
-		X3dExporter.obj \
-		SceneGraph.obj \
-		Material.obj \
-		Matrix4x4.obj \
-		Vector3.obj \
-		AxisAlignedBox3.obj \
-		Ray.obj \
-		main.obj \
-		Mesh.obj \
-		Exporter.obj \
-		Camera.obj \
-		X3dParser.obj \
-		MeshKdTree.obj \
-		Pvs.obj \
-		MutualVisibility.obj \
-		Triangle3.obj \
-		Rectangle3.obj \
-		Plane3.obj \
-		Polygon3.obj \
-		ViewCell.obj \
-		ViewCellBsp.obj \
-		Halton.obj
-FORMS =	
-UICDECLS =	
-UICIMPLS =	
-SRCMOC	=	
-OBJMOC	=	
-DIST	=	
-TARGET	=	preprocessor.exe
-
+OBJECTS = Preprocessor.o \
+		SamplingPreprocessor.o \
+		ExactPreprocessor.o \
+		KdTree.o \
+		Environment.o \
+		gzstream.o \
+		common.o \
+		UnigraphicsParser.o \
+		X3dExporter.o \
+		SceneGraph.o \
+		Material.o \
+		Matrix4x4.o \
+		Vector3.o \
+		AxisAlignedBox3.o \
+		Ray.o \
+		main.o \
+		Mesh.o \
+		Exporter.o \
+		Camera.o \
+		X3dParser.o \
+		MeshKdTree.o \
+		Pvs.o \
+		MutualVisibility.o \
+		Triangle3.o \
+		Rectangle3.o \
+		Plane3.o \
+		Polygon3.o \
+		ViewCell.o \
+		ViewCellBsp.o \
+		Halton.o
+FORMS = 
+UICDECLS = 
+UICIMPLS = 
+SRCMOC   = 
+OBJMOC = 
+DIST	   = preprocessor.pro
+QMAKE_TARGET = preprocessor
+DESTDIR  = 
+TARGET   = preprocessor
+
+first: all
 ####### Implicit rules
 
-.SUFFIXES: .c .cpp .cc .cxx .C
-
-{.}.cpp{}.obj::
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
-	$<
-<<
-
-{.}.cc{}.obj::
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
-	$<
-<<
-
-{.}.cxx{}.obj::
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
-	$<
-<<
-
-{.}.C{}.obj::
-	$(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo @<<
-	$<
-<<
-
-{.}.c{}.obj::
-	$(CC) -c $(CFLAGS) $(INCPATH) -Fo @<<
-	$<
-<<
+.SUFFIXES: .c .o .cpp .cc .cxx .C
+
+.cpp.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.cc.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.cxx.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.C.o:
+	$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.c.o:
+	$(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
 
 ####### Build rules
@@ -141,66 +141,43 @@
 all: Makefile $(TARGET)
 
-$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC) 
-	$(LINK) $(LFLAGS) /OUT:$(TARGET) @<< 
-	  $(OBJECTS) $(OBJMOC) $(LIBS)
-<<
-
+$(TARGET):  $(UICDECLS) $(OBJECTS) $(OBJMOC)  
+	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(OBJCOMP) $(LIBS)
 
 mocables: $(SRCMOC)
-uicables: $(UICIMPLS) $(UICDECLS)
-
-Makefile: preprocessor.pro  C:\Qt\3.3.2\mkspecs\win32-msvc.net\qmake.conf C:\Qt\3.3.2\lib\qtmain.prl
+uicables: $(UICDECLS) $(UICIMPLS)
+
+$(MOC): 
+	( cd $(QTDIR)/src/moc && $(MAKE) )
+
+Makefile: preprocessor.pro  /usr/lib/qt3/mkspecs/default/qmake.conf 
 	$(QMAKE) -o Makefile preprocessor.pro
 qmake: 
 	@$(QMAKE) -o Makefile preprocessor.pro
 
-dist:
-	$(ZIP) preprocessor.zip $(SOURCES) $(HEADERS) $(DIST) $(FORMS) d:/gametools/svn/trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro C:\Qt\3.3.2\lib\qtmain.prl  
+dist: 
+	@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
+
+mocclean:
 
 uiclean:
-mocclean:
-clean: uiclean mocclean
-	-$(DEL_FILE) Preprocessor.obj
-	-$(DEL_FILE) SamplingPreprocessor.obj
-	-$(DEL_FILE) ExactPreprocessor.obj
-	-$(DEL_FILE) KdTree.obj
-	-$(DEL_FILE) Environment.obj
-	-$(DEL_FILE) gzstream.obj
-	-$(DEL_FILE) common.obj
-	-$(DEL_FILE) UnigraphicsParser.obj
-	-$(DEL_FILE) X3dExporter.obj
-	-$(DEL_FILE) SceneGraph.obj
-	-$(DEL_FILE) Material.obj
-	-$(DEL_FILE) Matrix4x4.obj
-	-$(DEL_FILE) Vector3.obj
-	-$(DEL_FILE) AxisAlignedBox3.obj
-	-$(DEL_FILE) Ray.obj
-	-$(DEL_FILE) main.obj
-	-$(DEL_FILE) Mesh.obj
-	-$(DEL_FILE) Exporter.obj
-	-$(DEL_FILE) Camera.obj
-	-$(DEL_FILE) X3dParser.obj
-	-$(DEL_FILE) MeshKdTree.obj
-	-$(DEL_FILE) Pvs.obj
-	-$(DEL_FILE) MutualVisibility.obj
-	-$(DEL_FILE) Triangle3.obj
-	-$(DEL_FILE) Rectangle3.obj
-	-$(DEL_FILE) Plane3.obj
-	-$(DEL_FILE) Polygon3.obj
-	-$(DEL_FILE) ViewCell.obj
-	-$(DEL_FILE) ViewCellBsp.obj
-	-$(DEL_FILE) Halton.obj
-
+
+yaccclean:
+lexclean:
+clean:
+	-$(DEL_FILE) $(OBJECTS)
+	-$(DEL_FILE) *~ core *.core
+
+
+####### Sub-libraries
+
+distclean: clean
+	-$(DEL_FILE) $(TARGET) $(TARGET)
 
 
 FORCE:
 
-distclean: clean
-	-$(DEL_FILE) $(TARGET)
-
 ####### Compile
 
-Preprocessor.obj: Preprocessor.cpp  \
-		SceneGraph.h \
+Preprocessor.o: Preprocessor.cpp SceneGraph.h \
 		Exporter.h \
 		UnigraphicsParser.h \
@@ -223,9 +200,7 @@
 		Intersectable.h \
 		Pvs.h \
-		Ray.h \
-		
-
-SamplingPreprocessor.obj: SamplingPreprocessor.cpp  \
-		SceneGraph.h \
+		Ray.h
+
+SamplingPreprocessor.o: SamplingPreprocessor.cpp SceneGraph.h \
 		KdTree.h \
 		SamplingPreprocessor.h \
@@ -249,9 +224,7 @@
 		Intersectable.h \
 		Material.h \
-		Exporter.h \
-		
-
-ExactPreprocessor.obj: ExactPreprocessor.cpp  \
-		ExactPreprocessor.h \
+		Exporter.h
+
+ExactPreprocessor.o: ExactPreprocessor.cpp ExactPreprocessor.h \
 		Preprocessor.h \
 		Containers.h \
@@ -269,41 +242,31 @@
 		Vector3.h \
 		common.h \
-		Ray.h \
-		
-
-KdTree.obj: KdTree.cpp  \
+		Ray.h
+
+KdTree.o: KdTree.cpp Environment.h \
+		Mesh.h \
+		KdTree.h \
+		common.h \
+		Intersectable.h \
+		Plane3.h \
+		Matrix4x4.h \
+		AxisAlignedBox3.h \
+		Material.h \
+		Pvs.h \
+		Rectangle3.h \
+		Vector3.h \
+		Containers.h \
+		Ray.h
+
+Environment.o: Environment.cpp gzstream.h \
+		common.h \
 		Environment.h \
-		Mesh.h \
-		KdTree.h \
-		common.h \
-		Intersectable.h \
-		Plane3.h \
-		Matrix4x4.h \
-		AxisAlignedBox3.h \
-		Material.h \
-		Pvs.h \
-		Rectangle3.h \
-		Vector3.h \
-		Containers.h \
-		Ray.h \
-		
-
-Environment.obj: Environment.cpp  \
-		gzstream.h \
-		common.h \
-		Environment.h \
-		Vector3.h \
-		
-
-gzstream.obj: gzstream.cpp  \
-		gzstream.h \
-		
-
-common.obj: common.cpp  \
-		common.h \
-		
-
-UnigraphicsParser.obj: UnigraphicsParser.cpp  \
-		Vector3.h \
+		Vector3.h
+
+gzstream.o: gzstream.cpp gzstream.h
+
+common.o: common.cpp common.h
+
+UnigraphicsParser.o: UnigraphicsParser.cpp Vector3.h \
 		Mesh.h \
 		SceneGraph.h \
@@ -319,9 +282,7 @@
 		Rectangle3.h \
 		Containers.h \
-		Parser.h \
-		
-
-X3dExporter.obj: X3dExporter.cpp  \
-		common.h \
+		Parser.h
+
+X3dExporter.o: X3dExporter.cpp common.h \
 		SceneGraph.h \
 		X3dExporter.h \
@@ -341,9 +302,7 @@
 		Intersectable.h \
 		Pvs.h \
-		Ray.h \
-		
-
-SceneGraph.obj: SceneGraph.cpp  \
-		SceneGraph.h \
+		Ray.h
+
+SceneGraph.o: SceneGraph.cpp SceneGraph.h \
 		X3dExporter.h \
 		Intersectable.h \
@@ -357,27 +316,19 @@
 		Exporter.h \
 		Material.h \
-		Pvs.h \
-		
-
-Material.obj: Material.cpp  \
-		common.h \
-		Material.h \
-		
-
-Matrix4x4.obj: Matrix4x4.cpp  \
-		Matrix4x4.h \
-		Vector3.h \
-		common.h \
-		
-
-Vector3.obj: Vector3.cpp  \
-		Matrix4x4.h \
+		Pvs.h
+
+Material.o: Material.cpp common.h \
+		Material.h
+
+Matrix4x4.o: Matrix4x4.cpp Matrix4x4.h \
+		Vector3.h \
+		common.h
+
+Vector3.o: Vector3.cpp Matrix4x4.h \
 		Vector3.h \
 		Halton.h \
-		common.h \
-		
-
-AxisAlignedBox3.obj: AxisAlignedBox3.cpp  \
-		AxisAlignedBox3.h \
+		common.h
+
+AxisAlignedBox3.o: AxisAlignedBox3.cpp AxisAlignedBox3.h \
 		Ray.h \
 		Polygon3.h \
@@ -391,17 +342,13 @@
 		Intersectable.h \
 		Material.h \
-		Pvs.h \
-		
-
-Ray.obj: Ray.cpp  \
-		Ray.h \
-		Plane3.h \
-		Matrix4x4.h \
-		Vector3.h \
-		common.h \
-		
-
-main.obj: main.cpp  \
-		SamplingPreprocessor.h \
+		Pvs.h
+
+Ray.o: Ray.cpp Ray.h \
+		Plane3.h \
+		Matrix4x4.h \
+		Vector3.h \
+		common.h
+
+main.o: main.cpp SamplingPreprocessor.h \
 		ExactPreprocessor.h \
 		Parser.h \
@@ -429,9 +376,7 @@
 		Vector3.h \
 		common.h \
-		Ray.h \
-		
-
-Mesh.obj: Mesh.cpp  \
-		Ray.h \
+		Ray.h
+
+Mesh.o: Mesh.cpp Ray.h \
 		Mesh.h \
 		MeshKdTree.h \
@@ -446,34 +391,28 @@
 		Pvs.h \
 		Rectangle3.h \
-		Containers.h \
-		
-
-Exporter.obj: Exporter.cpp  \
-		X3dExporter.h \
-		Exporter.h \
-		Containers.h \
-		Material.h \
-		
-
-Camera.obj: Camera.cpp  \
-		Camera.h \
-		Ray.h \
-		KdTree.h \
-		Mesh.h \
-		Exporter.h \
-		Vector3.h \
-		AxisAlignedBox3.h \
-		common.h \
-		Rectangle3.h \
-		Matrix4x4.h \
-		Plane3.h \
-		Containers.h \
-		Pvs.h \
-		Intersectable.h \
-		Material.h \
-		
-
-X3dParser.obj: X3dParser.cpp  \
-		X3dParser.h \
+		Containers.h
+
+Exporter.o: Exporter.cpp X3dExporter.h \
+		Exporter.h \
+		Containers.h \
+		Material.h
+
+Camera.o: Camera.cpp Camera.h \
+		Ray.h \
+		KdTree.h \
+		Mesh.h \
+		Exporter.h \
+		Vector3.h \
+		AxisAlignedBox3.h \
+		common.h \
+		Rectangle3.h \
+		Matrix4x4.h \
+		Plane3.h \
+		Containers.h \
+		Pvs.h \
+		Intersectable.h \
+		Material.h
+
+X3dParser.o: X3dParser.cpp X3dParser.h \
 		X3dParserXerces.h \
 		Mesh.h \
@@ -492,9 +431,7 @@
 		Vector3.h \
 		common.h \
-		Ray.h \
-		
-
-MeshKdTree.obj: MeshKdTree.cpp  \
-		Environment.h \
+		Ray.h
+
+MeshKdTree.o: MeshKdTree.cpp Environment.h \
 		Mesh.h \
 		MeshKdTree.h \
@@ -509,13 +446,9 @@
 		Vector3.h \
 		Containers.h \
-		Ray.h \
-		
-
-Pvs.obj: Pvs.cpp  \
-		Pvs.h \
-		
-
-MutualVisibility.obj: MutualVisibility.cpp  \
-		KdTree.h \
+		Ray.h
+
+Pvs.o: Pvs.cpp Pvs.h
+
+MutualVisibility.o: MutualVisibility.cpp KdTree.h \
 		AxisAlignedBox3.h \
 		Ray.h \
@@ -533,45 +466,35 @@
 		common.h \
 		Material.h \
-		Intersectable.h \
-		
-
-Triangle3.obj: Triangle3.cpp  \
-		Triangle3.h \
-		Vector3.h \
-		common.h \
-		
-
-Rectangle3.obj: Rectangle3.cpp  \
-		Rectangle3.h \
-		Vector3.h \
-		common.h \
-		
-
-Plane3.obj: Plane3.cpp  \
-		Plane3.h \
-		Matrix4x4.h \
-		Vector3.h \
-		common.h \
-		
-
-Polygon3.obj: Polygon3.cpp  \
-		Polygon3.h \
-		Mesh.h \
-		ViewCellBsp.h \
-		AxisAlignedBox3.h \
-		Ray.h \
-		Containers.h \
-		Intersectable.h \
-		Plane3.h \
-		Matrix4x4.h \
-		Material.h \
-		Pvs.h \
-		Rectangle3.h \
-		Vector3.h \
-		common.h \
-		
-
-ViewCell.obj: ViewCell.cpp  \
-		ViewCell.h \
+		Intersectable.h
+
+Triangle3.o: Triangle3.cpp Triangle3.h \
+		Vector3.h \
+		common.h
+
+Rectangle3.o: Rectangle3.cpp Rectangle3.h \
+		Vector3.h \
+		common.h
+
+Plane3.o: Plane3.cpp Plane3.h \
+		Matrix4x4.h \
+		Vector3.h \
+		common.h
+
+Polygon3.o: Polygon3.cpp Polygon3.h \
+		Mesh.h \
+		ViewCellBsp.h \
+		AxisAlignedBox3.h \
+		Ray.h \
+		Containers.h \
+		Intersectable.h \
+		Plane3.h \
+		Matrix4x4.h \
+		Material.h \
+		Pvs.h \
+		Rectangle3.h \
+		Vector3.h \
+		common.h
+
+ViewCell.o: ViewCell.cpp ViewCell.h \
 		Mesh.h \
 		Intersectable.h \
@@ -587,9 +510,7 @@
 		Rectangle3.h \
 		Vector3.h \
-		common.h \
-		
-
-ViewCellBsp.obj: ViewCellBsp.cpp  \
-		Plane3.h \
+		common.h
+
+ViewCellBsp.o: ViewCellBsp.cpp Plane3.h \
 		ViewCellBsp.h \
 		Mesh.h \
@@ -607,10 +528,7 @@
 		Material.h \
 		Pvs.h \
-		Rectangle3.h \
-		
-
-Halton.obj: Halton.cpp  \
-		Halton.h \
-		
+		Rectangle3.h
+
+Halton.o: Halton.cpp Halton.h
 
 ####### Install
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.cpp	(revision 245)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/MutualVisibility.cpp	(revision 359)
@@ -603,11 +603,11 @@
   vector<RayShaft *> shafts;
   ConstructInitialSamples3(mSource, mTarget, shafts);
-
+	
   if (1)
     ExportShafts(shafts, false);
 
   stack<RayShaft *> shaftStack;
-  
-  for (int i=0; i < shafts.size(); i++)
+  int i;
+  for (i=0; i < shafts.size(); i++)
     shaftStack.push(shafts[i]);
 
@@ -627,5 +627,5 @@
       break;
     }
-
+		
     // compute error ....
     ComputeError(*shaft);
@@ -635,5 +635,5 @@
 
     if (shaft->mDepth < 10 &&
-	shaft->mError > mSolidAngleThreshold) {
+				shaft->mError > mSolidAngleThreshold) {
       
       // generate 2 new samples
@@ -646,7 +646,7 @@
       int axis;
       if (splitSource) {
-	axis = shaft->mSource.DominantAxis();
+				axis = shaft->mSource.DominantAxis();
       } else {
-	axis = shaft->mTarget.DominantAxis();
+				axis = shaft->mTarget.DominantAxis();
       }
       
@@ -678,8 +678,8 @@
 
 MutualVisibilitySampler::MutualVisibilitySampler(SceneGraph *sceneGraph,
-						 KdTree *kdTree,
-						 AxisAlignedBox3 &source,
-						 AxisAlignedBox3 &target,
-						 const float solidAngleThreshold)
+																								 KdTree *kdTree,
+																								 const AxisAlignedBox3 &source,
+																								 const AxisAlignedBox3 &target,
+																								 const float solidAngleThreshold)
 {
   mSceneGraph = sceneGraph;
@@ -694,10 +694,11 @@
 int
 ComputeBoxVisibility(SceneGraph *sceneGraph,
-		     KdTree *kdTree,
-		     AxisAlignedBox3 &source,
-		     AxisAlignedBox3 &target,
-		     const float solidAngleThreshold)
-{
-  MutualVisibilitySampler sampler(sceneGraph, kdTree, source, target, solidAngleThreshold);
+										 KdTree *kdTree,
+										 const AxisAlignedBox3 &source,
+										 const AxisAlignedBox3 &target,
+										 const float solidAngleThreshold)
+{
+  MutualVisibilitySampler
+		sampler(sceneGraph, kdTree, source, target, solidAngleThreshold);
 
   
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp	(revision 355)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp	(revision 359)
@@ -341,8 +341,8 @@
 		for (int j=0; j < invisibleNeighbors.size(); j++) {
 			int visibility = ComputeBoxVisibility(mSceneGraph,
-																						mKdTree,
-																						box,
-																						mKdTree->GetBox(invisibleNeighbors[j]),
-																						1e-6f);
+							      mKdTree,
+							      box,
+							      mKdTree->GetBox(invisibleNeighbors[j]),
+							      1e-6f);
 			//	      exit(0);
 		}
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.cpp	(revision 333)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.cpp	(revision 359)
@@ -1707,7 +1707,7 @@
 	{
 		Vector3 centerOfMass(0);
-
+		int i;
 		// compute center of mass
-		for (int i = 0; i < (int)planePoly->mVertices.size(); ++ i)
+		for (i = 0; i < (int)planePoly->mVertices.size(); ++ i)
 			centerOfMass += planePoly->mVertices[i];
 		
@@ -1720,10 +1720,10 @@
 		// compute angle to reference point
 		for (i = 1; i < (int)planePoly->mVertices.size(); ++ i)
-		{
-			float angle = 
-				Angle(refVec, centerOfMass - planePoly->mVertices[i], plane.mNormal);
-
-			vertexData.push_back(VertexData(planePoly->mVertices[i], angle));
-		}
+		  {
+		    float angle = 
+		      Angle(refVec, centerOfMass - planePoly->mVertices[i], plane.mNormal);
+		    
+		    vertexData.push_back(VertexData(planePoly->mVertices[i], angle));
+		  }
 		
 		std::stable_sort(vertexData.begin(), vertexData.end());
Index: /trunk/VUT/GtpVisibilityPreprocessor/src/Mesh.cpp
===================================================================
--- /trunk/VUT/GtpVisibilityPreprocessor/src/Mesh.cpp	(revision 354)
+++ /trunk/VUT/GtpVisibilityPreprocessor/src/Mesh.cpp	(revision 359)
@@ -295,26 +295,27 @@
 																	 )
 {
-	Plane3 plane;
-	int faceIndex = RandomValue(0, mFaces.size()-1);
-	for (int tries = 0; tries < maxTries; tries++) {
-		Face *face = mFaces[faceIndex];
-		plane = GetFacePlane(faceIndex);
-		
-		if (plane.Side(viewpoint) > 0) {
-			point = Vector3(0,0,0);
-			float sum = 0.0f;
-			// pickup a point inside this triangle
-			for (int i = 0; i < face->mVertexIndices.size(); i++) {
+  Plane3 plane;
+  int faceIndex = RandomValue(0, mFaces.size()-1);
+	int tries;
+  for (tries = 0; tries < maxTries; tries++) {
+    Face *face = mFaces[faceIndex];
+    plane = GetFacePlane(faceIndex);
+    
+    if (plane.Side(viewpoint) > 0) {
+      point = Vector3(0,0,0);
+      float sum = 0.0f;
+      // pickup a point inside this triangle
+      for (int i = 0; i < face->mVertexIndices.size(); i++) {
 				float r = RandomValue(0,1);
 				sum += r;
 				point += mVertices[face->mVertexIndices[i]]*r;
-			}
-			point *= 1.0f/sum;
-			break;
-		}
-	}
-	
-	normal = plane.mNormal;
-	return (tries < maxTries) ? faceIndex + 1 : 0;
+      }
+      point *= 1.0f/sum;
+      break;
+    }
+  }
+  
+  normal = plane.mNormal;
+  return (tries < maxTries) ? faceIndex + 1 : 0;
 }
 
