Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2543)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp	(revision 2560)
@@ -690,11 +690,15 @@
 	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
-	if (1) {
+	if (1) 
+	{
 		SetupCameraProjection(width(), height());
 		SetupCamera();
 
-		if (mRenderErrors) {
+		if (mRenderErrors) 
+		{
 			RenderErrors();
-		} else {
+		} 
+		else 
+		{
 			glColor3f(0.6f, 0.6f, 0.6f);
 			RenderPvs();
@@ -845,4 +849,5 @@
 	mShowRenderCost = false;
 	mShowPvsSizes = false;
+	mShowPiercingRays = false;
 	mSpatialFilterSize = 0.01;
 	mPvsSize = 0;
@@ -883,4 +888,5 @@
 	connect(mControlWidget, SIGNAL(SetUseSpatialFilter(bool)),
 		this, SLOT(SetUseSpatialFilter(bool)));
+	connect(mControlWidget, SIGNAL(SetShowPiercingRays(bool)), this, SLOT(SetShowPiercingRays(bool)));
 
 	connect(mControlWidget,
@@ -1146,5 +1152,6 @@
 	eq[3] = mSceneCutPlane.mD;
 
-	if (mCutViewCells) {
+	if (mCutViewCells) 
+	{
 		glClipPlane(GL_CLIP_PLANE0, eq);
 		glEnable(GL_CLIP_PLANE0);
@@ -1154,5 +1161,7 @@
 	ViewCellContainer &viewcells = mViewCellsManager->GetViewCells();
 	int maxPvs = -1;
-	for (i=0; i < viewcells.size(); i++) 
+	int maxPiercingRays = 0;
+
+	for (i = 0; i < viewcells.size(); ++ i) 
 	{
 		ViewCell *vc = viewcells[i];
@@ -1162,8 +1171,12 @@
 		if (p > maxPvs)
 			maxPvs = p;
-	}
-
-
-	for (i=0; i < viewcells.size(); i++) {
+		const int piercingRays = vc->GetNumPiercingRays();
+		if (piercingRays > maxPiercingRays)
+			maxPiercingRays = piercingRays;
+	}
+
+
+	for (i = 0; i < viewcells.size(); ++ i) 
+	{
 		ViewCell *vc = viewcells[i];
 		//	Mesh *m = vc->GetMesh();
@@ -1171,15 +1184,26 @@
 		RgbColor c;
 
-		if (!mShowPvsSizes) {
+		if (!mShowPvsSizes && !mShowPiercingRays)
+		{
 			mWireFrame = true;
 			c = vc->GetColor();
-		} else {
-			//	  const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs);
-			const float importance = 5.0f*mTransferFunction *
+		} 
+		else if (mShowPiercingRays)
+		{
+			// const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs);
+			const float importance = 5.0f * mTransferFunction *
+				((float)vc->GetNumPiercingRays() / (float)maxPiercingRays);
+			// c = RgbColor(importance, 1.0f - importance, 0.0f);
+			c = RainbowColorMapping(importance);
+		}
+		else
+		{
+			// const float importance = 5.0f*mTransferFunction * ((float)vc->GetPvs().CountObjectsInPvs() / (float)maxPvs);
+			const float importance = 5.0f * mTransferFunction *
 				((float)vc->GetPvs().GetSize() / (float)maxPvs);
-			//	  c = RgbColor(importance, 1.0f - importance, 0.0f);
+			// c = RgbColor(importance, 1.0f - importance, 0.0f);
 			c = RainbowColorMapping(importance);
-
 		}
+
 		glColor3f(c.r, c.g, c.b);
 
@@ -1191,5 +1215,4 @@
 
 	glPopAttrib();
-
 }
 
@@ -1318,5 +1341,11 @@
 	connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowRays(bool)));
 
-	vbox->resize(800,100);
+	
+	cb = new QCheckBox("Show piercing rays", hbox);
+	hlayout->addWidget(cb);
+	cb->setChecked(false);
+	connect(cb, SIGNAL(toggled(bool)), SIGNAL(SetShowPiercingRays(bool)));
+
+	vbox->resize(800,150);
 
 
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2543)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h	(revision 2560)
@@ -112,8 +112,8 @@
   void SetShowRenderCost(bool);
   void SetShowPvsSizes(bool);
+  void SetShowPiercingRays(bool);
   void SetTopView(bool);
   void SetCutViewCells(bool);
   void SetCutScene(bool);
-
 };
 
@@ -137,4 +137,5 @@
 	bool mUseSpatialFilter;
 	bool mShowRenderCost;
+	bool mShowPiercingRays;
 	bool mShowRays;
 
@@ -293,4 +294,9 @@
 	void SetShowPvsSizes(bool b) {
 		mShowPvsSizes = b;
+		updateGL();
+	}
+
+	void SetShowPiercingRays(bool b) {
+		mShowPiercingRays = b;
 		updateGL();
 	}
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj	(revision 2530)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj	(revision 2560)
@@ -166,5 +166,5 @@
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="..\..\src;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include\QtGui&quot;;&quot;$(QTDIR)\include&quot;;&quot;$(QTDIR)\include\QtOpenGl&quot;;..\..\..\..\..\..\..\NonGTP\Zlib\include;&quot;$(CG_INC_PATH)&quot;"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;QTGLRENDERER_EXPORTS;USE_VERBOSE_PVS;USE_QT;USE_CG;GTP_INTERNAL"
 				RuntimeLibrary="2"
 				UsePrecompiledHeader="0"
Index: GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 2538)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.cpp	(revision 2560)
@@ -52,5 +52,5 @@
 	if (mRenderer->mRenderViewCells) 
 	  mRenderer->RenderViewCells();
-
+	
 	glColor3f(0.8f, 0.8f, 0.8f);
 	mRenderer->RenderPvs();
