# HG changeset patch
# User postspectacular
# Date 1327488702 0
# Node ID 599d2a58cdf6a343c6cb54a6206ac25db9b24956
# Parent 032471906b662e0b1708c69035470dd51d8b66ca
issue #30 fixed: removing circular build dependency in build_core.xml and moving new mesh classes from toxi.geom.mesh package into new source folder src.newmesh and (temporary) package toxi.newmesh, updating .classpath
diff -r 032471906b662e0b1708c69035470dd51d8b66ca -r 599d2a58cdf6a343c6cb54a6206ac25db9b24956 .classpath
--- a/.classpath Wed Jan 25 10:47:45 2012 +0000
+++ b/.classpath Wed Jan 25 10:51:42 2012 +0000
@@ -12,6 +12,7 @@
+
diff -r 032471906b662e0b1708c69035470dd51d8b66ca -r 599d2a58cdf6a343c6cb54a6206ac25db9b24956 ant/build_core.xml
--- a/ant/build_core.xml Wed Jan 25 10:47:45 2012 +0000
+++ b/ant/build_core.xml Wed Jan 25 10:51:42 2012 +0000
@@ -46,11 +46,9 @@
-
-
diff -r 032471906b662e0b1708c69035470dd51d8b66ca -r 599d2a58cdf6a343c6cb54a6206ac25db9b24956 src.core/toxi/geom/mesh/AttributedEdge.java
--- a/src.core/toxi/geom/mesh/AttributedEdge.java Wed Jan 25 10:47:45 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-package toxi.geom.mesh;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class AttributedEdge {
-
- public final int a, b;
- public List faces;
-
- public AttributedEdge(int a, int b) {
- this.a = a;
- this.b = b;
- }
-
- public void addFace(AttributedFace f) {
- if (faces == null) {
- faces = new ArrayList(2);
- }
- faces.add(f);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- AttributedEdge other = (AttributedEdge) obj;
- if (a != other.a) {
- return false;
- }
- if (b != other.b) {
- return false;
- }
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = prime + a;
- result = prime * result + b;
- return result;
- }
-
- public String toString() {
- return String.format("a=%d, b=%d", a, b);
- }
-}
diff -r 032471906b662e0b1708c69035470dd51d8b66ca -r 599d2a58cdf6a343c6cb54a6206ac25db9b24956 src.core/toxi/geom/mesh/AttributedFace.java
--- a/src.core/toxi/geom/mesh/AttributedFace.java Wed Jan 25 10:47:45 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-package toxi.geom.mesh;
-
-import java.util.HashMap;
-
-public class AttributedFace {
-
- public int a, b, c;
- public int normal = -1;
- public HashMap attribs;
-
- public AttributedFace(int a, int b, int c, HashMap attribs) {
- this.a = a;
- this.b = b;
- this.c = c;
- this.attribs = attribs;
- }
-
- public String toString() {
- return String.format("a=%d,b=%d,c=%d,n=%d", a, b, c, normal);
- }
-}
diff -r 032471906b662e0b1708c69035470dd51d8b66ca -r 599d2a58cdf6a343c6cb54a6206ac25db9b24956 src.core/toxi/geom/mesh/IndexedTriangleMesh.java
--- a/src.core/toxi/geom/mesh/IndexedTriangleMesh.java Wed Jan 25 10:47:45 2012 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,565 +0,0 @@
-package toxi.geom.mesh;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import toxi.geom.AABB;
-import toxi.geom.IsectData3D;
-import toxi.geom.Ray3D;
-import toxi.geom.ReadonlyVec3D;
-import toxi.geom.Sphere;
-import toxi.geom.Triangle3D;
-import toxi.geom.TriangleIntersector;
-import toxi.geom.Vec2D;
-import toxi.geom.Vec3D;
-import toxi.geom.mesh.subdiv.NewSubdivStrategy;
-import toxi.util.datatypes.ItemIndex;
-import toxi.util.datatypes.UniqueItemIndex;
-
-public class IndexedTriangleMesh {
-
- public static final String ATTR_EDGES = "edges";
- public static final String ATTR_FNORMALS = "fnormals";
- public static final String ATTR_UVCOORDS = "uv";
- public static final String ATTR_VCOLORS = "col";
- public static final String ATTR_VERTICES = "vertices";
- public static final String ATTR_VNORMALS = "vnormals";
-
- public SpatialIndex vertices = new SpatialIndex(0.001f);
-
- public ItemIndex fnormals = new UniqueItemIndex();
-
- public final ArrayList faces = new ArrayList();
-
- public final HashMap> attributes = new HashMap>();
-
- public IndexedTriangleMesh() {
- }
-
- public IndexedTriangleMesh addFace(Vec3D a, Vec3D b, Vec3D c,
- HashMap attribs) {
- int idA = vertices.index(a);
- int idB = vertices.index(b);
- int idC = vertices.index(c);
- if (idA != idB && idA != idC && idB != idC) {
- AttributedFace f = new AttributedFace(idA, idB, idC,
- addFaceAttributes(null, attribs));
- faces.add(f);
- }
- return this;
- }
-
- public IndexedTriangleMesh addFace(Vec3D a, Vec3D b, Vec3D c, Vec2D uva,
- Vec2D uvb, Vec2D uvc) {
- HashMap attribs = null;
- if (uva != null && uvb != null && uvc != null) {
- attribs = new HashMap();
- attribs.put(ATTR_UVCOORDS, new Object[] {
- uva, uvb, uvc
- });
- }
- return addFace(a, b, c, attribs);
- }
-
- public HashMap addFaceAttribute(AttributedFace f,
- String attrib, Object attA, Object attB, Object attC) {
- if (f != null && attrib != null && attA != null && attB != null
- && attC != null) {
- ItemIndex