Index: /GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.h	(revision 1281)
@@ -18,5 +18,5 @@
 						 SceneGraphNode **root, 
 						 const bool loadPolygonsAsMeshes = false,
-						 vector<Intersectable *> *parents = NULL);
+						 vector<FaceParentInfo> *parents = NULL);
   
 };
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj	(revision 1281)
@@ -123,5 +123,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="3"
-				GlobalOptimizations="TRUE"
+				GlobalOptimizations="FALSE"
 				FavorSizeOrSpeed="1"
 				OptimizeForProcessor="3"
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.cpp	(revision 1281)
@@ -657,5 +657,5 @@
 					 SceneGraphNode **root,
 					 const bool loadPolygonsAsMeshes,
-					 vector<Intersectable *> *parents)
+					 vector<FaceParentInfo> *parents)
 {
   // Initialize the XML4C system
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj	(revision 1281)
@@ -5,11 +5,7 @@
 	Name="Preprocessor"
 	ProjectGUID="{E240C450-69B9-4B01-A6FD-88F9466A3A88}"
-	Keyword="Win32Proj"
 	VCNestedProjectGUID="{EABCE292-D598-4600-A1C9-2591E7D62FDA}"
-	VCNestedProjectFileName="Preprocessor.vcproj">
-	<Platforms>
-		<Platform 
-			Name="Win32"/>
-	</Platforms>
+	VCNestedProjectFileName="Preprocessor.vcproj"
+	Keyword="Win32Proj">
 	<Configurations>
 		<Configuration 
@@ -22,38 +18,39 @@
 				CharacterSet="2"/>
 			<Tool 
+				Name="DebugTool"/>
+			<Tool 
 				Name="CppCmplrTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost"
 				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
-				MinimalRebuild="TRUE"
+				MinimalRebuild="1"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
-				RuntimeTypeInfo="TRUE"
+				RuntimeTypeInfo="1"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
+				Name="LinkerTool"
+				DelayImpLib=""/>
+			<Tool 
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
 				Name="CustomTool"/>
 			<Tool 
-				Name="LibrarianTool"/>
-			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -66,42 +63,43 @@
 				CharacterSet="2"/>
 			<Tool 
+				Name="DebugTool"/>
+			<Tool 
 				Name="CppCmplrTool"
 				Optimization="0"
 				InlineFunctionExpansion="0"
 				FavorSizeOrSpeed="0"
-				OptimizeForWindowsApplication="TRUE"
+				OptimizeForWindowsApplication="1"
 				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
-				ExceptionHandling="TRUE"
+				ExceptionHandling="1"
 				RuntimeLibrary="2"
-				DisableLanguageExtensions="FALSE"
-				ForceConformanceInForLoopScope="FALSE"
-				RuntimeTypeInfo="TRUE"
+				DisableLanguageExtensions="0"
+				ForceConformanceInForLoopScope="0"
+				RuntimeTypeInfo="1"
 				UsePrecompiledHeader="0"
 				WarningLevel="2"
-				Detect64BitPortabilityProblems="TRUE"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
+				Name="LinkerTool"
+				DelayImpLib=""/>
+			<Tool 
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
 				Name="CustomTool"/>
 			<Tool 
-				Name="LibrarianTool"/>
-			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -114,44 +112,51 @@
 				CharacterSet="2"/>
 			<Tool 
+				Name="DebugTool"/>
+			<Tool 
 				Name="CppCmplrTool"
-				Optimization="3"
-				GlobalOptimizations="TRUE"
+				Optimization="1000"
+				GlobalOptimizations="0"
 				InlineFunctionExpansion="0"
+				EnableIntrinsicFunctions="0"
 				FavorSizeOrSpeed="1"
+				OmitFramePointers="1"
+				EnableFiberSafeOptimizations="1"
 				OptimizeForProcessor="3"
-				OptimizeForWindowsApplication="TRUE"
+				OptimizeForWindowsApplication="1"
 				AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\..\Preprocessing\MultiLevelRayTracing"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL"
-				ExceptionHandling="TRUE"
+				MinimalRebuild="1"
+				ExceptionHandling="1"
 				RuntimeLibrary="2"
-				DisableLanguageExtensions="FALSE"
-				ForceConformanceInForLoopScope="FALSE"
-				RuntimeTypeInfo="TRUE"
+				DisableLanguageExtensions="0"
+				ForceConformanceInForLoopScope="0"
+				RuntimeTypeInfo="1"
 				UsePrecompiledHeader="0"
 				WarningLevel="2"
-				Detect64BitPortabilityProblems="TRUE"
-				DebugInformationFormat="3"/>
+				Detect64BitPortabilityProblems="1"
+				DebugInformationFormat="3"
+				UseProcExt="0"
+				Parallelization="0"/>
+			<Tool 
+				Name="LinkerTool"
+				DelayImpLib=""/>
+			<Tool 
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
 			<Tool 
 				Name="CustomTool"/>
 			<Tool 
-				Name="LibrarianTool"/>
-			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -164,42 +169,43 @@
 				CharacterSet="2"/>
 			<Tool 
+				Name="DebugTool"/>
+			<Tool 
 				Name="CppCmplrTool"
 				Optimization="0"
 				InlineFunctionExpansion="0"
 				FavorSizeOrSpeed="0"
-				OptimizeForWindowsApplication="TRUE"
+				OptimizeForWindowsApplication="1"
 				AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;&quot;$(CG_INC_PATH)&quot;;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(BOOST_INCLUDE)&quot;;..\..\Preprocessing\MultiLevelRayTracing"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
-				ExceptionHandling="TRUE"
+				ExceptionHandling="1"
 				RuntimeLibrary="2"
-				DisableLanguageExtensions="FALSE"
-				ForceConformanceInForLoopScope="FALSE"
-				RuntimeTypeInfo="TRUE"
+				DisableLanguageExtensions="0"
+				ForceConformanceInForLoopScope="0"
+				RuntimeTypeInfo="1"
 				UsePrecompiledHeader="0"
 				WarningLevel="2"
-				Detect64BitPortabilityProblems="TRUE"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
+				Name="LinkerTool"
+				DelayImpLib=""/>
+			<Tool 
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
 				Name="CustomTool"/>
 			<Tool 
-				Name="LibrarianTool"/>
-			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -212,4 +218,6 @@
 				CharacterSet="2"/>
 			<Tool 
+				Name="DebugTool"/>
+			<Tool 
 				Name="CppCmplrTool"
 				Optimization="3"
@@ -217,563 +225,400 @@
 				FavorSizeOrSpeed="0"
 				OptimizeForProcessor="3"
-				OptimizeForWindowsApplication="TRUE"
+				OptimizeForWindowsApplication="1"
 				AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL"
-				ExceptionHandling="TRUE"
+				ExceptionHandling="1"
 				RuntimeLibrary="2"
-				DisableLanguageExtensions="FALSE"
-				ForceConformanceInForLoopScope="FALSE"
-				RuntimeTypeInfo="TRUE"
+				DisableLanguageExtensions="0"
+				ForceConformanceInForLoopScope="0"
+				RuntimeTypeInfo="1"
 				UsePrecompiledHeader="0"
 				WarningLevel="2"
-				Detect64BitPortabilityProblems="TRUE"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
-				Name="CustomTool"/>
+				Name="LinkerTool"
+				DelayImpLib=""/>
 			<Tool 
 				Name="LibrarianTool"
 				OutputFile="../lib/Release/$(ProjectName).lib"/>
 			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
 				Name="MidlCmplrTool"/>
 			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
 				Name="PostBuildEventTool"/>
 			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="CustomTool"/>
+			<Tool 
+				Name="CustomNodeTool"/>
 		</Configuration>
 	</Configurations>
-	<References>
-	</References>
 	<Files>
-		<Filter 
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File 
-				RelativePath="..\src\AxisAlignedBox3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\AxisAlignedBox3.h">
-			</File>
-			<File 
-				RelativePath="..\src\Beam.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Beam.h">
-			</File>
-			<File 
-				RelativePath="..\src\BoostPreprocessorThread.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\BoostPreprocessorThread.h">
-			</File>
-			<File 
-				RelativePath="..\src\BoundingBoxConverter.h">
-			</File>
-			<File 
-				RelativePath=".\BvHierarchy.cpp">
-			</File>
-			<File 
-				RelativePath=".\BvHierarchy.h">
-			</File>
-			<File 
-				RelativePath="..\src\Camera.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Camera.h">
-			</File>
-			<File 
-				RelativePath="..\src\common.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\common.h">
-			</File>
-			<File 
-				RelativePath="..\src\Containers.h">
-			</File>
-			<File 
-				RelativePath="..\src\dual_depth.cg">
-			</File>
-			<File 
-				RelativePath="..\src\Environment.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Environment.h">
-			</File>
-			<File 
-				RelativePath="..\src\ExactPreprocessor.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\ExactPreprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\src\Exporter.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Exporter.h">
-			</File>
-			<File 
-				RelativePath="..\src\FlexibleHeap.h">
-			</File>
-			<File 
-				RelativePath="..\src\glInterface.h">
-			</File>
-			<File 
-				RelativePath="..\src\GzBinFileInputStream.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\GzBinFileInputStream.h">
-			</File>
-			<File 
-				RelativePath="..\src\GzFileInputSource.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\GzFileInputSource.h">
-			</File>
-			<File 
-				RelativePath="..\src\gzstream.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\gzstream.h">
-			</File>
-			<File 
-				RelativePath="..\src\Halton.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Halton.h">
-			</File>
-			<File 
-				RelativePath=".\HierarchyManager.cpp">
-			</File>
-			<File 
-				RelativePath=".\HierarchyManager.h">
-			</File>
-			<File 
-				RelativePath="..\src\Intersectable.h">
-			</File>
-			<File 
-				RelativePath="..\src\KdIntersectable.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\KdIntersectable.h">
-			</File>
-			<File 
-				RelativePath="..\src\KdTree.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\KdTree.h">
-			</File>
-			<File 
-				RelativePath="..\src\LogManager.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\LogManager.h">
-			</File>
-			<File 
-				RelativePath="..\src\Material.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Material.h">
-			</File>
-			<File 
-				RelativePath="..\src\Matrix4x4.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Matrix4x4.h">
-			</File>
-			<File 
-				RelativePath="..\src\Mesh.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Mesh.h">
-			</File>
-			<File 
-				RelativePath="..\src\MeshKdTree.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\MeshKdTree.h">
-			</File>
-			<File 
-				RelativePath="..\src\MutualVisibility.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\MutualVisibility.h">
-			</File>
-			<File 
-				RelativePath="..\src\ObjParser.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\ObjParser.h">
-			</File>
-			<File 
-				RelativePath="..\src\OcclusionQuery.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\OcclusionQuery.h">
-			</File>
-			<File 
-				RelativePath=".\OspTree.cpp">
-			</File>
-			<File 
-				RelativePath=".\OspTree.h">
-			</File>
-			<File 
-				RelativePath="..\src\Parser.h">
-			</File>
-			<File 
-				RelativePath="..\src\Plane3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Plane3.h">
-			</File>
-			<File 
-				RelativePath="..\src\ply.h">
-			</File>
-			<File 
-				RelativePath="..\src\plyfile.c">
-			</File>
-			<File 
-				RelativePath="..\src\PlyParser.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\PlyParser.h">
-			</File>
-			<File 
-				RelativePath="..\src\Polygon3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Polygon3.h">
-			</File>
-			<File 
-				RelativePath="..\src\Polytope.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Polytope.h">
-			</File>
-			<File 
-				RelativePath="..\src\Preprocessor.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Preprocessor.h">
-				<FileConfiguration 
-					Name="Release|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-				<FileConfiguration 
-					Name="mlrt|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-				<FileConfiguration 
-					Name="Release_Internal|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-				<FileConfiguration 
-					Name="Release Internal|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-			</File>
-			<File 
-				RelativePath="..\src\PreprocessorThread.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\PreprocessorThread.h">
-				<FileConfiguration 
-					Name="Release|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-				<FileConfiguration 
-					Name="mlrt|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-				<FileConfiguration 
-					Name="Release_Internal|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-				<FileConfiguration 
-					Name="Release Internal|Win32">
-					<Tool 
-						Name="CustomTool"
-						Description=""
-						CommandLine=""
-						Outputs=""/>
-				</FileConfiguration>
-			</File>
-			<File 
-				RelativePath="..\src\Pvs.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Pvs.h">
-			</File>
-			<File 
-				RelativePath="..\src\Ray.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Ray.h">
-			</File>
-			<File 
-				RelativePath="..\src\RayInfo.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\RayInfo.h">
-			</File>
-			<File 
-				RelativePath="..\src\Rectangle3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Rectangle3.h">
-			</File>
-			<File 
-				RelativePath="..\src\RenderSampler.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\RenderSampler.h">
-			</File>
-			<File 
-				RelativePath="..\src\RenderSimulator.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\RenderSimulator.h">
-			</File>
-			<File 
-				RelativePath="..\src\ResourceManager.h">
-			</File>
-			<File 
-				RelativePath="..\src\RssPreprocessor.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\RssPreprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\src\RssTree.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\RssTree.h">
-			</File>
-			<File 
-				RelativePath="..\src\SamplingPreprocessor.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\SamplingPreprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\src\SamplingStrategy.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\SamplingStrategy.h">
-			</File>
-			<File 
-				RelativePath="..\src\SceneGraph.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\SceneGraph.h">
-			</File>
-			<File 
-				RelativePath="..\src\Statistics.h">
-			</File>
-			<File 
-				RelativePath=".\SubdivisionCandidate.h">
-			</File>
-			<File 
-				RelativePath="..\src\Tetrahedron3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Tetrahedron3.h">
-			</File>
-			<File 
-				RelativePath="..\src\Triangle3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Triangle3.h">
-			</File>
-			<File 
-				RelativePath="..\src\UnigraphicsParser.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\UnigraphicsParser.h">
-			</File>
-			<File 
-				RelativePath="..\src\Vector3.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Vector3.h">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCell.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCell.h">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellBsp.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellBsp.h">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellsManager.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellsManager.h">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellsParser.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellsParser.h">
-			</File>
-			<File 
-				RelativePath="..\src\ViewCellsParserXerces.h">
-			</File>
-			<File 
-				RelativePath="..\src\VrmlExporter.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\VrmlExporter.h">
-			</File>
-			<File 
-				RelativePath="..\src\VspBspTree.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\VspBspTree.h">
-			</File>
-			<File 
-				RelativePath=".\VspTree.cpp">
-			</File>
-			<File 
-				RelativePath=".\VspTree.h">
-			</File>
-			<File 
-				RelativePath="..\src\VssPreprocessor.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\VssPreprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\src\VssRay.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\VssRay.h">
-			</File>
-			<File 
-				RelativePath="..\src\VssTree.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\VssTree.h">
-			</File>
-			<File 
-				RelativePath="..\src\X3dExporter.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\X3dExporter.h">
-			</File>
-			<File 
-				RelativePath="..\src\X3dParser.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\X3dParser.h">
-			</File>
-			<File 
-				RelativePath="..\src\X3dParserXerces.h">
-			</File>
-		</Filter>
-		<Filter 
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-			<File 
-				RelativePath="..\include\AxisAlignedBox3.h">
-			</File>
-			<File 
-				RelativePath="..\include\Containers.h">
-			</File>
-			<File 
-				RelativePath="..\include\ExactPreprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\include\KdTree.h">
-			</File>
-			<File 
-				RelativePath="..\include\Mesh.h">
-			</File>
-			<File 
-				RelativePath="..\include\Plane3.h">
-			</File>
-			<File 
-				RelativePath="..\include\Preprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\include\SamplingPreprocessor.h">
-			</File>
-			<File 
-				RelativePath="..\include\SceneGraph.h">
-			</File>
-			<File 
-				RelativePath="..\include\Vector3.h">
-			</File>
-			<File 
-				RelativePath="..\include\ViewCell.h">
-			</File>
-		</Filter>
-		<Filter 
-			Name="Renderer"
-			Filter="">
-			<File 
-				RelativePath="..\src\GlRenderer.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\GlRenderer.h">
-			</File>
-			<File 
-				RelativePath="..\src\Renderer.cpp">
-			</File>
-			<File 
-				RelativePath="..\src\Renderer.h">
-			</File>
-		</Filter>
-		<File 
-			RelativePath=".\VTune\Preprocessor.vpj">
+		<File 
+			RelativePath=".\AxisAlignedBox3.cpp"/>
+		<File 
+			RelativePath=".\AxisAlignedBox3.h"/>
+		<File 
+			RelativePath=".\Beam.cpp"/>
+		<File 
+			RelativePath=".\Beam.h"/>
+		<File 
+			RelativePath=".\BoostPreprocessorThread.cpp"/>
+		<File 
+			RelativePath=".\BoostPreprocessorThread.h"/>
+		<File 
+			RelativePath=".\BoundingBoxConverter.h"/>
+		<File 
+			RelativePath=".\BvHierarchy.cpp"/>
+		<File 
+			RelativePath=".\BvHierarchy.h"/>
+		<File 
+			RelativePath=".\Camera.cpp"/>
+		<File 
+			RelativePath=".\Camera.h"/>
+		<File 
+			RelativePath=".\common.cpp"/>
+		<File 
+			RelativePath=".\common.h"/>
+		<File 
+			RelativePath=".\Containers.h"/>
+		<File 
+			RelativePath=".\dual_depth.cg"/>
+		<File 
+			RelativePath=".\Environment.cpp"/>
+		<File 
+			RelativePath=".\Environment.h"/>
+		<File 
+			RelativePath=".\ExactPreprocessor.cpp"/>
+		<File 
+			RelativePath=".\ExactPreprocessor.h"/>
+		<File 
+			RelativePath=".\Exporter.cpp"/>
+		<File 
+			RelativePath=".\Exporter.h"/>
+		<File 
+			RelativePath=".\FlexibleHeap.h"/>
+		<File 
+			RelativePath=".\glInterface.h"/>
+		<File 
+			RelativePath=".\GzBinFileInputStream.cpp"/>
+		<File 
+			RelativePath=".\GzBinFileInputStream.h"/>
+		<File 
+			RelativePath=".\GzFileInputSource.cpp"/>
+		<File 
+			RelativePath=".\GzFileInputSource.h"/>
+		<File 
+			RelativePath=".\gzstream.cpp"/>
+		<File 
+			RelativePath=".\gzstream.h"/>
+		<File 
+			RelativePath=".\Halton.cpp"/>
+		<File 
+			RelativePath=".\Halton.h"/>
+		<File 
+			RelativePath=".\HierarchyManager.cpp"/>
+		<File 
+			RelativePath=".\HierarchyManager.h"/>
+		<File 
+			RelativePath=".\Intersectable.h"/>
+		<File 
+			RelativePath=".\KdIntersectable.cpp"/>
+		<File 
+			RelativePath=".\KdIntersectable.h"/>
+		<File 
+			RelativePath=".\KdTree.cpp"/>
+		<File 
+			RelativePath=".\KdTree.h"/>
+		<File 
+			RelativePath=".\LogManager.cpp"/>
+		<File 
+			RelativePath=".\LogManager.h"/>
+		<File 
+			RelativePath=".\Material.cpp"/>
+		<File 
+			RelativePath=".\Material.h"/>
+		<File 
+			RelativePath=".\Matrix4x4.cpp"/>
+		<File 
+			RelativePath=".\Matrix4x4.h"/>
+		<File 
+			RelativePath=".\Mesh.cpp"/>
+		<File 
+			RelativePath=".\Mesh.h"/>
+		<File 
+			RelativePath=".\MeshKdTree.cpp"/>
+		<File 
+			RelativePath=".\MeshKdTree.h"/>
+		<File 
+			RelativePath=".\MutualVisibility.cpp"/>
+		<File 
+			RelativePath=".\MutualVisibility.h"/>
+		<File 
+			RelativePath=".\ObjParser.cpp"/>
+		<File 
+			RelativePath=".\ObjParser.h"/>
+		<File 
+			RelativePath=".\OcclusionQuery.cpp"/>
+		<File 
+			RelativePath=".\OcclusionQuery.h"/>
+		<File 
+			RelativePath=".\OspTree.cpp"/>
+		<File 
+			RelativePath=".\OspTree.h"/>
+		<File 
+			RelativePath=".\Parser.h"/>
+		<File 
+			RelativePath=".\Plane3.cpp"/>
+		<File 
+			RelativePath=".\Plane3.h"/>
+		<File 
+			RelativePath=".\ply.h"/>
+		<File 
+			RelativePath=".\plyfile.c"/>
+		<File 
+			RelativePath=".\PlyParser.cpp"/>
+		<File 
+			RelativePath=".\PlyParser.h"/>
+		<File 
+			RelativePath=".\Polygon3.cpp"/>
+		<File 
+			RelativePath=".\Polygon3.h"/>
+		<File 
+			RelativePath=".\Polytope.cpp"/>
+		<File 
+			RelativePath=".\Polytope.h"/>
+		<File 
+			RelativePath=".\Preprocessor.cpp"/>
+		<File 
+			RelativePath=".\Preprocessor.h">
+			<FileConfiguration 
+				Name="Release|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+			<FileConfiguration 
+				Name="mlrt|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+			<FileConfiguration 
+				Name="Release_Internal|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+			<FileConfiguration 
+				Name="Release Internal|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
 		</File>
+		<File 
+			RelativePath=".\PreprocessorThread.cpp"/>
+		<File 
+			RelativePath=".\PreprocessorThread.h">
+			<FileConfiguration 
+				Name="Release|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+			<FileConfiguration 
+				Name="mlrt|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+			<FileConfiguration 
+				Name="Release_Internal|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+			<FileConfiguration 
+				Name="Release Internal|Win32">
+				<Tool 
+					Name="CustomTool"
+					Description=""
+					CommandLine=""
+					Outputs=""/>
+			</FileConfiguration>
+		</File>
+		<File 
+			RelativePath=".\Pvs.cpp"/>
+		<File 
+			RelativePath=".\Pvs.h"/>
+		<File 
+			RelativePath=".\Ray.cpp"/>
+		<File 
+			RelativePath=".\Ray.h"/>
+		<File 
+			RelativePath=".\RayInfo.cpp"/>
+		<File 
+			RelativePath=".\RayInfo.h"/>
+		<File 
+			RelativePath=".\Rectangle3.cpp"/>
+		<File 
+			RelativePath=".\Rectangle3.h"/>
+		<File 
+			RelativePath=".\RenderSampler.cpp"/>
+		<File 
+			RelativePath=".\RenderSampler.h"/>
+		<File 
+			RelativePath=".\RenderSimulator.cpp"/>
+		<File 
+			RelativePath=".\RenderSimulator.h"/>
+		<File 
+			RelativePath=".\ResourceManager.h"/>
+		<File 
+			RelativePath=".\RssPreprocessor.cpp"/>
+		<File 
+			RelativePath=".\RssPreprocessor.h"/>
+		<File 
+			RelativePath=".\RssTree.cpp"/>
+		<File 
+			RelativePath=".\RssTree.h"/>
+		<File 
+			RelativePath=".\SamplingPreprocessor.cpp"/>
+		<File 
+			RelativePath=".\SamplingPreprocessor.h"/>
+		<File 
+			RelativePath=".\SamplingStrategy.cpp"/>
+		<File 
+			RelativePath=".\SamplingStrategy.h"/>
+		<File 
+			RelativePath=".\SceneGraph.cpp"/>
+		<File 
+			RelativePath=".\SceneGraph.h"/>
+		<File 
+			RelativePath=".\Statistics.h"/>
+		<File 
+			RelativePath=".\SubdivisionCandidate.h"/>
+		<File 
+			RelativePath=".\Tetrahedron3.cpp"/>
+		<File 
+			RelativePath=".\Tetrahedron3.h"/>
+		<File 
+			RelativePath=".\Triangle3.cpp"/>
+		<File 
+			RelativePath=".\Triangle3.h"/>
+		<File 
+			RelativePath=".\UnigraphicsParser.cpp"/>
+		<File 
+			RelativePath=".\UnigraphicsParser.h"/>
+		<File 
+			RelativePath=".\Vector3.cpp"/>
+		<File 
+			RelativePath=".\Vector3.h"/>
+		<File 
+			RelativePath=".\ViewCell.cpp"/>
+		<File 
+			RelativePath=".\ViewCell.h"/>
+		<File 
+			RelativePath=".\ViewCellBsp.cpp"/>
+		<File 
+			RelativePath=".\ViewCellBsp.h"/>
+		<File 
+			RelativePath=".\ViewCellsManager.cpp"/>
+		<File 
+			RelativePath=".\ViewCellsManager.h"/>
+		<File 
+			RelativePath=".\ViewCellsParser.cpp"/>
+		<File 
+			RelativePath=".\ViewCellsParser.h"/>
+		<File 
+			RelativePath=".\ViewCellsParserXerces.h"/>
+		<File 
+			RelativePath=".\VrmlExporter.cpp"/>
+		<File 
+			RelativePath=".\VrmlExporter.h"/>
+		<File 
+			RelativePath=".\VspBspTree.cpp"/>
+		<File 
+			RelativePath=".\VspBspTree.h"/>
+		<File 
+			RelativePath=".\VspTree.cpp"/>
+		<File 
+			RelativePath=".\VspTree.h"/>
+		<File 
+			RelativePath=".\VssPreprocessor.cpp"/>
+		<File 
+			RelativePath=".\VssPreprocessor.h"/>
+		<File 
+			RelativePath=".\VssRay.cpp"/>
+		<File 
+			RelativePath=".\VssRay.h"/>
+		<File 
+			RelativePath=".\VssTree.cpp"/>
+		<File 
+			RelativePath=".\VssTree.h"/>
+		<File 
+			RelativePath=".\X3dExporter.cpp"/>
+		<File 
+			RelativePath=".\X3dExporter.h"/>
+		<File 
+			RelativePath=".\X3dParser.cpp"/>
+		<File 
+			RelativePath=".\X3dParser.h"/>
+		<File 
+			RelativePath=".\X3dParserXerces.h"/>
+		<File 
+			RelativePath="..\include\AxisAlignedBox3.h"/>
+		<File 
+			RelativePath="..\include\Containers.h"/>
+		<File 
+			RelativePath="..\include\ExactPreprocessor.h"/>
+		<File 
+			RelativePath="..\include\KdTree.h"/>
+		<File 
+			RelativePath="..\include\Mesh.h"/>
+		<File 
+			RelativePath="..\include\Plane3.h"/>
+		<File 
+			RelativePath="..\include\Preprocessor.h"/>
+		<File 
+			RelativePath="..\include\SamplingPreprocessor.h"/>
+		<File 
+			RelativePath="..\include\SceneGraph.h"/>
+		<File 
+			RelativePath="..\include\Vector3.h"/>
+		<File 
+			RelativePath="..\include\ViewCell.h"/>
+		<File 
+			RelativePath=".\GlRenderer.cpp"/>
+		<File 
+			RelativePath=".\GlRenderer.h"/>
+		<File 
+			RelativePath=".\Renderer.cpp"/>
+		<File 
+			RelativePath=".\Renderer.h"/>
+		<File 
+			RelativePath=".\vtune\Preprocessor.vpj"/>
 	</Files>
-	<Globals>
-	</Globals>
 </VisualStudioProject>
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h	(revision 1199)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Ray.h	(revision 1281)
@@ -317,4 +317,8 @@
   SimpleRay(const Vector3 &o, const Vector3 &d, const float p=1.0f):
 	mOrigin(o), mDirection(d), mPdf(p) {}
+
+  Vector3 Extrap(const float t) {
+	return mOrigin + mDirection * t;
+  }
 };
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1279)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp	(revision 1281)
@@ -906,5 +906,5 @@
 		tPoint[2] = pforg[2] + pfdir[2] * dist;
 
