bprocessor-commit Mailing List for B-processor (Page 151)
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: Nikolaj B. <nbr...@us...> - 2005-11-21 09:52:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32657/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Added Files: MyKeyListener.java Log Message: Added functionality, and editing option of spacenames --- NEW FILE: MyKeyListener.java --- //--------------------------------------------------------------------------------- // $Id: MyKeyListener.java,v 1.1 2005/11/21 09:52:17 nbramsen Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attrview; import java.awt.event.KeyListener; import java.awt.event.KeyEvent; import javax.swing.text.JTextComponent; import net.sourceforge.bprocessor.model.FunctionalSpace; import net.sourceforge.bprocessor.model.ConstructionSpace; import net.sourceforge.bprocessor.model.Project; /** * The focus handler */ public class MyKeyListener implements KeyListener { /** The current ConstructionSpace */ private ConstructionSpace cons; /** The current FunctionalSpace */ private FunctionalSpace funs; /** The current Object */ private Object current; /** * The constructor * @param o the event */ public MyKeyListener (Object o) { current = o; } /** * Handles keyTyped keyevent * @param e the event */ public void keyTyped(KeyEvent e) { } /** * Handles the keyReleased keyevent * @param e the keyevent */ public void keyReleased(KeyEvent e) { } /** * Handles focus event * @param e the event */ public void keyPressed(KeyEvent e) { int keyPressed = e.getKeyCode(); if (keyPressed == KeyEvent.VK_ENTER) { JTextComponent tf = (JTextComponent)e.getSource(); String newName = tf.getText(); if (current instanceof FunctionalSpace) { funs = (FunctionalSpace)current; funs.setName(newName); Project.getInstance().update(funs); } if (current instanceof ConstructionSpace) { cons = (ConstructionSpace)current; cons.setName(newName); Project.getInstance().update(cons); } } } } Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AttributeView.java 20 Nov 2005 19:32:37 -0000 1.8 --- AttributeView.java 21 Nov 2005 09:52:17 -0000 1.9 *************** *** 22,29 **** --- 22,33 ---- import java.util.ArrayList; import java.util.List; + import java.awt.GridBagLayout; + import java.awt.GridBagConstraints; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; + import javax.swing.JTextField; + import javax.swing.JComboBox; import org.apache.log4j.Logger; *************** *** 64,71 **** if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED)) { FunctionalSpace current = Project.getInstance().findFunctionalSpaceById(n.getObject()); ! ap.display(current); } else if (type.equals(Notification.CONSTRUCTION_SPACE_SELECTED)) { ConstructionSpace current = Project.getInstance().findConstructionSpaceById(n.getObject()); ! ap.display(current); } else if (type.equals(Notification.ELEMENT_SELECTED)) { Element current = Project.getInstance().findElementById(n.getObject()); --- 68,75 ---- if (type.equals(Notification.FUNCTIONAL_SPACE_SELECTED)) { FunctionalSpace current = Project.getInstance().findFunctionalSpaceById(n.getObject()); ! ap.displayFuncSpace(current); } else if (type.equals(Notification.CONSTRUCTION_SPACE_SELECTED)) { ConstructionSpace current = Project.getInstance().findConstructionSpaceById(n.getObject()); ! ap.displayConsSpace(current); } else if (type.equals(Notification.ELEMENT_SELECTED)) { Element current = Project.getInstance().findElementById(n.getObject()); *************** *** 76,80 **** } else if (type.equals(Notification.SURFACE_SELECTED)) { Surface current = Project.getInstance().findSurfaceById(n.getObject()); ! ap.display(current); } else if (type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || --- 80,84 ---- } else if (type.equals(Notification.SURFACE_SELECTED)) { Surface current = Project.getInstance().findSurfaceById(n.getObject()); ! ap.displaySurface(current); } else if (type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || *************** *** 125,128 **** --- 129,208 ---- /** + * Display the functional space + * @param o The object + */ + void displayFuncSpace(FunctionalSpace o) { + removeAll(); + + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints con = new GridBagConstraints(); + setLayout(layout); + + JLabel name = new JLabel("Name:"); + con.anchor = GridBagConstraints.PAGE_START; + con.weightx = 1.0; + layout.setConstraints(name, con); + add(name); + + JTextField nameEdit = new JTextField(o.getName(), 10); + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(nameEdit, con); + add(nameEdit); + nameEdit.addKeyListener(new MyKeyListener(o)); + + Object[] options = {"Arbejdsværelse", "Badeværelse", "Gang", "Køkken", "Stue", "Værelse"}; + JComboBox klassifikation = new JComboBox(options); + con.weightx = 0.0; + layout.setConstraints(klassifikation, con); + add(klassifikation); + } + + /** + * Display the construction space + * @param o The object + */ + void displayConsSpace(ConstructionSpace o) { + removeAll(); + + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints con = new GridBagConstraints(); + setLayout(layout); + + JLabel name = new JLabel("Name:"); + con.anchor = GridBagConstraints.NORTH; + con.weightx = 1.0; + layout.setConstraints(name, con); + add(name); + JTextField nameEdit = new JTextField(o.getName(), 10); + nameEdit.addKeyListener(new MyKeyListener(o)); + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(nameEdit, con); + add(nameEdit); + } + + /** + * Display the surface + * @param o The object + */ + void displaySurface(Surface o) { + removeAll(); + + GridBagLayout layout = new GridBagLayout(); + GridBagConstraints con = new GridBagConstraints(); + setLayout(layout); + + JLabel name = new JLabel("Name:"); + con.anchor = GridBagConstraints.NORTH; + con.weightx = 1.0; + layout.setConstraints(name, con); + add(name); + + JLabel surfaceName = new JLabel(o.getName()); + con.gridwidth = GridBagConstraints.REMAINDER; + layout.setConstraints(surfaceName, con); + add(surfaceName); + } + + /** * Display the object * @param o The object |
From: Nikolaj B. <nbr...@us...> - 2005-11-21 09:52:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32657/src/net/sourceforge/bprocessor/gui/treeview Modified Files: SpacesTreeView.java Log Message: Added functionality, and editing option of spacenames Index: SpacesTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpacesTreeView.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SpacesTreeView.java 2 Oct 2005 14:37:10 -0000 1.8 --- SpacesTreeView.java 21 Nov 2005 09:52:17 -0000 1.9 *************** *** 90,96 **** } RootNode rn = (RootNode)getModel().getRoot(); SpaceNode sn = (SpaceNode)rn.findNode(GenericNode.TYPE_SPACE, space.getId()); ! SurfaceContainerNode scn = sn.getSurfaceContainer(); scn.removeAll(); --- 90,97 ---- } + String name = space.getName(); RootNode rn = (RootNode)getModel().getRoot(); SpaceNode sn = (SpaceNode)rn.findNode(GenericNode.TYPE_SPACE, space.getId()); ! sn.setName(name); SurfaceContainerNode scn = sn.getSurfaceContainer(); scn.removeAll(); |
From: Nikolaj B. <nbr...@us...> - 2005-11-21 09:50:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32293/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Added notification handler, to update view on events. Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GLView.java 20 Nov 2005 19:33:52 -0000 1.24 --- GLView.java 21 Nov 2005 09:50:51 -0000 1.25 *************** *** 42,46 **** * The 3D display */ ! public class GLView implements MouseListener { /** The logger */ private static Logger log = Logger.getLogger(GLView.class); --- 42,46 ---- * The 3D display */ ! public class GLView implements MouseListener, NotificationListener { /** The logger */ private static Logger log = Logger.getLogger(GLView.class); *************** *** 63,66 **** --- 63,67 ---- public GLView() { log.info("Using JOGL version " + Version.getVersion()); + Notifier.getInstance().addListener(this); GLCapabilities glCap = new GLCapabilities(); glCap.setDoubleBuffered(true); *************** *** 313,315 **** --- 314,345 ---- } + + /** + * Handle a notification + * @param n The notification + */ + public void handleNotification(Notification n) { + repaint(); + } + + /** + * Should the listener handle this notification + * @param type The notification type + * @return True if it should handle it; otherwise false + */ + public boolean isNotificationEnabled(String type) { + if (type.equals(Notification.FUNCTIONAL_SPACE_CREATED) || + type.equals(Notification.FUNCTIONAL_SPACE_DELETED) || + type.equals(Notification.FUNCTIONAL_SPACE_SELECTED) || + type.equals(Notification.FUNCTIONAL_SPACE_DESELECTED) || + type.equals(Notification.FUNCTIONAL_SPACE_MODIFIED) || + type.equals(Notification.CONSTRUCTION_SPACE_CREATED) || + type.equals(Notification.CONSTRUCTION_SPACE_DELETED) || + type.equals(Notification.CONSTRUCTION_SPACE_SELECTED) || + type.equals(Notification.CONSTRUCTION_SPACE_DESELECTED) || + type.equals(Notification.CONSTRUCTION_SPACE_MODIFIED)) { + return true; + } + return false; + } } |
From: Michael L. <he...@us...> - 2005-11-20 19:34:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Small Improvements of layout Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GLView.java 18 Nov 2005 01:27:55 -0000 1.23 --- GLView.java 20 Nov 2005 19:33:52 -0000 1.24 *************** *** 70,77 **** JPanel jp = new JPanel(); - jp.setPreferredSize(new Dimension(450, 450)); jp.setLayout(new BorderLayout()); jp.add((Component) glc, BorderLayout.CENTER); ! JPanel lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); --- 70,76 ---- JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); jp.add((Component) glc, BorderLayout.CENTER); ! jp.setMinimumSize(new Dimension(320, 240)); JPanel lengthPanel = new JPanel(); lengthPanel.setLayout(new BorderLayout()); |
From: Michael L. <he...@us...> - 2005-11-20 19:34:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java SelectTool.java Log Message: Small Improvements of layout Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** SelectTool.java 17 Nov 2005 18:14:00 -0000 1.42 --- SelectTool.java 20 Nov 2005 19:33:52 -0000 1.43 *************** *** 334,342 **** deleteEdge(selectedEdge); } ! } else if (selected instanceof ClippingPlane) { glv.getView().removeClippingPlane((ClippingPlane)selected); } } glv.getView().makeTarget(null); } else { super.keyPressed(e); --- 334,347 ---- deleteEdge(selectedEdge); } ! } else if (selected instanceof Vertex) { ! selection.remove(selected); ! deleteVertex((Vertex) selected); ! } else if (selected instanceof ClippingPlane) { ! selection.remove(selected); glv.getView().removeClippingPlane((ClippingPlane)selected); } } glv.getView().makeTarget(null); + glv.repaint(); } else { super.keyPressed(e); Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** PencilTool.java 18 Nov 2005 16:25:01 -0000 1.35 --- PencilTool.java 20 Nov 2005 19:33:52 -0000 1.36 *************** *** 495,498 **** --- 495,501 ---- boolean changed = false; if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { + if (active != null) { + deleteEdge(active); + } Iterator it = edges.iterator(); while (it.hasNext()) { |
From: Michael L. <he...@us...> - 2005-11-20 19:34:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18206/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java Log Message: Small Improvements of layout Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** AbstractView.java 17 Nov 2005 18:14:00 -0000 1.58 --- AbstractView.java 20 Nov 2005 19:33:52 -0000 1.59 *************** *** 653,658 **** Iterator selit = selection.iterator(); while (selit.hasNext()) { ! Object o = selit.next(); ! drawObject(o); } --- 653,660 ---- Iterator selit = selection.iterator(); while (selit.hasNext()) { ! Object o = selit.next(); ! if (o instanceof Surface) { ! drawObject(o); ! } } *************** *** 721,724 **** --- 723,735 ---- } + gl.glColor3fv(SELECTED_COLOR); + selit = selection.iterator(); + while (selit.hasNext()) { + Object o = selit.next(); + if (!(o instanceof Surface)) { + drawObject(o); + } + } + // draw target gl.glColor3fv(TARGET_COLOR); *************** *** 822,827 **** while (it.hasNext()) { ClippingPlane cp = (ClippingPlane)it.next(); pushName(gl, cp); ! //drawClipplane(cp); popName(gl); } --- 833,839 ---- while (it.hasNext()) { ClippingPlane cp = (ClippingPlane)it.next(); + gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); pushName(gl, cp); ! drawClipplaneFrame(cp); popName(gl); } *************** *** 831,839 **** /** * Draw a clippingPlane * @param clipplane The clipplane to draw */ private void drawClipplane(ClippingPlane clipplane) { ! double[] d = clipplane.getPlane().getDoublev(); Collection corners = clipplane.getCorners(); --- 843,876 ---- /** + * Draw the frame of a clippingplane + * @param clipplane The clippingplane + */ + private void drawClipplaneFrame(ClippingPlane clipplane) { + { + Collection corners = clipplane.getCorners(); + gl.glColor3fv(CLIP_PLANE_COLOR); + gl.glLineWidth(2.0f); + gl.glBegin(GL.GL_LINE_STRIP); + Iterator it = corners.iterator(); + while (it.hasNext()) { + Vertex v = (Vertex)it.next(); + gl.glVertex3d(v.getX(), + v.getY(), + v.getZ()); + } + Vertex v = (Vertex) corners.iterator().next(); + gl.glVertex3d(v.getX(), + v.getY(), + v.getZ()); + gl.glEnd(); + } + } + + /** * Draw a clippingPlane * @param clipplane The clipplane to draw */ private void drawClipplane(ClippingPlane clipplane) { ! Collection selection = glv.getTool().getSelection(); double[] d = clipplane.getPlane().getDoublev(); Collection corners = clipplane.getCorners(); *************** *** 852,856 **** } { ! gl.glColor3fv(CLIP_PLANE_COLOR); gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINE_STRIP); --- 889,897 ---- } { ! if (selection.contains(clipplane)) { ! gl.glColor3fv(SELECTED_COLOR); ! } else { ! gl.glColor3fv(CLIP_PLANE_COLOR); ! } gl.glLineWidth(2.0f); gl.glBegin(GL.GL_LINE_STRIP); *************** *** 1252,1256 **** Set vertices = new HashSet(); Set edges = new HashSet(); - for (int i = 0; i < hits; i++) { names = selectBuffer.get(bufferOffset); --- 1293,1296 ---- *************** *** 1272,1279 **** if (near < nearest) { nearest = near; ! if (!(current instanceof ClippingPlane && closest != null)) { ! // if the closest are set we don't care about clipplanes ! closest = current; ! } } bufferOffset += names; --- 1312,1316 ---- if (near < nearest) { nearest = near; ! closest = current; } bufferOffset += names; |
From: Michael L. <he...@us...> - 2005-11-20 19:32:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17934/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Small Improvements of layout Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** GUI.java 17 Nov 2005 11:19:32 -0000 1.11 --- GUI.java 20 Nov 2005 19:32:37 -0000 1.12 *************** *** 28,31 **** --- 28,32 ---- import java.awt.BorderLayout; import java.awt.Component; + import java.awt.Dimension; import java.awt.event.KeyEvent; *************** *** 287,291 **** splitPaneTopDown.setTopComponent(new JPanel()); splitPaneTopDown.setBottomComponent(new JPanel()); - splitPaneTopDown.setDividerLocation(460); splitPaneLeftRight = new JSplitPane(); --- 288,291 ---- *************** *** 300,303 **** --- 300,305 ---- tp.addTab("Spaces", new SpacesTreeView()); tp.addTab("Surfaces", new SurfacesTreeView()); + tp.setPreferredSize(new Dimension(170, 340)); + splitPaneTopDown.setMinimumSize(new Dimension(170, 340)); registerPanel(tp, SPLIT_LEFT); *************** *** 314,324 **** public void registerPanel(Component panel, Integer placement) { if (placement.equals(SPLIT_LEFT)) { - //splitPaneTopDown.remove(1); splitPaneTopDown.setTopComponent(new JScrollPane(panel)); } else if (placement.equals(SPLIT_MIDDLE)) { - //splitPaneLeftRight.remove(1); splitPaneLeftRight.setRightComponent(panel); } else { - //splitPaneTopDown.remove(2); splitPaneTopDown.setBottomComponent(new JScrollPane(panel)); } --- 316,323 ---- *************** *** 334,338 **** settings.load(); ! setSize(1024, 768); } --- 333,337 ---- settings.load(); ! setSize(800, 600); } |
From: Michael L. <he...@us...> - 2005-11-20 19:32:45
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17934/src/net/sourceforge/bprocessor/gui/attrview Modified Files: AttributeView.java Log Message: Small Improvements of layout Index: AttributeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/AttributeView.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AttributeView.java 15 Nov 2005 19:01:02 -0000 1.7 --- AttributeView.java 20 Nov 2005 19:32:37 -0000 1.8 *************** *** 48,52 **** addTab("Attributes", ap); ! setPreferredSize(new Dimension(200, 324)); Notifier.getInstance().addListener(this); } --- 48,52 ---- addTab("Attributes", ap); ! setMinimumSize(new Dimension(170, 120)); Notifier.getInstance().addListener(this); } |
From: Michael L. <he...@us...> - 2005-11-18 16:27:18
|
Update of /cvsroot/bprocessor/gui/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11839/bin Removed Files: .cvsignore Log Message: Eclipse fix --- .cvsignore DELETED --- |
From: Michael L. <he...@us...> - 2005-11-18 16:27:10
|
Update of /cvsroot/bprocessor/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11839 Modified Files: .classpath Log Message: Eclipse fix Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/gui/.classpath,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .classpath 10 Aug 2005 12:39:44 -0000 1.1 --- .classpath 18 Nov 2005 16:27:02 -0000 1.2 *************** *** 6,9 **** <classpathentry kind="lib" path="lib/log4j.jar"/> <classpathentry kind="lib" path="lib/kernel.jar"/> ! <classpathentry kind="output" path="build"/> </classpath> --- 6,9 ---- <classpathentry kind="lib" path="lib/log4j.jar"/> <classpathentry kind="lib" path="lib/kernel.jar"/> ! <classpathentry kind="output" path="bin"/> </classpath> |
From: Michael L. <he...@us...> - 2005-11-18 16:26:35
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11776 Modified Files: build.xml Log Message: New version number Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/build/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build.xml 4 Oct 2005 08:03:26 -0000 1.7 --- build.xml 18 Nov 2005 16:26:27 -0000 1.8 *************** *** 3,7 **** <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M1"/> <property name="script.dir" value="${basedir}/bin"/> --- 3,7 ---- <target name="init"> <property name="project" value="bprocessor"/> ! <property name="version" value="M2"/> <property name="script.dir" value="${basedir}/bin"/> |
From: Michael L. <he...@us...> - 2005-11-18 16:25:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11543/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Splits edges also when using length field to insert Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** PencilTool.java 18 Nov 2005 01:27:56 -0000 1.34 --- PencilTool.java 18 Nov 2005 16:25:01 -0000 1.35 *************** *** 167,171 **** edge.split(vertex); } ! } if (vertex.getId() == null) { //log.info("ID was null on " + vertex); --- 167,171 ---- edge.split(vertex); } ! } if (vertex.getId() == null) { //log.info("ID was null on " + vertex); *************** *** 544,550 **** // TODO fix. if (current != null) { - double x = current.getX(); - double y = current.getY(); - double z = current.getZ(); Vertex before = null; if (alignVertex != null) { --- 544,547 ---- *************** *** 561,564 **** --- 558,567 ---- current.setY(roundMM(current.getY())); current.setZ(roundMM(current.getZ())); + Set edges = Project.getInstance().findEdge(current); + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge edge = (Edge) iter.next(); + target = edge; + } onVertex(current); glv.repaint(); |
From: Michael L. <he...@us...> - 2005-11-18 16:24:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11411/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Project.java Log Message: Edgefinding from vertex Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Edge.java 17 Nov 2005 17:01:30 -0000 1.18 --- Edge.java 18 Nov 2005 16:24:11 -0000 1.19 *************** *** 364,366 **** --- 364,395 ---- return new double[]{from.getX() + x, from.getY() + y, from.getZ() + z}; } + + /** + * Tests if the vertex concides with this Edge + * @param vertex The vertex + * @return The answer + */ + public boolean coincides(Vertex vertex) { + Vertex p0 = getFrom(); + Vertex p1 = getTo(); + Vertex r = p1.minus(p0); + Vertex q = vertex; + double t = 0.0; + + if (Math.abs(r.getX()) > 0.0000001) { + t = (q.getX() - p0.getX()) / r.getX(); + } else if (Math.abs(r.getY()) > 0.0000001) { + t = (q.getY() - p0.getY()) / r.getY(); + } else if (Math.abs(r.getZ()) > 0.0000001) { + t = (q.getZ() - p0.getZ()) / r.getZ(); + } + if (t > 0 && t < 1) { + r.scale(t); + Vertex p = p0.add(r).minus(q); + if (p.length() < 0.0000001) { + return true; + } + } + return false; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Project.java 15 Nov 2005 18:58:30 -0000 1.5 --- Project.java 18 Nov 2005 16:24:11 -0000 1.6 *************** *** 525,527 **** --- 525,545 ---- return result; } + + /** + * Find set of edges that coincides with the vertex + * @param vertex The vertex + * @return The set of edges + */ + public Set findEdge(Vertex vertex) { + Set result = new HashSet(); + Set edges = getEdges(); + Iterator iter = edges.iterator(); + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + if (current.coincides(vertex)) { + result.add(current); + } + } + return result; + } } |
From: Nordholt <nor...@us...> - 2005-11-18 12:32:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20981 Modified Files: ExtrusionTool.java Log Message: small changes Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ExtrusionTool.java 18 Nov 2005 01:27:56 -0000 1.28 --- ExtrusionTool.java 18 Nov 2005 12:32:05 -0000 1.29 *************** *** 31,36 **** import java.util.Set; import java.util.HashSet; import java.util.LinkedList; ! import org.apache.log4j.Logger; /** --- 31,37 ---- import java.util.Set; import java.util.HashSet; + import java.util.HashMap; import java.util.LinkedList; ! import java.util.Map; import org.apache.log4j.Logger; /** *************** *** 178,185 **** --- 179,385 ---- protected void released(MouseEvent e) { super.released(e); + //holeDetection(); spaceAssignment(); } /** + * Detects if the an extrusion went through other surfaces and thus + * making it nessesary to form new holes. (should be done before) space- + * assignment) + */ + private void holeDetection() { + //this is when nothing is extruded + if (extrudeSurface == null) { + return; + } + Surface top = (Surface)extrudedSurfaces.getFirst(); + Surface bottom = (Surface)extrudedSurfaces.getLast(); + + List topVerticies = top.getVertices(); + List sideEdges = new LinkedList(); + Iterator topVertIt = topVerticies.iterator(); + while (topVertIt.hasNext()) { + Set edges = ((Vertex)(topVertIt.next())).getEdges(); + if (edges != null) { + if (edges.size() > 3) { + log.warn("Algorithm assumtion is wrong"); + } + Iterator edgeIt = edges.iterator(); + while (edgeIt.hasNext()) { + Edge edge = (Edge)edgeIt.next(); + if (!top.contains(edge)) { + sideEdges.add(edge); + } + } + } + } + Map surfaceToInnerPoints = new HashMap(); + Map edgeToSplit = new HashMap(); + Map splitToEdge = new HashMap(); + Iterator sIt = Project.getInstance().getSurfaces().iterator(); + while (sIt.hasNext()) { + Surface surface = (Surface)sIt.next(); + if (!extrudedSurfaces.contains(surface)) { + List cutVerticies = new LinkedList(); + List cutEdges = new LinkedList(); + boolean hole = true; + Iterator sideEdgeIt = sideEdges.iterator(); + while (sideEdgeIt.hasNext() && hole) { + Edge edge = (Edge)sideEdgeIt.next(); + Vertex vertex = surface.intersection(edge); + if (vertex == null) { + hole = false; + } else { + vertex = createVertex(vertex); + cutVerticies.add(vertex); + cutEdges.add(edge); + splitToEdge.put(vertex, edge); + if (edgeToSplit.containsKey(edge)) { + LinkedList splitList = (LinkedList)edgeToSplit.get(edge); + edgeToSplit.put(edge, insertSplit(splitList, vertex, edge)); + } else { + LinkedList splitList = new LinkedList(); + splitList.add(vertex); + edgeToSplit.put(edge, splitList); + } + } + } + if (hole) { + surfaceToInnerPoints.put(surface, cutVerticies); + } + } + } + /* + Debug code + Iterator it = edgeToSplit.keySet().iterator(); + while (it.hasNext()) { + Edge edge = (Edge)it.next(); + log.info("To: " + edge.getTo()); + Iterator it2 = ((LinkedList)edgeToSplit.get(edge)).iterator(); + while (it2.hasNext()) { + log.info((Vertex)it2.next()); + } + } + */ + breakExtension(surfaceToInnerPoints, edgeToSplit, splitToEdge); + } + + /** + * Keeps a sorted list of splitting verticies sorted after insertion + * so that the verticies closest to the "to" node is in front of the list. + * @param splitList the original list. + * @param split the new vertex to insert. + * @param edge the edge corresponding to the splitlist. + * @return the new list. + */ + private LinkedList insertSplit(LinkedList splitList, Vertex split, Edge edge) { + Iterator it = splitList.iterator(); + boolean inserted = false; + while (it.hasNext() && !inserted) { + Vertex current = (Vertex)it.next(); + if (closerThan(split, current, edge)) { + int i = splitList.indexOf(current); + splitList.add(i, split); + inserted = true; + } + } + if (!inserted) { + splitList.addLast(split); + } + return splitList; + } + + /** + * Tells wherther or not one vertex is closer to the "to"-vertex of + * an edge than an other vertex. + * @param v1 the first vertex + * @param v2 the second vertex + * @param edge the edge + * @return true if v1 is closer to the "to"-vertex otherwise false + */ + private boolean closerThan(Vertex v1, Vertex v2, Edge edge) { + Vertex direction = edge.getFrom().minus(edge.getTo()); + double distance1; + double distance2; + if (direction.getX() != 0) { + distance1 = (v1.getX() + edge.getTo().getX()) / direction.getX(); + distance2 = (v2.getX() + edge.getTo().getX()) / direction.getX(); + } else if (direction.getY() != 0) { + distance1 = (v1.getY() + edge.getTo().getX()) / direction.getY(); + distance2 = (v2.getY() + edge.getTo().getY()) / direction.getY(); + } else { + distance1 = (v1.getZ() + edge.getTo().getZ()) / direction.getZ(); + distance2 = (v2.getZ() + edge.getTo().getZ()) / direction.getZ(); + } + return distance1 < distance2; + } + + + /** + * Makes the apropriate hole when an extrusion goes through a surface + * @param surfaceToPoints a map having a surface as key and a list of + * verticies corresponding to an innersurface as value + * @param edgeToPoints a map having edges as keys and a ordered list of + * verticies that split the edge as value + * @param pointToEdge a map having verticies as keys and the edge which it splits + * as value. + */ + private void breakExtension(Map surfaceToPoints, Map edgeToPoints, Map pointToEdge) { + //First we create the holes + Set surfaceKeys = surfaceToPoints.keySet(); + Iterator skIt = surfaceKeys.iterator(); + Map fromToTo = new HashMap(); + Map toToFrom = new HashMap(); + while (skIt.hasNext()) { + Surface surface = (Surface)skIt.next(); + List verticies = (List)surfaceToPoints.get(surface); + Iterator vertIt = verticies.iterator(); + Vertex origin; + if (vertIt.hasNext()) { + List edges = new LinkedList(); + origin = (Vertex)vertIt.next(); + Vertex from = origin; + Vertex to; + while (vertIt.hasNext()) { + to = (Vertex)vertIt.next(); + if (to != null) { + edges.add(createEdge(from, to)); + toToFrom.put(to, from); + fromToTo.put(from, to); + from = to; + if (to.equals(origin)) { + log.warn("Algorithm assumtions wrong"); + } + } + } + edges.add(createEdge(from, origin)); + Surface hole = createSurface(edges); + surface.addHole(hole); + Project.getInstance().update(surface); + } + } + Iterator it = edgeToPoints.keySet().iterator(); + while (it.hasNext()) { + Iterator pointIt = ((List)edgeToPoints.get((Edge)it.next())).iterator(); + while (pointIt.hasNext()) { + Vertex point = (Vertex)pointIt.next(); + Vertex oppositePoint = (Vertex)toToFrom.get(point); + List edges = new LinkedList(); + edges.add(createEdge(point, oppositePoint)); + Edge oppositeEdge = (Edge)pointToEdge.get(oppositePoint); + LinkedList oppositePoints = (LinkedList)edgeToPoints.get(oppositeEdge); + int indexOfLower = oppositePoints.indexOf(oppositePoint) + 1; + if (indexOfLower < oppositePoints.size()) { + Vertex lowerOppositePoint = (Vertex)oppositePoints.get(indexOfLower); + edges.add(createEdge(oppositePoint, lowerOppositePoint)); + Vertex lowerPoint = (Vertex)(fromToTo.get(lowerOppositePoint)); + edges.add(createEdge(lowerOppositePoint, lowerPoint)); + edges.add(createEdge(lowerPoint, point)); + createSurface(edges); + } + } + } + } + /** * Does appropriate space assignments for the current extrusion. Does * Nothing if nothing has been extruded. *************** *** 417,475 **** for extrusion, and if the "number"-variable has been initialised */ if (dragSurface != null && number != null) { ! if (number.equals("") && e.getKeyCode() == KeyEvent.VK_MINUS) { ! number = "-"; ! } else { ! if (e.getKeyCode() == KeyEvent.VK_1) { ! number += "1"; ! } else if (e.getKeyCode() == KeyEvent.VK_2) { ! number += "2"; ! } else if (e.getKeyCode() == KeyEvent.VK_3) { ! number += "3"; ! } else if (e.getKeyCode() == KeyEvent.VK_4) { ! number += "4"; ! } else if (e.getKeyCode() == KeyEvent.VK_5) { ! number += "5"; ! } else if (e.getKeyCode() == KeyEvent.VK_6) { ! number += "6"; ! } else if (e.getKeyCode() == KeyEvent.VK_7) { ! number += "7"; ! } else if (e.getKeyCode() == KeyEvent.VK_8) { ! number += "8"; ! } else if (e.getKeyCode() == KeyEvent.VK_9) { ! number += "9"; ! } else if (e.getKeyCode() == KeyEvent.VK_0) { ! number += "0"; ! } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { ! if (!number.equals("")) { ! double length = glv.getLength(); ! double delta = extrusion.getLength() - length; ! Vertex extrusionDir = extrusion.getFrom().minus(extrusion.getTo()); ! Vertex normal = dragSurface.normal(); ! normal.scale(1 / normal.length()); ! if (normal.dot(extrusionDir) > 0) { ! delta = 0 - delta; ! } ! moveDelta(delta); ! glv.repaint(); ! } ! } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { ! int length = number.length(); ! if (length > 0) { ! number = number.substring(0, length - 1); } } ! } ! ! if (number.equals("-") || number.equals("")) { ! glv.setLength(0); ! } else { ! try { ! double d = Double.parseDouble(number); ! glv.setLength(d / 1000); ! } catch (NumberFormatException exp) { ! log.warn(exp); } } } super.keyPressed(e); --- 617,672 ---- for extrusion, and if the "number"-variable has been initialised */ + super.keyPressed(e); if (dragSurface != null && number != null) { ! if (e.getKeyCode() == KeyEvent.VK_1) { ! number += "1"; ! } else if (e.getKeyCode() == KeyEvent.VK_2) { ! number += "2"; ! } else if (e.getKeyCode() == KeyEvent.VK_3) { ! number += "3"; ! } else if (e.getKeyCode() == KeyEvent.VK_4) { ! number += "4"; ! } else if (e.getKeyCode() == KeyEvent.VK_5) { ! number += "5"; ! } else if (e.getKeyCode() == KeyEvent.VK_6) { ! number += "6"; ! } else if (e.getKeyCode() == KeyEvent.VK_7) { ! number += "7"; ! } else if (e.getKeyCode() == KeyEvent.VK_8) { ! number += "8"; ! } else if (e.getKeyCode() == KeyEvent.VK_9) { ! number += "9"; ! } else if (e.getKeyCode() == KeyEvent.VK_0) { ! number += "0"; ! } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { ! if (!number.equals("")) { ! double length = glv.getLength(); ! double delta = extrusion.getLength() - length; ! Vertex extrusionDir = extrusion.getFrom().minus(extrusion.getTo()); ! Vertex normal = dragSurface.normal(); ! normal.scale(1 / normal.length()); ! if (normal.dot(extrusionDir) > 0) { ! delta = 0 - delta; } + moveDelta(delta); + glv.repaint(); } ! } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { ! int length = number.length(); ! if (length > 0) { ! number = number.substring(0, length - 1); } } + } + + if (number.equals("") || number.equals("-")) { + glv.setLength(0); + } else { + try { + double d = Double.parseDouble(number); + glv.setLength(d / 1000); + } catch (NumberFormatException exp) { + log.warn(exp); + } } super.keyPressed(e); |
From: Nordholt <nor...@us...> - 2005-11-18 12:31:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20813 Modified Files: AbstractTool.java Log Message: new method for vertex creation Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractTool.java 18 Nov 2005 01:27:56 -0000 1.28 --- AbstractTool.java 18 Nov 2005 12:31:26 -0000 1.29 *************** *** 313,316 **** --- 313,335 ---- } } + + /** + * Make and register a new vertex + * @param vertex The vertex + * @return The registered Vertex + */ + protected Vertex createVertex(Vertex vertex) { + if (vertex != null) { + Vertex v = new Vertex("V" + vertexNum, + vertex.getX(), + vertex.getY(), + vertex.getZ()); + Project.getInstance().intern(v); + return v; + } else { + log.warn("attempted to create null vertex"); + return null; + } + } /** |
From: Nordholt <nor...@us...> - 2005-11-18 12:15:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17986 Modified Files: Surface.java Log Message: method for calculating if a vertex is inside the surface Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Surface.java 17 Nov 2005 18:10:25 -0000 1.46 --- Surface.java 18 Nov 2005 12:15:44 -0000 1.47 *************** *** 451,455 **** surface.move(dx, dy, dz); } ! } } --- 451,455 ---- surface.move(dx, dy, dz); } ! } } *************** *** 469,472 **** --- 469,473 ---- //this can not happen so here we move the inner surface back { + log.info("contained check fejlede"); List vertices = getVertices(); Vertex v0 = (Vertex) vertices.get(0); *************** *** 507,515 **** */ private boolean containedCheck(Surface hole, Surface surf) { /*this is done by aplying the crossing numbers algorithm on every vertex *of the hole. Using the edges of the hole as rays we cover two vertecies *at a time. */ ! //log.info("contained check"); List holeEdges = hole.getEdges(); Iterator holeIt = holeEdges.iterator(); --- 508,525 ---- */ private boolean containedCheck(Surface hole, Surface surf) { + Iterator vertIt = hole.getVertices().iterator(); + boolean contained = true; + while (vertIt.hasNext() && contained) { + contained = surf.surrounds((Vertex)vertIt.next()); + } + return contained; + } + + //private boolean containedCheck(Surface hole, Surface surf) { /*this is done by aplying the crossing numbers algorithm on every vertex *of the hole. Using the edges of the hole as rays we cover two vertecies *at a time. */ ! /* List holeEdges = hole.getEdges(); Iterator holeIt = holeEdges.iterator(); *************** *** 530,534 **** } return contained; ! } /** --- 540,545 ---- } return contained; ! }*/ ! /** *************** *** 539,543 **** */ private boolean crossingNumbers(Edge edge, Surface surf) { - //log.info("crossing numbers"); List surfEdges = surf.getEdges(); Iterator surfIt = surfEdges.iterator(); --- 550,553 ---- *************** *** 796,799 **** --- 806,877 ---- return edges.contains(e); } + /** + * Tells whether or not a Vertex is contained inside the surface. + * @param v the vertex + * @return boolean whether or not the vertex is surrounded by the surface. + */ + public boolean surrounds(Vertex v) { + CoordinateSystem cs = this.coordinateSystem(); + Vertex lv = cs.translate(v); + /* + This is when the vertex is not in the same plane as + this surface + */ + if (lv.getZ() > 0.00001) { + return false; + } else { + /* + The crossing numbers algorithm but simplyfied by translating + points to the local coordinates of the surface plane. + */ + Iterator ei = edges.iterator(); + int count = 0; + while (ei.hasNext()) { + Edge e = (Edge)ei.next(); + Vertex t = cs.translate(e.getTo()); + Vertex f = cs.translate(e.getFrom()); + boolean cross = false; + if (t.getY() > lv.getY() && + f.getY() < lv.getY()) { + cross = true; + } else if (t.getY() < lv.getY() && + f.getY() > lv.getY()) { + cross = true; + } + /* + Making sure only to count crossings to the right + of v. + */ + if (cross) { + Vertex dir = t.minus(f); + if (!(dir.getY() == 0)) { + double p = ((lv.getY() - t.getY()) + / dir.getY()); + double pstar = ((dir.getX() * p) + t.getX() - lv.getX()); + cross = (pstar > 0); + } + } + if (cross) { + count++; + } + } + return !(count % 2 == 0); + } + } + /** + * Find the intersection point of an endge with this Surface. + * If there is no intersectionpoint null is returned. + * @param e the edge + * @return the vertex at the intersection + */ + public Vertex intersection(Edge e) { + Plane p = this.plane(); + Vertex v = p.intersection(e); + + if (v != null && this.surrounds(v)) { + return v; + } + return null; + } /** |
From: rimestad <rim...@us...> - 2005-11-18 01:49:52
|
Update of /cvsroot/bprocessor/build/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5416 Modified Files: Changelog Log Message: added some of the changes in M2 Index: Changelog =================================================================== RCS file: /cvsroot/bprocessor/build/doc/Changelog,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Changelog 23 Sep 2005 09:58:16 -0000 1.3 --- Changelog 18 Nov 2005 01:49:44 -0000 1.4 *************** *** 2,5 **** --- 2,26 ---- ========== + 2005/11/18: Release M2 + ---------------------- + GUI: + - Replaced the attribute view + - Added cursors for the different tools + - + + Model: + - far better selection of edges and vertexes + - algorithms for splitting edges and spaces + - + + GL: + - Made a separate tool for rotations, and added rotation about own axis + - Changed the view so that it now stores center and camera postions along with focalwidth to make it + easy to edit the settings in a dialog window. + - Clipping planes + - length input is added for extrusion + - guidence lines + - + 2005/09/23: Release M1 ---------------------- |
From: rimestad <rim...@us...> - 2005-11-18 01:48:49
|
Update of /cvsroot/bprocessor/build/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5061 Modified Files: README Log Message: made it reflect the current version Index: README =================================================================== RCS file: /cvsroot/bprocessor/build/doc/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README 23 Sep 2005 09:57:54 -0000 1.6 --- README 18 Nov 2005 01:48:41 -0000 1.7 *************** *** 29,42 **** Q : Select W : Pencil ! E : Move ! R : Extrude ! UP : Camera foward ! DOWN : Camera back LEFT : Camera left RIGHT : Camera right ! PERIOD : Zoom in ! COMMA : Zoom out DELETE OR BACKSPACE : Delete the selected object. --- 29,43 ---- Q : Select W : Pencil ! M : Move ! E : Extrude ! R : Rotation tool ! UP : Camera up ! DOWN : Camera down LEFT : Camera left RIGHT : Camera right ! Z : Zoom in ! X : Zoom out DELETE OR BACKSPACE : Delete the selected object. *************** *** 52,58 **** BACKSPACE : Delete a digit in the specified length Enter : Make the active edge the specified length and continue the drawing. <-- SELECTION --> ! SHIFT (held down) : ability for miltiple selection Homepage: --- 53,68 ---- BACKSPACE : Delete a digit in the specified length Enter : Make the active edge the specified length and continue the drawing. + It is possible to split lines and spaces. <-- SELECTION --> ! SHIFT (held down) : ability for multiple selection ! ! <-- EXTRUSION --> ! Always start an extrusion there are'nt any modifier keys here. ! ! <-- ROTATION --> ! SHIFT (held down) : roll the camera ! mouse drag (button 1) rotate (works in all tools) ! button 2 drag like arrow keys Homepage: |
From: rimestad <rim...@us...> - 2005-11-18 01:28:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31672/src/net/sourceforge/bprocessor/gl/view Modified Files: View3D.java Log Message: new cursors for drag and rotate along with better rotation and drag, still small bugs when rotating while an surface is selected and zoomfactor different from 1 Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** View3D.java 17 Nov 2005 18:14:00 -0000 1.20 --- View3D.java 18 Nov 2005 01:27:56 -0000 1.21 *************** *** 66,70 **** double aspect = width / height; double near = 1 * getZoomFactor(); ! double far = 200.0 * getZoomFactor(); focalwidth = 60.0; if (aspect < 1.0) { --- 66,70 ---- double aspect = width / height; double near = 1 * getZoomFactor(); ! double far = 1000.0 * getZoomFactor(); focalwidth = 60.0; if (aspect < 1.0) { *************** *** 78,87 **** gl.glLoadIdentity(); ! glu.gluLookAt(camera[0] * getZoomFactor(), ! camera[1] * getZoomFactor(), ! camera[2] * getZoomFactor(), center[0], center[1], center[2], roll[0], roll[1], roll[2]); - //gl.glMultMatrixd(modelMatrix); if (reset) { --- 78,86 ---- gl.glLoadIdentity(); ! glu.gluLookAt(center[0] + (camera[0] - center[0]) * getZoomFactor(), ! center[1] + (camera[1] - center[1]) * getZoomFactor(), ! center[2] + (camera[2] - center[2]) * getZoomFactor(), center[0], center[1], center[2], roll[0], roll[1], roll[2]); if (reset) { *************** *** 124,136 **** public void translateCenter(double [] mv) { if (mv.length == 3) { ! double dx = modelMatrix[0] * mv[0] + modelMatrix[1] * -mv[1] + modelMatrix[2] * mv[2]; ! double dy = modelMatrix[4] * mv[0] + modelMatrix[5] * -mv[1] + modelMatrix[6] * mv[2]; ! double dz = modelMatrix[8] * mv[0] + modelMatrix[9] * -mv[1] + modelMatrix[10] * mv[2]; ! center[0] += dx; ! center[1] += dy; ! center[2] += dz; ! camera[0] += dx; ! camera[1] += dy; ! camera[2] += dz; } else { log.error("[translateViewMatrix] Wrong parameter size"); --- 123,135 ---- public void translateCenter(double [] mv) { if (mv.length == 3) { ! double x = modelMatrix[0] * mv[0] - modelMatrix[1] * mv[1] + modelMatrix[2] * mv[2]; ! double y = modelMatrix[4] * mv[0] - modelMatrix[5] * mv[1] + modelMatrix[6] * mv[2]; ! double z = modelMatrix[8] * mv[0] - modelMatrix[9] * mv[1] + modelMatrix[10] * mv[2]; ! center[0] += x * getZoomFactor(); ! center[1] += y * getZoomFactor(); ! center[2] += z * getZoomFactor(); ! camera[0] += x * getZoomFactor(); ! camera[1] += y * getZoomFactor(); ! camera[2] += z * getZoomFactor(); } else { log.error("[translateViewMatrix] Wrong parameter size"); *************** *** 179,187 **** public void rotate(double angle, double[] c, double x, double y, double z) { double rx, ry, rz; ! double dx = camera[0] - c[0]; ! double dy = camera[1] - c[1]; ! double dz = camera[2] - c[2]; double sinx, cosx, siny, sinz, cosy, cosz; - double pro = x * y * z; sinx = Math.sin(x * angle); --- 178,185 ---- public void rotate(double angle, double[] c, double x, double y, double z) { double rx, ry, rz; ! double dx = (camera[0] - c[0]); ! double dy = (camera[1] - c[1]); ! double dz = (camera[2] - c[2]); double sinx, cosx, siny, sinz, cosy, cosz; sinx = Math.sin(x * angle); *************** *** 225,260 **** public void rollCamera(double angle) { angle /= width; ! double dx = camera[0] - center[0]; ! double dy = camera[1] - center[1]; ! double dz = camera[2] - center[2]; ! double length = Math.sqrt(dx * dx + dy * dy + dz * dz); ! ! double sinx = Math.sin(dx / length * angle); ! double cosx = Math.cos(dx / length * angle); ! double siny = Math.sin(dy / length * angle); ! double cosy = Math.cos(dy / length * angle); ! double sinz = Math.sin(dz / length * angle); ! double cosz = Math.cos(dz / length * angle); ! ! double[] rotx = new double[] {1, 0, 0, ! 0, cosx, sinx, ! 0, -sinx, cosx}; ! double[] roty = new double[] {cosy, 0, -siny, ! 0, 1, 0, ! siny, 0, cosy}; ! double[] rotz = new double[] {cosz, sinz, 0, ! -sinz, cosz, 0, ! 0, 0, 1}; ! ! double[] rot = multMatrix3(rotx, roty); ! rot = multMatrix3(rot, rotz); ! ! double rx = roll[0] * rot[0] + roll[1] * rot[1] + roll[2] * rot[2]; ! double ry = roll[0] * rot[3] + roll[1] * rot[4] + roll[2] * rot[5]; ! double rz = roll[0] * rot[6] + roll[1] * rot[7] + roll[2] * rot[8]; ! ! roll[0] = rx; ! roll[1] = ry; ! roll[2] = rz; } --- 223,227 ---- public void rollCamera(double angle) { angle /= width; ! rotate(angle, center, modelMatrix[2], modelMatrix[6], modelMatrix[10]); } *************** *** 292,298 **** double angle = change / height; if (roll[2] < 0) { ! rotate(-angle, c, 0, 0, -1); } else { ! rotate(-angle, c, 0, 0, 1); } } --- 259,265 ---- double angle = change / height; if (roll[2] < 0) { ! rotate(-angle, c, 0, 0, -1); } else { ! rotate(-angle, c, 0, 0, 1); } } |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31672/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ExtrusionTool.java PencilTool.java RotationTool.java Tool.java ToolFactory.java Log Message: new cursors for drag and rotate along with better rotation and drag, still small bugs when rotating while an surface is selected and zoomfactor different from 1 Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Tool.java 17 Nov 2005 16:58:16 -0000 1.11 --- Tool.java 18 Nov 2005 01:27:56 -0000 1.12 *************** *** 11,14 **** --- 11,15 ---- import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; + import java.awt.event.MouseWheelListener; import java.util.Collection; *************** *** 16,20 **** * The tool interface */ ! public interface Tool extends MouseListener, MouseMotionListener, KeyListener { /** The select tool */ public static final int SELECT_TOOL = 0; --- 17,21 ---- * The tool interface */ ! public interface Tool extends MouseListener, MouseMotionListener, KeyListener, MouseWheelListener { /** The select tool */ public static final int SELECT_TOOL = 0; *************** *** 29,32 **** --- 30,35 ---- /** The Rotation tool */ public static final int ROTATION_TOOL = 5; + /** The prevoius tool (the tool used before this one) */ + public static final int PREVIOUS_TOOL = 6; /** Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ToolFactory.java 17 Nov 2005 16:58:16 -0000 1.13 --- ToolFactory.java 18 Nov 2005 01:27:56 -0000 1.14 *************** *** 52,55 **** --- 52,61 ---- private RotationTool rotation; + /** The previous tool */ + private Tool previousTool; + + /** The curretn tool */ + private Tool currentTool; + /** * Constructor *************** *** 62,65 **** --- 68,79 ---- Cursor pencilcursor = Toolkit.getDefaultToolkit().createCustomCursor(pencilimage, new Point(7, 8), "Pencil"); + url = cl.getResource("Biconrotcam.gif"); + Image rotationImage = Toolkit.getDefaultToolkit().getImage(url); + Cursor rotationCursor = + Toolkit.getDefaultToolkit().createCustomCursor(rotationImage, new Point(7, 8), "Rotation"); + url = cl.getResource("Bicondrag.gif"); + Image dragImage = Toolkit.getDefaultToolkit().getImage(url); + Cursor dragCursor = + Toolkit.getDefaultToolkit().createCustomCursor(dragImage, new Point(7, 8), "Drag"); Toolbar tb = Toolbar.getInstance(); *************** *** 82,86 **** extrusion = new ExtrusionTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); ! rotation = new RotationTool(glv, pencilcursor); Notifier.getInstance().addListener(select); --- 96,100 ---- extrusion = new ExtrusionTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); ! rotation = new RotationTool(glv, rotationCursor, dragCursor); Notifier.getInstance().addListener(select); *************** *** 108,111 **** --- 122,136 ---- /** + * Get the previous tool + * @return The tool + */ + public Tool getPrevious() { + Tool temp = previousTool; + previousTool = currentTool; + currentTool = temp; + return temp; + } + + /** * Get the tool i if it is a legal tool * @param i The tool number *************** *** 113,127 **** --- 138,159 ---- */ public Tool get(int i) { + previousTool = currentTool; if (i == Tool.SELECT_TOOL) { + currentTool = select; return select; } else if (i == Tool.MOVE_TOOL) { + currentTool = move; return move; } else if (i == Tool.EXTRUSION_TOOL) { + currentTool = extrusion; return extrusion; } else if (i == Tool.PENCIL_TOOL) { + currentTool = pencil; return pencil; } else if (i == Tool.CLIP_TOOL) { + currentTool = clipplane; return clipplane; } else if (i == Tool.ROTATION_TOOL) { + currentTool = rotation; return rotation; } else { Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ExtrusionTool.java 17 Nov 2005 18:14:00 -0000 1.27 --- ExtrusionTool.java 18 Nov 2005 01:27:56 -0000 1.28 *************** *** 473,476 **** --- 473,477 ---- } } + super.keyPressed(e); } } Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** PencilTool.java 15 Nov 2005 19:04:10 -0000 1.33 --- PencilTool.java 18 Nov 2005 01:27:56 -0000 1.34 *************** *** 388,391 **** --- 388,394 ---- vertex.setName("current"); current = vertex; + } else { + // just to take an initial bug + current = new Vertex("", 0, 0, 0); } } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AbstractTool.java 17 Nov 2005 16:58:16 -0000 1.27 --- AbstractTool.java 18 Nov 2005 01:27:56 -0000 1.28 *************** *** 17,20 **** --- 17,21 ---- import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; + import java.awt.event.MouseWheelEvent; import java.util.List; *************** *** 33,40 **** /** The mouse position last time the mouse was pressed initializes to (0,0) */ ! private static int[] pressPos = new int[2]; /** The mouse position last time there was a mouse event */ ! private static int[] lastPos = new int[2]; /** The mouse movement in x axis since press */ --- 34,41 ---- /** The mouse position last time the mouse was pressed initializes to (0,0) */ ! protected static int[] pressPos = new int[2]; /** The mouse position last time there was a mouse event */ ! protected static int[] previousPos = new int[2]; /** The mouse movement in x axis since press */ *************** *** 65,70 **** protected Object target; ! /** The cursor associated with this tool */ ! protected Cursor cursor; --- 66,70 ---- protected Object target; ! /** The cursor associated with this tool */ protected Cursor cursor; *************** *** 93,96 **** --- 93,111 ---- /** + * Invoked when the mouse wheel is used + * @param e The mouseWheelEvent + */ + public void mouseWheelMoved(MouseWheelEvent e) { + int rotation = e.getWheelRotation(); + View v = glv.getView(); + if (rotation > 0) { + v.zoom(1.1); + } else { + v.zoom(0.9); + } + glv.repaint(false); + } + + /** * Invoked when a key has been pressed. * @param e The KeyEvent *************** *** 164,176 **** View v = glv.getView(); - if ((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK) { - v.translateCenter(new double[] {(x - lastPos[0]) / (30 * (glv.getView()).getZoomFactor()), - (y - lastPos[1]) / (30 * (glv.getView()).getZoomFactor()), - 0.0}); - } - - lastPos[0] = x; - lastPos[1] = y; dragged(e); glv.repaint(true); } --- 179,186 ---- View v = glv.getView(); dragged(e); + + previousPos[0] = x; + previousPos[1] = y; glv.repaint(true); } *************** *** 187,193 **** dy = y - pressPos[1]; - lastPos[0] = x; - lastPos[1] = y; moved(e); glv.repaint(true); } --- 197,204 ---- dy = y - pressPos[1]; moved(e); + + previousPos[0] = x; + previousPos[1] = y; glv.repaint(true); } *************** *** 223,229 **** dx = 0; dy = 0; ! lastPos[0] = pressPos[0]; ! lastPos[1] = pressPos[1]; ! pressed(e); glv.repaint(true); } --- 234,245 ---- dx = 0; dy = 0; ! previousPos[0] = pressPos[0]; ! previousPos[1] = pressPos[1]; ! if ((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK || ! e.getButton() == MouseEvent.BUTTON2) { ! glv.changeTool(Tool.ROTATION_TOOL); ! } else { ! pressed(e); ! } glv.repaint(true); } *************** *** 235,240 **** public void mouseReleased(MouseEvent e) { int currentButton = e.getButton(); ! ! released(e); glv.repaint(true); } --- 251,260 ---- public void mouseReleased(MouseEvent e) { int currentButton = e.getButton(); ! if ((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK || ! e.getButton() == MouseEvent.BUTTON2) { ! glv.changeTool(Tool.PREVIOUS_TOOL); ! } else { ! released(e); ! } glv.repaint(true); } Index: RotationTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RotationTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RotationTool.java 17 Nov 2005 16:58:16 -0000 1.1 --- RotationTool.java 18 Nov 2005 01:27:56 -0000 1.2 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.view.View; import java.awt.event.ActionListener; *************** *** 43,46 **** --- 44,53 ---- protected int mode = ROTATION; + /** The cursor for rotation */ + private Cursor rotationCursor; + + /** The cursor for drag */ + private Cursor dragCursor; + static { timer = new Timer(40, null); *************** *** 50,58 **** * KeyListener for the GL Canvas * @param glv The 3D canvas ! * @param cursor The Mouse cursor */ ! public RotationTool(GLView glv, Cursor cursor) { ! super(glv, cursor); timer.start(); rotateAction = new CameraMoveTimer(this, glv); } --- 57,68 ---- * KeyListener for the GL Canvas * @param glv The 3D canvas ! * @param cursor1 The Mouse cursor for rotation ! * @param cursor2 The Mouse cursor for drag */ ! public RotationTool(GLView glv, Cursor cursor1, Cursor cursor2) { ! super(glv, cursor1); timer.start(); + rotationCursor = cursor1; + dragCursor = cursor2; rotateAction = new CameraMoveTimer(this, glv); } *************** *** 75,82 **** */ protected void dragged(MouseEvent e) { ! if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { ! mode = ROLL; } else { ! mode = ROTATION; } } --- 85,101 ---- */ protected void dragged(MouseEvent e) { ! View v = glv.getView(); ! if ((e.getModifiersEx() & MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK || ! e.getButton() == MouseEvent.BUTTON2) { ! glv.setCursor(dragCursor); ! v.translateCenter(new double[] {(e.getX() - previousPos[0]) / (30 * v.getZoomFactor()), ! (e.getY() - previousPos[1]) / (30 * v.getZoomFactor()), ! 0.0}); } else { ! if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { ! mode = ROLL; ! } else { ! mode = ROTATION; ! } } } *************** *** 87,96 **** */ protected void pressed(MouseEvent e) { ! if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { ! mode = ROLL; ! } else { ! mode = ROTATION; ! } if (e.getButton() == MouseEvent.BUTTON1) { timer.addActionListener(rotateAction); } --- 106,116 ---- */ protected void pressed(MouseEvent e) { ! glv.setCursor(rotationCursor); if (e.getButton() == MouseEvent.BUTTON1) { + if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { + mode = ROLL; + } else { + mode = ROTATION; + } timer.addActionListener(rotateAction); } |
From: rimestad <rim...@us...> - 2005-11-18 01:28:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31672/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: new cursors for drag and rotate along with better rotation and drag, still small bugs when rotating while an surface is selected and zoomfactor different from 1 Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** GLView.java 7 Nov 2005 07:21:21 -0000 1.22 --- GLView.java 18 Nov 2005 01:27:55 -0000 1.23 *************** *** 87,90 **** --- 87,91 ---- glc.addMouseListener(tool); glc.addMouseMotionListener(tool); + glc.addMouseWheelListener(tool); glc.addKeyListener(tool); glc.addMouseListener(this); *************** *** 112,120 **** * @param mode The new tool */ ! public void changeTool(int mode) { glc.removeMouseListener(tool); glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); ! tool = ToolFactory.getFactory(this).get(mode); if (tool != null) { glc.addMouseListener(tool); --- 113,125 ---- * @param mode The new tool */ ! public void changeTool(int mode) { glc.removeMouseListener(tool); glc.removeMouseMotionListener(tool); glc.removeKeyListener(tool); ! if (mode == Tool.PREVIOUS_TOOL) { ! tool = ToolFactory.getFactory(this).getPrevious(); ! } else { ! tool = ToolFactory.getFactory(this).get(mode); ! } if (tool != null) { glc.addMouseListener(tool); |
From: Michael L. <he...@us...> - 2005-11-17 18:14:08
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20173/src/net/sourceforge/bprocessor/gl/view Modified Files: AbstractView.java View.java View3D.java Log Message: - Changed initial camera position - Changed drawing of grid and coordinatesystem Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** AbstractView.java 17 Nov 2005 16:59:45 -0000 1.57 --- AbstractView.java 17 Nov 2005 18:14:00 -0000 1.58 *************** *** 243,247 **** AbstractView.aspect = AbstractView.width / AbstractView.height; ! gl.glClearColor(0.7f, 0.7f, 0.7f, 0.0f); gl.glViewport(0, 0, (int)width, (int)height); gl.glLineStipple(4, (short)0xAAAA); --- 243,247 ---- AbstractView.aspect = AbstractView.width / AbstractView.height; ! gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f); gl.glViewport(0, 0, (int)width, (int)height); gl.glLineStipple(4, (short)0xAAAA); *************** *** 295,299 **** gl.glLineWidth(1.0f); grid(); ! gl.glLineWidth(2.0f); gl.glEnable(GL.GL_DEPTH_TEST); gl.glDepthFunc(GL.GL_LESS); --- 295,299 ---- gl.glLineWidth(1.0f); grid(); ! gl.glLineWidth(1.0f); gl.glEnable(GL.GL_DEPTH_TEST); gl.glDepthFunc(GL.GL_LESS); *************** *** 620,623 **** --- 620,633 ---- } + /** + * Compare two doubles to see if they are close enough to + * be considered equal + * @param a A value + * @param b A value + * @return Do they compare? + */ + protected boolean cmp(double a, double b) { + return Math.abs(b - a) < 0.0000001; + } /** * Draw all the existing elements *************** *** 719,730 **** gl.glDisable(GL.GL_DEPTH_TEST); Vertex to = null; if (activeEdge != null) { to = activeEdge.getTo(); Vertex from = activeEdge.getFrom(); ! if (from.getY() == to.getY() && from.getZ() == to.getZ()) { gl.glColor3fv(X_AXIS_COLOR); ! } else if (from.getX() == to.getX() && from.getZ() == to.getZ()) { gl.glColor3fv(Y_AXIS_COLOR); ! } else if (from.getX() == to.getX() && from.getY() == to.getY()) { gl.glColor3fv(Z_AXIS_COLOR); } else { --- 729,741 ---- gl.glDisable(GL.GL_DEPTH_TEST); Vertex to = null; + if (activeEdge != null) { to = activeEdge.getTo(); Vertex from = activeEdge.getFrom(); ! if (cmp(from.getY(), to.getY()) && cmp(from.getZ(), to.getZ())) { gl.glColor3fv(X_AXIS_COLOR); ! } else if (cmp(from.getX(), to.getX()) && cmp(from.getZ(), to.getZ())) { gl.glColor3fv(Y_AXIS_COLOR); ! } else if (cmp(from.getX(), to.getX()) && cmp(from.getY(), to.getY())) { gl.glColor3fv(Z_AXIS_COLOR); } else { *************** *** 744,752 **** if (snapVertex != null && to != null) { boolean doDraw = true; ! if (snapVertex.getY() == to.getY() && snapVertex.getZ() == to.getZ()) { gl.glColor3fv(X_AXIS_COLOR); ! } else if (snapVertex.getX() == to.getX() && snapVertex.getZ() == to.getZ()) { gl.glColor3fv(Y_AXIS_COLOR); ! } else if (snapVertex.getX() == to.getX() && snapVertex.getY() == to.getY()) { gl.glColor3fv(Z_AXIS_COLOR); } else { --- 755,763 ---- if (snapVertex != null && to != null) { boolean doDraw = true; ! if (cmp(snapVertex.getY(), to.getY()) && cmp(snapVertex.getZ(), to.getZ())) { gl.glColor3fv(X_AXIS_COLOR); ! } else if (cmp(snapVertex.getX(), to.getX()) && cmp(snapVertex.getZ(), to.getZ())) { gl.glColor3fv(Y_AXIS_COLOR); ! } else if (cmp(snapVertex.getX(), to.getX()) && cmp(snapVertex.getY(), to.getY())) { gl.glColor3fv(Z_AXIS_COLOR); } else { Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** View3D.java 17 Nov 2005 16:59:45 -0000 1.19 --- View3D.java 17 Nov 2005 18:14:00 -0000 1.20 *************** *** 40,46 **** super(glv); center = new double[]{.0, .0, .0}; ! camera = new double[]{25.0, 0.0, 0.0}; roll = new double[]{.0, .0, 1.0}; } /** --- 40,47 ---- super(glv); center = new double[]{.0, .0, .0}; ! camera = new double[]{16.0, -16, 9}; roll = new double[]{.0, .0, 1.0}; } + /** *************** *** 76,79 **** --- 77,81 ---- gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); + glu.gluLookAt(camera[0] * getZoomFactor(), camera[1] * getZoomFactor(), *************** *** 382,392 **** gl.glColor4fv(GRID_COLOR); gl.glBegin(GL.GL_LINES); for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x, -size, -0.01); ! gl.glVertex3d((double) x, size, -0.01); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size, (double) y, -0.01); ! gl.glVertex3d(size, (double) y, -0.01); } gl.glEnd(); --- 384,396 ---- gl.glColor4fv(GRID_COLOR); gl.glBegin(GL.GL_LINES); + size /= 2; + for (int x = -(int)size; x <= (int)size; x++) { ! gl.glVertex3d((double) x * 2, -size * 2, -0.01); ! gl.glVertex3d((double) x * 2, size * 2, -0.01); } for (int y = -(int)size; y <= (int)size; y++) { ! gl.glVertex3d(-size * 2, (double) y * 2, -0.01); ! gl.glVertex3d(size * 2, (double) y * 2, -0.01); } gl.glEnd(); *************** *** 397,410 **** */ protected void coords() { gl.glBegin(GL.GL_LINES); gl.glColor3fv(X_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(10.0, 0.0, 0.0); gl.glColor3fv(Y_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, 10.0, 0.0); gl.glColor3fv(Z_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, 0.0, 10.0); gl.glEnd(); } --- 401,420 ---- */ protected void coords() { + double size = AbstractView.size; + if (aspect > 1) { + size *= aspect; + } else { + size /= aspect; + } gl.glBegin(GL.GL_LINES); gl.glColor3fv(X_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(size, 0.0, 0.0); gl.glColor3fv(Y_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, size, 0.0); gl.glColor3fv(Z_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, 0.0, size); gl.glEnd(); } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** View.java 17 Nov 2005 16:59:45 -0000 1.20 --- View.java 17 Nov 2005 18:14:00 -0000 1.21 *************** *** 41,44 **** --- 41,47 ---- public static final float[] Z_AXIS_COLOR = new float[] {0.1f, 0.1f, 0.8f}; + /** the background color */ + public static final float[] BACKGROUND_COLOR = new float[] {1.0f, 1.0f, 1.0f}; + /** the std line color*/ public static final float[] STD_LINE_COLOR = new float[] {0.1f, 0.1f, 0.1f}; *************** *** 48,55 **** /** Used for the actual drawing line */ ! public static final float[] GRID_COLOR = new float[] {0.85f, 0.85f, 0.85f, 0.8f}; /** Surface color for all not selected surfaces */ ! public static final float[] SURFACE_COLOR = new float[] {0.93f, 0.93f, 0.93f}; /** Front color for surfaces */ --- 51,58 ---- /** Used for the actual drawing line */ ! public static final float[] GRID_COLOR = new float[] {0.80f, 0.80f, 0.80f, 0.8f}; /** Surface color for all not selected surfaces */ ! public static final float[] SURFACE_COLOR = new float[] {1.0f, 1.0f, 1.0f}; /** Front color for surfaces */ |
From: Michael L. <he...@us...> - 2005-11-17 18:14:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20173/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java SelectTool.java Log Message: - Changed initial camera position - Changed drawing of grid and coordinatesystem Index: SelectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SelectTool.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** SelectTool.java 14 Nov 2005 11:20:15 -0000 1.41 --- SelectTool.java 17 Nov 2005 18:14:00 -0000 1.42 *************** *** 338,341 **** --- 338,342 ---- } } + glv.getView().makeTarget(null); } else { super.keyPressed(e); Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ExtrusionTool.java 7 Nov 2005 19:22:19 -0000 1.26 --- ExtrusionTool.java 17 Nov 2005 18:14:00 -0000 1.27 *************** *** 473,477 **** } } - log.info("Number: " + number); } } --- 473,476 ---- |
From: Michael L. <he...@us...> - 2005-11-17 18:10:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19040/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Log Message: Fixed calculation of normals for surface Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Surface.java 15 Nov 2005 18:58:30 -0000 1.45 --- Surface.java 17 Nov 2005 18:10:25 -0000 1.46 *************** *** 751,758 **** if (edges.size() > 1) { Vertex i, j, n, origin; ! Edge e0 = (Edge) edges.get(0); ! Edge e1 = (Edge) edges.get(1); ! return CoordinateSystem.create(e0, e1); } else { return null; --- 751,762 ---- if (edges.size() > 1) { Vertex i, j, n, origin; ! n = normal(); Edge e0 = (Edge) edges.get(0); ! origin = getFirtVertex(); ! i = e0.otherVertex(origin).minus(origin); ! i.scale(1 / i.length()); ! j = i.cross(n); ! j.scale(1 / j.length()); ! return new CoordinateSystem(i, j, n, origin); } else { return null; Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Geometry.java 15 Nov 2005 18:58:30 -0000 1.4 --- Geometry.java 17 Nov 2005 18:10:25 -0000 1.5 *************** *** 28,31 **** --- 28,34 ---- public static Vertex normal(List vertices) { Vertex normal = normal0(vertices); + if (normal == null) { + return null; + } Vertex origin = (Vertex) vertices.get(0); Vertex a = (Vertex) vertices.get(1); *************** *** 141,146 **** } - System.out.println("exterior = " + exterior); - Set siblings = to.getEdges(); siblings.remove(first); --- 144,147 ---- |
From: rimestad <rim...@us...> - 2005-11-17 17:01:38
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23473/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: added a center method Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Edge.java 15 Nov 2005 18:58:30 -0000 1.17 --- Edge.java 17 Nov 2005 17:01:30 -0000 1.18 *************** *** 353,355 **** --- 353,366 ---- to.setZ(dz * res + from.getZ()); } + + /** + * Calculates the center of the edge and returns it + * @return The center point as a double array with x y z + */ + public double[] center() { + double x = (to.getX() - from.getX()) / 2; + double y = (to.getY() - from.getY()) / 2; + double z = (to.getZ() - from.getZ()) / 2; + return new double[]{from.getX() + x, from.getY() + y, from.getZ() + z}; + } } |