bprocessor-commit Mailing List for B-processor (Page 37)
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: rimestad <rim...@us...> - 2007-11-23 10:27:18
|
Update of /cvsroot/bprocessor/bprocessor/library In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3418/library Removed Files: lib.bpl Log Message: Changed library directory to components and made build script copy it into dist. --- lib.bpl DELETED --- |
From: rimestad <rim...@us...> - 2007-11-23 10:27:18
|
Update of /cvsroot/bprocessor/bprocessor/components In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3418/components Added Files: lib.bpl Log Message: Changed library directory to components and made build script copy it into dist. --- NEW FILE: lib.bpl --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Library> <libObj useableLevels="0" name="box.obj" locked="false" author="n/a" version="n/a"> <space voidref="13" name="box.obj" union="true" type="0" transparent="false" progid="0" id="12"> <description/> <Classification>unassigned</Classification> <space name="Void" union="false" type="1" transparent="true" progid="1" id="13"> <description/> <Classification>unassigned</Classification> <boundary>16</boundary> <boundary>17</boundary> <boundary>18</boundary> <boundary>19</boundary> <boundary>20</boundary> <boundary>21</boundary> </space> <space voidref="15" name="Object" union="false" type="0" transparent="false" progid="2" id="14"> <description/> <Classification>unassigned</Classification> [...112613 lines suppressed...] <vertex z="4.04881073" x="0.34531834" y="-0.81218262" progid="3147" id="18437"/> <vertex z="4.09879456" x="0.31021788" y="0.85384277" progid="3148" id="18438"/> <vertex z="4.09879456" x="0.31021788" y="0.4267429" progid="3149" id="18439"/> <vertex z="4.09879456" x="0.31021788" y="-4.0797E-4" progid="3150" id="18440"/> <vertex z="4.09879456" x="0.31021788" y="-0.85486267" progid="3151" id="18441"/> <vertex z="4.09879456" x="0.31021788" y="-1.2821666" progid="3152" id="18442"/> <vertex z="4.04881073" x="0.39433403" y="1.69500656" progid="3153" id="18443"/> <vertex z="4.04881073" x="1.47013687" y="1.69500656" progid="3154" id="18444"/> <vertex z="4.04881073" x="0.94011452" y="1.69500656" progid="3155" id="18445"/> <vertex z="4.09879456" x="1.49252213" y="1.75799225" progid="3156" id="18446"/> <vertex z="4.09879456" x="1.20320847" y="1.75799225" progid="3157" id="18447"/> <vertex z="4.09879456" x="0.91826416" y="1.75799225" progid="3158" id="18448"/> <vertex z="4.04881073" x="1.60309525" y="1.64371384" progid="3159" id="18449"/> <vertex z="4.04881073" x="1.66619949" y="1.50149948" progid="3160" id="18450"/> <vertex z="4.09879456" x="1.6965155" y="1.55852646" progid="3161" id="18451"/> <vertex z="4.04881073" x="1.66619949" y="1.25347092" progid="3162" id="18452"/> </space> </libObj> </Library> |
From: rimestad <rim...@us...> - 2007-11-23 10:27:16
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3783/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: minor javadoc update Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** Edge.java 13 Nov 2007 12:19:29 -0000 1.101 --- Edge.java 23 Nov 2007 10:27:12 -0000 1.102 *************** *** 904,913 **** /** ! * Create a offset from a list of lines and a surface ! * PRECONDITION: all the edges have to be in the given surface and the edges ! * in the surface have to be counter clockwise drawn. If the edges are drawn clockwise ! * the offset will be negative outside and positive inside * @param which The list of edges in inner that are going to be offset ! * @param inner The surface * @param offset The offset negative inside and positive outside * @return The generated list of Edges --- 904,911 ---- /** ! * Create a offset from a list of lines and a coordinatesystem ! * PRECONDITION: all the edges have to be in the xy plane of the given coordinatesystem * @param which The list of edges in inner that are going to be offset ! * @param inner The coordinatesystem * @param offset The offset negative inside and positive outside * @return The generated list of Edges *************** *** 918,923 **** /** ! * Create a offset from a list of lines and a surface ! * PRECONDITION: all the edges have to be in the given surface. * @param which The list of edges in inner that are going to be offset * @param inner The surface --- 916,921 ---- /** ! * Create a offset from a list of lines and a coordinatesystem ! * PRECONDITION: all the edges have to be in the xy plane of the given coordinatesystem * @param which The list of edges in inner that are going to be offset * @param inner The surface |
From: rimestad <rim...@us...> - 2007-11-23 10:26:39
|
Update of /cvsroot/bprocessor/bprocessor/components In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3409/components Log Message: Directory /cvsroot/bprocessor/bprocessor/components added to the repository |
From: Michael L. <he...@us...> - 2007-11-23 08:34:15
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26289/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: Layer command started Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Command.java 22 Nov 2007 15:36:43 -0000 1.36 --- Command.java 23 Nov 2007 08:34:05 -0000 1.37 *************** *** 1214,1216 **** --- 1214,1276 ---- } } + + /** + * Layer + */ + public static class Layer extends Command { + private Space net; + + /** + * Constructs a frame command + * @param net Space + */ + public Layer(Space net) { + this.net = net; + parameters.put("offset", 0.3); + parameters.put("interior", ""); + parameters.put("top", ""); + parameters.put("bottom", ""); + parameters.put("side", ""); + } + + private Space find(String name) { + for (Space element : net.getElements()) { + if (element.getName().equals(name)) { + return element; + } + } + return null; + } + + /** {@inheritDoc} */ + @Override + public void evaluate() { + Space interior = find((String) parameters.get("interior")); + Space roof = find((String) parameters.get("top")); + Space floor = find((String) parameters.get("bottom")); + Space exterior = find((String) parameters.get("side")); + + Surface top = null; + Surface bottom = null; + List<Surface> sides = new LinkedList(); + + for (Surface current : net.getSurfaces()) { + Space other; + if (current.getFrontDomain() == interior) { + other = current.getBackDomain(); + } else { + other = current.getFrontDomain(); + } + if (other == roof) { + top = current; + } else if (other == floor) { + bottom = current; + } else if (other == exterior) { + sides.add(current); + } + } + Selection.primary().set((List) sides); + } + + } } |
From: Michael L. <he...@us...> - 2007-11-23 08:34:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26480/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Layer command started Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** PopupMenu.java 22 Nov 2007 15:36:40 -0000 1.76 --- PopupMenu.java 23 Nov 2007 08:34:10 -0000 1.77 *************** *** 308,311 **** --- 308,320 ---- } { + AbstractAction action = new SpaceMenuAction(sp, "Layer..") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.Layer(space); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } + { AbstractAction action = new SpaceMenuAction(sp, "Normals") { public void actionPerformed(ActionEvent event) { |
From: Michael L. <he...@us...> - 2007-11-22 15:36:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19874/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: Command to show normals on surfaces in a space Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Command.java 22 Nov 2007 14:26:48 -0000 1.35 --- Command.java 22 Nov 2007 15:36:43 -0000 1.36 *************** *** 51,55 **** } ! protected List list(Object ...objects) { List result = new LinkedList(); for (Object object : objects) { --- 51,60 ---- } ! /** ! * Creates list of the arguments ! * @param objects objects ! * @return list ! */ ! public static List list(Object ...objects) { List result = new LinkedList(); for (Object object : objects) { *************** *** 626,634 **** } /** * * */ ! public static class Cube extends Command { /** * --- 631,748 ---- } + /** * * */ ! public abstract static class Shape extends Command { ! /** ! * Adds a collection surfaces to a space. ! * @param owner Space ! * @param surfaces surface ! */ ! public static void addTo(Space owner, Collection<Surface> surfaces) { ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! ! for (Vertex current : vertices) { ! owner.add(current); ! } ! ! for (Edge current : edges) { ! owner.add(current); ! } ! ! for (Surface current : surfaces) { ! owner.add(current); ! } ! } ! } ! ! /** ! * Pyramid ! */ ! public static class Pyramid extends Shape { ! ! /** ! * Create a pyramid ! * @param w width ! * @param h height ! * @param d depth ! * @return union ! */ ! public static Space pyramid(double w, double h, double d) { ! double x = -w / 2; ! double y = -h / 2; ! double z = 0; ! Vertex v0 = new Vertex(x, y, z); ! Vertex v1 = new Vertex(x + w, y, z); ! Vertex v2 = new Vertex(x + w, y + h, z); ! Vertex v3 = new Vertex(x, y + h, z); ! ! Edge e0 = new Edge(v0, v1); ! Edge e1 = new Edge(v1, v2); ! Edge e2 = new Edge(v2, v3); ! Edge e3 = new Edge(v3, v0); ! ! Surface s0 = new Surface(list(e0, e1, e2, e3)); ! ! Vertex top = new Vertex(0, 0, d); ! ! Edge l0 = new Edge(v0, top); ! Edge l1 = new Edge(v1, top); ! Edge l2 = new Edge(v2, top); ! Edge l3 = new Edge(v3, top); ! ! Surface side0 = new Surface(list(e0, l0, l1)); ! Surface side1 = new Surface(list(e1, l1, l2)); ! Surface side2 = new Surface(list(e2, l2, l3)); ! Surface side3 = new Surface(list(e3, l3, l0)); ! ! Space union = new Space("Pyramid", Space.CONSTRUCTION, true); ! ! addTo(union, list(s0, side0, side1, side2, side3)); ! ! return union; ! } ! ! /** ! * Constructs the Pyramid command ! * ! */ ! public Pyramid() { ! parameters.put("width", 1.0); ! parameters.put("height", 1.0); ! parameters.put("depth", 1.0); ! } ! ! /** {@inheritDoc}} */ ! @Override ! public String getGeneralName() { ! return "Create Pyramid"; ! } ! ! /** {@inheritDoc} */ ! @Override ! public void evaluate() { ! double w = parameters.getDouble("width"); ! double h = parameters.getDouble("height"); ! double d = parameters.getDouble("depth"); ! Space union = pyramid(w, h, d); ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); ! ! for (Vertex current : union.getVertices()) { ! current.set(system.unTranslate(current)); ! } ! ! Project.getInstance().getActiveSpace().add(union); ! } ! } ! ! ! /** ! * Cube ! */ ! public static class Cube extends Shape { /** * *************** *** 655,662 **** double y = -h / 2; double z = -d / 2; ! Vertex v0 = system.unTranslate(new Vertex(x, y, z)); ! Vertex v1 = system.unTranslate(new Vertex(x + w, y, z)); ! Vertex v2 = system.unTranslate(new Vertex(x + w, y + h, z)); ! Vertex v3 = system.unTranslate(new Vertex(x, y + h, z)); Edge e0 = new Edge(v0, v1); --- 769,776 ---- double y = -h / 2; double z = -d / 2; ! Vertex v0 = new Vertex(x, y, z); ! Vertex v1 = new Vertex(x + w, y, z); ! Vertex v2 = new Vertex(x + w, y + h, z); ! Vertex v3 = new Vertex(x, y + h, z); Edge e0 = new Edge(v0, v1); *************** *** 669,673 **** Surface top = s0.extrusion(d, sides); ! Space union = new Space("Union", Space.CONSTRUCTION, true); Collection<Surface> surfaces = new LinkedList(); surfaces.add(s0); --- 783,787 ---- Surface top = s0.extrusion(d, sides); ! Space union = new Space("Cube", Space.CONSTRUCTION, true); Collection<Surface> surfaces = new LinkedList(); surfaces.add(s0); *************** *** 675,691 **** surfaces.add(top); ! Collection<Edge> edges = Surface.edges(surfaces); ! Collection<Vertex> vertices = Edge.vertices(edges); ! ! for (Vertex current : vertices) { ! union.add(current); ! } ! ! for (Edge current : edges) { ! union.add(current); ! } ! for (Surface current : surfaces) { ! union.add(current); } --- 789,797 ---- surfaces.add(top); ! ! addTo(union, surfaces); ! for (Vertex current : union.getVertices()) { ! current.set(system.unTranslate(current)); } |
From: Michael L. <he...@us...> - 2007-11-22 15:36:40
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19866/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Command to show normals on surfaces in a space Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** PopupMenu.java 21 Nov 2007 13:50:56 -0000 1.75 --- PopupMenu.java 22 Nov 2007 15:36:40 -0000 1.76 *************** *** 308,311 **** --- 308,334 ---- } { + AbstractAction action = new SpaceMenuAction(sp, "Normals") { + public void actionPerformed(ActionEvent event) { + Space union = new Space("Normals", Space.CONSTRUCTION, true); + for (Surface surface : space.getSurfaces()) { + Vertex normal = surface.normal(); + Vertex origin = surface.center(); + + CoordinateSystem system = CoordinateSystem.systemFor(origin, normal); + + Space pyramid = Command.Pyramid.pyramid(0.05, 0.05, 0.2); + for (Vertex current : pyramid.getVertices()) { + current.set(system.unTranslate(current)); + } + union.add(pyramid); + } + Project.getInstance().world().add(union); + Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); + } + }; + menu.add(action); + } + { AbstractAction action = new SpaceMenuAction(sp, "Make Component") { public void actionPerformed(ActionEvent event) { *************** *** 638,641 **** --- 661,673 ---- menu.add(action); } + { + AbstractAction action = new AbstractAction("Pyramid...") { + public void actionPerformed(ActionEvent event) { + Command command = new Command.Pyramid(); + AttributeView.instance().display(command); + } + }; + menu.add(action); + } return menu; } |
From: Michael L. <he...@us...> - 2007-11-22 14:26:57
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24453/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: frame command uses the name "frame" Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Command.java 22 Nov 2007 13:32:49 -0000 1.34 --- Command.java 22 Nov 2007 14:26:48 -0000 1.35 *************** *** 1074,1078 **** } ! Space union = new Space("Union", Space.CONSTRUCTION, true); Collection<Surface> inserted = new LinkedList(); --- 1074,1078 ---- } ! Space union = new Space("Frame", Space.CONSTRUCTION, true); Collection<Surface> inserted = new LinkedList(); |
From: Michael L. <he...@us...> - 2007-11-22 13:32:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2994/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: frame command done for now Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Command.java 21 Nov 2007 13:51:01 -0000 1.33 --- Command.java 22 Nov 2007 13:32:49 -0000 1.34 *************** *** 1026,1032 **** public Frame(Space net) { this.net = net; ! parameters.put("outside-frame", 1.0); ! parameters.put("inside-frame", 1.0); ! parameters.put("interior", 1.0); parameters.put("depth", 1.0); } --- 1026,1032 ---- public Frame(Space net) { this.net = net; ! parameters.put("outside-frame", 0.2); ! parameters.put("inside-frame", 0.1); ! parameters.put("interior", 0.1); parameters.put("depth", 1.0); } *************** *** 1038,1042 **** double inside = parameters.getDouble("inside-frame"); double delta = parameters.getDouble("interior"); ! List<Surface> surfaces = new LinkedList(); --- 1038,1042 ---- double inside = parameters.getDouble("inside-frame"); double delta = parameters.getDouble("interior"); ! double depth = parameters.getDouble("depth"); List<Surface> surfaces = new LinkedList(); *************** *** 1063,1067 **** } ! if (boundary.size() > 0) { List<Vertex> vertices = Offset.vertices(boundary); Vertex normal = Surface.normalOf(boundary); --- 1063,1067 ---- } ! { List<Vertex> vertices = Offset.vertices(boundary); Vertex normal = Surface.normalOf(boundary); *************** *** 1076,1084 **** Space union = new Space("Union", Space.CONSTRUCTION, true); ! if (boundary.size() > 0) { ! List<Edge> offset = Offset.offset(boundary, inside + outside - (delta / 2)); ! Surface exterior = new Surface(offset); ! union.insert(exterior); ! } List<Surface> interior = new LinkedList(); --- 1076,1085 ---- Space union = new Space("Union", Space.CONSTRUCTION, true); ! Collection<Surface> inserted = new LinkedList(); ! ! List<Edge> offset = Offset.offset(boundary, inside + outside - (delta / 2)); ! Surface exterior = new Surface(offset); ! inserted.add(exterior); ! List<Surface> interior = new LinkedList(); *************** *** 1086,1091 **** --- 1087,1106 ---- interior.add(new Surface(Offset.offset(current.getEdges(), -delta / 2))); } + inserted.addAll(interior); for (Surface current : interior) { + exterior.addHole(current); + } + + if (depth != 0) { + Collection<Surface> sides = new LinkedList(); + Set<Surface> tops = new HashSet(); + Surface top = exterior.extrusionall(depth, sides, tops); + inserted.addAll(sides); + inserted.addAll(tops); + inserted.add(top); + } + + for (Surface current : inserted) { union.insert(current); } |
From: Michael L. <he...@us...> - 2007-11-22 10:46:22
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11122/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: adjusted status panel Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StatusBar.java 20 Nov 2007 14:56:49 -0000 1.7 --- StatusBar.java 22 Nov 2007 10:46:25 -0000 1.8 *************** *** 11,20 **** import java.awt.Dimension; import javax.swing.Box; - import javax.swing.JComponent; - import javax.swing.JLabel; import javax.swing.JPanel; - import javax.swing.JSeparator; - import javax.swing.JTextField; - import javax.swing.SwingConstants; /** * Status bar --- 11,15 ---- *************** *** 44,104 **** } - private JComponent createSeparator(int height) { - JSeparator separator = new JSeparator(SwingConstants.VERTICAL); - separator.setMaximumSize(new Dimension(2, height)); - return separator; - } - - private JComponent createTipPanel() { - Box tippanel = Box.createVerticalBox(); - tippanel.add(Box.createRigidArea(new Dimension(360, 0))); - Box labelarea = Box.createHorizontalBox(); - labelarea.add(new JLabel("Tip")); - labelarea.add(Box.createHorizontalGlue()); - tippanel.add(labelarea); - return tippanel; - } - - private JComponent createScalePanel() { - Box panel = Box.createVerticalBox(); - panel.add(Box.createRigidArea(new Dimension(60, 0))); - Box labelarea = Box.createHorizontalBox(); - labelarea.add(new JLabel("Scale")); - labelarea.add(Box.createHorizontalGlue()); - panel.add(labelarea); - panel.setMaximumSize(new Dimension(60, 20)); - return panel; - } - - - private JComponent createLengthPanel() { - Box lengthpanel = Box.createVerticalBox(); - lengthpanel.add(Box.createRigidArea(new Dimension(180, 0))); - Box lengtharea = Box.createHorizontalBox(); - lengtharea.add(new JLabel("Length:")); - lengtharea.add(Box.createHorizontalStrut(3)); - JTextField field = new JTextField(); - Dimension preferred = field.getPreferredSize(); - field.setMaximumSize(preferred); - lengtharea.add(field); - lengthpanel.add(lengtharea); - return lengthpanel; - } - - private void createContent() { - content.add(createTipPanel()); - content.add(Box.createHorizontalGlue()); - content.add(Box.createHorizontalStrut(7)); - content.add(createSeparator(18)); - content.add(Box.createHorizontalStrut(7)); - content.add(createLengthPanel()); - content.add(Box.createHorizontalGlue()); - content.add(Box.createHorizontalStrut(7)); - content.add(createSeparator(18)); - content.add(Box.createHorizontalStrut(7)); - content.add(createScalePanel()); - content.add(Box.createHorizontalStrut(20)); - } - /** * Constructs a status bar --- 39,42 ---- *************** *** 108,112 **** content = Box.createHorizontalBox(); add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 32))); } } --- 46,50 ---- content = Box.createHorizontalBox(); add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 20))); } } |
From: Michael L. <he...@us...> - 2007-11-22 10:46:19
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11107/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: adjusted status panel Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Editor.java 21 Nov 2007 09:21:17 -0000 1.6 --- Editor.java 22 Nov 2007 10:46:22 -0000 1.7 *************** *** 177,180 **** --- 177,182 ---- panel.add(Box.createRigidArea(new Dimension(200, 0))); Box labelarea = Box.createHorizontalBox(); + Dimension size = factor.getMaximumSize(); + labelarea.add(Box.createRigidArea(new Dimension(0, size.height))); factorPanel = Box.createHorizontalBox(); labelarea.add(factorPanel); |
From: Michael L. <he...@us...> - 2007-11-22 10:26:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2837/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: Implemented CoordinateSystem.systemFor(origin, normal) that returns an appropriate coordinate system Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** CoordinateSystem.java 21 Nov 2007 13:51:01 -0000 1.65 --- CoordinateSystem.java 22 Nov 2007 10:26:00 -0000 1.66 *************** *** 144,147 **** --- 144,185 ---- /** + * CoordinateSystem for specified origin and z-axis (n), where the orientation + * is such that x-axis points right when looking down the negative z-axis. + * @param origin Vertex + * @param n z-axis + * @return coordinate system + */ + public static CoordinateSystem systemFor(Vertex origin, Vertex n) { + int index = n.largestCoefficient(); + Vertex i = null; + Vertex j = null; + if (index == Vertex.X) { + i = new Vertex(0, 1, 0); + Vertex z = new Vertex(1, 0, 0); + if (n.dot(z) < 0) { + i = i.scale(-1); + } + } + if (index == Vertex.Y) { + i = new Vertex(-1, 0, 0); + Vertex z = new Vertex(0, 1, 0); + if (n.dot(z) < 0) { + i = i.scale(-1); + } + } + if (index == Vertex.Z) { + i = new Vertex(1, 0, 0); + } + + double t = n.dot(i); + + i = i.minus(n.scale(t)); + i.normalize(); + j = n.cross(i); + + return new CoordinateSystem(i, j, n, origin); + } + + /** * Empty constructor for persistence only */ |
From: Michael L. <he...@us...> - 2007-11-22 10:25:53
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2828/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Log Message: Implemented CoordinateSystem.systemFor(origin, normal) that returns an appropriate coordinate system Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Protractor.java 22 Nov 2007 10:12:46 -0000 1.19 --- Protractor.java 22 Nov 2007 10:25:57 -0000 1.20 *************** *** 166,197 **** */ public CoordinateSystem systemFor(Vertex origin, Vertex n) { ! int index = n.largestCoefficient(); ! Vertex i = null; ! Vertex j = null; ! if (index == Vertex.X) { ! i = new Vertex(0, 1, 0); ! Vertex z = new Vertex(1, 0, 0); ! if (n.dot(z) < 0) { ! i = i.scale(-1); ! } ! } ! if (index == Vertex.Y) { ! i = new Vertex(-1, 0, 0); ! Vertex z = new Vertex(0, 1, 0); ! if (n.dot(z) < 0) { ! i = i.scale(-1); ! } ! } ! if (index == Vertex.Z) { ! i = new Vertex(1, 0, 0); ! } ! ! double t = n.dot(i); ! ! i = i.minus(n.scale(t)); ! i.normalize(); ! j = n.cross(i); ! ! return new CoordinateSystem(i, j, n, origin); } --- 166,170 ---- */ public CoordinateSystem systemFor(Vertex origin, Vertex n) { ! return CoordinateSystem.systemFor(origin, n); } |
From: Michael L. <he...@us...> - 2007-11-22 10:12:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30185/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Plane.java Log Message: Refactoring of coordinate system computation in protractor Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Vertex.java 13 Nov 2007 12:40:19 -0000 1.70 --- Vertex.java 22 Nov 2007 10:12:49 -0000 1.71 *************** *** 22,25 **** --- 22,34 ---- public class Vertex extends Geometric implements Parametric { private static Logger log = Logger.getLogger(Vertex.class); + + /** X component in a double-array */ + public static final int X = 0; + + /** Y component in a double-array */ + public static final int Y = 1; + + /** Z component in a double-array */ + public static final int Z = 2; /** The x coordinate */ *************** *** 202,205 **** --- 211,236 ---- return result; } + + /** + * Return X, Y or Z based on + * which of the coefficients a, b and c are the largest + * @return Index indicating the largest coefficient + */ + public int largestCoefficient() { + int result = X; + double coefficient = Math.abs(x); + + if (Math.abs(y) > coefficient) { + result = Y; + coefficient = Math.abs(y); + } + + if (Math.abs(z) > coefficient) { + result = Z; + } + + return result; + } + /** * Return a copy of this Vertex Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Plane.java 15 Nov 2007 07:17:28 -0000 1.33 --- Plane.java 22 Nov 2007 10:12:49 -0000 1.34 *************** *** 36,48 **** private double d; - /** X component in a double-array */ - public static final int X = 0; - - /** Y component in a double-array */ - public static final int Y = 1; - - /** Z component in a double-array */ - public static final int Z = 2; - /** --- 36,39 ---- *************** *** 259,275 **** */ public int largestCoefficient() { ! int result = X; ! double coefficient = Math.abs(a); ! ! if (Math.abs(b) > coefficient) { ! result = Y; ! coefficient = Math.abs(b); ! } ! ! if (Math.abs(c) > coefficient) { ! result = Z; ! } ! ! return result; } --- 250,255 ---- */ public int largestCoefficient() { ! Vertex normal = new Vertex(a, b, c); ! return normal.largestCoefficient(); } *************** *** 283,292 **** double[] vector = new double[3]; double[] values = getDoublev(); ! vector[X] = 0; ! vector[Y] = 0; ! vector[Z] = 0; int index = largestCoefficient(); vector[index] = -d / values[index]; ! return new Vertex(vector[X], vector[Y], vector[Z]); } --- 263,272 ---- double[] vector = new double[3]; double[] values = getDoublev(); ! vector[Vertex.X] = 0; ! vector[Vertex.Y] = 0; ! vector[Vertex.Z] = 0; int index = largestCoefficient(); vector[index] = -d / values[index]; ! return new Vertex(vector[Vertex.X], vector[Vertex.Y], vector[Vertex.Z]); } *************** *** 302,312 **** Vertex j = null; ! if (index == X) { i = new Vertex(0, 1, 0); } ! if (index == Y) { i = new Vertex(1, 0, 0); } ! if (index == Z) { i = new Vertex(1, 0, 0); } --- 282,292 ---- Vertex j = null; ! if (index == Vertex.X) { i = new Vertex(0, 1, 0); } ! if (index == Vertex.Y) { i = new Vertex(1, 0, 0); } ! if (index == Vertex.Z) { i = new Vertex(1, 0, 0); } |
From: Michael L. <he...@us...> - 2007-11-22 10:12:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30174/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java RotationTool.java Log Message: Refactoring of coordinate system computation in protractor Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Protractor.java 21 Nov 2007 15:28:46 -0000 1.18 --- Protractor.java 22 Nov 2007 10:12:46 -0000 1.19 *************** *** 157,205 **** } ! /** ! * Returns a coordinate system for specified surface where the Z axis ! * is a normal to the surface and the x-axis points to the right. ! * Does not work exactly correct yet, but works in cases where the surfaces ! * are mostly vertical. ! * ! * @param surface Surface * @return coordinate system */ ! public CoordinateSystem systemFor(Surface surface) { ! Vertex n = surface.normal(); ! Vertex origin = surface.getFirstVertex(); ! if (!editor.getView().facingFront(surface)) { ! n = n.scale(-1); ! } ! Plane plane = new Plane(n, origin); ! int index = plane.largestCoefficient(); Vertex i = null; Vertex j = null; ! Vertex z = null; ! if (index == Plane.X) { i = new Vertex(0, 1, 0); ! z = new Vertex(1, 0, 0); } ! if (index == Plane.Y) { i = new Vertex(-1, 0, 0); ! z = new Vertex(0, 1, 0); } ! if (index == Plane.Z) { i = new Vertex(1, 0, 0); - z = new Vertex(0, 0, 1); } double t = n.dot(i); - double sign = 1; - - if (n.dot(z) < 0) { - sign = -1; - } - - i.setX(i.getX() - n.getX() * t); - i.setY(i.getY() - n.getY() * t); - i.setZ(i.getZ() - n.getZ() * t); - i.scaleInPlace(sign / i.length()); j = n.cross(i); --- 157,194 ---- } ! ! /** ! * CoordinateSystem for specified origin and z-axis (n), where the orientation ! * is such that x-axis points right when looking down the negative z-axis. ! * @param origin Vertex ! * @param n z-axis * @return coordinate system */ ! public CoordinateSystem systemFor(Vertex origin, Vertex n) { ! int index = n.largestCoefficient(); Vertex i = null; Vertex j = null; ! if (index == Vertex.X) { i = new Vertex(0, 1, 0); ! Vertex z = new Vertex(1, 0, 0); ! if (n.dot(z) < 0) { ! i = i.scale(-1); ! } } ! if (index == Vertex.Y) { i = new Vertex(-1, 0, 0); ! Vertex z = new Vertex(0, 1, 0); ! if (n.dot(z) < 0) { ! i = i.scale(-1); ! } } ! if (index == Vertex.Z) { i = new Vertex(1, 0, 0); } double t = n.dot(i); + i = i.minus(n.scale(t)); + i.normalize(); j = n.cross(i); *************** *** 207,210 **** --- 196,215 ---- } + /** + * Returns a coordinate system for specified surface where the Z axis + * is a normal to the surface and the x-axis points to the right. + * + * @param surface Surface + * @return coordinate system + */ + public CoordinateSystem systemFor(Surface surface) { + Vertex n = surface.normal(); + Vertex origin = surface.getFirstVertex(); + if (!editor.getView().facingFront(surface)) { + n = n.scale(-1); + } + return systemFor(origin, n); + } + /** * {@inheritDoc} Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** RotationTool.java 18 Nov 2007 21:30:17 -0000 1.32 --- RotationTool.java 22 Nov 2007 10:12:46 -0000 1.33 *************** *** 291,296 **** while (iter.hasNext()) { Vertex v = (Vertex)iter.next(); ! Geometry.rotate(angle, onto.getDoublev()[Plane.X], ! onto.getDoublev()[Plane.Y], onto.getDoublev()[Plane.Z], v, p1); } } --- 291,296 ---- while (iter.hasNext()) { Vertex v = (Vertex)iter.next(); ! Geometry.rotate(angle, onto.getDoublev()[Vertex.X], ! onto.getDoublev()[Vertex.Y], onto.getDoublev()[Vertex.Z], v, p1); } } |
From: Michael L. <he...@us...> - 2007-11-21 21:10:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9233/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: fixed bugs with selecting clipplanes and adjusted size of control in statusbar Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Display.java 19 Nov 2007 17:50:17 -0000 1.60 --- Display.java 21 Nov 2007 21:10:41 -0000 1.61 *************** *** 1281,1285 **** if (selecting()) { ! selectClips(clips); } --- 1281,1285 ---- if (selecting()) { ! // selectClips(clips); } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.262 retrieving revision 1.263 diff -C2 -d -r1.262 -r1.263 *** View.java 18 Nov 2007 21:30:17 -0000 1.262 --- View.java 21 Nov 2007 21:10:41 -0000 1.263 *************** *** 677,681 **** --- 677,683 ---- if (current == target) { gl.glDisable(GL.GL_DEPTH_TEST); + pushName(gl, current); drawClipplane(current); + popName(gl); gl.glEnable(GL.GL_DEPTH_TEST); } else { *************** *** 685,689 **** --- 687,693 ---- gl.glColor3fv(CLIP_PLANE_COLOR, 0); } + pushName(gl, current); drawClipplane(current); + popName(gl); } } |
From: Michael L. <he...@us...> - 2007-11-21 21:10:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9233/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: fixed bugs with selecting clipplanes and adjusted size of control in statusbar Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** SpaceTool.java 21 Nov 2007 09:21:17 -0000 1.94 --- SpaceTool.java 21 Nov 2007 21:10:41 -0000 1.95 *************** *** 9,12 **** --- 9,13 ---- import java.awt.Cursor; + import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; *************** *** 369,372 **** --- 370,375 ---- List<JComponent> controls = super.controls(); JToggleButton button = new JToggleButton(new OptionAction("multiicon.gif")); + button.setMargin(new Insets(1, 1, 1, 1)); + button.setMaximumSize(button.getMinimumSize()); button.setSelected(Editor.isMulti()); controls.add(button); |
From: Michael L. <he...@us...> - 2007-11-21 15:28:44
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv655/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Log Message: plane orientation Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Protractor.java 21 Nov 2007 13:50:53 -0000 1.17 --- Protractor.java 21 Nov 2007 15:28:46 -0000 1.18 *************** *** 102,107 **** Surface surface = View.getLastSurface(); if (surface != null) { ! system = surface.coordinateSystem(); ! system = system.plane().coordinateSystem(); } else { system = Project.getInstance().getActiveCoordinateSystem(); --- 102,106 ---- Surface surface = View.getLastSurface(); if (surface != null) { ! system = systemFor(surface); } else { system = Project.getInstance().getActiveCoordinateSystem(); *************** *** 158,161 **** --- 157,210 ---- } + /** + * Returns a coordinate system for specified surface where the Z axis + * is a normal to the surface and the x-axis points to the right. + * Does not work exactly correct yet, but works in cases where the surfaces + * are mostly vertical. + * + * @param surface Surface + * @return coordinate system + */ + public CoordinateSystem systemFor(Surface surface) { + Vertex n = surface.normal(); + Vertex origin = surface.getFirstVertex(); + if (!editor.getView().facingFront(surface)) { + n = n.scale(-1); + } + Plane plane = new Plane(n, origin); + int index = plane.largestCoefficient(); + Vertex i = null; + Vertex j = null; + Vertex z = null; + if (index == Plane.X) { + i = new Vertex(0, 1, 0); + z = new Vertex(1, 0, 0); + } + if (index == Plane.Y) { + i = new Vertex(-1, 0, 0); + z = new Vertex(0, 1, 0); + } + if (index == Plane.Z) { + i = new Vertex(1, 0, 0); + z = new Vertex(0, 0, 1); + } + + double t = n.dot(i); + double sign = 1; + + if (n.dot(z) < 0) { + sign = -1; + } + + i.setX(i.getX() - n.getX() * t); + i.setY(i.getY() - n.getY() * t); + i.setZ(i.getZ() - n.getZ() * t); + i.scaleInPlace(sign / i.length()); + + j = n.cross(i); + + return new CoordinateSystem(i, j, n, origin); + } + /** * {@inheritDoc} *************** *** 168,173 **** Surface surface = View.getLastSurface(); if (surface != null) { ! system = surface.coordinateSystem(); ! system = system.plane().coordinateSystem(); } else { system = Project.getInstance().getActiveCoordinateSystem(); --- 217,221 ---- Surface surface = View.getLastSurface(); if (surface != null) { ! system = systemFor(surface); } else { system = Project.getInstance().getActiveCoordinateSystem(); |
From: Michael L. <he...@us...> - 2007-11-21 14:43:24
|
Update of /cvsroot/bprocessor/gl/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15101/src/etc Modified Files: plugin.xml Log Message: Renamed GLView to Editor in plugin.xml Index: plugin.xml =================================================================== RCS file: /cvsroot/bprocessor/gl/src/etc/plugin.xml,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** plugin.xml 14 Jul 2005 09:49:59 -0000 1.1.1.1 --- plugin.xml 21 Nov 2007 14:43:27 -0000 1.2 *************** *** 1,4 **** <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <plugin> ! <main-class>net.sourceforge.bprocessor.gl.GLView</main-class> </plugin> --- 1,4 ---- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <plugin> ! <main-class>net.sourceforge.bprocessor.gl.Editor</main-class> </plugin> |
From: Michael L. <he...@us...> - 2007-11-21 13:51:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25806/src/net/sourceforge/bprocessor/model Modified Files: Command.java CoordinateSystem.java Log Message: Experiment with transforming coordinate system Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Command.java 18 Nov 2007 20:25:33 -0000 1.32 --- Command.java 21 Nov 2007 13:51:01 -0000 1.33 *************** *** 780,783 **** --- 780,784 ---- Vertex v2 = locals.get(i); v1.set(v2); + v1.update(); } Project.getInstance().changed(Project.getInstance()); *************** *** 821,824 **** --- 822,826 ---- Vertex v2 = locals.get(i); v1.set(v2); + v1.update(); } Project.getInstance().changed(Project.getInstance()); Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** CoordinateSystem.java 13 Nov 2007 12:19:29 -0000 1.64 --- CoordinateSystem.java 21 Nov 2007 13:51:01 -0000 1.65 *************** *** 237,241 **** public Set<Vertex> collect() { Set<Vertex> result = super.collect(); ! // result.addAll(handles(1.0)); return result; } --- 237,241 ---- public Set<Vertex> collect() { Set<Vertex> result = super.collect(); ! result.addAll(handles(1.0)); return result; } *************** *** 743,747 **** */ public CoordinateSystem copy(Vertex origin) { ! return new CoordinateSystem(i, j, n, origin); } --- 743,747 ---- */ public CoordinateSystem copy(Vertex origin) { ! return new CoordinateSystem(i.copy(), j.copy(), n.copy(), origin); } |
From: Michael L. <he...@us...> - 2007-11-21 13:50:59
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25796/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Experiment with transforming coordinate system Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** PopupMenu.java 19 Nov 2007 10:51:38 -0000 1.74 --- PopupMenu.java 21 Nov 2007 13:50:56 -0000 1.75 *************** *** 30,33 **** --- 30,34 ---- import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Component; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; *************** *** 511,515 **** public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometry.collect(entities); ! Vertex center = Vertex.center(vertices); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); --- 512,530 ---- public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometry.collect(entities); ! ! Vertex center = null; ! ! if (entities.size() == 1) { ! Geometric geometric = entities.iterator().next(); ! if (geometric instanceof Constructor) { ! Constructor constructor = (Constructor) geometric; ! center = constructor.getOrigin(); ! } ! } ! ! if (center == null) { ! center = Vertex.center(vertices); ! } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); *************** *** 525,532 **** public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometry.collect(entities); ! Vertex center = Vertex.center(vertices); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); Command command = new Command.Translate(vertices, system); AttributeView.instance().display(command); --- 540,562 ---- public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometry.collect(entities); ! ! Vertex center = null; ! ! if (entities.size() == 1) { ! Geometric geometric = entities.iterator().next(); ! if (geometric instanceof Constructor) { ! Constructor constructor = (Constructor) geometric; ! center = constructor.getOrigin(); ! } ! } ! ! if (center == null) { ! center = Vertex.center(vertices); ! } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); + Command command = new Command.Translate(vertices, system); AttributeView.instance().display(command); *************** *** 539,546 **** public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometry.collect(entities); ! Vertex center = Vertex.center(vertices); CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); Command command = new Command.Rotate(vertices, system); AttributeView.instance().display(command); --- 569,591 ---- public void actionPerformed(ActionEvent event) { Set<Vertex> vertices = Geometry.collect(entities); ! ! Vertex center = null; ! ! if (entities.size() == 1) { ! Geometric geometric = entities.iterator().next(); ! if (geometric instanceof Constructor) { ! Constructor constructor = (Constructor) geometric; ! center = constructor.getOrigin(); ! } ! } ! ! if (center == null) { ! center = Vertex.center(vertices); ! } ! CoordinateSystem system = Project.getInstance().getActiveCoordinateSystem(); system = system.copy(); system.setOrigin(center); + Command command = new Command.Rotate(vertices, system); AttributeView.instance().display(command); |
From: Michael L. <he...@us...> - 2007-11-21 13:50:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25787/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java Log Message: Experiment with transforming coordinate system Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Protractor.java 18 Nov 2007 21:30:17 -0000 1.16 --- Protractor.java 21 Nov 2007 13:50:53 -0000 1.17 *************** *** 34,38 **** */ public class Protractor extends AbstractPencil { - private Protract protract; private Vertex normal; --- 34,37 ---- *************** *** 126,130 **** double d = normal.dot(base.cross(direction)); if (d < 0) { ! angle = 2 * Math.PI - angle; } double degrees = angle * 180 / Math.PI; --- 125,129 ---- double d = normal.dot(base.cross(direction)); if (d < 0) { ! angle = -angle; } double degrees = angle * 180 / Math.PI; |
From: Michael L. <he...@us...> - 2007-11-21 09:21:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18934/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: multi/single choice selecting in space-assignment tool Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** Surface.java 13 Nov 2007 12:19:29 -0000 1.206 --- Surface.java 21 Nov 2007 09:21:52 -0000 1.207 *************** *** 1349,1356 **** * Assigns the back and propagates to nearby surfaces. * @param back Space */ ! public void assignBack(Space back) { setBackDomain(back); ! if (!AUTOMATIC) { SpaceAnalysis analysis = new SpaceAnalysis(); analysis.propagate(this, -1); --- 1349,1358 ---- * Assigns the back and propagates to nearby surfaces. * @param back Space + * @param propagate if true, the space should propagate + * to nearby surfaces */ ! public void assignBack(Space back, boolean propagate) { setBackDomain(back); ! if (propagate) { SpaceAnalysis analysis = new SpaceAnalysis(); analysis.propagate(this, -1); *************** *** 1373,1380 **** * to nearby surfaces * @param front Space to assign */ ! public void assignFront(Space front) { setFrontDomain(front); ! if (!AUTOMATIC) { SpaceAnalysis analysis = new SpaceAnalysis(); analysis.propagate(this, 1); --- 1375,1384 ---- * to nearby surfaces * @param front Space to assign + * @param propagate if true, the space should propagate + * to nearby surfaces */ ! public void assignFront(Space front, boolean propagate) { setFrontDomain(front); ! if (propagate) { SpaceAnalysis analysis = new SpaceAnalysis(); analysis.propagate(this, 1); |
From: Michael L. <he...@us...> - 2007-11-21 09:21:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18875/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java AbstractTool.java SpaceTool.java DomainPopupListener.java CreateSpaceActionListener.java ControlledExtrudeTool.java Log Message: multi/single choice selecting in space-assignment tool Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CreateSpaceActionListener.java 17 Oct 2007 09:08:19 -0000 1.21 --- CreateSpaceActionListener.java 21 Nov 2007 09:21:17 -0000 1.22 *************** *** 8,11 **** --- 8,12 ---- + import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.gui.attrview.AttributeView; import java.awt.event.ActionEvent; *************** *** 54,60 **** owner.add(space); if (front) { ! surface.assignFront(space); } else { ! surface.assignBack(space); } surface.changed(); --- 55,61 ---- owner.add(space); if (front) { ! surface.assignFront(space, Editor.isMulti()); } else { ! surface.assignBack(space, Editor.isMulti()); } surface.changed(); Index: DomainPopupListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DomainPopupListener.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DomainPopupListener.java 17 Oct 2007 09:08:19 -0000 1.7 --- DomainPopupListener.java 21 Nov 2007 09:21:17 -0000 1.8 *************** *** 10,13 **** --- 10,14 ---- import java.awt.event.ActionListener; + import net.sourceforge.bprocessor.gl.Editor; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; *************** *** 48,52 **** if (front) { Space oldFront = surface.getFrontDomain(); ! surface.assignFront(domain); if (oldFront != null) { oldFront.changed(); --- 49,53 ---- if (front) { Space oldFront = surface.getFrontDomain(); ! surface.assignFront(domain, Editor.isMulti()); if (oldFront != null) { oldFront.changed(); *************** *** 54,58 **** } else { Space oldBack = surface.getBackDomain(); ! surface.assignBack(domain); if (oldBack != null) { oldBack.changed(); --- 55,59 ---- } else { Space oldBack = surface.getBackDomain(); ! surface.assignBack(domain, Editor.isMulti()); if (oldBack != null) { oldBack.changed(); Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Tool.java 27 Sep 2007 10:38:35 -0000 1.38 --- Tool.java 21 Nov 2007 09:21:17 -0000 1.39 *************** *** 14,17 **** --- 14,20 ---- import java.util.Collection; + import java.util.List; + + import javax.swing.JComponent; /** * The tool interface *************** *** 97,100 **** --- 100,111 ---- public void prepare(); + /** + * Returns a list of controls for this tools. The controls are + * displayed in the statusbar. + * @return list of controls + */ + public List<JComponent> controls(); + + /** * Gives a tip on how to use the tool Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ControlledExtrudeTool.java 18 Nov 2007 21:30:17 -0000 1.10 --- ControlledExtrudeTool.java 21 Nov 2007 09:21:17 -0000 1.11 *************** *** 242,254 **** if (pressedSurface.getExterior() != null) { if (length > 0) { ! pressedSurface.assignFront(pressedSurface.getBackDomain()); } else { ! pressedSurface.assignBack(pressedSurface.getFrontDomain()); } } else { if (length > 0) { ! pressedSurface.assignFront(pressedSurface.getFrontDomain()); } else { ! pressedSurface.assignBack(pressedSurface.getBackDomain()); } } --- 242,254 ---- if (pressedSurface.getExterior() != null) { if (length > 0) { ! pressedSurface.assignFront(pressedSurface.getBackDomain(), true); } else { ! pressedSurface.assignBack(pressedSurface.getFrontDomain(), true); } } else { if (length > 0) { ! pressedSurface.assignFront(pressedSurface.getFrontDomain(), true); } else { ! pressedSurface.assignBack(pressedSurface.getBackDomain(), true); } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.139 retrieving revision 1.140 diff -C2 -d -r1.139 -r1.140 *** AbstractTool.java 19 Nov 2007 19:56:05 -0000 1.139 --- AbstractTool.java 21 Nov 2007 09:21:17 -0000 1.140 *************** *** 51,54 **** --- 51,56 ---- import java.util.Collection; import java.util.Stack; + + import javax.swing.JComponent; import javax.swing.Timer; *************** *** 938,940 **** --- 940,950 ---- } } + + /** + * {@inheritDoc} + */ + public List<JComponent> controls() { + List<JComponent> controls = new LinkedList(); + return controls; + } } Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** SpaceTool.java 18 Nov 2007 21:30:17 -0000 1.93 --- SpaceTool.java 21 Nov 2007 09:21:17 -0000 1.94 *************** *** 12,24 **** --- 12,31 ---- import java.awt.event.ActionListener; import java.awt.event.MouseEvent; + import java.net.URL; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; + import java.util.List; import java.util.Stack; + import javax.swing.AbstractAction; + import javax.swing.Action; + import javax.swing.ImageIcon; + import javax.swing.JComponent; import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; + import javax.swing.JToggleButton; import org.apache.log4j.Logger; *************** *** 336,338 **** --- 343,376 ---- return null; } + + class OptionAction extends AbstractAction { + /** + * Constructs option action + * @param iconname String + */ + public OptionAction(String iconname) { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource(iconname); + ImageIcon im = new ImageIcon(url); + putValue(Action.SMALL_ICON, im); + }; + + /** {@inheritDoc} */ + public void actionPerformed(ActionEvent event) { + JToggleButton button = (JToggleButton) event.getSource(); + Editor.setMulti(button.isSelected()); + } + } + + /** + * {@inheritDoc} + */ + public List<JComponent> controls() { + List<JComponent> controls = super.controls(); + JToggleButton button = new JToggleButton(new OptionAction("multiicon.gif")); + button.setSelected(Editor.isMulti()); + controls.add(button); + return controls; + } + } |