-		return mFaceParents[hittriangle];
+		return mFaceParents[hittriangle].mObject;
 	}
 }
@@ -1013,4 +1013,223 @@
 
 
+int
+Preprocessor::ProcessRay(
+						 Vector3 &viewPoint,
+						 Vector3 &direction,
+						 Intersectable *objectA,
+						 Vector3 &pointA,
+						 Vector3 &normalA,
+						 Intersectable *objectB,
+						 Vector3 &pointB,
+						 Vector3 &normalB,
+						 const float probability,
+						 VssRayContainer &vssRays,
+						 const AxisAlignedBox3 &box
+						 )
+{
+  int hits=0;
+
+  if (objectA == NULL && objectB == NULL)
+	return 0;
+
+  AxisAlignedBox3 sbox = box;
+  sbox.Enlarge(Vector3(-Limits::Small));
+
+  
+  if (!sbox.IsInside(viewPoint))
+	return 0;
+
+  if (objectA == NULL) {
+	// compute intersection with the scene bounding box
+	static Ray ray;
+	SetupRay(ray, viewPoint, direction);
+	
+	float tmin, tmax;
+	if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax)
+	  pointA = ray.Extrap(tmax);
+	else
+	  return 0;
+  } else {
+	if (mDetectEmptyViewSpace)
+	  if (DotProd(normalA, direction) >= 0) {
+		// discard the sample
+		return 0;
+	  }
+  }
+
+  if (objectB == NULL) {
+	// compute intersection with the scene bounding box
+	static Ray ray;
+	SetupRay(ray, viewPoint, -direction);
+
+	float tmin, tmax;
+	if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax)
+	  pointB = ray.Extrap(tmax);
+	else
+	  return 0;
+  } else {
+	if (mDetectEmptyViewSpace)
+	  if (DotProd(normalB, direction) <= 0) {
+		// discard the sample
+		return 0;
+	  }
+  }
+  
+  VssRay *vssRay  = NULL;
+  bool validSample = (objectA != objectB);
+  if (validSample) {
+	if (objectA) {
+	  vssRay = new VssRay(pointB,
+						  pointA,
+						  objectB,
+						  objectA,
+						  mPass,
+						  probability
+						  );
+	  vssRays.push_back(vssRay);
+	  hits ++;
+	}
+	
+	if (objectB) {
+	  vssRay = new VssRay(pointA,
+						  pointB,
+						  objectA,
+						  objectB,
+						  mPass,
+						  probability
+						  );
+	  vssRays.push_back(vssRay);
+	  hits ++;
+	}
+  }
+  
+  return hits;
+}
+
+void
+Preprocessor::CastRays16(const int index,
+						 SimpleRayContainer &rays, 
+						 VssRayContainer &vssRays,
+						 const AxisAlignedBox3 &sbox)
+{
+  int i;
+  int num = 16;
+  
+  if (mRayCastMethod == INTEL_RAYCASTER) {
+#ifdef GTP_INTERNAL
+
+  int forward_hit_triangles[16];
+  float forward_dist[16];
+
+  int backward_hit_triangles[16];
+  float backward_dist[16];
+  
+  Vector3 min = sbox.Min();
+  Vector3 max = sbox.Max();
+  
+  for (i=0; i < num; i++) {
+	mlrtaStoreRayAS16(&rays[index + i].mOrigin.x,
+					  &rays[index + i].mDirection.x,
+					  i);
+  }
+  
+  
+  mlrtaTraverseGroupAS16(&min.x,
+						 &max.x,
+						 forward_hit_triangles,
+						 forward_dist);
+
+  for (i=0; i < num; i++) {
+	Vector3 dir = -rays[index+i].mDirection;
+	mlrtaStoreRayAS16(&rays[index+i].mOrigin.x,
+					  &dir.x,
+					  i);
+  }
+  
+  
+  mlrtaTraverseGroupAS16(&min.x,
+						 &max.x,
+						 backward_hit_triangles,
+						 backward_dist);
+  
+
+  for (i=0; i < num; i++) {
+	Intersectable *objectA = NULL, *objectB = NULL;
+	Vector3 pointA, pointB;
+	Vector3 normalA, normalB;
+	if (forward_hit_triangles[i] !=-1 ) {
+	  objectA = mFaceParents[forward_hit_triangles[i]].mObject;
+	  // Get the normal of that face
+	  Mesh *mesh = ((MeshInstance *)objectA)->GetMesh();
+	  normalA = mesh->GetFacePlane(mFaceParents[forward_hit_triangles[i]].mFaceIndex).mNormal;
+	  //-rays[index+i].mDirection; // $$ temporary
+	  pointA = rays[index+i].Extrap(forward_dist[i]);
+	}
+	
+	if (backward_hit_triangles[i]!=-1) {
+	  objectB = mFaceParents[backward_hit_triangles[i]].mObject;
+	  Mesh *mesh = ((MeshInstance *)objectB)->GetMesh();
+
+	  normalB = mesh->GetFacePlane(mFaceParents[backward_hit_triangles[i]].mFaceIndex).mNormal;
+	  
+	  //	  normalB = rays[index+i].mDirection; // $$ temporary
+	  pointB = rays[index+i].Extrap(-backward_dist[i]);
+	}
+	
+	ProcessRay(rays[index+i].mOrigin,
+			   rays[index+i].mDirection,
+			   objectA, pointA, normalA,
+			   objectB, pointB, normalB,
+			   rays[index+i].mPdf,
+			   vssRays,
+			   sbox
+			   );
+  }
+#endif
+  } else {
+
+	for (i=index; i < index + num; i++) {
+	  CastRay(rays[i].mOrigin,
+			  rays[i].mDirection,
+			  rays[i].mPdf,
+			  vssRays,
+			  sbox);
+	}
+  }
+  
+}
+
+void
+Preprocessor::CastRays(
+					   SimpleRayContainer &rays,
+					   VssRayContainer &vssRays
+					   )
+{
+  long t1 = GetTime();
+  for (int i=0; i < rays.size(); ) {
+	if (i + 16 < rays.size()) {
+	  CastRays16(
+				 i,
+				 rays,
+				 vssRays,
+				 mViewCellsManager->GetViewSpaceBox());
+	  i += 16;
+	} else {
+	  CastRay(rays[i].mOrigin,
+			  rays[i].mDirection,
+			  rays[i].mPdf,
+			  vssRays,
+			  mViewCellsManager->GetViewSpaceBox());
+	  i++;
+	}
+	if (i % 10000 == 0)
+	  cout<<".";
+  }
+
+  long t2 = GetTime();
+  
+  cout<<2*rays.size()/(1e3*TimeDiff(t1, t2))<<"M rays/s"<<endl;
+}
+
 int Preprocessor::CastRay(
 						  const Vector3 &viewPoint,
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj	(revision 1281)
@@ -107,12 +107,16 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				Optimization="3"
-				GlobalOptimizations="TRUE"
+				Optimization="2"
+				GlobalOptimizations="FALSE"
 				InlineFunctionExpansion="0"
+				EnableIntrinsicFunctions="FALSE"
 				FavorSizeOrSpeed="1"
+				OmitFramePointers="TRUE"
+				EnableFiberSafeOptimizations="TRUE"
 				OptimizeForProcessor="3"
 				OptimizeForWindowsApplication="TRUE"
 				AdditionalIncludeDirectories="..\include;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\..\Preprocessing\MultiLevelRayTracing"
 				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;GTP_INTERNAL"
+				MinimalRebuild="TRUE"
 				ExceptionHandling="TRUE"
 				RuntimeLibrary="2"
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp	(revision 1281)
@@ -79,21 +79,4 @@
 }
 
