[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Mesh.java, 1.21, 1.22
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-09-29 14:29:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29960/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: Mesh extended with elements Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Mesh.java 27 Sep 2007 10:43:02 -0000 1.21 --- Mesh.java 29 Sep 2007 14:29:05 -0000 1.22 *************** *** 21,24 **** --- 21,25 ---- private Collection<Edge> edges; private Collection<Surface> surfaces; + private Collection<Space> elements; /** *************** *** 44,47 **** --- 45,65 ---- /** + * Constructs a Mesh. + * @param elements Collection of spaces + * @param surfaces Collection of surfaces + * @param edges Collection of edges + * @param vertices Collection of vertices + */ + public Mesh(Collection<Space> elements, + Collection<Surface> surfaces, + Collection<Edge> edges, + Collection<Vertex> vertices) { + this.elements = elements; + this.surfaces = surfaces; + this.edges = edges; + this.vertices = vertices; + } + + /** * * @param geometrics Collection of Geometric objects *************** *** 51,56 **** Collection<Edge> edges = new HashSet<Edge>(); Collection<Surface> surfaces = new HashSet<Surface>(); for (Geometric current : geometrics) { ! if (current instanceof Surface) { surfaces.add((Surface) current); } else if (current instanceof Edge) { --- 69,77 ---- Collection<Edge> edges = new HashSet<Edge>(); Collection<Surface> surfaces = new HashSet<Surface>(); + Collection<Space> elements = new HashSet<Space>(); for (Geometric current : geometrics) { ! if (current instanceof Space) { ! elements.add((Space) current); ! } else if (current instanceof Surface) { surfaces.add((Surface) current); } else if (current instanceof Edge) { *************** *** 62,65 **** --- 83,87 ---- edges.addAll(Surface.edges(surfaces)); vertices.addAll(Edge.vertices(edges)); + this.elements = elements; this.surfaces = surfaces; this.edges = edges; *************** *** 92,95 **** --- 114,125 ---- /** + * + * @return elements + */ + public Collection<Space> elements() { + return elements; + } + + /** * Returns all geometric objects in this Mesh * @return collection of geometrics objects |