bprocessor-commit Mailing List for B-processor (Page 74)
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-09 10:03:51
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24469/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Fixed class-cast exception Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** GenericTreeView.java 8 Mar 2007 14:47:26 -0000 1.80 --- GenericTreeView.java 9 Mar 2007 10:03:48 -0000 1.81 *************** *** 507,511 **** int[] ins = new int[sorted.size()]; int i = 0; ! for (Entity current : entities) { this.add(new EntityNode(current)); ins[i] = this.getChildCount() - 1; --- 507,511 ---- int[] ins = new int[sorted.size()]; int i = 0; ! for (Object current : entities) { this.add(new EntityNode(current)); ins[i] = this.getChildCount() - 1; *************** *** 514,517 **** --- 514,527 ---- model.nodesWereInserted(this, ins); } + + /** + * Create a node for the given entity. The default is to + * return an EntityNode. + * @param entity The entity to create a node for.0 + * @return A node for the given entity. + */ + public EntityNode nodeFor(Object entity) { + return new EntityNode(entity); + } } |
|
From: Michael L. <he...@us...> - 2007-03-08 14:47:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19174/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Genericityfied insertChildren/removeChildren too Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** GenericTreeView.java 8 Mar 2007 14:38:28 -0000 1.79 --- GenericTreeView.java 8 Mar 2007 14:47:26 -0000 1.80 *************** *** 446,451 **** * @param children the children to remove */ ! protected void removeChildren(Collection children) { ! Object[] rem = new Object[children.size()]; int[] indices = new int[children.size()]; int i = 0; --- 446,451 ---- * @param children the children to remove */ ! protected void removeChildren(Collection<GenericNode> children) { ! GenericNode[] rem = new GenericNode[children.size()]; int[] indices = new int[children.size()]; int i = 0; *************** *** 459,463 **** } for (int k = 0; k < rem.length; k++) { ! this.remove((GenericNode)rem[k]); } if (rem.length > 0) { --- 459,463 ---- } for (int k = 0; k < rem.length; k++) { ! this.remove(rem[k]); } if (rem.length > 0) { *************** *** 502,513 **** * @param entities collection of Entity */ ! public void insertChildren(Collection entities) { LinkedList sorted = new LinkedList(entities); Entity.sort(sorted); int[] ins = new int[sorted.size()]; int i = 0; ! Iterator iter = sorted.iterator(); ! while (iter.hasNext()) { ! this.add(new EntityNode(iter.next())); ins[i] = this.getChildCount() - 1; i++; --- 502,512 ---- * @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; ! for (Entity current : entities) { ! this.add(new EntityNode(current)); ins[i] = this.getChildCount() - 1; i++; |
|
From: Michael L. <he...@us...> - 2007-03-08 14:38:47
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15588/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Refactored ContainerNode.update() to use generics Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** GenericTreeView.java 8 Mar 2007 13:09:29 -0000 1.78 --- GenericTreeView.java 8 Mar 2007 14:38:28 -0000 1.79 *************** *** 18,27 **** import java.util.Comparator; import java.util.Enumeration; - import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; - import java.util.Map; import java.util.Set; import java.util.Stack; --- 18,25 ---- *************** *** 406,410 **** */ public class ContainerNode extends GenericNode { ! protected Object content; /** --- 404,408 ---- */ public class ContainerNode extends GenericNode { ! protected Collection< ? extends Entity> content; /** *************** *** 413,417 **** * @param label The label for the container node */ ! public ContainerNode(Object label, Object object) { super(label); this.content = object; --- 411,415 ---- * @param label The label for the container node */ ! public ContainerNode(Object label, Collection< ? extends Entity> object) { super(label); this.content = object; *************** *** 470,501 **** /** * Update the node with the given object ! * @param o The object */ ! public void update(Object o) { ! if (o instanceof Collection) { ! content = (Collection) o; ! //to make sure undo and redo keep nodes ! Map elem = new HashMap(); ! Iterator iter = ((Collection)o).iterator(); ! while (iter.hasNext()) { ! Entity e = (Entity)iter.next(); ! elem.put(e.getId(), e); ! } ! //Set elem = new HashSet((Collection)o); ! Set children = new HashSet(); ! Enumeration e = this.children(); ! while (e.hasMoreElements()) { ! GenericNode sn = (GenericNode)e.nextElement(); ! Long id = ((Entity)sn.getUserObject()).getId(); ! if (elem.containsKey(id)) { ! //If the node is allready there then just update it ! sn.update(elem.get(id)); ! elem.remove(id); } else { ! children.add(sn); } } ! if (elem.size() > 0) { ! this.insertChildren(elem.values()); } if (children.size() > 0) { --- 468,492 ---- /** * Update the node with the given object ! * @param object The object */ ! public void update(Object object) { ! if (object instanceof Collection) { ! content = (Collection) object; ! Set<Entity> elements = new HashSet(); ! elements.addAll(content); ! Set<GenericNode> children = new HashSet(); ! Enumeration enumeration = this.children(); ! while (enumeration.hasMoreElements()) { ! GenericNode node = (GenericNode)enumeration.nextElement(); ! Entity entity = (Entity)node.getUserObject(); ! if (elements.contains(entity)) { ! node.update(entity); ! elements.remove(entity); } else { ! children.add(node); } } ! if (elements.size() > 0) { ! this.insertChildren(elements); } if (children.size() > 0) { *************** *** 503,507 **** } } else { ! log.warn(userObject + " were called with " + o + " and not a list"); } } --- 494,498 ---- } } else { ! log.warn(userObject + " were called with " + object + " and not a list"); } } *************** *** 1249,1253 **** */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object); insertChildren(object.getAttributes()); } --- 1240,1244 ---- */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object.getAttributes()); insertChildren(object.getAttributes()); } *************** *** 1258,1262 **** public void update(Object o) { if (o instanceof ParameterBlock) { ! update(((ParameterBlock)o).getAttributes()); } } --- 1249,1253 ---- public void update(Object o) { if (o instanceof ParameterBlock) { ! //super.update(((ParameterBlock)o).getAttributes()); } } |
|
From: Michael L. <he...@us...> - 2007-03-08 13:09:42
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12847/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Removed some unncessary serial uids Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** GenericTreeView.java 8 Mar 2007 10:04:15 -0000 1.77 --- GenericTreeView.java 8 Mar 2007 13:09:29 -0000 1.78 *************** *** 356,364 **** public abstract class GenericNode extends DefaultMutableTreeNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor * @param object The value --- 356,359 ---- *************** *** 411,417 **** */ public class ContainerNode extends GenericNode { - /** */ - private static final long serialVersionUID = 1L; - /** The content for the container for the node */ protected Object content; --- 406,409 ---- *************** *** 539,546 **** public class EntityNode extends GenericNode { /** - * - */ - private static final long serialVersionUID = 1L; - /** * Constructor for EntityNode * @param object User object --- 531,534 ---- *************** *** 584,592 **** public class SpaceNode extends EntityNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor for SpaceNode * @param space Space --- 572,575 ---- *************** *** 750,758 **** public class SurfaceNode extends EntityNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor for SurfaceNode * @param surface The surface --- 733,736 ---- *************** *** 830,838 **** public class EdgeNode extends EntityNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor for SurfaceNode * @param edge The edge --- 808,811 ---- *************** *** 873,881 **** public class VertexNode extends EntityNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor for VertexNode * @param vertex The vertex --- 846,849 ---- *************** *** 900,908 **** public class ModellorNode extends EntityNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor * @param modellor The modellor --- 868,871 ---- *************** *** 917,923 **** */ public class SurfaceContainer extends ContainerNode { - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor for SurfaceContainer --- 880,883 ---- *************** *** 971,979 **** public class ElementContainer extends ContainerNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor * @param elements The elements --- 931,934 ---- *************** *** 1029,1036 **** */ public class GeometryContainer extends ContainerNode { - - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor --- 984,987 ---- *************** *** 1065,1074 **** */ public class ConstructorContainer extends ContainerNode { - - /** - * - */ - private static final long serialVersionUID = 1L; - /** * Constructor --- 1016,1019 ---- *************** *** 1119,1125 **** */ public class EdgeContainer extends ContainerNode { - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor for EdgeContainer --- 1064,1067 ---- *************** *** 1164,1170 **** */ public class ProjectNode extends ContainerNode { - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor for EdgeContainer --- 1106,1109 ---- *************** *** 1224,1230 **** */ public class CameraNode extends ContainerNode { - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor for EdgeContainer --- 1163,1166 ---- *************** *** 1257,1263 **** */ public class VertexContainer extends ContainerNode { - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor for EdgeContainer --- 1193,1196 ---- *************** *** 1310,1316 **** */ public class ParameterBlockNode extends ContainerNode { - /** */ - private static final long serialVersionUID = 1L; - /** * Constructor --- 1243,1246 ---- *************** *** 1374,1382 **** public class ConstraintContainer extends ContainerNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor for ConstraintContainer * @param name The name --- 1304,1307 ---- *************** *** 1409,1417 **** public class TransformationContainer extends ContainerNode { /** - * - */ - private static final long serialVersionUID = 1L; - - /** * Constructor for ConstraintContainer * @param name The name --- 1334,1337 ---- |
|
From: rimestad <rim...@us...> - 2007-03-08 12:07:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20365/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Added extrusion of a contour to the edge class, havn't implemented the tool interaction yet Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** Edge.java 16 Feb 2007 09:47:43 -0000 1.73 --- Edge.java 8 Mar 2007 12:07:28 -0000 1.74 *************** *** 949,952 **** --- 949,995 ---- /** + * Extrude a set of lines in a given direction, create the surfaces in between + * @param edges The edges to extrude + * @param direction the direction of the extrusion + * @return the generated surfaces during extrusion + */ + public static Collection<Geometric> extrude(Set<Edge> edges, Vertex direction) { + Collection<Geometric> extrusion = new ArrayList<Geometric>(); + if (edges == null || edges.isEmpty() || direction == null) { + return extrusion; + } + Map<Vertex, Vertex> vertexmap = new HashMap<Vertex, Vertex>(); + Map<Vertex, Edge> sideMap = new HashMap<Vertex, Edge>(); + Map<Edge, Edge> topMap = new HashMap<Edge, Edge>(); + Set<Vertex> vertexes = Geometry.collect(edges); + + // generate new vertexes and edges to them + for (Vertex v : vertexes) { + Vertex newv = v.add(direction); + vertexmap.put(v, newv); + Edge newe = new Edge(v, newv); + sideMap.put(v, newe); + } + + // generate the displaces edges + for (Edge e : edges) { + Edge ecopy = new Edge(vertexmap.get(e.getFrom()), vertexmap.get(e.getTo())); + topMap.put(e, ecopy); + } + + // generate surfaces + for (Edge e : edges) { + ArrayList<Edge> surfaceedges = new ArrayList<Edge>(4); + surfaceedges.add(sideMap.get(e.getFrom())); + surfaceedges.add(topMap.get(e)); + surfaceedges.add(sideMap.get(e.getTo())); + surfaceedges.add(e); + extrusion.add(new Surface(surfaceedges)); + } + + return extrusion; + } + + /** * Find the common vertex of the two given edges, if there is one * otherwise return null |
|
From: rimestad <rim...@us...> - 2007-03-08 10:05:20
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2025/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: minor checkstyle fixes Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** CoordinateSystem.java 7 Mar 2007 09:47:13 -0000 1.39 --- CoordinateSystem.java 8 Mar 2007 10:05:19 -0000 1.40 *************** *** 706,709 **** --- 706,712 ---- } + /** + * {@inheritDoc} + */ public void update() { for (Relation relation : relations) { |
|
From: rimestad <rim...@us...> - 2007-03-08 10:05:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1968/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: minor checkstyle fixes Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AltMoveTool.java 7 Mar 2007 09:47:08 -0000 1.6 --- AltMoveTool.java 8 Mar 2007 10:05:14 -0000 1.7 *************** *** 12,16 **** import java.util.Collection; import java.util.Collections; - import java.util.HashMap; import java.util.LinkedList; import java.util.List; --- 12,15 ---- |
|
From: rimestad <rim...@us...> - 2007-03-08 10:05:02
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1466/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: added icons in stead of lines Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** GenericTreeView.java 7 Mar 2007 10:37:13 -0000 1.76 --- GenericTreeView.java 8 Mar 2007 10:04:15 -0000 1.77 *************** *** 113,116 **** --- 113,122 ---- protected static ImageIcon constructorgroupicon; + /** Shown icon */ + protected static ImageIcon shownicon; + + /** hidden icon */ + protected static ImageIcon hiddenicon; + static { spacegroupicon = loadIcon("Biconspacegroup.gif"); *************** *** 126,129 **** --- 132,137 ---- constructionspaceicon = loadIcon("Biconconspace.gif"); functionalspaceicon = loadIcon("Biconspace.gif"); + shownicon = loadIcon("Beyeopen.gif"); + hiddenicon = loadIcon("Beyeclosed.gif"); } *************** *** 169,173 **** private static final long serialVersionUID = 1L; ! private boolean shown; /** * Constructor --- 177,181 ---- private static final long serialVersionUID = 1L; ! private int shown; /** * Constructor *************** *** 184,188 **** Dimension d1 = super.getPreferredSize(); if (d1 != null) { ! return new Dimension(d1.width + 15, d1.height); } else { return null; --- 192,196 ---- Dimension d1 = super.getPreferredSize(); if (d1 != null) { ! return new Dimension(d1.width + 20, d1.height); } else { return null; *************** *** 197,202 **** Dimension d = getPreferredSize(); // will be icon later ! if (!shown) { ! g.drawLine(0, 0, d.width, d.height); } } --- 205,216 ---- Dimension d = getPreferredSize(); // will be icon later ! if (shown == 0) { ! // hidden ! hiddenicon.paintIcon(this, g, d.width - 16, 0); ! } else if (shown == 1) { ! // shown ! shownicon.paintIcon(this, g, d.width - 16, 0); ! } else { ! // not defined } } *************** *** 234,241 **** Camera c = Project.getInstance().getCurrentCamera(); if (c.getHiddenGeometrics().contains(node.getUserObject())) { ! shown = false; } else { ! shown = true; } } } --- 248,257 ---- Camera c = Project.getInstance().getCurrentCamera(); if (c.getHiddenGeometrics().contains(node.getUserObject())) { ! shown = 0; } else { ! shown = 1; } + } else { + shown = -1; } } |
|
From: rimestad <rim...@us...> - 2007-03-08 10:05:02
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1466/src/gfx Added Files: Beyeclosed.gif Beyeopen.gif Log Message: added icons in stead of lines --- NEW FILE: Beyeopen.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Beyeclosed.gif --- (This appears to be a binary file; contents omitted.) |
|
From: rimestad <rim...@us...> - 2007-03-07 10:40:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11230/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: removed outcommented code and placed it a better place Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.193 retrieving revision 1.194 diff -C2 -d -r1.193 -r1.194 *** View.java 7 Mar 2007 09:47:06 -0000 1.193 --- View.java 7 Mar 2007 10:40:22 -0000 1.194 *************** *** 835,839 **** */ protected void drawAll(boolean hitdetection) { - //invisibles.addAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); if (!hitdetection) { drawNormalMode(); --- 835,838 ---- *************** *** 841,845 **** drawSelectionMode(); } - //invisibles.removeAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); } --- 840,843 ---- *************** *** 876,879 **** --- 874,882 ---- 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) { |
|
From: rimestad <rim...@us...> - 2007-03-07 10:37:14
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9984/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: removed null pointer exc and changed functionallyty a bit Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** GenericTreeView.java 6 Mar 2007 14:11:31 -0000 1.75 --- GenericTreeView.java 7 Mar 2007 10:37:13 -0000 1.76 *************** *** 1523,1535 **** Object object = path.getLastPathComponent(); if (e.getClickCount() > 1) { ! if (object instanceof Geometric) { ! Geometric g = (Geometric) object; ! Camera c = Project.getInstance().getCurrentCamera(); ! if (c.getHiddenGeometrics().contains(g)) { ! //show the thing ! c.removeHiddenGeometric(g); ! } else { ! //hide it ! c.addHiddenGeometric(g); } } --- 1523,1538 ---- Object object = path.getLastPathComponent(); if (e.getClickCount() > 1) { ! if (object instanceof GenericNode) { ! Object o = ((GenericNode) object).getUserObject(); ! if (o instanceof Geometric) { ! Geometric g = (Geometric) o; ! Camera c = Project.getInstance().getCurrentCamera(); ! if (c.getHiddenGeometrics().contains(g)) { ! //show the thing ! c.removeHiddenGeometric(g); ! } else { ! //hide it ! c.addHiddenGeometric(g); ! } } } |
|
From: Michael L. <he...@us...> - 2007-03-07 09:47:15
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24385/src/net/sourceforge/bprocessor/model Modified Files: Space.java Relation.java CoordinateSystem.java Log Message: Implemented update of relations Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** Space.java 6 Feb 2007 16:17:23 -0000 1.122 --- Space.java 7 Mar 2007 09:47:13 -0000 1.123 *************** *** 2676,2679 **** --- 2676,2703 ---- } + /** + * + * @param vertices Collection of vertices + * @return Map of edges going into the collection + */ + public Map<Vertex, Collection<Edge>> + edgeMap(Collection<Vertex> vertices) { + HashMap<Vertex, Collection<Edge>> map = new HashMap<Vertex, Collection<Edge>>(); + for (Vertex vertex : vertices) { + map.put(vertex, new LinkedList<Edge>()); + } + Collection<Edge> edges = getEdges(); + for (Edge edge : edges) { + Collection<Edge> from = map.get(edge.getFrom()); + Collection<Edge> to = map.get(edge.getTo()); + if (from != null && to == null) { + from.add(edge); + } + if (to != null && from == null) { + to.add(edge); + } + } + return map; + } } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** CoordinateSystem.java 7 Mar 2007 07:38:41 -0000 1.38 --- CoordinateSystem.java 7 Mar 2007 09:47:13 -0000 1.39 *************** *** 13,16 **** --- 13,17 ---- import java.util.LinkedList; import java.util.List; + import java.util.Map; /** *************** *** 259,263 **** double b = n.getY(); double c = n.getZ(); ! d = -(a * getOrigin().getX() + b * getOrigin().getY() + c * getOrigin().getZ()); return new Plane(a, b, c, d); } --- 260,284 ---- double b = n.getY(); double c = n.getZ(); ! double x0 = origin.x; ! double y0 = origin.y; ! double z0 = origin.z; ! d = -(a * x0 + b * y0 + c * z0); ! return new Plane(a, b, c, d); ! } ! ! /** ! * ! * @param offset offset ! * @return Plane ! */ ! public Plane plane(double offset) { ! double d = 0; ! double a = n.getX(); ! double b = n.getY(); ! double c = n.getZ(); ! double x0 = origin.x + a * offset; ! double y0 = origin.y + b * offset; ! double z0 = origin.z + c * offset; ! d = -(a * x0 + b * y0 + c * z0); return new Plane(a, b, c, d); } *************** *** 688,692 **** for (Relation relation : relations) { double distance = relation.evaluate(); ! System.out.println("offset : " + distance); } } --- 709,728 ---- for (Relation relation : relations) { double distance = relation.evaluate(); ! Geometric geometric = relation.geometric(); ! Space space = geometric.getOwner(); ! Collection<Vertex> vertices = geometric.collect(); ! Map<Vertex, Collection<Edge>> map = space.edgeMap(vertices); ! for (Vertex vertex : vertices) { ! Vertex vector = getN(); ! Collection<Edge> binding = map.get(vertex); ! if (!binding.isEmpty()) { ! Edge bind = binding.iterator().next(); ! vector = bind.getDirection(); ! vector.normalize(); ! } ! Plane plane = plane(distance); ! Vertex project = plane.intersection(vertex, vector, true); ! vertex.set(project); ! } } } Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Relation.java 7 Mar 2007 07:38:41 -0000 1.4 --- Relation.java 7 Mar 2007 09:47:13 -0000 1.5 *************** *** 54,57 **** --- 54,65 ---- /** + * + * @return geometric + */ + public Geometric geometric() { + return geometric; + } + + /** * @return offset */ |
|
From: Michael L. <he...@us...> - 2007-03-07 09:47:11
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24243/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: Implemented update of relations Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AltMoveTool.java 6 Mar 2007 14:53:44 -0000 1.5 --- AltMoveTool.java 7 Mar 2007 09:47:08 -0000 1.6 *************** *** 50,72 **** } ! private Map<Vertex, Collection<Edge>> ! edgeMap(Space space, Collection<Vertex> vertices) { ! HashMap<Vertex, Collection<Edge>> map = new HashMap<Vertex, Collection<Edge>>(); ! for (Vertex vertex : vertices) { ! map.put(vertex, new LinkedList<Edge>()); ! } ! Collection<Edge> edges = space.getEdges(); ! for (Edge edge : edges) { ! Collection<Edge> from = map.get(edge.getFrom()); ! Collection<Edge> to = map.get(edge.getTo()); ! if (from != null && to == null) { ! from.add(edge); ! } ! if (to != null && from == null) { ! to.add(edge); ! } ! } ! return map; ! } private void move(Vertex to) { --- 50,54 ---- } ! private void move(Vertex to) { *************** *** 121,125 **** Space space = surface.getOwner(); vertices = surface.collect(); ! map = edgeMap(space, vertices); Selection.primary().set(surface); system = surface.coordinateSystem(); --- 103,107 ---- Space space = surface.getOwner(); vertices = surface.collect(); ! map = space.edgeMap(vertices); Selection.primary().set(surface); system = surface.coordinateSystem(); |
|
From: Michael L. <he...@us...> - 2007-03-07 09:47:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24243/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Implemented update of relations Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** View.java 6 Mar 2007 14:11:27 -0000 1.192 --- View.java 7 Mar 2007 09:47:06 -0000 1.193 *************** *** 835,839 **** */ protected void drawAll(boolean hitdetection) { ! invisibles.addAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); if (!hitdetection) { drawNormalMode(); --- 835,839 ---- */ protected void drawAll(boolean hitdetection) { ! //invisibles.addAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); if (!hitdetection) { drawNormalMode(); *************** *** 841,845 **** drawSelectionMode(); } ! invisibles.removeAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); } --- 841,845 ---- drawSelectionMode(); } ! //invisibles.removeAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); } |
|
From: Michael L. <he...@us...> - 2007-03-07 07:38:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6923/src/net/sourceforge/bprocessor/model Modified Files: Relation.java CoordinateSystem.java Log Message: More work on relations Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** CoordinateSystem.java 6 Mar 2007 14:53:48 -0000 1.37 --- CoordinateSystem.java 7 Mar 2007 07:38:41 -0000 1.38 *************** *** 687,691 **** public void update() { for (Relation relation : relations) { ! System.out.println("offset : " + relation.getOffset()); } } --- 687,692 ---- public void update() { for (Relation relation : relations) { ! double distance = relation.evaluate(); ! System.out.println("offset : " + distance); } } Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Relation.java 6 Mar 2007 14:53:48 -0000 1.3 --- Relation.java 7 Mar 2007 07:38:41 -0000 1.4 *************** *** 8,15 **** --- 8,23 ---- package net.sourceforge.bprocessor.model; + import java.io.Reader; + import java.io.StringReader; + import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import net.sourceforge.bprocessor.model.parser.ExpressionLexer; + import net.sourceforge.bprocessor.model.parser.ExpressionParser; + import antlr.RecognitionException; + import antlr.TokenStreamException; + /** * Relation *************** *** 44,47 **** --- 52,76 ---- return offset; } + + /** + * @return offset + */ + public double evaluate() { + Reader input = new StringReader(offset); + ExpressionLexer lexer = new ExpressionLexer(input); + ExpressionParser parser = new ExpressionParser(lexer); + HashMap env = Project.getInstance().getGlobals().environment(); + double value = 1.0; + try { + value = parser.expression(env); + } catch (RecognitionException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TokenStreamException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return value; + } /** {@inheritDoc} */ |
|
From: Michael L. <he...@us...> - 2007-03-06 14:54:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25652/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: A few changes to relations handling Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AltMoveTool.java 6 Mar 2007 10:41:20 -0000 1.4 --- AltMoveTool.java 6 Mar 2007 14:53:44 -0000 1.5 *************** *** 83,86 **** --- 83,87 ---- vertex.set(project); } + system.update(); } |
|
From: Michael L. <he...@us...> - 2007-03-06 14:54:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25660/src/net/sourceforge/bprocessor/model Modified Files: Relation.java CoordinateSystem.java Log Message: A few changes to relations handling Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** CoordinateSystem.java 6 Mar 2007 14:11:41 -0000 1.36 --- CoordinateSystem.java 6 Mar 2007 14:53:48 -0000 1.37 *************** *** 684,686 **** --- 684,692 ---- n.scale(-1); } + + public void update() { + for (Relation relation : relations) { + System.out.println("offset : " + relation.getOffset()); + } + } } Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Relation.java 6 Mar 2007 10:41:24 -0000 1.2 --- Relation.java 6 Mar 2007 14:53:48 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- package net.sourceforge.bprocessor.model; + import java.util.Iterator; import java.util.LinkedList; import java.util.List; *************** *** 35,38 **** --- 36,47 ---- return attributes; } + + /** + * Returns the offset. + * @return The offset + */ + public String getOffset() { + return offset; + } /** {@inheritDoc} */ *************** *** 52,56 **** /** {@inheritDoc} */ public void setAttributes(List attributes) { ! // TODO Auto-generated method stub } --- 61,71 ---- /** {@inheritDoc} */ public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute current = (Attribute) iter.next(); ! if (current.getName().equals("Offset")) { ! this.offset = (String) current.getValue(); ! } ! } } |
|
From: rimestad <rim...@us...> - 2007-03-06 14:44:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8920/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: started on eye Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.191 retrieving revision 1.192 diff -C2 -d -r1.191 -r1.192 *** View.java 4 Mar 2007 23:14:40 -0000 1.191 --- View.java 6 Mar 2007 14:11:27 -0000 1.192 *************** *** 835,838 **** --- 835,839 ---- */ protected void drawAll(boolean hitdetection) { + invisibles.addAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); if (!hitdetection) { drawNormalMode(); *************** *** 840,843 **** --- 841,845 ---- drawSelectionMode(); } + invisibles.removeAll(Project.getInstance().getCurrentCamera().getHiddenGeometrics()); } |
|
From: rimestad <rim...@us...> - 2007-03-06 14:44:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8948/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: started on eye Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Camera.java 22 Feb 2007 12:36:54 -0000 1.38 --- Camera.java 6 Mar 2007 14:11:35 -0000 1.39 *************** *** 71,74 **** --- 71,77 ---- private static final double RELATION = 2.54; + /** Hidden geometrics */ + private Set<Geometric> hiddenGeometrics; + /** * The constructor for the persistence layer *************** *** 76,79 **** --- 79,83 ---- Camera() { this.clipplanes = new ArrayList<ClippingPlane>(); + this.hiddenGeometrics = new HashSet<Geometric>(); } *************** *** 87,90 **** --- 91,95 ---- */ public Camera(String name, double[] center, double[] camera, double[] roll, int type) { + this(); this.name = name; this.center = center; *************** *** 92,96 **** this.roll = roll; this.focalwidth = 35; - this.clipplanes = new ArrayList<ClippingPlane>(); if (type == ORTHOGRAPHIC || type == PERSPECTIVE) { this.type = type; --- 97,100 ---- *************** *** 766,768 **** --- 770,796 ---- camera[2] = center[2] + back.getZ(); } + + /** + * @return Returns the hiddenGeometrics. + */ + public Set<Geometric> getHiddenGeometrics() { + return hiddenGeometrics; + } + + /** + * Remove a hidden geometric + * @param g the geometric to remove from hidden + * @return true if the geometric were in the set and removed otherwise false + */ + public boolean removeHiddenGeometric(Geometric g) { + return hiddenGeometrics.remove(g); + } + + /** + * Add a hidden geometric + * @param g the geometric to add to hidden + */ + public void addHiddenGeometric(Geometric g) { + hiddenGeometrics.add(g); + } } |
|
From: rimestad <rim...@us...> - 2007-03-06 14:42:35
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8935/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: started on eye Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** GenericTreeView.java 6 Mar 2007 10:41:29 -0000 1.74 --- GenericTreeView.java 6 Mar 2007 14:11:31 -0000 1.75 *************** *** 8,11 **** --- 8,13 ---- import java.awt.Component; + import java.awt.Dimension; + import java.awt.Graphics; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; *************** *** 139,150 **** /** ! * Renderer */ ! public class Renderer extends DefaultTreeCellRenderer { /** ! * */ private static final long serialVersionUID = 1L; ! /** * Constructor --- 141,173 ---- /** ! * Listener for the eye */ ! public class EyeListener extends MouseAdapter { /** ! * {@inheritDoc} */ + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + log.info("Eye were clicked"); + } + + /** + * {@inheritDoc} + */ + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + log.info("Clicked on " + e.getSource()); + } + } + + /** + * Renderer + */ + public class Renderer extends DefaultTreeCellRenderer { + /** */ private static final long serialVersionUID = 1L; ! ! private boolean shown; /** * Constructor *************** *** 155,158 **** --- 178,206 ---- /** + * Overrides <code>DefaultTreeCellRenderer.getPreferredSize</code> to + * @return slightly wider preferred size value. + */ + public Dimension getPreferredSize() { + Dimension d1 = super.getPreferredSize(); + if (d1 != null) { + return new Dimension(d1.width + 15, d1.height); + } else { + return null; + } + } + + /** + * {@inheritDoc} + */ + public void paint(Graphics g) { + super.paint(g); + Dimension d = getPreferredSize(); + // will be icon later + if (!shown) { + g.drawLine(0, 0, d.width, d.height); + } + } + + /** * Customize icon * @param tree Tree *************** *** 173,177 **** int row, boolean hasFocus) { - super.getTreeCellRendererComponent( tree, value, sel, --- 221,224 ---- *************** *** 184,187 **** --- 231,242 ---- setIcon(icon); } + if (node.getUserObject() instanceof Geometric) { + Camera c = Project.getInstance().getCurrentCamera(); + if (c.getHiddenGeometrics().contains(node.getUserObject())) { + shown = false; + } else { + shown = true; + } + } } return this; *************** *** 1448,1459 **** react(e); } - - /** - * Mouse releashed - * @param e MouseEvent - */ - public void mouseReleased(MouseEvent e) { - react(e); - } /** --- 1503,1506 ---- *************** *** 1475,1483 **** } else { Object object = path.getLastPathComponent(); ! if (object instanceof GenericNode) { ! GenericNode node = (GenericNode) object; ! Object target = node.getUserObject(); ! if (target instanceof Camera) { ! Project.getInstance().setCurrentCamera((Camera) target); } } --- 1522,1545 ---- } else { Object object = path.getLastPathComponent(); ! if (e.getClickCount() > 1) { ! if (object instanceof Geometric) { ! Geometric g = (Geometric) object; ! Camera c = Project.getInstance().getCurrentCamera(); ! if (c.getHiddenGeometrics().contains(g)) { ! //show the thing ! c.removeHiddenGeometric(g); ! } else { ! //hide it ! c.addHiddenGeometric(g); ! } ! } ! } else { ! ! if (object instanceof GenericNode) { ! GenericNode node = (GenericNode) object; ! Object target = node.getUserObject(); ! if (target instanceof Camera) { ! Project.getInstance().setCurrentCamera((Camera) target); ! } } } |
|
From: Michael L. <he...@us...> - 2007-03-06 14:11:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8958/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: Creates an empty list of relations in default constructor Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** CoordinateSystem.java 6 Mar 2007 10:41:24 -0000 1.35 --- CoordinateSystem.java 6 Mar 2007 14:11:41 -0000 1.36 *************** *** 70,73 **** --- 70,74 ---- public CoordinateSystem() { super(); + relations = new LinkedList<Relation>(); } |
|
From: Michael L. <he...@us...> - 2007-03-06 10:41:38
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24044/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Implemented a "Relate" command that creates a relation between a new coordinate-system and the selected objects. Changed alt-move to also be able to move a coordinate-system Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** PopupMenu.java 5 Mar 2007 12:14:10 -0000 1.27 --- PopupMenu.java 6 Mar 2007 10:41:29 -0000 1.28 *************** *** 30,33 **** --- 30,34 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; *************** *** 96,100 **** AbstractAction relate = new CollectionMenuAction(c, "Relate") { public void actionPerformed(ActionEvent e) { ! } }; --- 97,101 ---- AbstractAction relate = new CollectionMenuAction(c, "Relate") { public void actionPerformed(ActionEvent e) { ! CoordinateSystem.relate(col); } }; |
|
From: Michael L. <he...@us...> - 2007-03-06 10:41:34
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24044/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Implemented a "Relate" command that creates a relation between a new coordinate-system and the selected objects. Changed alt-move to also be able to move a coordinate-system Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** GenericTreeView.java 4 Mar 2007 23:14:50 -0000 1.73 --- GenericTreeView.java 6 Mar 2007 10:41:29 -0000 1.74 *************** *** 725,728 **** --- 725,729 ---- CoordinateSystem system = (CoordinateSystem) constructor; add(new ContainerNode("Relations", system.relations())); + update(system); } } *************** *** 740,743 **** --- 741,745 ---- */ public void update(Object o) { + if (o instanceof Constructor) { if (updated == o) { |
|
From: Michael L. <he...@us...> - 2007-03-06 10:41:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24034/src/net/sourceforge/bprocessor/model Modified Files: Relation.java CoordinateSystem.java Log Message: Implemented a "Relate" command that creates a relation between a new coordinate-system and the selected objects. Changed alt-move to also be able to move a coordinate-system Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** CoordinateSystem.java 4 Mar 2007 23:14:45 -0000 1.34 --- CoordinateSystem.java 6 Mar 2007 10:41:24 -0000 1.35 *************** *** 40,43 **** --- 40,69 ---- /** + * Create a CoordinateSystem related to the give geometric objects. + * @param geometrics Collection of geometric objects. + */ + public static void relate(Collection<Geometric> geometrics) { + if (geometrics.size() > 0) { + Geometric leader = geometrics.iterator().next(); + if (leader instanceof Surface) { + Surface surface = (Surface) leader; + CoordinateSystem system = surface.coordinateSystem(); + system.setOrigin(system.getOrigin().copy()); + for (Geometric geometric : geometrics) { + if (geometric instanceof Surface) { + Surface current = (Surface) geometric; + Vertex origin = current.getFirstVertex(); + double distance = system.plane().distance(origin); + Relation relation = new Relation(current, String.valueOf(distance)); + system.add(relation); + } + } + Project.getInstance().world().add(system); + Project.getInstance().changed(Project.getInstance().world()); + } + } + } + + /** * Empty constructor for persistence only */ Index: Relation.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Relation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Relation.java 4 Mar 2007 23:14:45 -0000 1.1 --- Relation.java 6 Mar 2007 10:41:24 -0000 1.2 *************** *** 37,40 **** --- 37,49 ---- /** {@inheritDoc} */ + public String getName() { + if (id != null) { + return "Relation " + id; + } else { + return "Relation"; + } + }; + + /** {@inheritDoc} */ public String getGeneralName() { return "Relation"; |
|
From: Michael L. <he...@us...> - 2007-03-06 10:41:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24025/src/net/sourceforge/bprocessor/gl/tool Modified Files: AltMoveTool.java Log Message: Implemented a "Relate" command that creates a relation between a new coordinate-system and the selected objects. Changed alt-move to also be able to move a coordinate-system Index: AltMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AltMoveTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AltMoveTool.java 4 Mar 2007 23:14:40 -0000 1.3 --- AltMoveTool.java 6 Mar 2007 10:41:20 -0000 1.4 *************** *** 11,14 **** --- 11,15 ---- import java.awt.event.MouseEvent; import java.util.Collection; + import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; *************** *** 120,144 **** vertices = surface.collect(); map = edgeMap(space, vertices); - Selection.primary().set(surface); system = surface.coordinateSystem(); - origin = system.getOrigin().copy(); system.onlyPlane(true); system.setActive(true); - start = findIntersection(e); - makeTarget(start); - glv.getView().addTempConstructor(system); ! 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); ! Plane plane = system.plane(); ! dragplane = plane.orthogonalPlane(ray); } } else { Project.getInstance().checkpoint(); --- 121,149 ---- vertices = surface.collect(); map = edgeMap(space, vertices); Selection.primary().set(surface); system = surface.coordinateSystem(); system.onlyPlane(true); system.setActive(true); ! } else if (target instanceof CoordinateSystem) { ! system = (CoordinateSystem) target; ! Selection.primary().set(system); ! vertices = Collections.EMPTY_LIST; } + origin = system.getOrigin().copy(); + start = new Intersection(origin, Intersection.SURFACE, null); + makeTarget(start); + glv.getView().addTempConstructor(system); + 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); + Plane plane = system.plane(); + dragplane = plane.orthogonalPlane(ray); + } else { Project.getInstance().checkpoint(); |