-void
-RssPreprocessor::CastRays(
-						  SimpleRayContainer &rays,
-						  VssRayContainer &vssRays
-						  )
-{
-  for (int i=0; i < rays.size(); i++) {
-	CastRay(rays[i].mOrigin,
-			rays[i].mDirection,
-			rays[i].mPdf,
-			vssRays,
-			mViewCellsManager->GetViewSpaceBox());
-	if (i % 10000 == 0)
-	  cout<<".";
-  }
-  cout<<endl;
-}
 
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 1264)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.cpp	(revision 1281)
@@ -60,54 +60,6 @@
 
 
-void
-VssPreprocessor::CastRays(
-						  SimpleRayContainer &rays,
-						  VssRayContainer &vssRays
-						  )
-{
-	const AxisAlignedBox3 box =  mViewSpaceBox ? *mViewSpaceBox : mKdTree->GetBox();
-	
-#if 1
-	SimpleRayContainer::const_iterator rit, rit_end = rays.end();
-	for (rit = rays.begin(); rit != rit_end; ++ rit)
-	{
-		CastRay((*rit).mOrigin, (*rit).mDirection, 1, vssRays, box);
-	}
-#else
-	for (int i = 0; i < rays.size(); i += 16)
-	{
-		CastRay(rays[i].mOrigin, rays[i].mDirection, vssRays, box);
-	}
-
-#endif
-}
-
-
-void VssPreprocessor::CastRays16(SimpleRayContainer &rays, 
-								 VssRayContainer &vssRays,
-								 const AxisAlignedBox3 &sbox)
-{
-#ifdef GTP_INTERNAL
-/*
-	mlrtaStoreRayAS16(const float* pforg, const float* pfdir, int j);
-
-
-	// input parameters
-	const RTVec3f& org = *reinterpret_cast<const RTVec3f*> (pforg);
-	const RTVec3f& rd  = *reinterpret_cast<const RTVec3f*> (pfdir);
-
-	int ri = j/4;
-	int ci = j%4;
-	*((float*)&ibp4.ray4X[ri].m_origin.t[0] + ci) = org[0];
-	*((float*)&ibp4.ray4X[ri].m_origin.t[1] + ci) = org[1];
-	*((float*)&ibp4.ray4X[ri].m_origin.t[2] + ci) = org[2];
-
-	*((float*)&ibp4.ray4X[ri].m_direction.t[0] + ci) = rd[0];
-	*((float*)&ibp4.ray4X[ri].m_direction.t[1] + ci) = rd[1];
-	*((float*)&ibp4.ray4X[ri].m_direction.t[2] + ci) = rd[2];
-
-	mlrtaTraverseGroupAS16(const float* bbmin, const float* bbmax, int* hit_triangles, float* dist);*/
-#endif
-}
+
+
 
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.h	(revision 1281)
@@ -17,5 +17,5 @@
 				 SceneGraphNode **root,
 				 const bool loadPolygonsAsMeshes = false,
