bprocessor-commit Mailing List for B-processor (Page 72)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
| 2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
| 2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
| 2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
| 2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
| 2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michael L. <he...@us...> - 2007-03-22 14:37:39
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3078/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Progress on mesh algorithms Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** SpaceTool.java 31 Jan 2007 15:22:06 -0000 1.69 --- SpaceTool.java 22 Mar 2007 14:37:29 -0000 1.70 *************** *** 40,43 **** --- 40,44 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.IDTransform; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Scale; *************** *** 630,645 **** Space space = Project.getInstance().getActiveSpace(); while (!stack.empty()) { Object result = stack.pop(); if (result instanceof Vertex) { ! result = space.insert((Vertex)result); ! Selection.primary().add(result); } else if (result instanceof Edge) { ! result = space.insert((Edge)result); ! Selection.primary().add(result); } else if (result instanceof Surface) { ! result = space.insert((Surface) result); ! Selection.primary().add(result); } else if (result instanceof Space) { space.add((Space) result); Selection.primary().add(result); --- 631,650 ---- Space space = Project.getInstance().getActiveSpace(); + Collection<Vertex> vertices = new LinkedList(); + Collection<Edge> edges = new LinkedList(); + Collection<Surface> surfaces = new LinkedList(); + Collection<Space> spaces = new LinkedList(); + + while (!stack.empty()) { Object result = stack.pop(); if (result instanceof Vertex) { ! vertices.add((Vertex)result); } else if (result instanceof Edge) { ! edges.add((Edge)result); } else if (result instanceof Surface) { ! surfaces.add((Surface)result); } else if (result instanceof Space) { + spaces.add((Space) result); space.add((Space) result); Selection.primary().add(result); *************** *** 648,651 **** --- 653,664 ---- } } + edges.addAll(Surface.edges(surfaces)); + vertices.addAll(Edge.vertices(edges)); + Mesh mesh = new Mesh(surfaces, edges, vertices); + // mesh.identify(); + Mesh result = space.insert(mesh); + Selection.primary().addAll(result.vertices()); + Selection.primary().addAll(result.edges()); + Selection.primary().addAll(result.surfaces()); Project.getInstance().checkpoint(); typing = false; |
|
From: Michael L. <he...@us...> - 2007-03-22 14:37:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3066/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Vertex.java Space.java Mesh.java Log Message: Progress on mesh algorithms Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Edge.java 22 Mar 2007 11:44:29 -0000 1.76 --- Edge.java 22 Mar 2007 14:37:26 -0000 1.77 *************** *** 229,235 **** String name; if (id == null) { ! name = "None"; } else { ! name = "E" + id; } return name; --- 229,239 ---- String name; if (id == null) { ! name = "E"; } else { ! if (getOwner() == null) { ! name = "e" + id; ! } else { ! name = "E" + id; ! } } return name; Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** Space.java 12 Mar 2007 08:32:47 -0000 1.124 --- Space.java 22 Mar 2007 14:37:26 -0000 1.125 *************** *** 2721,2723 **** --- 2721,2744 ---- } + /** + * + * @param mesh Mesh + * @return new mesh + */ + public Mesh insert(Mesh mesh) { + Collection<Vertex> vertices = new LinkedList(); + Collection<Edge> edges = new LinkedList(); + Collection<Surface> surfaces = new LinkedList(); + mesh.split(this.getVertices()); + for (Vertex vertex : mesh.vertices()) { + vertices.add(insert(vertex)); + } + for (Edge edge : mesh.edges()) { + edges.add(insert(edge)); + } + for (Surface surface : mesh.surfaces()) { + surfaces.add(insert(surface)); + } + return new Mesh(surfaces, edges, vertices); + } } Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Vertex.java 19 Mar 2007 11:53:11 -0000 1.55 --- Vertex.java 22 Mar 2007 14:37:26 -0000 1.56 *************** *** 103,107 **** name = "V"; } else { ! name = "V" + id; } return name; --- 103,111 ---- name = "V"; } else { ! if (getOwner() == null) { ! name = "v" + id; ! } else { ! name = "V" + id; ! } } return name; Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Mesh.java 21 Mar 2007 13:44:13 -0000 1.12 --- Mesh.java 22 Mar 2007 14:37:26 -0000 1.13 *************** *** 9,12 **** --- 9,14 ---- import java.util.Collection; + import java.util.LinkedList; + import java.util.List; /** *************** *** 38,40 **** --- 40,181 ---- this.vertices = vertices; } + + /** + * + * @return vertices + */ + public Collection<Vertex> vertices() { + return vertices; + } + + /** + * + * @return edges + */ + public Collection<Edge> edges() { + return edges; + } + + /** + * + * @return surfaces + */ + public Collection<Surface> surfaces() { + return surfaces; + } + + /** + * + */ + public void identify() { + long count = 1; + for (Edge current : edges) { + if (current.id == null) { + current.setId(new Long(count++)); + } + } + count = 1; + for (Vertex current : vertices) { + if (current.id == null) { + current.setId(new Long(count++)); + } + } + } + + /** + * Insert the other mesh into this mesh. + * The other mesh is assumed to not contain + * duplicates. + * @param other The mesh to insert into this mesh. + */ + public void insert(Mesh other) { + // Version 1 + // Replace vertices in other + // Split edges in other + // Replace edges in other + // Replace surfaces in other + // Insert new geometry + + // Version 2 + // Split edges in other + // Insert vertices + // Insert edges + // Insert surfaces + + // Plan 1 + // Insert geometry + // implement version 2. + } + + /** + * + * @param others Collection of vertices + */ + public void split(Collection<Vertex> others) { + Collection<Edge> added = new LinkedList(); + Collection<Edge> removed = new LinkedList(); + for (Vertex vertex : others) { + split(vertex, added, removed); + } + edges.removeAll(removed); + edges.addAll(added); + } + + /** + * + * @param vertex Vertex + * @param added Collection + * @param removed Collection + * @return Boolean + */ + public boolean split(Vertex vertex, + Collection<Edge> added, Collection<Edge> removed) { + boolean add = false; + for (Edge edge : edges) { + if (edge.coincides(vertex)) { + split(edge, vertex, added, removed); + add = true; + } + } + return add; + } + + private void split(Edge edge, Vertex vertex, + Collection<Edge> added, Collection<Edge> removed) { + Edge e1 = new Edge(edge.from, vertex); + Edge e2 = new Edge(vertex, edge.to); + added.add(e1); + added.add(e2); + removed.add(edge); + Collection<Surface> surfaces = adjacent(edge); + for (Surface current : surfaces) { + Vertex from = current.getFirstVertex(); + List<Edge> edges = current.getEdges(); + LinkedList<Edge> replacement = new LinkedList(); + for (Edge original : edges) { + if (original == edge) { + if (original.from == from) { + replacement.add(e1); + replacement.add(e2); + } else { + replacement.add(e2); + replacement.add(e1); + } + } else { + replacement.add(original); + } + } + current.setEdges(replacement); + } + } + + private Collection<Surface> adjacent(Edge edge) { + LinkedList<Surface> result = new LinkedList(); + for (Surface current : surfaces) { + if (current.contains(edge)) { + result.add(current); + } + } + return result; + } } |
|
From: rimestad <rim...@us...> - 2007-03-22 11:47:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28888/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java ToolFactory.java Added Files: EdgeMoveTool.java Log Message: added a edgeMoveTool to the system, it is not done yet, need som bug fixing --- NEW FILE: EdgeMoveTool.java --- //--------------------------------------------------------------------------------- // $Id: EdgeMoveTool.java,v 1.1 2007/03/22 11:47:06 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.awt.Cursor; import java.awt.event.MouseEvent; import java.util.Collection; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Relation; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * Alternative Move Tool */ public class EdgeMoveTool extends AbstractPencil { private Edge edge; private Plane dragplane; private Map<Surface, Collection<Vertex>> verticesMap; private Map<Vertex, Collection<Edge>> map; private HashMap<Surface, CoordinateSystem> coordMap; private HashMap<Surface, Line> swiwel; private Intersection previous; /** * @param glv GLView * @param cursor Cursor */ public EdgeMoveTool(GLView glv, Cursor cursor) { super(glv, cursor); } private void move(Vertex to, Vertex from) { if (to == null) { System.out.println("move-to null"); } else { for (Surface surface : coordMap.keySet()) { CoordinateSystem system = coordMap.get(surface); Vertex about = swiwel.get(surface).getOrigin(); Vertex v1 = to.minus(about); Vertex v2 = from.minus(about); double angle = v1.dot(v2); System.out.println("Angle were " + angle); system.rotate(angle, swiwel.get(surface)); for (Vertex vertex : verticesMap.get(surface)) { Vertex vector = system.getN(); Collection<Edge> binding = map.get(vertex); if (!binding.isEmpty()) { Edge bind = binding.iterator().next(); vector = bind.getDirection(); vector.normalize(); } Vertex project = system.slide(vertex, vector); vertex.set(project); } system.update(); } /* system.setOrigin(to); for (Vertex vertex : vertices) { Vertex vector = system.getN(); Collection<Edge> binding = map.get(vertex); if (!binding.isEmpty()) { Edge bind = binding.iterator().next(); vector = bind.getDirection(); vector.normalize(); } Vertex project = system.slide(vertex, vector); vertex.set(project); } system.update();*/ } } /** {@inheritDoc} */ @Override protected void moved(MouseEvent e) { List<Edge> edges = new LinkedList<Edge>(); if (coordMap == null) { findTarget(e, View.OBJECTS); glv.getView().makeTarget(target); } else { Vertex hit = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); previous = current; current = new Intersection(hit, Intersection.EDGE, null); Vertex from = start.vertex(); makeTarget(current); Vertex to = current.vertex(); Edge edge = new Edge(from, to); edge.setStrippled(true); edges.add(edge); move(to, previous.vertex()); } feedback(edges); } /** {@inheritDoc} */ @Override protected void pressed(MouseEvent e) { if (coordMap == null) { findTarget(e, View.OBJECTS); glv.getView().makeTarget(target); if (target instanceof Edge) { edge = (Edge) target; Set<Surface> surfaces = edge.getSurfaces(); verticesMap = new HashMap<Surface, Collection<Vertex>>(); coordMap = new HashMap<Surface, CoordinateSystem>(); swiwel = new HashMap<Surface, Line>(); Space space = edge.getOwner(); // find relations Collection<CoordinateSystem> systems = space.getCoordinateSystems(); for (CoordinateSystem current : systems) { Collection<Relation> relations = current.relations(); for (Relation relation : relations) { if (surfaces.contains(relation.geometric())) { coordMap.put((Surface)relation.geometric(), current); } } } // find rotation lines and vertices for (Surface surface : surfaces) { Vertex center = surface.oppositeVertex(edge); swiwel.put(surface, new Line(center, edge.getDirection())); verticesMap.put(surface, surface.getVertices()); } map = space.edgeMap(Geometry.collect(surfaces)); Selection.primary().set(edge); for (Surface surface : surfaces) { if (!coordMap.containsKey(surface)) { CoordinateSystem system = surface.coordinateSystem(); system.onlyPlane(true); system.setActive(true); coordMap.put(surface, system); } } } start = findIntersection(e); makeTarget(start); for (CoordinateSystem cs : coordMap.values()) { glv.getView().addTempConstructor(cs); } View view = glv.getView(); Transformation trans = view.transformation(); double x = e.getX(); double y = View.getHeight() - e.getY(); Vertex near = new Vertex(x, y, 0.0); Vertex far = new Vertex(x, y, 1.0); Edge ray = new Edge(near, far); ray = trans.unProject(ray); Vertex dir = edge.getDirection(); Plane plane = new Plane(dir.getX(), dir.getY(), dir.getZ(), start.vertex()); dragplane = plane.orthogonalPlane(ray); } else { Project.getInstance().checkpoint(); cleanUp(); moved(e); } } /** {@inheritDoc} */ @Override public void cleanUp() { if (start != null) { move(current.vertex(), start.vertex()); } if (coordMap != null) { for (CoordinateSystem cs : coordMap.values()) { glv.getView().removeTempConstructor(cs); } } edge = null; coordMap = null; swiwel = null; dragplane = null; verticesMap = null; map = null; Selection.primary().clear(); super.cleanUp(); } } Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** ToolFactory.java 28 Feb 2007 15:25:52 -0000 1.78 --- ToolFactory.java 22 Mar 2007 11:47:06 -0000 1.79 *************** *** 119,125 **** private FocusTool focusTool; ! /** The too for moving alternatively */ private AltMoveTool altMoveTool; /** The selection button */ private JToggleButton selBut; --- 119,128 ---- private FocusTool focusTool; ! /** The tool for moving alternatively */ private AltMoveTool altMoveTool; + /** The tool for moving edges alternatively */ + private EdgeMoveTool edgeMoveTool; + /** The selection button */ private JToggleButton selBut; *************** *** 214,217 **** --- 217,221 ---- focusTool = new FocusTool(glv, null); altMoveTool = new AltMoveTool(glv, pencilcursor); + edgeMoveTool = new EdgeMoveTool(glv, pencilcursor); Toolbar tb = Toolbar.getInstance(); *************** *** 237,240 **** --- 241,245 ---- registerTool(Tool.CONTROLLED_MOVE_TOOL, controlled, "Biconmovetool.gif", "Controlled Move"); registerTool(Tool.ALT_MOVE_TOOL, altMoveTool, "Biconmovetool.gif", "Alternative Moving"); + registerTool(Tool.EDGE_MOVE_TOOL, edgeMoveTool, "Biconmovetool.gif", "Edge moving"); rotationBut = this.registerTool(Tool.ROTATION_TOOL, rotation, "Biconrotaxe.gif", "Rotate"); tb.addSeparator(3); Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Tool.java 28 Feb 2007 15:25:52 -0000 1.30 --- Tool.java 22 Mar 2007 11:47:06 -0000 1.31 *************** *** 66,69 **** --- 66,71 ---- /** the tool for alternative moving of objects */ public static final int ALT_MOVE_TOOL = 22; + /** the tool for alternative moving of edges */ + public static final int EDGE_MOVE_TOOL = 23; /** |
|
From: rimestad <rim...@us...> - 2007-03-22 11:46:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28571/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: removed the hide temp impl. and changed the placement of handles on coords. to be able to hit them Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** View.java 21 Mar 2007 11:51:58 -0000 1.197 --- View.java 22 Mar 2007 11:46:34 -0000 1.198 *************** *** 880,888 **** highligts = new HashSet(); - // Add all hidden geometry to the set of geometry not to draw - if (Project.getInstance().getCurrentCamera().getHiddenGeometrics() != null) { - invisibles.addAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); - } - { for (Geometric object : (Collection<Geometric>) selection) { --- 880,883 ---- *************** *** 918,922 **** } } ! drawSpace(Project.getInstance().world(), false, false); --- 913,917 ---- } } ! drawSpace(Project.getInstance().world(), false, false); *************** *** 2112,2116 **** drawVertexHit(origin); popName(gl); ! List handles = current.handles(dist / 16); Iterator iterator = handles.iterator(); while (iterator.hasNext()) { --- 2107,2111 ---- drawVertexHit(origin); popName(gl); ! List handles = current.handles(dist); Iterator iterator = handles.iterator(); while (iterator.hasNext()) { |
|
From: rimestad <rim...@us...> - 2007-03-22 11:45:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28166/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: added a update call after setAttributes and moved some inner classes to the bottom of the file Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** CoordinateSystem.java 14 Mar 2007 10:22:13 -0000 1.45 --- CoordinateSystem.java 22 Mar 2007 11:45:31 -0000 1.46 *************** *** 536,539 **** --- 536,540 ---- onlyPlane(((Boolean)(((Attribute)attributes.get(17)).getValue())).booleanValue()); } + update(); } *************** *** 686,715 **** return list; } - /** - * Guide - */ - private class Guide extends Edge { - /** */ - private static final long serialVersionUID = 1L; - - /** - * Constructor - * @param from Vertex - * @param to Vertex - */ - public Guide(Vertex from, Vertex to) { - super(from, to); - setStrippled(true); - } - - /** - * Parent - * @return This line - */ - public Geometric parent() { - return CoordinateSystem.this; - } - } - /** --- 687,690 ---- *************** *** 726,729 **** --- 701,754 ---- return list; } + + /** + * make a copy of the coordinatsystem + * @return the copy + */ + public CoordinateSystem copy() { + CoordinateSystem n = new CoordinateSystem(); + n.setAttributes(this.getAttributes()); + return n; + } + + /** + * flip the coordinatesystem on its head; + */ + public void flip() { + Vertex tmp = i; + i = j; + j = tmp; + n.scale(-1); + } + + /** + * {@inheritDoc} + * + */ + public void update() { + Map<Relation, Map<Vertex, Vertex>> directions = new HashMap<Relation, Map<Vertex, Vertex>>(); + for (Relation relation : relations) { + Geometric geometric = relation.geometric(); + Space space = geometric.getOwner(); + Collection<Vertex> vertices = geometric.collect(); + Map<Vertex, Vertex> map = space.directionMap(vertices); + directions.put(relation, map); + } + for (Relation relation : relations) { + double distance = relation.evaluate(); + Geometric geometric = relation.geometric(); + Collection<Vertex> vertices = geometric.collect(); + Map<Vertex, Vertex> map = directions.get(relation); + for (Vertex vertex : vertices) { + Vertex vector = map.get(vertex); + if (vector == null) { + vector = getN(); + } + Plane plane = plane(distance); + Vertex project = plane.intersection(vertex, vector, true); + vertex.set(project); + } + } + } /** *************** *** 768,819 **** } } ! /** ! * make a copy of the coordinatsystem ! * @return the copy */ ! public CoordinateSystem copy() { ! CoordinateSystem n = new CoordinateSystem(); ! n.setAttributes(this.getAttributes()); ! return n; ! } ! /** ! * flip the coordinatesystem on its head; ! */ ! public void flip() { ! Vertex tmp = i; ! i = j; ! j = tmp; ! n.scale(-1); } ! /** ! * {@inheritDoc} */ ! public void update() { ! Map<Relation, Map<Vertex, Vertex>> directions = new HashMap(); ! for (Relation relation : relations) { ! Geometric geometric = relation.geometric(); ! Space space = geometric.getOwner(); ! Collection<Vertex> vertices = geometric.collect(); ! Map<Vertex, Vertex> map = space.directionMap(vertices); ! directions.put(relation, map); ! } ! for (Relation relation : relations) { ! double distance = relation.evaluate(); ! Geometric geometric = relation.geometric(); ! Collection<Vertex> vertices = geometric.collect(); ! Map<Vertex, Vertex> map = directions.get(relation); ! for (Vertex vertex : vertices) { ! Vertex vector = map.get(vertex); ! if (vector == null) { ! vector = getN(); ! } ! Plane plane = plane(distance); ! Vertex project = plane.intersection(vertex, vector, true); ! vertex.set(project); ! } ! } } } --- 793,836 ---- } } ! /** ! * Guide */ ! private class Guide extends Edge { ! /** */ ! private static final long serialVersionUID = 1L; ! /** ! * Constructor ! * @param from Vertex ! * @param to Vertex ! */ ! public Guide(Vertex from, Vertex to) { ! super(from, to); ! setStrippled(true); ! } ! ! /** ! * Parent ! * @return This line ! */ ! public Geometric parent() { ! return CoordinateSystem.this; ! } } ! /** ! * rotate a coordinatesystem about a line ! * rotate all axis about 0,0,0 and the origin about line.origin ! * @param angle the angle to rotate ! * @param line the line to rotate about */ ! public void rotate(double angle, Line line) { ! Vertex dir = line.getDirection(); ! Geometry.rotate(angle, dir.getX(), dir.getY(), dir.getZ(), getOrigin(), line.getOrigin()); ! Vertex zero = new Vertex(0, 0, 0); ! Geometry.rotate(angle, dir.getX(), dir.getY(), dir.getZ(), getI(), zero); ! Geometry.rotate(angle, dir.getX(), dir.getY(), dir.getZ(), getJ(), zero); ! Geometry.rotate(angle, dir.getX(), dir.getY(), dir.getZ(), getN(), zero); } } |
|
From: rimestad <rim...@us...> - 2007-03-22 11:44:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27771/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Log Message: small refactoring to generics Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** Surface.java 21 Mar 2007 11:58:06 -0000 1.144 --- Surface.java 22 Mar 2007 11:44:29 -0000 1.145 *************** *** 236,241 **** * @return An ordered list of vertices around this Surface */ ! public List getVertices() { ! ArrayList vertices = new ArrayList(); List edges = getEdges(); if (edges.size() == 1) { --- 236,241 ---- * @return An ordered list of vertices around this Surface */ ! public List<Vertex> getVertices() { ! ArrayList<Vertex> vertices = new ArrayList<Vertex>(); List edges = getEdges(); if (edges.size() == 1) { *************** *** 1662,1667 **** * @return the set of vertices */ ! public Set collect() { ! Set result = new HashSet(this.getVertices()); if (holes != null) { Iterator it = holes.iterator(); --- 1662,1667 ---- * @return the set of vertices */ ! public Set<Vertex> collect() { ! Set<Vertex> result = new HashSet<Vertex>(this.getVertices()); if (holes != null) { Iterator it = holes.iterator(); *************** *** 1953,1955 **** --- 1953,1982 ---- return top; } + + /** + * Find the last hit vertex, when the given edge is used as sweepline across the surface + * @precondtion The given edge is in the surface + * @param e the edge to use as sweepline + * @return the vertex farest away (if there are several vertexes with the same distance the + * last is returned + */ + public Vertex oppositeVertex(Edge e) { + if (!edges.contains(e)) { + return null; + } + Vertex result = null; + double maxdist = 0; + Vertex i = e.getDirection().cross(normal()); + CoordinateSystem translation = + new CoordinateSystem(i, e.getDirection(), normal(), e.getFrom()); + Set<Vertex> vertexes = collect(); + for (Vertex v : vertexes) { + Vertex translatedVertex = translation.translate(v); + if (Math.abs(translatedVertex.getX()) >= maxdist) { + result = v; + maxdist = Math.abs(translatedVertex.getX()); + } + } + return result; + } } Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Edge.java 12 Mar 2007 16:01:26 -0000 1.75 --- Edge.java 22 Mar 2007 11:44:29 -0000 1.76 *************** *** 449,454 **** * @return the set of surfaces */ ! public Set getSurfaces() { ! Set result = new HashSet(); if (getOwner() != null) { Collection surfaces = getOwner().getSurfaces(); --- 449,454 ---- * @return the set of surfaces */ ! public Set<Surface> getSurfaces() { ! Set<Surface> result = new HashSet<Surface>(); if (getOwner() != null) { Collection surfaces = getOwner().getSurfaces(); |
|
From: Michael L. <he...@us...> - 2007-03-21 13:44:15
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9810/src/net/sourceforge/bprocessor/model Added Files: Mesh.java Log Message: Introduced a Mesh class for geometric algorithms --- NEW FILE: Mesh.java --- //--------------------------------------------------------------------------------- // $Id: Mesh.java,v 1.12 2007/03/21 13:44:13 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.model; import java.util.Collection; /** * */ public class Mesh { private Collection<Vertex> vertices; private Collection<Edge> edges; private Collection<Surface> surfaces; /** * Basic constructor */ public Mesh() { } /** * Constructs a Mesh object. * @param surfaces Collection of surfaces * @param edges Collection of edges * @param vertices Collection of vertices */ public Mesh(Collection<Surface> surfaces, Collection<Edge> edges, Collection<Vertex> vertices) { this.surfaces = surfaces; this.edges = edges; this.vertices = vertices; } } |
|
From: Michael L. <he...@us...> - 2007-03-21 11:58:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30028/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometric.java Project.java Log Message: removed usage of the term "mesh" Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** Surface.java 15 Mar 2007 15:06:28 -0000 1.143 --- Surface.java 21 Mar 2007 11:58:06 -0000 1.144 *************** *** 504,516 **** /** * Return a copy of this Surface ! * @param mesh The mesh to copy into * @return The copy */ ! public Surface copy(Space mesh) { HashMap map = new HashMap(); Surface surface = copy(map); Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); ! mesh.addAll(surfaces); return surface; } --- 504,516 ---- /** * Return a copy of this Surface ! * @param space The space to copy into * @return The copy */ ! public Surface copy(Space space) { HashMap map = new HashMap(); Surface surface = copy(map); Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); ! space.addAll(surfaces); return surface; } Index: Geometric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometric.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Geometric.java 6 Feb 2007 17:27:18 -0000 1.14 --- Geometric.java 21 Mar 2007 11:58:06 -0000 1.15 *************** *** 16,20 **** */ public abstract class Geometric extends Entity { ! /** The mesh containing this geometric entity */ private Space owner; --- 16,20 ---- */ public abstract class Geometric extends Entity { ! /** The space containing this geometric entity */ private Space owner; *************** *** 23,28 **** /** ! * Get the mesh ! * @return The mesh */ public Space getOwner() { --- 23,28 ---- /** ! * Get the space ! * @return The space */ public Space getOwner() { *************** *** 31,39 **** /** ! * Set the mesh ! * @param mesh The mesh */ ! public void setOwner(Space mesh) { ! this.owner = mesh; } --- 31,39 ---- /** ! * Set the space ! * @param space The space */ ! public void setOwner(Space space) { ! this.owner = space; } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** Project.java 13 Mar 2007 10:10:23 -0000 1.116 --- Project.java 21 Mar 2007 11:58:06 -0000 1.117 *************** *** 50,54 **** private List scheduledObservers; ! /** The Mesh */ private Space world; --- 50,54 ---- private List scheduledObservers; ! /** The toplevel space */ private Space world; *************** *** 167,172 **** /** ! * Get the mesh ! * @return The mesh */ public Space world() { --- 167,172 ---- /** ! * Get the world ! * @return The world */ public Space world() { |
|
From: Michael L. <he...@us...> - 2007-03-21 11:52:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27547/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: got rid of iterator Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.196 retrieving revision 1.197 diff -C2 -d -r1.196 -r1.197 *** View.java 21 Mar 2007 11:43:57 -0000 1.196 --- View.java 21 Mar 2007 11:51:58 -0000 1.197 *************** *** 643,659 **** //draw the clipping planes ! Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (clipit.hasNext()) { ! ClippingPlane cp = (ClippingPlane)clipit.next(); Collection selection = Selection.primary(); ! if (cp == target) { ! drawObject(cp); } else { ! if (selection.contains(cp)) { gl.glColor3fv(SELECTED_COLOR, 0); } else { gl.glColor3fv(CLIP_PLANE_COLOR, 0); } ! drawClipplane(cp); } } --- 643,660 ---- //draw the clipping planes ! Collection<ClippingPlane> clips ! = Project.getInstance().getCurrentCamera().getClipplanes(); ! ! for (ClippingPlane current : clips) { Collection selection = Selection.primary(); ! if (current == target) { ! drawObject(current); } else { ! if (selection.contains(current)) { gl.glColor3fv(SELECTED_COLOR, 0); } else { gl.glColor3fv(CLIP_PLANE_COLOR, 0); } ! drawClipplane(current); } } |
|
From: Michael L. <he...@us...> - 2007-03-21 11:44:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24364/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Minor improvement of selection-drawing Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.195 retrieving revision 1.196 diff -C2 -d -r1.195 -r1.196 *** View.java 15 Mar 2007 15:06:21 -0000 1.195 --- View.java 21 Mar 2007 11:43:57 -0000 1.196 *************** *** 937,941 **** while (highlightIter.hasNext()) { Object o = highlightIter.next(); ! if (!(o instanceof Surface)) { drawGeometric((Geometric) o); } --- 937,941 ---- while (highlightIter.hasNext()) { Object o = highlightIter.next(); ! if (!(o instanceof Surface || o instanceof Edge)) { drawGeometric((Geometric) o); } *************** *** 1503,1534 **** * @param dodge dodge colors */ ! public void drawGeneralEdges(Collection edges, boolean dodge) { gl.glLineWidth(1.0f); ! gl.glColor3fv(lineColor, 0); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge)iter.next(); ! float[] color = (float[])colorMap.get(current); ! if (color != null) { ! gl.glColor3fv(color, 0); ! if (current.getStrippled()) { ! drawConstructor(current); } else { ! drawEdge(current); } ! gl.glColor3fv(lineColor, 0); ! } else if (current.getStrippled()) { ! gl.glColor3fv(constructorColor, 0); drawConstructor(current); - gl.glColor3fv(lineColor, 0); } else { - if (dodge) { - gl.glColor3fv(GREY_LINE_COLOR, 0); - } drawEdge(current); } ! if (dodge) { ! gl.glColor3fv(lineColor, 0); ! } } } --- 1503,1534 ---- * @param dodge dodge colors */ ! public void drawGeneralEdges(Collection<Edge> edges, boolean dodge) { ! Collection selection = Selection.primary(); gl.glLineWidth(1.0f); ! for (Edge current : edges) { ! float[] color = lineColor; ! ! if (selection.contains(current)) { ! color = SELECTED_COLOR; ! gl.glLineWidth(1.5f); ! } else { ! float[] individualColor = (float[])colorMap.get(current); ! if (individualColor != null) { ! color = individualColor; } else { ! if (current.getStrippled()) { ! color = constructorColor; ! } else if (dodge) { ! color = GREY_LINE_COLOR; ! } } ! } ! gl.glColor3fv(color, 0); ! if (current.getStrippled()) { drawConstructor(current); } else { drawEdge(current); } ! gl.glColor3fv(lineColor, 0); } } |
|
From: Michael L. <he...@us...> - 2007-03-20 09:46:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12885/src/net/sourceforge/bprocessor/model Modified Files: EnergyCalc.java Log Message: Tests for error Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EnergyCalc.java 31 Jan 2007 12:48:23 -0000 1.6 --- EnergyCalc.java 20 Mar 2007 09:46:14 -0000 1.7 *************** *** 147,150 **** --- 147,152 ---- } } + + if (closest != null && closest.getFrontDomain().isFunctionalSpace()) { spa = closest.getFrontDomain(); *************** *** 154,170 **** } ! if (spa.getClassification() != null) { ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getFullId(null).equalsIgnoreCase("-10")) { ! relevant = true; ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getFullId(null) ! .equalsIgnoreCase("-10")) { ! relevant = true; } } - return relevant; } --- 156,173 ---- } ! if (spa != null) { ! if (spa.getClassification() != null) { ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getFullId(null).equalsIgnoreCase("-10")) { ! relevant = true; ! } ! if (spa.getClassification().getParent() != null && ! spa.getClassification().getParent().getFullId(null) ! .equalsIgnoreCase("-10")) { ! relevant = true; ! } } } return relevant; } |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-19 16:00:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17127/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Log Message: Now with commentary Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Classification.java 19 Mar 2007 12:38:14 -0000 1.8 --- Classification.java 19 Mar 2007 12:46:16 -0000 1.9 *************** *** 36,40 **** private String produkt; ! /** The id of the classification */ private Double uvalue = 0.0; --- 36,40 ---- private String produkt; ! /** The uvalue the classification */ private Double uvalue = 0.0; *************** *** 242,245 **** --- 242,249 ---- } + /** + * Return a list of the attributes in the object + * @return the list of attributes for the object + */ public List getAttributes() { ArrayList res = new ArrayList(); *************** *** 250,257 **** --- 254,266 ---- } + /** {@inheritDoc} */ public String getGeneralName() { return "Classification"; } + /** + * Set the attributes of the object to the values in the list + * @param attributes The attributes to set + */ public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); *************** *** 264,271 **** --- 273,289 ---- } + + /** + * Get the U-value for this classification + * @return uvalue the U-value + */ public Double getUvalue() { return uvalue; } + /** + * Set the U-value for this classification + * @param uvalue the U-value + */ public void setUvalue(Double uvalue) { this.uvalue = uvalue; |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-19 15:58:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13094/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Log Message: Made classification parametric and added an U-value attribute Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Classification.java 31 Jan 2007 12:48:23 -0000 1.7 --- Classification.java 19 Mar 2007 12:38:14 -0000 1.8 *************** *** 7,10 **** --- 7,13 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; import java.util.Vector; *************** *** 14,18 **** * This class persist the model from/to an XML document */ ! public class Classification { /** The logger */ private static Logger log = Logger.getLogger(Classification.class); --- 17,21 ---- * This class persist the model from/to an XML document */ ! public class Classification implements Parametric { /** The logger */ private static Logger log = Logger.getLogger(Classification.class); *************** *** 33,36 **** --- 36,42 ---- private String produkt; + /** The id of the classification */ + private Double uvalue = 0.0; + /** Construction Type */ *************** *** 236,239 **** --- 242,275 ---- } + public List getAttributes() { + ArrayList res = new ArrayList(); + res.add(new Attribute("Name", getName(), false)); + res.add(new Attribute("Id", getId(), false)); + res.add(new Attribute("U-value", getUvalue(), true)); + return res; + } + + public String getGeneralName() { + return "Classification"; + } + + public void setAttributes(List attributes) { + Iterator iter = attributes.iterator(); + while (iter.hasNext()) { + Attribute a = (Attribute)iter.next(); + if (a.getName().equals("U-value")) { + setUvalue((Double)a.getValue()); + } + } + } + + public Double getUvalue() { + return uvalue; + } + + public void setUvalue(Double uvalue) { + this.uvalue = uvalue; + } + |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-19 15:57:39
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18129/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: now with correct java doc Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** GenericTreeView.java 19 Mar 2007 12:37:10 -0000 1.88 --- GenericTreeView.java 19 Mar 2007 12:48:25 -0000 1.89 *************** *** 870,875 **** public class ClassificationNode extends EntityNode { /** ! * Constructor for VertexNode ! * @param vertex The vertex */ public ClassificationNode(Classification clas) { --- 870,875 ---- public class ClassificationNode extends EntityNode { /** ! * Constructor for ClassificationNode ! * @param clas The classification */ public ClassificationNode(Classification clas) { *************** *** 1029,1033 **** * Constructor * @param name The name ! * @param space The space */ public DBKContainer(String name, Project project) { --- 1029,1033 ---- * Constructor * @param name The name ! * @param project The project */ public DBKContainer(String name, Project project) { |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-19 15:23:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12509/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Added DBK to the treeview Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** GenericTreeView.java 13 Mar 2007 10:02:34 -0000 1.87 --- GenericTreeView.java 19 Mar 2007 12:37:10 -0000 1.88 *************** *** 42,45 **** --- 42,46 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 486,490 **** } if (elements.size() > 0) { ! this.insertChildren(elements); } if (children.size() > 0) { --- 487,491 ---- } if (elements.size() > 0) { ! this.insertChildren(elements, true); } if (children.size() > 0) { *************** *** 499,506 **** * Insert a collection of Entity into this node * @param entities collection of Entity */ ! public void insertChildren(Collection<Entity> entities) { LinkedList sorted = new LinkedList(entities); ! Entity.sort(sorted); int[] ins = new int[sorted.size()]; int i = 0; --- 500,510 ---- * Insert a collection of Entity into this node * @param entities collection of Entity + * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection<Entity> entities, boolean sort) { LinkedList sorted = new LinkedList(entities); ! if (sort) { ! Entity.sort(sorted); ! } int[] ins = new int[sorted.size()]; int i = 0; *************** *** 862,865 **** --- 866,889 ---- /** + * ClassificationNode + */ + public class ClassificationNode extends EntityNode { + /** + * Constructor for VertexNode + * @param vertex The vertex + */ + public ClassificationNode(Classification clas) { + super(clas); + if (!clas.getChildren().isEmpty()) { + Iterator it = clas.getChildren().iterator(); + while (it.hasNext()) { + add(new ClassificationNode((Classification) it.next())); + } + } + } + + } + + /** * ModellorNode */ *************** *** 885,889 **** public SurfaceContainer(String name, Collection surfaces) { super(name, surfaces); ! insertChildren(surfaces); } --- 909,913 ---- public SurfaceContainer(String name, Collection surfaces) { super(name, surfaces); ! insertChildren(surfaces, true); } *************** *** 918,922 **** setUserObject(s.getLevelString()); } ! insertChildren(elements); } --- 942,946 ---- setUserObject(s.getLevelString()); } ! insertChildren(elements, true); } *************** *** 936,939 **** --- 960,994 ---- /** + * ClassificationContainer + */ + public class ClassificationContainer extends ContainerNode { + /** + * Constructor for ClassificationContainer + * @param name The name + * @param clas The classification + */ + public ClassificationContainer(String name, Classification clas) { + super(name, clas.getChildren()); + insertChildren(clas.getChildren(), false); + } + + /** {@inheritDoc} */ + public EntityNode nodeFor(Object entity) { + + return new ClassificationNode((Classification) entity); + + } + /** + * Return icon + * @return Icon + */ + public ImageIcon icon() { + return surfacegroupicon; + } + } + + + + /** * Geometry Container */ *************** *** 968,971 **** --- 1023,1056 ---- /** + * DBK Container + */ + public class DBKContainer extends ContainerNode { + /** + * Constructor + * @param name The name + * @param space The space + */ + public DBKContainer(String name, Project project) { + super(name, null); + add(new ClassificationContainer("Construction", project.getConstructionClas())); + add(new ClassificationContainer("Functional", project.getFunctionalClas())); + } + + /** + * Update the node with the given object + * @param o The object + */ + public void update(Object o) { + if (o instanceof Classification) { + Classification c = (Classification) o; + ((ClassificationContainer)this.getChildAt(0)).update(c.getChildren()); + ((ClassificationContainer)this.getChildAt(1)).update(c.getChildren()); + } else { + log.warn("Expected a Classification but found a " + o); + } + } + } + + /** * Constructor Container */ *************** *** 978,982 **** public ConstructorContainer(String name, Collection constructors) { super(name, constructors); ! insertChildren(constructors); } --- 1063,1067 ---- public ConstructorContainer(String name, Collection constructors) { super(name, constructors); ! insertChildren(constructors, true); } *************** *** 1006,1010 **** public EdgeContainer(String name, Collection edges) { super(name, edges); ! insertChildren(edges); } --- 1091,1095 ---- public EdgeContainer(String name, Collection edges) { super(name, edges); ! insertChildren(edges, true); } *************** *** 1033,1037 **** public ProjectNode(Project p) { super(p, p.getSpaces()); ! insertChildren(p.getSpaces()); } --- 1118,1122 ---- public ProjectNode(Project p) { super(p, p.getSpaces()); ! insertChildren(p.getSpaces(), true); } *************** *** 1100,1104 **** public VertexContainer(String name, Collection vertices) { super(name, vertices); ! insertChildren(vertices); } --- 1185,1189 ---- public VertexContainer(String name, Collection vertices) { super(name, vertices); ! insertChildren(vertices, true); } *************** *** 1128,1132 **** public ParameterBlockNode(String name, ParameterBlock object) { super(name, object.getAttributes()); ! insertChildren(object.getAttributes()); } --- 1213,1217 ---- public ParameterBlockNode(String name, ParameterBlock object) { super(name, object.getAttributes()); ! insertChildren(object.getAttributes(), true); } Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** SpaceTreeView.java 16 Oct 2006 08:43:32 -0000 1.19 --- SpaceTreeView.java 19 Mar 2007 12:37:10 -0000 1.20 *************** *** 31,34 **** --- 31,35 ---- root.add(new ConstraintContainer("Constraints", Project.getInstance().getConstraints())); root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); + root.add(new DBKContainer("DBK", Project.getInstance())); root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); model.nodeStructureChanged(root); *************** *** 39,47 **** */ public void update() { ! if (root.getChildCount() == 5) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ((GenericNode)root.getChildAt(1)).update(Project.getInstance().world()); ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); } --- 40,49 ---- */ public void update() { ! if (root.getChildCount() == 6) { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ((GenericNode)root.getChildAt(1)).update(Project.getInstance().world()); ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); + ((GenericNode)root.getChildAt(3)).update(Project.getInstance()); ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); } |
|
From: Nikolaj B. <nbr...@us...> - 2007-03-19 13:03:36
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25890/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Log Message: Fixed a small problem caused by classification implementing parametric Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** GenericPanel.java 19 Mar 2007 11:52:10 -0000 1.35 --- GenericPanel.java 19 Mar 2007 13:03:25 -0000 1.36 *************** *** 150,154 **** genAttributes.add(da); where.add(new AttributeRow(da)); ! } else if (a.getValue() instanceof Parametric) { // Handles the links LinkAttribute la = new LinkAttribute(a); --- 150,154 ---- genAttributes.add(da); where.add(new AttributeRow(da)); ! } else if (a.getValue() instanceof Parametric && !(a.getValue() instanceof Classification)) { // Handles the links LinkAttribute la = new LinkAttribute(a); |
|
From: Nordholt <nor...@us...> - 2007-03-19 12:56:13
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13686/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: removed some code Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** NetFacadeModellor.java 19 Mar 2007 11:54:32 -0000 1.22 --- NetFacadeModellor.java 19 Mar 2007 12:39:45 -0000 1.23 *************** *** 408,413 **** space.addAll(frame1); space.addAll(frame2); - Geometry.allPossibleCollapses(Geometry.collect(frame1)); - Geometry.allPossibleCollapses(Geometry.collect(frame2)); } } --- 408,411 ---- |
|
From: Nordholt <nor...@us...> - 2007-03-19 11:54:33
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27106/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: added a new type cut and the possibility to choose between them. Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** NetFacadeModellor.java 15 Mar 2007 10:15:08 -0000 1.21 --- NetFacadeModellor.java 19 Mar 2007 11:54:32 -0000 1.22 *************** *** 51,54 **** --- 51,57 ---- private static final double FRAME_DEPTH = 0.05; + /** The depth of window and door frames */ + private static final double GLASS_FRAME = 0.02; + /** serial id */ private static final long serialVersionUID = 1L; *************** *** 353,356 **** --- 356,367 ---- s.getParameters().put(new Attribute("type", sel)); } + if (!single && (env.get("cut") == null)) { + List options = new LinkedList(); + options.add("type1"); + options.add("type2"); + Selector sel = new Selector(options); + sel.setCurrentValue("type1"); + s.getParameters().put(new Attribute("cut", sel)); + } } } *************** *** 372,377 **** while (fields.hasNext()) { Surface field = (Surface)fields.next(); ! if (field.getEdges().size() > 3) { Surface cut1 = cutType1(); Surface cut2 = cutType2(); cut1.setBackDomain(frame); --- 383,395 ---- while (fields.hasNext()) { Surface field = (Surface)fields.next(); ! if (field.getEdges().size() > 3) { ! Map envF = field.getParameters().environment(); Surface cut1 = cutType1(); + if (envF.get("cut") instanceof Selector) { + Selector sel = (Selector)envF.get("cut"); + if (sel.getCurrentValue().equals("type2")) { + cut1 = cutType3(); + } + } Surface cut2 = cutType2(); cut1.setBackDomain(frame); *************** *** 385,392 **** Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); Set<Surface> frame2 = generateFrame(cut2, field.getEdges(), out); frame.removeSurface(cut1); frame.removeSurface(cut2); space.addAll(frame1); ! space.addAll(frame2); } } --- 403,413 ---- Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); Set<Surface> frame2 = generateFrame(cut2, field.getEdges(), out); + frame.removeSurface(cut1); frame.removeSurface(cut2); space.addAll(frame1); ! space.addAll(frame2); ! Geometry.allPossibleCollapses(Geometry.collect(frame1)); ! Geometry.allPossibleCollapses(Geometry.collect(frame2)); } } *************** *** 476,482 **** } else if (type.equals("Door")) { frameSize = DOOR_FRAME; ! } } ! if (frameSize > 0) { Map offmap1 = new HashMap<Edge, Double>(); Map offmap2 = new HashMap<Edge, Double>(); --- 497,503 ---- } else if (type.equals("Door")) { frameSize = DOOR_FRAME; ! } } ! if (frameSize > FRAME_IDENTATION) { Map offmap1 = new HashMap<Edge, Double>(); Map offmap2 = new HashMap<Edge, Double>(); *************** *** 518,523 **** assignOpposite(front, hole, space, f); Geometry.holeAnalysis(hole); ! } } --- 539,576 ---- assignOpposite(front, hole, space, f); + Geometry.holeAnalysis(hole); ! } /*else if (frameSize == 0) { ! Map offmap1 = new HashMap<Edge, Double>(); ! for (Object o : hole.getEdges()) { ! Edge e = (Edge)o; ! offmap1.put(e, FRAME_IDENTATION); ! } ! Surface in = new Surface(Edge.placeOffset(hole.getEdges(), hole, offmap1)); ! Space f = new Space(type + " Frame", ! Space.CONSTRUCTION, ! Space.ELEMENT_LEVEL, ! true); ! Space g = new Space("Glass", ! Space.CONSTRUCTION, ! Space.ELEMENT_LEVEL, ! true); ! g.setTransparent(true); ! space.add(g); ! space.add(f); ! assignSame(front, in, space, f); ! assignSame(front, hole, space, g); ! in = space.insert(in); ! Geometry.holeAnalysis(in); ! ! Set sides = new HashSet(); ! Surface inEx = extrudeIntoSpace(in, FRAME_DEPTH, sides); ! space.add(inEx); ! assignSame(front, inEx, space, frame); ! Geometry.holeAnalysis(inEx); ! ! //assignOpposite(front, hole, space, f); ! Geometry.holeAnalysis(hole); ! }*/ } *************** *** 858,861 **** --- 911,933 ---- } + private static Surface cutType3() { + List<Vertex> vl = new LinkedList<Vertex>(); + Vertex first = new Vertex(0, 0, 0); + vl.add(new Vertex(0.050, 0, 0)); + vl.add(new Vertex(0.050, 0.125, 0)); + vl.add(new Vertex(0.004, 0.125, 0)); + vl.add(new Vertex(0.004, 0.121, 0)); + vl.add(new Vertex(0.000, 0.121, 0)); + List<Edge> el = new LinkedList<Edge>(); + Vertex prevV = first; + for (Vertex v : vl) { + el.add(new Edge(prevV, v)); + prevV = v; + } + el.add(new Edge(prevV, first)); + Surface cut = new Surface(el); + return cut; + } + /** * Generates one frame post. |
|
From: Nordholt <nor...@us...> - 2007-03-19 11:53:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26656/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: added some generics Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Vertex.java 5 Jan 2007 13:54:47 -0000 1.54 --- Vertex.java 19 Mar 2007 11:53:11 -0000 1.55 *************** *** 181,186 **** * @return The connected vertexes */ ! public Set getEdges() { ! Set result = new HashSet(); if (getOwner() == null) { return result; --- 181,186 ---- * @return The connected vertexes */ ! public Set<Edge> getEdges() { ! Set<Edge> result = new HashSet<Edge>(); if (getOwner() == null) { return result; |
|
From: Nordholt <nor...@us...> - 2007-03-19 11:52:25
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26248/src/net/sourceforge/bprocessor/gui/attrview Modified Files: SelectorListener.java SelectorAttribute.java GenericPanel.java Log Message: corrected checkstyle errors...I am very sorry Index: SelectorListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/SelectorListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelectorListener.java 15 Mar 2007 12:32:48 -0000 1.1 --- SelectorListener.java 19 Mar 2007 11:52:10 -0000 1.2 *************** *** 1,2 **** --- 1,8 ---- + //--------------------------------------------------------------------------------- + // $Id$ + // + // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) + // Released under the Lesser GNU Public License v2.1 + //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attrview; *************** *** 6,18 **** import net.sourceforge.bprocessor.model.Selector; public abstract class SelectorListener implements ItemListener { /** The selector to manipulate */ ! public Selector sel; public SelectorListener(Selector s) { sel = s; } public abstract void itemStateChanged(ItemEvent e); } --- 12,43 ---- import net.sourceforge.bprocessor.model.Selector; + /** + * Listeners for selectors + */ public abstract class SelectorListener implements ItemListener { /** The selector to manipulate */ ! private Selector sel; + /** + * Constructs the selectorlistener + * @param s the selector to listen for + */ public SelectorListener(Selector s) { sel = s; } + /** + * Called when the itemState is changed + * @param e an item event + */ public abstract void itemStateChanged(ItemEvent e); + + /** + * Gets the selector of this listener + * @return the selector + */ + public Selector getSelector() { + return sel; + } } Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** GenericPanel.java 15 Mar 2007 12:32:48 -0000 1.34 --- GenericPanel.java 19 Mar 2007 11:52:10 -0000 1.35 *************** *** 10,14 **** import java.awt.Dimension; import java.awt.event.ItemEvent; - import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; --- 10,13 ---- *************** *** 241,245 **** public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == e.SELECTED) { ! sel.setCurrentValue(e.getItem()); if (obj instanceof Entity) { obj.setAttributes(attributes); --- 240,244 ---- public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == e.SELECTED) { ! getSelector().setCurrentValue(e.getItem()); if (obj instanceof Entity) { obj.setAttributes(attributes); Index: SelectorAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/SelectorAttribute.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SelectorAttribute.java 15 Mar 2007 12:32:48 -0000 1.2 --- SelectorAttribute.java 19 Mar 2007 11:52:10 -0000 1.3 *************** *** 8,22 **** package net.sourceforge.bprocessor.gui.attrview; ! import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; - import javax.swing.BoxLayout; import javax.swing.JComboBox; - import net.sourceforge.bprocessor.model.Attribute; - import net.sourceforge.bprocessor.model.Entity; - import net.sourceforge.bprocessor.model.Parametric; - import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; --- 8,17 ---- package net.sourceforge.bprocessor.gui.attrview; ! import java.awt.event.ItemListener; import java.util.List; import javax.swing.BoxLayout; import javax.swing.JComboBox; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Selector; |
|
From: Michael L. <he...@us...> - 2007-03-15 15:06:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18247/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Improved drawing in net by ruling out surrounding edges Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** Surface.java 15 Mar 2007 10:12:16 -0000 1.142 --- Surface.java 15 Mar 2007 15:06:28 -0000 1.143 *************** *** 1106,1114 **** // If there are no front space assignments, make one if (hole.getFrontDomain() == getOwner().getEmpty()) { ! hole.setFrontDomain(front); } // If there are no back space assignments, make one if (hole.getBackDomain() == getOwner().getEmpty()) { ! hole.setBackDomain(back); } } --- 1106,1114 ---- // If there are no front space assignments, make one if (hole.getFrontDomain() == getOwner().getEmpty()) { ! //hole.setFrontDomain(front); } // If there are no back space assignments, make one if (hole.getBackDomain() == getOwner().getEmpty()) { ! //hole.setBackDomain(back); } } |
|
From: Michael L. <he...@us...> - 2007-03-15 15:06:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18227/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Improved drawing in net by ruling out surrounding edges Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** View.java 7 Mar 2007 10:40:22 -0000 1.194 --- View.java 15 Mar 2007 15:06:21 -0000 1.195 *************** *** 25,28 **** --- 25,29 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 858,862 **** edges.addAll(current.getEdges()); } ! current = current.getOwner(); } } --- 859,867 ---- edges.addAll(current.getEdges()); } ! if (!(current instanceof Net)) { ! current = current.getOwner(); ! } else { ! current = null; ! } } } |
|
From: Nordholt <nor...@us...> - 2007-03-15 12:32:49
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19656/src/net/sourceforge/bprocessor/gui/attrview Modified Files: SelectorAttribute.java GenericPanel.java Added Files: SelectorListener.java Log Message: made changes in a selector register imediately --- NEW FILE: SelectorListener.java --- package net.sourceforge.bprocessor.gui.attrview; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import net.sourceforge.bprocessor.model.Selector; public abstract class SelectorListener implements ItemListener { /** The selector to manipulate */ public Selector sel; public SelectorListener(Selector s) { sel = s; } public abstract void itemStateChanged(ItemEvent e); } Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GenericPanel.java 6 Feb 2007 16:19:05 -0000 1.33 --- GenericPanel.java 15 Mar 2007 12:32:48 -0000 1.34 *************** *** 9,12 **** --- 9,14 ---- import java.awt.BorderLayout; import java.awt.Dimension; + import java.awt.event.ItemEvent; + import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; *************** *** 233,239 **** } } else if (a.getValue() instanceof Selector) { ! SelectorAttribute sa = new SelectorAttribute(a); ! genAttributes.add(sa); ! where.add(new AttributeRow(sa)); } else { log.info("[GenericPanel] Something were not implemented"); --- 235,254 ---- } } else if (a.getValue() instanceof Selector) { ! Selector s = (Selector)a.getValue(); ! SelectorAttribute satt = new SelectorAttribute(a); ! ! satt.addItemListener(new SelectorListener(s) { ! public void itemStateChanged(ItemEvent e) { ! if (e.getStateChange() == e.SELECTED) { ! sel.setCurrentValue(e.getItem()); ! if (obj instanceof Entity) { ! obj.setAttributes(attributes); ! ((Entity)obj).changed(); ! } ! } ! } ! }); ! genAttributes.add(satt); ! where.add(new AttributeRow(satt)); } else { log.info("[GenericPanel] Something were not implemented"); Index: SelectorAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/SelectorAttribute.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelectorAttribute.java 29 Jan 2007 18:10:46 -0000 1.1 --- SelectorAttribute.java 15 Mar 2007 12:32:48 -0000 1.2 *************** *** 16,19 **** --- 16,22 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Parametric; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selector; *************** *** 32,38 **** --- 35,45 ---- private Selector sel = null; + /** The combobox */ + private JComboBox cb = new JComboBox(); + /** * Constructor sets the selector attribute. * @param a the attribute + */ public SelectorAttribute(Attribute a) { *************** *** 42,60 **** sel = (Selector)att.getValue(); List options = sel.getOptions(); ! JComboBox cb = new JComboBox(); for (Object o : options) { cb.addItem(o); } ! cb.setSelectedItem(sel.getCurrentValue()); ! cb.addItemListener(new ItemListener() { ! public void itemStateChanged(ItemEvent e) { ! if (e.getStateChange() == e.SELECTED) { ! sel.setCurrentValue(e.getItem()); ! } ! } ! }); this.add(cb); } ! } --- 49,68 ---- sel = (Selector)att.getValue(); List options = sel.getOptions(); ! cb = new JComboBox(); for (Object o : options) { cb.addItem(o); } ! cb.setSelectedItem(sel.getCurrentValue()); this.add(cb); } ! } ! ! /** ! * Adds an itemlistener to the combobox of the selector ! * @param il a itemlistener ! */ ! public void addItemListener(ItemListener il) { ! cb.addItemListener(il); ! } |
|
From: Nordholt <nor...@us...> - 2007-03-15 10:15:12
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25870/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: improved the drawing of frames in the double posted facades Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** NetFacadeModellor.java 13 Mar 2007 09:49:11 -0000 1.20 --- NetFacadeModellor.java 15 Mar 2007 10:15:08 -0000 1.21 *************** *** 125,129 **** */ public Modellor newInstance(Space s) { - //genFrameTest(); NetFacadeModellor mod = new NetFacadeModellor(); mod.setSpace(s); --- 125,128 ---- *************** *** 373,378 **** while (fields.hasNext()) { Surface field = (Surface)fields.next(); ! //assuming here that each window is a rectangle. ! if (field.getEdges().size() == 4) { Surface cut1 = cutType1(); Surface cut2 = cutType2(); --- 372,376 ---- while (fields.hasNext()) { Surface field = (Surface)fields.next(); ! if (field.getEdges().size() > 3) { Surface cut1 = cutType1(); Surface cut2 = cutType2(); *************** *** 381,406 **** cut2.setBackDomain(frame); cut2.setFrontDomain(frame); ! ! Iterator it = field.getEdges().iterator(); ! Edge e1 = (Edge)it.next(); ! Edge e2 = (Edge)it.next(); ! Set<Surface> frame1 = generateFrame(cut1, e2.getLength(), e1.getLength()); ! Set<Surface> frame2 = generateFrame(cut2, e2.getLength(), e1.getLength()); ! ! frame.removeSurface(cut1); ! frame.removeSurface(cut2); ! Vertex common = Edge.commonVertex(e1, e2); ! Vertex i = e1.otherVertex(common).minus(common); ! Vertex n = e2.otherVertex(common).minus(common); ! Vertex j = front.normal(); if (front.getBackDomain() == space) { ! j.scale(-1); } ! i.normalize(); ! j.normalize(); ! n.normalize(); ! CoordinateSystem anker = new CoordinateSystem(i, j, n, common); ! unTranslateGeometry(frame1, anker); ! unTranslateGeometry(frame2, anker); space.addAll(frame1); space.addAll(frame2); --- 379,390 ---- cut2.setBackDomain(frame); cut2.setFrontDomain(frame); ! Vertex out = front.normal(); if (front.getBackDomain() == space) { ! out.scale(-1); } ! Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); ! Set<Surface> frame2 = generateFrame(cut2, field.getEdges(), out); ! frame.removeSurface(cut1); ! frame.removeSurface(cut2); space.addAll(frame1); space.addAll(frame2); *************** *** 646,650 **** Set tops = new HashSet(); Surface top = s.extrusionall(delta * deltaCorrection, sides, tops); - tops.addAll(sides); for (Object o1 : tops) { --- 630,633 ---- *************** *** 758,802 **** return getGeneralName(); } ! /** * Generates a frame based an a surface descibing a cut of the frame * @param cut the cut surface ! * @param height height of the frame ! * @param width with of the frame * @return the set of surfaces in the frame */ ! private static Set<Surface> generateFrame(Surface cut, double height, double width) { ! Set topPost = genFramePost(cut, width); ! Set leftPost = genFramePost(cut, height); ! Set rightPost = genFramePost(cut, height); ! Set bottomPost = genFramePost(cut, width); ! CoordinateSystem csTop = new CoordinateSystem(new Vertex(0, 0, -1), ! new Vertex(0, 1, 0), ! new Vertex(1, 0, 0), ! new Vertex(0, 0, height)); ! CoordinateSystem csRight = new CoordinateSystem(new Vertex(-1, 0, 0), ! new Vertex(0, 1, 0), ! new Vertex(0, 0, -1), ! new Vertex(width, 0, height)); ! CoordinateSystem csBottom = new CoordinateSystem(new Vertex(0, 0, 1), ! new Vertex(0, 1, 0), ! new Vertex(-1, 0, 0), ! new Vertex(width, 0, 0)); ! unTranslateGeometry(bottomPost, csBottom); ! unTranslateGeometry(rightPost, csRight); ! unTranslateGeometry(topPost, csTop); ! Set<Surface> surfaces = new HashSet<Surface>(); ! HashSet surfs = new HashSet(leftPost); ! surfs.addAll(rightPost); ! surfs.addAll(topPost); ! surfs.addAll(bottomPost); ! Iterator it = surfs.iterator(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! surfaces.add(s); } return surfaces; } /** --- 741,805 ---- return getGeneralName(); } ! /** * Generates a frame based an a surface descibing a cut of the frame * @param cut the cut surface ! * @param contour the outer contour of the frame ! * @param out a vector pointing towards the outside of the frame * @return the set of surfaces in the frame */ ! private static Set<Surface> generateFrame(Surface cut, List<Edge> contour, Vertex out) { ! Surface test = new Surface(contour); ! boolean rightHand = rightHand(test, out); ! if (!rightHand) { ! test.flip(); ! contour = test.getEdges(); ! } Set<Surface> surfaces = new HashSet<Surface>(); ! HashSet surfs = new HashSet(); ! if (contour.size() > 2) { ! Vertex j = out; ! Iterator it = contour.iterator(); ! Edge prev = contour.get(contour.size() - 1); ! Edge current = (Edge)it.next(); ! Edge next; ! double bottomAngle = angle(prev, current); ! double topAngle; ! while (it.hasNext()) { ! next = (Edge)it.next(); ! topAngle = angle(current, next); ! Vertex origin = Edge.commonVertex(current, prev); ! Vertex n = current.otherVertex(origin).minus(origin); ! Vertex i = j.cross(n); ! n.normalize(); ! i.normalize(); ! CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); ! unTranslateGeometry(post, cs); ! surfs.addAll(post); ! prev = current; ! current = next; ! bottomAngle = topAngle; ! } ! next = contour.get(0); ! topAngle = angle(current, next); ! Vertex origin = Edge.commonVertex(current, prev); ! Vertex n = current.otherVertex(origin).minus(origin); ! Vertex i = j.cross(n); ! n.normalize(); ! i.normalize(); ! CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); ! unTranslateGeometry(post, cs); ! surfs.addAll(post); ! Iterator surfIt = surfs.iterator(); ! while (surfIt.hasNext()) { ! Surface s = (Surface)surfIt.next(); ! surfaces.add(s); ! } } return surfaces; } + /** *************** *** 818,822 **** } } ! private static Surface cutType1() { List<Vertex> vl = new LinkedList<Vertex>(); --- 821,825 ---- } } ! private static Surface cutType1() { List<Vertex> vl = new LinkedList<Vertex>(); *************** *** 854,858 **** return cut; } ! /** * Generates one frame post. --- 857,861 ---- return cut; } ! /** * Generates one frame post. *************** *** 861,871 **** * @return the surfaces of the new post */ ! private static Set genFramePost(Surface cut, double length) { Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); copy.setFrontDomain(cut.getFrontDomain()); ! Plane topPlane = new Plane(1, 0, 1, new Vertex(0, 0, length / 2)); ! Plane bottomPlane = new Plane(-1, 0, 1, new Vertex(0 , 0, -length / 2)); ! Set surfaces = new HashSet(); surfaces.add(copy); --- 864,877 ---- * @return the surfaces of the new post */ ! private static Set genFramePost(Surface cut, double length, double bottomAngle, double topAngle) { Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); copy.setFrontDomain(cut.getFrontDomain()); ! Plane topPlane = new Plane(Math.cos(topAngle / 2), 0, ! Math.sin(topAngle / 2), ! new Vertex(0, 0, length / 2)); ! Plane bottomPlane = new Plane(Math.cos(-bottomAngle / 2), 0, ! Math.sin(-bottomAngle / 2), ! new Vertex(0 , 0, -length / 2)); Set surfaces = new HashSet(); surfaces.add(copy); *************** *** 878,880 **** --- 884,922 ---- return surfaces; } + + private static double angle(Edge e1, Edge e2) { + double angle = Double.NaN; + Vertex common = Edge.commonVertex(e1, e2); + if (common != null) { + Vertex dir1 = e1.otherVertex(common).minus(common); + Vertex dir2 = e2.otherVertex(common).minus(common); + angle = dir1.angle(dir2); + } + return angle; + } + + /** + * Test if a surface is right hand turned around a vector + * @param s surface + * @param j vector + * @return true if the surface is right hand turned + */ + private static boolean rightHand(Surface s, Vertex j) { + double determinant = 0; + List<Edge> el = s.getEdges(); + if (el.size() > 2) { + Edge prev = el.get(el.size() - 1); + for (Edge current : el) { + Vertex origin = Edge.commonVertex(current, prev); + Vertex n = current.otherVertex(origin).minus(origin); + Vertex testI = prev.otherVertex(origin).minus(origin); + CoordinateSystem testCS = new CoordinateSystem(testI, j, n, origin); + determinant = testCS.determinant(); + if (Math.abs(determinant) > 0.000001) { + break; + } + } + } + return determinant > 0; + } } |
|
From: Nordholt <nor...@us...> - 2007-03-15 10:12:25
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25001/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: added some generics Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** Surface.java 13 Mar 2007 15:21:23 -0000 1.141 --- Surface.java 15 Mar 2007 10:12:16 -0000 1.142 *************** *** 510,514 **** HashMap map = new HashMap(); Surface surface = copy(map); ! Collection surfaces = new LinkedList(); surfaces.add(surface); mesh.addAll(surfaces); --- 510,514 ---- HashMap map = new HashMap(); Surface surface = copy(map); ! Collection<Surface> surfaces = new LinkedList<Surface>(); surfaces.add(surface); mesh.addAll(surfaces); *************** *** 528,532 **** if (copy == null) { copy = new Surface(); ! List edges = new ArrayList(); Iterator iter = getEdges().iterator(); while (iter.hasNext()) { --- 528,532 ---- if (copy == null) { copy = new Surface(); ! List<Edge> edges = new ArrayList<Edge>(); Iterator iter = getEdges().iterator(); while (iter.hasNext()) { |