From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 Feb 2008 19:44:27 +0000 Subject: Converted logging to use log4net. Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done. --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 6 +++--- OpenSim/Region/Physics/Meshing/SimpleHull.cs | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Physics/Meshing') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 3217dd8..d4c9926 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -53,6 +53,8 @@ namespace OpenSim.Region.Physics.Meshing public class Meshmerizer : IMesher { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + // Setting baseDir to a path will enable the dumping of raw files // raw files can be imported by blender so a visual inspection of the results can be done // const string baseDir = "rawFiles"; @@ -101,7 +103,6 @@ namespace OpenSim.Region.Physics.Meshing return influenced; } - private static void InsertVertices(List vertices, int usedForSeed, List triangles) { // This is a variant of the delaunay algorithm @@ -174,7 +175,6 @@ namespace OpenSim.Region.Physics.Meshing } } - private static Mesh CreateBoxMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size) // Builds the z (+ and -) surfaces of a box shaped prim { @@ -236,7 +236,7 @@ namespace OpenSim.Region.Physics.Meshing // Calculated separately to avoid errors cutHull.AddVertex(legEnd); - MainLog.Instance.Debug("Starting cutting of the hollow shape from the prim {1}", 0, primName); + m_log.Debug(String.Format("Starting cutting of the hollow shape from the prim {1}", 0, primName)); SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull); outerHull = cuttedHull; diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs index 4532bda..9209860 100644 --- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs +++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs @@ -42,6 +42,8 @@ namespace OpenSim.Region.Physics.Meshing // is defined by the hull lies inside or outside the simplex chain public class SimpleHull { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private List vertices = new List(); private List holeVertices = new List(); // Only used, when the hull is hollow @@ -243,9 +245,9 @@ namespace OpenSim.Region.Physics.Meshing SimpleHull otherHullClone = otherHull.Clone(); bool intersects = false; - MainLog.Instance.Debug("State before intersection detection"); - MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString()); - MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString()); + m_log.Debug("State before intersection detection"); + m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString())); + m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString())); { int iBase, iOther; @@ -274,8 +276,8 @@ namespace OpenSim.Region.Physics.Meshing } } - MainLog.Instance.Debug("State after intersection detection for the base hull"); - MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString()); + m_log.Debug("State after intersection detection for the base hull"); + m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString())); { int iOther, iBase; @@ -303,8 +305,8 @@ namespace OpenSim.Region.Physics.Meshing } } - MainLog.Instance.Debug("State after intersection detection for the base hull"); - MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString()); + m_log.Debug("State after intersection detection for the base hull"); + m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString())); bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone); @@ -387,7 +389,7 @@ namespace OpenSim.Region.Physics.Meshing done = true; } - MainLog.Instance.Debug("The resulting Hull is:\n{1}", 0, result.ToString()); + m_log.Debug(String.Format("The resulting Hull is:\n{1}", 0, result.ToString())); return result; } -- cgit v1.1