Index: GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp
===================================================================
--- GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp	(revision 1002)
+++ GTP/trunk/Lib/Vis/Preprocessing/src/FromPointVisibilityTree.cpp	(revision 1004)
@@ -67,69 +67,69 @@
 {
 	bool randomize = false;
-	environment->GetBoolValue("FromPointVisibilityTree.Construction.randomize", randomize);
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.Construction.randomize", randomize);
 	if (randomize)
 		Randomize(); // initialise random generator for heuristics
 
 	//-- termination criteria for autopartition
-	environment->GetIntValue("FromPointVisibilityTree.Termination.maxDepth", mTermMaxDepth);
-	environment->GetIntValue("FromPointVisibilityTree.Termination.minPvs", mTermMinPvs);
-	environment->GetIntValue("FromPointVisibilityTree.Termination.minRays", mTermMinRays);
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.minProbability", mTermMinProbability);
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.maxRayContribution", mTermMaxRayContribution);
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.minAccRayLenght", mTermMinAccRayLength);
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio);
-	environment->GetIntValue("FromPointVisibilityTree.Termination.missTolerance", mTermMissTolerance);
-	environment->GetIntValue("FromPointVisibilityTree.Termination.maxViewCells", mMaxViewCells);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.maxDepth", mTermMaxDepth);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.minPvs", mTermMinPvs);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.minRays", mTermMinRays);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.minProbability", mTermMinProbability);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.maxRayContribution", mTermMaxRayContribution);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.minAccRayLenght", mTermMinAccRayLength);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.missTolerance", mTermMissTolerance);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.maxViewCells", mMaxViewCells);
 
 	//-- max cost ratio for early tree termination
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio);
-
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio);
-	environment->GetIntValue("FromPointVisibilityTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.maxCostRatio", mTermMaxCostRatio);
+
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance);
 
 	// HACK//mTermMinPolygons = 25;
 
 	//-- factors for bsp tree split plane heuristics
-	environment->GetFloatValue("FromPointVisibilityTree.Factor.pvs", mPvsFactor);
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.ct_div_ci", mCtDivCi);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Factor.pvs", mPvsFactor);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.ct_div_ci", mCtDivCi);
 
 
 	//-- partition criteria
-	environment->GetIntValue("FromPointVisibilityTree.maxPolyCandidates", mMaxPolyCandidates);
-	environment->GetIntValue("FromPointVisibilityTree.maxRayCandidates", mMaxRayCandidates);
-	environment->GetIntValue("FromPointVisibilityTree.splitPlaneStrategy", mSplitPlaneStrategy);
-
-	environment->GetFloatValue("FromPointVisibilityTree.Construction.epsilon", mEpsilon);
-	environment->GetIntValue("FromPointVisibilityTree.maxTests", mMaxTests);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.maxPolyCandidates", mMaxPolyCandidates);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.maxRayCandidates", mMaxRayCandidates);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.splitPlaneStrategy", mSplitPlaneStrategy);
+
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.epsilon", mEpsilon);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.maxTests", mMaxTests);
 
 	// if only the driving axis is used for axis aligned split
-	environment->GetBoolValue("FromPointVisibilityTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis);
 	
 	//-- termination criteria for axis aligned split
-	environment->GetFloatValue("FromPointVisibilityTree.Termination.AxisAligned.maxRayContribution", 
-								mTermMaxRayContriForAxisAligned);
-	environment->GetIntValue("FromPointVisibilityTree.Termination.AxisAligned.minRays",
-							 mTermMinRaysForAxisAligned);
-
-	//environment->GetFloatValue("FromPointVisibilityTree.maxTotalMemory", mMaxTotalMemory);
-	environment->GetFloatValue("FromPointVisibilityTree.maxStaticMemory", mMaxMemory);
-
-	environment->GetFloatValue("FromPointVisibilityTree.Construction.renderCostWeight", mRenderCostWeight);
-	environment->GetBoolValue("FromPointVisibilityTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable);
-
-	environment->GetBoolValue("FromPointVisibilityTree.useCostHeuristics", mUseCostHeuristics);
-	environment->GetBoolValue("FromPointVisibilityTree.useSplitCostQueue", mUseSplitCostQueue);
-	environment->GetBoolValue("FromPointVisibilityTree.simulateOctree", mCirculatingAxis);
-	environment->GetBoolValue("FromPointVisibilityTree.useRandomAxis", mUseRandomAxis);
-	environment->GetIntValue("FromPointVisibilityTree.nodePriorityQueueType", mNodePriorityQueueType);
-
-	environment->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Termination.AxisAligned.maxRayContribution", 
+												mTermMaxRayContriForAxisAligned);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.Termination.AxisAligned.minRays",
+											  mTermMinRaysForAxisAligned);
+
+	//Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.maxTotalMemory", mMaxTotalMemory);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.maxStaticMemory", mMaxMemory);
+
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.renderCostWeight", mRenderCostWeight);
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.usePolygonSplitIfAvailable", mUsePolygonSplitIfAvailable);
+
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.useCostHeuristics", mUseCostHeuristics);
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.useSplitCostQueue", mUseSplitCostQueue);
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.simulateOctree", mCirculatingAxis);
+	Environment::GetSingleton()->GetBoolValue("FromPointVisibilityTree.useRandomAxis", mUseRandomAxis);
+	Environment::GetSingleton()->GetIntValue("FromPointVisibilityTree.nodePriorityQueueType", mNodePriorityQueueType);
+
+	Environment::GetSingleton()->GetBoolValue("ViewCells.PostProcess.emptyViewCellsMerge", mEmptyViewCellsMergeAllowed);
 	
 	char subdivisionStatsLog[100];
-	environment->GetStringValue("FromPointVisibilityTree.subdivisionStats", subdivisionStatsLog);
+	Environment::GetSingleton()->GetStringValue("FromPointVisibilityTree.subdivisionStats", subdivisionStatsLog);
 	mSubdivisionStats.open(subdivisionStatsLog);
 
-	environment->GetFloatValue("FromPointVisibilityTree.Construction.minBand", mMinBand);
-	environment->GetFloatValue("FromPointVisibilityTree.Construction.maxBand", mMaxBand);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.minBand", mMinBand);
+	Environment::GetSingleton()->GetFloatValue("FromPointVisibilityTree.Construction.maxBand", mMaxBand);
 
 	//-- debug output