-				 vector<Intersectable *> *parents = NULL);
+				 vector<FaceParentInfo> *parents = NULL);
 
   bool ParseFile(const string filename, ViewCellsManager &viewCells) { return false; }
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1279)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h	(revision 1281)
@@ -146,5 +146,5 @@
   
   virtual void CastRays(SimpleRayContainer &rays,
-						VssRayContainer &vssRays) {};
+						VssRayContainer &vssRays);
 
   /** Returns a view cells manager with respect to the given name.
@@ -221,24 +221,38 @@
 	void SetupRay(Ray &ray, const Vector3 &point, const Vector3 &direction);
 
-	int CastInternalRay(
-		const Vector3 &viewPoint,
-		const Vector3 &direction,
-		const float probability,
-		VssRayContainer &vssRays,
-		const AxisAlignedBox3 &box);
-
-	int CastIntelDoubleRay(
-		const Vector3 &viewPoint,
-		const Vector3 &direction,
-		const float probability,
-		VssRayContainer &vssRays,
-		const AxisAlignedBox3 &box);
-
-	Intersectable *CastIntelSingleRay(
-			const Vector3 &viewPoint,
-			const Vector3 &direction,
-			Vector3 &tPoint,
-			const AxisAlignedBox3 &box);
-
+  int
+  ProcessRay(
+			 Vector3 &viewPoint,
+			 Vector3 &direction,
+			 Intersectable *objectA,
+			 Vector3 &pointA,
+			 Vector3 &normalA,
+			 Intersectable *objectB,
+			 Vector3 &pointB,
+			 Vector3 &normalB,
+			 const float probability,
+			 VssRayContainer &vssRays,
+			 const AxisAlignedBox3 &box);
+  
+  int CastInternalRay(
+					  const Vector3 &viewPoint,
+					  const Vector3 &direction,
+					  const float probability,
+					  VssRayContainer &vssRays,
+					  const AxisAlignedBox3 &box);
+  
+  int CastIntelDoubleRay(
+						 const Vector3 &viewPoint,
+						 const Vector3 &direction,
+						 const float probability,
+						 VssRayContainer &vssRays,
+						 const AxisAlignedBox3 &box);
+  
+  Intersectable *CastIntelSingleRay(
+									const Vector3 &viewPoint,
+									const Vector3 &direction,
+									Vector3 &tPoint,
+									const AxisAlignedBox3 &box);
+  
   /////////////////////////
 
@@ -252,5 +266,7 @@
   RenderSimulator *mRenderSimulator;
 
-  vector<Intersectable *> mFaceParents;
+  
+  vector<FaceParentInfo> mFaceParents;
+  
   GlRendererBuffer *renderer;
 // matt: remove qt dependencies 
@@ -258,4 +274,12 @@
   void EvalPvsStat();
 
+  protected:
+
+  
+  void CastRays16(const int i,
+				  SimpleRayContainer &rays, 
+				  VssRayContainer &vssRays,
+				  const AxisAlignedBox3 &sbox);
+  
 };
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h	(revision 1251)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.h	(revision 1281)
@@ -67,9 +67,4 @@
   virtual bool BuildBspTree() { return false; }
   
-  void
-  CastRays(
-		   SimpleRayContainer &rays,
-		   VssRayContainer &vssRays
-		   );
 
   bool
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h	(revision 1251)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/VssPreprocessor.h	(revision 1281)
@@ -54,5 +54,4 @@
 			   );
 	
-  void CastRays(SimpleRayContainer &rays, VssRayContainer &vssRays);
 
   bool
@@ -94,11 +93,4 @@
   bool mTestBeamSampling;
 
-protected:
-		
- 
-
-	void CastRays16(SimpleRayContainer &rays, 
-					VssRayContainer &vssRays,
-					const AxisAlignedBox3 &sbox);
 };
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/UnigraphicsParser.cpp	(revision 1281)
@@ -43,7 +43,7 @@
 bool
 UnigraphicsParser::ParseFile(const string filename,
-			     SceneGraphNode **proot,
-				 const bool loadPolygonsAsMeshes,
-				 vector<Intersectable *> *parents)
+							 SceneGraphNode **proot,
+							 const bool loadPolygonsAsMeshes,
+							 vector<FaceParentInfo> *parents)
 {
   map<string, Vector3, ltstr> vht; // hash table for vectors
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Parser.h	(revision 1281)
@@ -5,4 +5,5 @@
 #include <vector>
 
+#include "Intersectable.h"
 
 namespace GtpVisibilityPreprocessor {
@@ -20,5 +21,5 @@
 						 SceneGraphNode **root, 
 						 const bool loadPolygonsAsMeshes = false,
-						 std::vector<Intersectable *> *parents = NULL) 
+						 std::vector<FaceParentInfo> *parents = NULL) 
   {return false;};
 	
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.h	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.h	(revision 1281)
@@ -18,5 +18,5 @@
 						 SceneGraphNode **root, 
 						 const bool loadPolygonsAsMeshes = false,
-						 vector<Intersectable *> *parents = NULL);
+						 vector<FaceParentInfo> *parents = NULL);
   
 };
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp	(revision 1281)
@@ -128,13 +128,14 @@
 
 // HACK: associate mesh instances with triangles
-void AssociateFacesWithInstance(MeshInstance *mi, vector<Intersectable *> &parents)
-{
-	Mesh *mesh = mi->GetMesh();
-
-	FaceContainer::const_iterator fit, fit_end = mesh->mFaces.end();
-	
-	for (fit = mesh->mFaces.begin(); fit != fit_end; ++ fit)
-	{
-        parents.push_back(mi);
+void AssociateFacesWithInstance(MeshInstance *mi,
+								vector<FaceParentInfo> &parents)
+{
+  Mesh *mesh = mi->GetMesh();
+  
+  FaceContainer::const_iterator fit, fit_end = mesh->mFaces.end();
+  int i = 0;
+  for (fit = mesh->mFaces.begin(); fit != fit_end; ++ fit, i++)
+	{
+	  parents.push_back(FaceParentInfo(mi, i));
 	}
 }
@@ -144,5 +145,5 @@
 						  SceneGraphNode **proot,
 						  const bool loadPolygonsAsMeshes,
-						  vector<Intersectable *> *parents)
+						  vector<FaceParentInfo> *parents)
 {
 	FILE *file;
@@ -192,8 +193,8 @@
 					
 					if (parents) 
-					{
+					  {
 						AssociateFacesWithInstance(mi, *parents);
-					}
-
+					  }
+					
 					// reset tables
 					hashTable.clear();
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h	(revision 1233)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Intersectable.h	(revision 1281)
@@ -13,4 +13,19 @@
 class BvhLeaf;
 
+class Intersectable;
+struct Face;
+
+struct FaceParentInfo {
+  // intersectable
+  Intersectable *mObject;
+  // face index
+  int mFaceIndex;
+  
+  FaceParentInfo(Intersectable *obj,
+				 const int fi):
+	mObject(obj),
+	mFaceIndex(fi)
+  {}
+};
 
 class Intersectable {
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 1272)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj	(revision 1281)
@@ -5,11 +5,7 @@
 	Name="TestPreprocessor"
 	ProjectGUID="{2BF1B1A6-D665-472B-B1B1-E172512D66C1}"
-	Keyword="Win32Proj"
 	VCNestedProjectGUID="{69BC58F0-C7EB-4B43-B782-B6F047EF0528}"
-	VCNestedProjectFileName="TestPreprocessor.vcproj">
-	<Platforms>
-		<Platform 
-			Name="Win32"/>
-	</Platforms>
+	VCNestedProjectFileName="TestPreprocessor.vcproj"
+	Keyword="Win32Proj">
 	<Configurations>
 		<Configuration 
@@ -21,4 +17,6 @@
 				ConfigurationType="1"
 				CharacterSet="2"/>
+			<Tool 
+				Name="DebugTool"/>
 			<Tool 
 				Name="CppCmplrTool"
@@ -26,43 +24,40 @@
 				AdditionalIncludeDirectories="..\include;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="TRUE"
+				MinimalRebuild="1"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="4"/>
 			<Tool 
-				Name="CustomTool"/>
-			<Tool 
-				Name="LinkerTool"
+				Name="LinkerTool"
+				DelayImpLib=""
 				AdditionalDependencies="xerces-c_2D.lib zdll.lib zziplibd.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib glew32.lib"
 				OutputFile="$(OutDir)/Preprocessor.exe"
 				LinkIncremental="2"
 				AdditionalLibraryDirectories="..\include;..\src\GL;&quot;..\lib\$(ConfigurationName)&quot;;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib"
-				GenerateDebugInformation="TRUE"
+				GenerateDebugInformation="1"
 				ProgramDatabaseFile="$(OutDir)/TestPreprocessor.pdb"
 				SubSystem="1"
 				TargetMachine="1"/>
 			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCWebDeploymentTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
+				Name="CustomTool"/>
+			<Tool 
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -74,4 +69,6 @@
 				ConfigurationType="1"
 				CharacterSet="2"/>
+			<Tool 
+				Name="DebugTool"/>
 			<Tool 
 				Name="CppCmplrTool"
@@ -80,18 +77,17 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
 				RuntimeLibrary="2"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
+				RuntimeTypeInfo="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
-				Name="CustomTool"/>
-			<Tool 
-				Name="LinkerTool"
+				Name="LinkerTool"
+				DelayImpLib=""
 				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib"
 				OutputFile="$(OutDir)/Preprocessor.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib"
-				GenerateDebugInformation="FALSE"
+				GenerateDebugInformation="0"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -100,23 +96,21 @@
 				FixedBaseAddress="1"/>
 			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCWebDeploymentTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
+				Name="CustomTool"/>
+			<Tool 
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -129,7 +123,9 @@
 				CharacterSet="2"/>
 			<Tool 
+				Name="DebugTool"/>
+			<Tool 
 				Name="CppCmplrTool"
 				Optimization="3"
-				GlobalOptimizations="TRUE"
+				GlobalOptimizations="0"
 				FavorSizeOrSpeed="1"
 				OptimizeForProcessor="3"
@@ -137,18 +133,17 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL"
 				RuntimeLibrary="2"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
+				RuntimeTypeInfo="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
-				Name="CustomTool"/>
-			<Tool 
-				Name="LinkerTool"
+				Name="LinkerTool"
+				DelayImpLib=""
 				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib cg.lib cgGL.lib Preprocessor.lib RTWorld.lib RTScene.lib"
 				OutputFile="$(OutDir)/Preprocessor.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\src\mlrt;&quot;$(CG_LIB_PATH)&quot;;..\src\GL;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\..\Preprocessing\MultiLevelRayTracing\RTScene\Release;..\..\Preprocessing\MultiLevelRayTracing\RTWorld\Release"
-				GenerateDebugInformation="FALSE"
+				GenerateDebugInformation="0"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -157,23 +152,21 @@
 				FixedBaseAddress="1"/>
 			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCWebDeploymentTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
+				Name="CustomTool"/>
+			<Tool 
+				Name="CustomNodeTool"/>
 		</Configuration>
 		<Configuration 
@@ -185,4 +178,6 @@
 				ConfigurationType="1"
 				CharacterSet="2"/>
+			<Tool 
+				Name="DebugTool"/>
 			<Tool 
 				Name="CppCmplrTool"
@@ -191,18 +186,17 @@
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL"
 				RuntimeLibrary="2"
-				RuntimeTypeInfo="TRUE"
-				UsePrecompiledHeader="0"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="TRUE"
+				RuntimeTypeInfo="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="1"
 				DebugInformationFormat="3"/>
 			<Tool 
-				Name="CustomTool"/>
-			<Tool 
-				Name="LinkerTool"
+				Name="LinkerTool"
+				DelayImpLib=""
 				AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib"
 				OutputFile="../bin/release/Preprocessor.exe"
 				LinkIncremental="1"
 				AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release"
-				GenerateDebugInformation="FALSE"
+				GenerateDebugInformation="0"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -211,52 +205,29 @@
 				FixedBaseAddress="1"/>
 			<Tool 
-				Name="MidlCmplrTool"/>
-			<Tool 
-				Name="PostBuildEventTool"/>
-			<Tool 
-				Name="PreBuildEventTool"/>
-			<Tool 
-				Name="PreLinkEventTool"/>
-			<Tool 
-				Name="ResCmplrTool"/>
-			<Tool 
-				Name="VCWebServiceProxyGeneratorTool"/>
-			<Tool 
-				Name="VCXMLDataGeneratorTool"/>
-			<Tool 
-				Name="VCWebDeploymentTool"/>
-			<Tool 
-				Name="VCManagedWrapperGeneratorTool"/>
-			<Tool 
-				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+				Name="LibrarianTool"/>
+			<Tool 
+				Name="ResCmplrTool"/>
+			<Tool 
+				Name="MidlCmplrTool"/>
+			<Tool 
+				Name="BscMakeTool"/>
+			<Tool 
+				Name="PreBuildEventTool"/>
+			<Tool 
+				Name="PreLinkEventTool"/>
+			<Tool 
+				Name="PostBuildEventTool"/>
+			<Tool 
+				Name="CustomTool"/>
+			<Tool 
+				Name="CustomNodeTool"/>
 		</Configuration>
 	</Configurations>
-	<References>
-	</References>
 	<Files>
-		<Filter 
-			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
-			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-			<File 
-				RelativePath="..\src\main.cpp">
-			</File>
-		</Filter>
-		<Filter 
-			Name="Header Files"
-			Filter="h;hpp;hxx;hm;inl;inc;xsd"
-			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-		</Filter>
-		<Filter 
-			Name="Resource Files"
-			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
-			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
-		</Filter>
 		<File 
-			RelativePath=".\VTune\TestPreprocessor.vpj">
-		</File>
+			RelativePath=".\main.cpp"/>
+		<File 
+			RelativePath=".\vtune\TestPreprocessor.vpj"/>
 	</Files>
-	<Globals>
-	</Globals>
 </VisualStudioProject>
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/X3dParser.h	(revision 1281)
@@ -16,8 +16,8 @@
   
 	bool ParseFile(
-		const string filename, 
-		SceneGraphNode **root, 
-		const bool loadPolygonsAsMeshes = false,
-		vector<Intersectable *> *parents = NULL);
+				   const string filename, 
+				   SceneGraphNode **root, 
+				   const bool loadPolygonsAsMeshes = false,
+				   vector<FaceParentInfo> *parents = NULL);
 
 	bool ParseFile(const string filename, ViewCellsManager &viewCells);
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 1221)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/PlyParser.cpp	(revision 1281)
@@ -261,5 +261,5 @@
 					 SceneGraphNode **root,
 					 const bool loadPolygonsAsMeshes,
-					 vector<Intersectable *> *parents)
+					 vector<FaceParentInfo> *parents)
 {
   vector<string> filelist;
