remove log4net dependency and from PrimMesher.cs

sync PrimMesher.cs with PrimMesher.dll version 29 on forge
GenericGridServerConcept
Dahlia Trimble 2009-02-24 06:02:44 +00:00
parent c31e2d5987
commit 8afad46d10
2 changed files with 18 additions and 7 deletions

View File

@ -269,6 +269,10 @@ namespace OpenSim.Region.Physics.Meshing
primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides); primMesh = new PrimMesh(sides, profileBegin, profileEnd, profileHollow, hollowSides);
if (primMesh.errorMessage != null)
if (primMesh.errorMessage.Length > 0)
m_log.Error("[ERROR] " + primMesh.errorMessage);
primMesh.topShearX = pathShearX; primMesh.topShearX = pathShearX;
primMesh.topShearY = pathShearY; primMesh.topShearY = pathShearY;
primMesh.pathCutBegin = pathBegin; primMesh.pathCutBegin = pathBegin;

View File

@ -29,8 +29,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.IO; using System.IO;
using log4net;
using System.Reflection;
namespace PrimMesher namespace PrimMesher
{ {
@ -578,9 +576,10 @@ namespace PrimMesher
/// </summary> /// </summary>
internal class Profile internal class Profile
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private const float twoPi = 2.0f * (float)Math.PI; private const float twoPi = 2.0f * (float)Math.PI;
internal string errorMessage = null;
internal List<Coord> coords; internal List<Coord> coords;
internal List<Face> faces; internal List<Face> faces;
internal List<Coord> vertexNormals; internal List<Coord> vertexNormals;
@ -646,8 +645,10 @@ namespace PrimMesher
try { angles.makeAngles(sides, startAngle, stopAngle); } try { angles.makeAngles(sides, startAngle, stopAngle); }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("makeAngles failed: Exception: " + ex.ToString());
m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); errorMessage = "makeAngles failed: Exception: " + ex.ToString()
+ "\nsides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString();
return; return;
} }
@ -666,8 +667,9 @@ namespace PrimMesher
try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); } try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); }
catch (Exception ex) catch (Exception ex)
{ {
m_log.Error("makeAngles failed: Exception: " + ex.ToString()); errorMessage = "makeAngles failed: Exception: " + ex.ToString()
m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + "\nsides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString();
return; return;
} }
} }
@ -1127,6 +1129,7 @@ namespace PrimMesher
public class PrimMesh public class PrimMesh
{ {
public string errorMessage = "";
private const float twoPi = 2.0f * (float)Math.PI; private const float twoPi = 2.0f * (float)Math.PI;
public List<Coord> coords; public List<Coord> coords;
@ -1314,6 +1317,8 @@ namespace PrimMesher
hollow *= 1.414f; hollow *= 1.414f;
Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, true, calcVertexNormals); Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, true, calcVertexNormals);
this.errorMessage = profile.errorMessage;
this.numPrimFaces = profile.numPrimFaces; this.numPrimFaces = profile.numPrimFaces;
int cut1Vert = -1; int cut1Vert = -1;
@ -1694,6 +1699,8 @@ namespace PrimMesher
needEndFaces = true; needEndFaces = true;
Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, needEndFaces, calcVertexNormals); Profile profile = new Profile(this.sides, this.profileStart, this.profileEnd, hollow, this.hollowSides, needEndFaces, calcVertexNormals);
this.errorMessage = profile.errorMessage;
this.numPrimFaces = profile.numPrimFaces; this.numPrimFaces = profile.numPrimFaces;
int cut1Vert = -1; int cut1Vert = -1;