bprocessor-commit Mailing List for B-processor (Page 54)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2007-09-23 16:02:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17396/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Progress on new display implementation Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Display.java 22 Sep 2007 17:16:26 -0000 1.1 --- Display.java 23 Sep 2007 16:02:08 -0000 1.2 *************** *** 8,16 **** --- 8,45 ---- package net.sourceforge.bprocessor.gl.view; + import java.util.Collection; + import java.util.HashSet; + import java.util.LinkedList; + import java.util.List; + import java.util.Set; + + import javax.media.opengl.GL; + import javax.media.opengl.GLAutoDrawable; + import javax.media.opengl.glu.GLU; + import javax.media.opengl.glu.GLUtessellator; + import javax.media.opengl.glu.GLUtessellatorCallback; + import javax.media.opengl.glu.GLUtessellatorCallbackAdapter; + + import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Space; + import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.Vertex; + /** * */ public class Display { + private static boolean initialized; private static boolean selecting; + private static GLUtessellator tesselator; + private static GL gl; + private static GLU glu; + + private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; + private static float[] black = new float[] {0.0f, 0.0f, 0.0f}; + /** *************** *** 24,27 **** --- 53,92 ---- /** * + * + */ + public static void initialize() { + if (!initialized) { + glu = new GLU(); + tesselator = glu.gluNewTess(); + GLUtessellatorCallback callback = new TesselatorCallback(); + glu.gluTessCallback(tesselator, GLU.GLU_TESS_BEGIN, callback); + glu.gluTessCallback(tesselator, GLU.GLU_TESS_END, callback); + glu.gluTessCallback(tesselator, GLU.GLU_TESS_VERTEX, callback); + glu.gluTessProperty(tesselator, GLU.GLU_TESS_WINDING_RULE, GLU.GLU_TESS_WINDING_ODD); + initialized = true; + } + } + + private static class TesselatorCallback extends GLUtessellatorCallbackAdapter { + + /** {@inheritDoc} */ + public void begin(int type) { + gl.glBegin(type); + } + + /** {@inheritDoc} */ + public void end() { + gl.glEnd(); + } + + /** {@inheritDoc} */ + public void vertex(Object object) { + Vertex vertex = (Vertex) object; + gl.glVertex3d(vertex.getX(), vertex.getY(), vertex.getZ()); + } + } + + /** + * * @param value selecting */ *************** *** 30,38 **** } /** * */ ! public static void draw() { } } --- 95,244 ---- } + private static void drawSurfaces(Collection<Surface> surfaces) { + gl.glColor3fv(white, 0); + gl.glEnable(GL.GL_POLYGON_OFFSET_FILL); + gl.glPolygonOffset(0.5f, 0.5f); + for (Surface current : surfaces) { + draw(current); + } + gl.glDisable(GL.GL_POLYGON_OFFSET_FILL); + } + + private static void draw(Surface surface) { + glu.gluTessBeginPolygon(tesselator, null); + drawContour(surface); + for (Surface current : surface.getHoles()) { + drawContour(current); + } + glu.gluTessEndPolygon(tesselator); + } + + private static void drawContour(Surface surface) { + List<Vertex> vertices = surface.getVertices(); + if (vertices.size() > 2) { + vertices.add(vertices.get(0)); + glu.gluTessBeginContour(tesselator); + for (Vertex current : vertices) { + glu.gluTessVertex(tesselator, current.values(), 0, current); + } + glu.gluTessEndContour(tesselator); + } + } + + private static void drawEdges(Collection<Edge> edges) { + gl.glColor3fv(black, 0); + for (Edge current : edges) { + draw(current); + } + } + + private static void draw(Edge edge) { + Vertex to = edge.getTo(); + Vertex from = edge.getFrom(); + gl.glBegin(GL.GL_LINE_STRIP); + gl.glVertex3d(to.getX(), to.getY(), to.getZ()); + gl.glVertex3d(from.getX(), from.getY(), from.getZ()); + gl.glEnd(); + } + + private static boolean transparent(Space space) { + return (space.isFunctionalSpace() || space.isTransparent() || !space.getSurfaces().isEmpty()); + } + + private static boolean transparent(Surface surface) { + Space front = surface.getFrontDomain(); + Space back = surface.getBackDomain(); + if (front == back) { + return true; + } + if (transparent(front) && transparent(back)) { + return true; + } + return false; + } + + private static void draw(Space space) { + Project project = Project.getInstance(); + Camera camera = project.getCurrentCamera(); + Set<Geometric> hidden = new HashSet(); + hidden.addAll(camera.getHiddenGeometrics()); + Collection<Space> elements = new LinkedList(); + for (Space current : space.getElements()) { + if (hidden.contains(current)) { + if (!transparent(current)) { + for (Surface surface : current.getEnvelope()) { + Space front = surface.getFrontDomain(); + Space back = surface.getBackDomain(); + if (front == back) { + hidden.add(surface); + } else { + Space other = null; + if (front == current) { + other = back; + } else { + other = front; + } + if (hidden.contains(other) || transparent(other)) { + hidden.add(surface); + } + } + } + } + } else { + elements.add(current); + } + } + + Collection<Surface> surfaces = new LinkedList(); + + Set<Edge> mark = new HashSet(); + Set<Edge> visible = new HashSet(); + for (Surface current : space.getSurfaces()) { + mark.addAll(current.getEdges()); + if (!hidden.contains(current)) { + if (!transparent(current)) { + surfaces.add(current); + visible.addAll(current.getEdges()); + for (Surface hole : current.getHoles()) { + visible.addAll(hole.getEdges()); + } + } + } + } + + Collection<Edge> edges = new LinkedList(); + for (Edge current : space.getEdges()) { + if (mark.contains(current)) { + if (visible.contains(current)) { + edges.add(current); + } + } else { + edges.add(current); + } + } + + + + + + + gl.glEnable(GL.GL_DEPTH_TEST); + drawSurfaces(surfaces); + drawEdges(edges); + for (Space current : elements) { + draw(current); + } + } + /** * + * @param gld GLAutoDrawable */ ! public static void draw(GLAutoDrawable gld) { ! gl = gld.getGL(); ! initialize(); ! Space world = Project.getInstance().world(); + draw(world); } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.231 retrieving revision 1.232 diff -C2 -d -r1.231 -r1.232 *** View.java 22 Sep 2007 17:16:25 -0000 1.231 --- View.java 23 Sep 2007 16:02:08 -0000 1.232 *************** *** 691,695 **** Display.selecting(hitdetection); initNames(gl); ! Display.draw(); Display.selecting(false); } else { --- 691,695 ---- Display.selecting(hitdetection); initNames(gl); ! Display.draw(gld); Display.selecting(false); } else { |
From: Michael L. <he...@us...> - 2007-09-22 17:16:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25415/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Added Files: Display.java Log Message: Started new display implementation --- NEW FILE: Display.java --- //--------------------------------------------------------------------------------- // $Id: Display.java,v 1.1 2007/09/22 17:16:26 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.view; /** * */ public class Display { private static boolean selecting; /** * * @return selecting */ public static boolean selecting() { return selecting; } /** * * @param value selecting */ public static void selecting(boolean value) { selecting = value; } /** * */ public static void draw() { } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.230 retrieving revision 1.231 diff -C2 -d -r1.230 -r1.231 *** View.java 21 Sep 2007 12:02:29 -0000 1.230 --- View.java 22 Sep 2007 17:16:25 -0000 1.231 *************** *** 83,86 **** --- 83,87 ---- private static final boolean DISP = false; + private static final boolean UNIFIED_DISPLAY = false; /** OBJECTS flag */ *************** *** 687,691 **** gl.glLineWidth(1.0f); ! drawAll(hitdetection); gl.glEnable(GL.GL_DEPTH_TEST); --- 688,699 ---- gl.glLineWidth(1.0f); ! if (UNIFIED_DISPLAY) { ! Display.selecting(hitdetection); ! initNames(gl); ! Display.draw(); ! Display.selecting(false); ! } else { ! drawAll(hitdetection); ! } gl.glEnable(GL.GL_DEPTH_TEST); |
From: rimestad <rim...@us...> - 2007-09-22 13:55:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7257/src/net/sourceforge/bprocessor/gl/tool Modified Files: ControlledExtrudeTool.java Log Message: Continued implementation on controlled extrude Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ControlledExtrudeTool.java 7 Sep 2007 13:21:10 -0000 1.1 --- ControlledExtrudeTool.java 22 Sep 2007 13:55:25 -0000 1.2 *************** *** 16,23 **** --- 16,28 ---- import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.Intersection; + import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Direction; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 37,40 **** --- 42,46 ---- private HashSet<Surface> extrusion; private Map<Vertex, Direction> v2dir; + private Surface pressedSurface; /** *************** *** 52,56 **** @Override public void onVertex() { ! //TODO finish the extrusion } --- 58,67 ---- @Override public void onVertex() { ! if (pressedSurface != null) { ! Vertex normal = pressedSurface.normal(); ! Plane p = new Plane(normal.getX(), normal.getY(), normal.getZ(), current.vertex()); ! extrudeTo(p); ! finishTool(); ! } } *************** *** 58,89 **** @Override protected void moved(MouseEvent e) { ! if (extrusion.isEmpty()) { ! findTarget(e, View.HANDLES); glv.getView().makeTarget(target); } else { ! current = findIntersection(e); ! makeTarget(current); } } /** {@inheritDoc} */ @Override protected void pressed(MouseEvent e) { ! if (target != null && target instanceof Surface) { ! Surface workingSurface = (Surface)target; ! Surface top = workingSurface.extrusionControlled(1, extrusion, v2dir); ! if (top != null) { ! extrusion.add(top); ! } ! log.debug(extrusion.size()); ! ExtrusionTool.insert(Project.getInstance().getActiveSpace(), extrusion); } } /** {@inheritDoc} */ @Override public void prepare() { super.prepare(); ! Selection.primary().clear(); } --- 69,171 ---- @Override protected void moved(MouseEvent e) { ! findTarget(e, View.HANDLES); ! if (pressedSurface == null) { glv.getView().makeTarget(target); } else { ! double x = e.getX(); ! double y = View.getHeight() - e.getY(); ! ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! Transformation transformation = glv.getView().transformation(); ! ray = transformation.unProject(ray); ! Vertex hit = lockingPlane.intersection(ray); ! Vertex normal = pressedSurface.normal(); ! current = new Intersection(hit.minus(start.vertex()).projectOnto(normal).add(start.vertex()), ! Intersection.PLANE_INTERSECTION, lockingPlane); ! Plane p = new Plane(normal.getX(), normal.getY(), normal.getZ(), current.vertex()); ! if (v2dir.isEmpty()) { ! Vertex delta = current.vertex().minus(start.vertex()); ! double length = delta.length(); ! if (delta.angle(normal) > Math.PI / 2) { ! length *= -1; ! } ! Surface topSurface = pressedSurface.extrusionControlled(length, extrusion, v2dir); ! log.info("Elements in extrusion " + extrusion.size()); ! if (topSurface != pressedSurface) { ! extrusion.add(topSurface); ! } ! excluded(extrusion); ! excluded.add(pressedSurface); ! pressedSurface.getOwner().addProtected(extrusion); ! feedback(extrusion); ! ! } ! extrudeTo(p); } } + private void extrudeTo(Plane p) { + for (Vertex v : v2dir.keySet()) { + Direction d = v2dir.get(v); + Vertex intersection = p.intersection(d.getVertex(), d.getDirection(), true); + d.getVertex().set(intersection); + } + updateLength(); + } + /** {@inheritDoc} */ @Override protected void pressed(MouseEvent e) { ! current = findIntersection(e); ! if (v2dir.isEmpty() && target != null && target instanceof Surface) { ! start = current; ! pressedSurface = (Surface)target; ! lock = true; ! Transformation transformation = glv.getView().transformation(); ! double x = e.getX(); ! double y = View.getHeight() - e.getY(); ! ! Vertex near = new Vertex(x, y, 0.0); ! Vertex far = new Vertex(x, y, 1.0); ! Edge ray = new Edge(near, far); ! ray = transformation.unProject(ray); ! Vertex dir = ray.getDirection(); ! dir.normalize(); ! Vertex normal = pressedSurface.normal(); ! Vertex tmp = dir.cross(normal); ! dir = tmp.cross(normal); ! lockingPlane = new Plane(dir.getX(), dir.getY(), dir.getZ(), ! pressedSurface.intersection(ray)); ! } else { ! finishTool(); } } + private void finishTool() { + Space owner = pressedSurface.getOwner(); + owner.removeProtected(extrusion); + ExtrusionTool.insert(owner, extrusion); + Project.getInstance().checkpoint(); + cleanUp(); + } + /** {@inheritDoc} */ @Override public void prepare() { super.prepare(); ! if (!getSelection().isEmpty()) { ! Selection.primary().clear(); ! } ! } ! ! /** {@inheritDoc} */ ! @Override ! public void escape() { ! Vertex n = pressedSurface.normal(); ! extrudeTo(new Plane(n.getX(), n.getY(), n.getZ(), start.vertex())); ! pressedSurface.getOwner().removeProtected(extrusion); ! cleanUp(); } *************** *** 94,97 **** --- 176,180 ---- extrusion.clear(); v2dir.clear(); + pressedSurface = null; } |
From: rimestad <rim...@us...> - 2007-09-22 13:54:50
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6841/src/net/sourceforge/bprocessor/gl Modified Files: GLView.java Log Message: Tried to make tooltip apear above gl view Index: GLView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/GLView.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** GLView.java 31 Aug 2007 12:47:48 -0000 1.63 --- GLView.java 22 Sep 2007 13:54:50 -0000 1.64 *************** *** 43,46 **** --- 43,47 ---- import javax.swing.JPopupMenu; import javax.swing.SwingUtilities; + import javax.swing.ToolTipManager; import org.apache.log4j.Logger; *************** *** 79,82 **** --- 80,84 ---- glCap.setDoubleBuffered(true); glCap.setHardwareAccelerated(true); + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); glc = new GLCanvas(glCap); log.info("Using JOGL version official"); |
From: rimestad <rim...@us...> - 2007-09-22 13:54:25
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6807/src/net/sourceforge/bprocessor/gui/attrview Modified Files: StringAttribute.java Log Message: Changed round method to avoid loss of value in large ints Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** StringAttribute.java 14 Sep 2007 11:32:38 -0000 1.15 --- StringAttribute.java 22 Sep 2007 13:54:26 -0000 1.16 *************** *** 100,105 **** */ protected double round(double value) { ! int i = (int) (value * 100000000); ! return ((double) i) / 100000.0; } --- 100,105 ---- */ protected double round(double value) { ! long i = (long) (value * 1000000); ! return ((double) i) / 1000.0; } |
From: rimestad <rim...@us...> - 2007-09-22 13:53:47
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6384/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Implemented alert method in gui Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** GUI.java 14 Sep 2007 11:32:38 -0000 1.73 --- GUI.java 22 Sep 2007 13:53:43 -0000 1.74 *************** *** 49,52 **** --- 49,53 ---- import java.awt.BorderLayout; + import java.awt.Color; import java.awt.Component; import java.awt.Dimension; *************** *** 56,59 **** --- 57,62 ---- import java.awt.event.ActionListener; import java.awt.event.KeyEvent; + import java.awt.event.MouseAdapter; + import java.awt.event.MouseEvent; import java.io.File; *************** *** 62,73 **** --- 65,81 ---- import javax.swing.JMenu; import javax.swing.JMenuItem; + import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; + import javax.swing.JTextArea; + import javax.swing.JWindow; import javax.swing.ToolTipManager; import javax.swing.JPopupMenu; import javax.swing.KeyStroke; + import javax.swing.border.LineBorder; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; + import javax.swing.Timer; import org.apache.log4j.Logger; *************** *** 113,116 **** --- 121,132 ---- private JTabbedPane tree; + private JWindow alertWindow; + + private JPanel alertPanel; + + private JTextArea textArea; + + private Timer alertTimer; + /** * Constructor for GUI *************** *** 545,550 **** */ public void alert(String string) { ! // TODO Implement at gui alert instead ! log.info("GUI notice: " + string); } --- 561,640 ---- */ public void alert(String string) { ! if (alertWindow == null) { ! alertWindow = new JWindow(this); ! alertWindow.setAlwaysOnTop(true); ! alertWindow.setFocusable(false); ! } ! if (alertPanel == null) { ! alertPanel = new JPanel(); ! alertPanel.setBorder(new LineBorder(new Color(1, 1, 1), 1)); ! alertPanel.setBackground(Color.ORANGE); ! alertPanel.setFocusable(false); ! alertWindow.add(alertPanel); ! } ! if (textArea == null) { ! textArea = new JTextArea(); ! textArea.setOpaque(false); ! textArea.setEditable(false); ! textArea.setHighlighter(null); ! textArea.setFocusable(false); ! textArea.setWrapStyleWord(true); ! textArea.setLineWrap(true); ! alertPanel.add(textArea); ! textArea.addMouseListener(new MouseAdapter() { ! @Override ! public void mouseEntered(MouseEvent e) { ! log.info("Mouse entered"); ! alertTimer.stop(); ! } ! ! @Override ! public void mouseExited(MouseEvent e) { ! alertTimer.start(); ! log.info("Mouse exited"); ! } ! }); ! } ! textArea.setText(string); ! alertPanel.setMaximumSize(new Dimension(300, 400)); ! alertWindow.pack(); ! // to Make sure the window size is correct pack have to be called twice ! alertWindow.pack(); ! ! java.awt.Point where = getFocusOwner().getLocationOnScreen(); ! if (where == null) { ! where = getMousePosition(); ! if (where == null) { ! where = getInstance().getLocation(); ! } else { ! where.x += 5; ! where.y += 5; ! } ! } else { ! where.y += getFocusOwner().getSize().height; ! } ! ! Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); ! int remainingWidth = screenSize.width - where.x; ! int remainingHeight = screenSize.height - where.y; ! if (remainingWidth < alertPanel.getPreferredSize().width) { ! remainingWidth = alertPanel.getPreferredSize().width - remainingWidth; ! where.x = where.x - remainingWidth; ! } ! if (remainingHeight < alertPanel.getPreferredSize().height) { ! remainingHeight = alertPanel.getPreferredSize().height - remainingHeight; ! where.y = where.y - remainingHeight; ! } ! alertWindow.setLocation(where); ! alertWindow.setVisible(true); ! if (alertTimer == null) { ! alertTimer = new Timer(2500, new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! alertWindow.setVisible(false); ! }; ! }); ! alertTimer.setRepeats(false); ! } ! alertTimer.restart(); } |
From: rimestad <rim...@us...> - 2007-09-22 13:51:51
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5514/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Changed controlledExtrusion method so that it does not add created geom to model Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.175 retrieving revision 1.176 diff -C2 -d -r1.175 -r1.176 *** Surface.java 19 Sep 2007 09:28:22 -0000 1.175 --- Surface.java 22 Sep 2007 13:51:44 -0000 1.176 *************** *** 935,939 **** vmap[i] = v[i].copy(); v2dir.put(v[i], new Direction(vmap[i], normal)); - getOwner().add(vmap[i]); } } else { --- 935,938 ---- *************** *** 964,968 **** } else { topmap[i] = new Edge(vmap[i], vmap[(i + 1) % n]); - getOwner().add(topmap[i]); } e2e.put(e[i], topmap[i]); --- 963,966 ---- *************** *** 1020,1024 **** } v2e.put(v[i], sidemap[i]); - getOwner().add(sidemap[i]); } } --- 1018,1021 ---- *************** *** 1044,1048 **** facemap[i] = new Surface(newEdges); e2s.put(b, facemap[i]); - getOwner().add(facemap[i]); sides.add(facemap[i]); } --- 1041,1044 ---- *************** *** 1056,1060 **** } top = new Surface(newEdges); - getOwner().add(top); } else { top = this; --- 1052,1055 ---- |
From: Michael L. <he...@us...> - 2007-09-21 12:32:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31094/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Camera switching is back Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** GenericTreeView.java 21 Sep 2007 11:14:48 -0000 1.110 --- GenericTreeView.java 21 Sep 2007 12:32:30 -0000 1.111 *************** *** 1370,1373 **** --- 1370,1376 ---- model.nodeChanged(node); } + } else if (object instanceof Camera) { + Camera camera = (Camera) object; + Project.getInstance().setCurrentCamera(camera); } } |
From: Michael L. <he...@us...> - 2007-09-21 12:02:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18177/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Preliminary implementation of hidden geometry Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** View.java 19 Sep 2007 12:29:39 -0000 1.229 --- View.java 21 Sep 2007 12:02:29 -0000 1.230 *************** *** 374,378 **** /** Contains invisible entities during drawing */ ! private Set invisibles; /** Contains highlighted entities during drawing */ --- 374,378 ---- /** Contains invisible entities during drawing */ ! private Set<Surface> invisibles; /** Contains highlighted entities during drawing */ *************** *** 962,965 **** --- 962,974 ---- } { + Camera camera = Project.getInstance().getCurrentCamera(); + for (Geometric geometric : camera.getHiddenGeometrics()) { + if (geometric instanceof Space) { + Space space = (Space) geometric; + invisibles.addAll(space.getEnvelope()); + } + } + } + { Iterator iter = highligts.iterator(); while (iter.hasNext()) { *************** *** 1189,1193 **** } if (doDrawEdges) { ! drawGeneralEdges(space.getEdges(), !active); } --- 1198,1217 ---- } if (doDrawEdges) { ! Set<Edge> mark = new HashSet(); ! for (Surface current : invisibles) { ! mark.addAll(current.getEdges()); ! } ! for (Surface current : space.getSurfaces()) { ! if (!hidden(current)) { ! mark.removeAll(current.getEdges()); ! } ! } ! List<Edge> edges = new LinkedList(); ! for (Edge current : space.getEdges()) { ! if (!mark.contains(current)) { ! edges.add(current); ! } ! } ! drawGeneralEdges(edges, !active); } *************** *** 1633,1636 **** --- 1657,1672 ---- } + private boolean hidden(Space space) { + Camera camera = Project.getInstance().getCurrentCamera(); + return camera.getHiddenGeometrics().contains(space); + } + + private boolean hidden(Surface surface) { + if (hidden(surface.getBackDomain()) || hidden(surface.getFrontDomain())) { + return true; + } + return false; + } + /** * |
From: Michael L. <he...@us...> - 2007-09-21 11:14:47
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30448/src/gfx Modified Files: Beyeclosed.gif Beyeopen.gif Log Message: Eye interaction changed Index: Beyeopen.gif =================================================================== RCS file: /cvsroot/bprocessor/gui/src/gfx/Beyeopen.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsJPe62r and /tmp/cvsTYeyrW differ Index: Beyeclosed.gif =================================================================== RCS file: /cvsroot/bprocessor/gui/src/gfx/Beyeclosed.gif,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsJjeEIA and /tmp/cvsVi3ig5 differ |
From: Michael L. <he...@us...> - 2007-09-21 11:14:47
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30448/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Eye interaction changed Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** GenericTreeView.java 21 Sep 2007 08:23:18 -0000 1.109 --- GenericTreeView.java 21 Sep 2007 11:14:48 -0000 1.110 *************** *** 9,13 **** --- 9,15 ---- import java.awt.Component; import java.awt.Dimension; + import java.awt.Event; import java.awt.Graphics; + import java.awt.Rectangle; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; *************** *** 185,200 **** */ public void paint(Graphics g) { ! super.paint(g); ! Dimension d = getPreferredSize(); ! // will be icon later if (shown == 0) { ! // hidden ! hiddenicon.paintIcon(this, g, d.width - 16, 0); } else if (shown == 1) { ! // shown ! shownicon.paintIcon(this, g, d.width - 16, 0); ! } else { ! // not defined } } --- 187,199 ---- */ public void paint(Graphics g) { ! Dimension size = getSize(); if (shown == 0) { ! hiddenicon.paintIcon(this, g, 0, (size.height - 16) / 2); ! g.translate(18, 0); } else if (shown == 1) { ! shownicon.paintIcon(this, g, 0, (size.height - 16) / 2); ! g.translate(18, 0); } + super.paint(g); } *************** *** 1334,1402 **** /** * Mouse released ! * @param e MouseEvent */ ! public void mouseReleased(MouseEvent e) { ! react(e); } /** * Mouse released ! * @param e MouseEvent */ ! public void mousePressed(MouseEvent e) { ! react(e); } ! ! /** ! * Do the thing ! * @param e the MouseEvent ! */ ! private void react(MouseEvent e) { ! TreePath path = getPathForLocation(e.getX(), e.getY()); if (path != null) { ! if (e.isPopupTrigger()) { ! if (getSelectionCount() < 2) { setSelectionPath(path); - } else { - boolean wereFound = false; - for (TreePath treepath : getSelectionPaths()) { - if (treepath.equals(path)) { - wereFound = true; - } - } - if (!wereFound) { - setSelectionPath(path); - } - } - Object object = path.getLastPathComponent(); - if (object instanceof GenericNode) { - GenericNode node = (GenericNode) object; JPopupMenu menu = node.menu(); if (menu != null) { ! menu.show(GenericTreeView.this, e.getX(), e.getY()); ! } ! } ! } else { ! Object object = path.getLastPathComponent(); ! if (e.getClickCount() > 1) { ! if (object instanceof GenericNode) { ! Object o = ((GenericNode) object).getUserObject(); ! if (o instanceof Geometric) { ! Geometric g = (Geometric) o; ! Camera c = Project.getInstance().getCurrentCamera(); ! if (c.getHiddenGeometrics().contains(g)) { ! c.removeHiddenGeometric(g); ! } else { ! c.addHiddenGeometric(g); ! } ! model.nodeChanged((GenericNode)object); ! } } } else { ! if (object instanceof GenericNode) { ! GenericNode node = (GenericNode) object; ! Object target = node.getUserObject(); ! if (target instanceof Camera) { ! Project.getInstance().setCurrentCamera((Camera) target); } } --- 1333,1373 ---- /** * Mouse released ! * @param event MouseEvent */ ! public void mouseReleased(MouseEvent event) { ! handle(event); } /** * Mouse released ! * @param event MouseEvent */ ! public void mousePressed(MouseEvent event) { ! handle(event); } ! ! private void handle(MouseEvent event) { ! TreePath path = getPathForLocation(event.getX(), event.getY()); if (path != null) { ! Object selected = path.getLastPathComponent(); ! if (selected instanceof GenericNode) { ! GenericNode node = (GenericNode) selected; ! if (event.isPopupTrigger()) { setSelectionPath(path); JPopupMenu menu = node.menu(); if (menu != null) { ! menu.show(GenericTreeView.this, event.getX(), event.getY()); } } else { ! if (event.getID() == Event.MOUSE_DOWN) { ! Object object = node.getUserObject(); ! if (object instanceof Geometric) { ! Geometric geometric = (Geometric) object; ! Rectangle bounds = getPathBounds(path); ! int x = event.getX() - bounds.x; ! if (x <= 16) { ! toggle(geometric); ! model.nodeChanged(node); ! } } } *************** *** 1405,1408 **** --- 1376,1388 ---- } } + + private void toggle(Geometric geometric) { + Camera camera = Project.getInstance().getCurrentCamera(); + if (camera.getHiddenGeometrics().contains(geometric)) { + camera.removeHiddenGeometric(geometric); + } else { + camera.addHiddenGeometric(geometric); + } + } } |
From: Michael L. <he...@us...> - 2007-09-21 08:23:22
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25799/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Cosmetic changes Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** GenericTreeView.java 20 Sep 2007 14:41:46 -0000 1.108 --- GenericTreeView.java 21 Sep 2007 08:23:18 -0000 1.109 *************** *** 70,73 **** --- 70,75 ---- private static final long serialVersionUID = 1L; + private static final boolean TAG = false; + /** Functionalspace icon */ protected static ImageIcon functionalspaceicon; *************** *** 143,146 **** --- 145,153 ---- private boolean changing; + /** + * + */ + private boolean synchronize; + /** The object udpated on a update call */ private Object updated = null; *************** *** 265,268 **** --- 272,276 ---- isChanged = false; changing = false; + synchronize = false; setCellRenderer(new Renderer()); } *************** *** 325,337 **** if (!changing) { changing = true; ! List<TreePath> paths = new LinkedList(); ! for (Object current : Selection.primary()) { ! TreePath path = search(root, current); ! if (path != null) { ! paths.add(path); } } - TreePath[] array = paths.toArray(new TreePath[0]); - setSelectionPaths(array); changing = false; } --- 333,349 ---- if (!changing) { changing = true; ! if (synchronize) { ! List<TreePath> paths = new LinkedList(); ! for (Object current : Selection.primary()) { ! TreePath path = search(root, current); ! if (path != null) { ! paths.add(path); ! } } + TreePath[] array = paths.toArray(new TreePath[0]); + setSelectionPaths(array); + } else { + setSelectionPaths(new TreePath[0]); } changing = false; } *************** *** 738,745 **** public String toString() { String nid = ((Space)userObject).getDisplayName(); ! if (GUI.getInstance().isClosed(((Space)userObject))) { ! nid += " (C)"; ! } else { ! nid += " (O)"; } return nid; --- 750,759 ---- public String toString() { String nid = ((Space)userObject).getDisplayName(); ! if (TAG) { ! if (GUI.getInstance().isClosed(((Space)userObject))) { ! nid += " (C)"; ! } else { ! nid += " (O)"; ! } } return nid; |
From: Michael L. <he...@us...> - 2007-09-21 08:23:11
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25789/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Cosmetic changes Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.172 retrieving revision 1.173 diff -C2 -d -r1.172 -r1.173 *** Space.java 14 Sep 2007 10:57:43 -0000 1.172 --- Space.java 21 Sep 2007 08:23:12 -0000 1.173 *************** *** 1499,1505 **** String lvl = getLevelName(); if (getClassification() != null) { ! return " - " + lvl + " - " + getClassification().toString(); } else { ! return " - " + lvl; } } else { --- 1499,1505 ---- String lvl = getLevelName(); if (getClassification() != null) { ! return lvl + " - " + getClassification().toString(); } else { ! return lvl; } } else { *************** *** 1521,1525 **** return name; } else { ! return name + " " + lvl; } } --- 1521,1529 ---- return name; } else { ! if (name.length() > 0) { ! return name + " - " + lvl; ! } else { ! return lvl; ! } } } |
From: Michael L. <he...@us...> - 2007-09-20 14:41:52
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20144/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: more synchronisity Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** GenericTreeView.java 20 Sep 2007 09:39:32 -0000 1.107 --- GenericTreeView.java 20 Sep 2007 14:41:46 -0000 1.108 *************** *** 325,335 **** if (!changing) { changing = true; ! if (Selection.primary().size() == 1) { ! Object selected = Selection.primary().iterator().next(); ! TreePath path = search(root, selected); if (path != null) { ! setSelectionPath(path); } } changing = false; } --- 325,337 ---- if (!changing) { changing = true; ! List<TreePath> paths = new LinkedList(); ! for (Object current : Selection.primary()) { ! TreePath path = search(root, current); if (path != null) { ! paths.add(path); } } + TreePath[] array = paths.toArray(new TreePath[0]); + setSelectionPaths(array); changing = false; } |
From: Michael L. <he...@us...> - 2007-09-20 09:39:34
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24487/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: D-View selection synchronizes with primary selection Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** GenericTreeView.java 19 Sep 2007 14:14:07 -0000 1.106 --- GenericTreeView.java 20 Sep 2007 09:39:32 -0000 1.107 *************** *** 138,141 **** --- 138,146 ---- private boolean isChanged; + /** + * Flag saying that we are changing + */ + private boolean changing; + /** The object udpated on a update call */ private Object updated = null; *************** *** 259,262 **** --- 264,268 ---- model.nodeStructureChanged(root); isChanged = false; + changing = false; setCellRenderer(new Renderer()); } *************** *** 267,285 **** */ public void synchronizeRight() { ! TreePath[] paths = getSelectionPaths(); ! LinkedList<Geometric> select = new LinkedList<Geometric>(); ! for (int i = 0; i < paths.length; i++) { ! Object o = paths[i].getLastPathComponent(); ! if (o instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) o; ! Object target = node.getUserObject(); ! if (target instanceof Geometric) { ! select.add((Geometric)target); ! } else if (target instanceof Parametric) { ! AttributeView.instance().display(target); } } } - Selection.primary().set(select); } --- 273,337 ---- */ public void synchronizeRight() { ! if (!changing) { ! changing = true; ! TreePath[] paths = getSelectionPaths(); ! if (paths != null) { ! LinkedList<Geometric> select = new LinkedList<Geometric>(); ! for (int i = 0; i < paths.length; i++) { ! Object o = paths[i].getLastPathComponent(); ! if (o instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) o; ! Object target = node.getUserObject(); ! if (target instanceof Geometric) { ! select.add((Geometric)target); ! } else if (target instanceof Parametric) { ! AttributeView.instance().display(target); ! } ! } } + Selection.primary().set(select); } + changing = false; + } + } + + /** + * + * @param node node + * @param object object + * @return path + */ + public TreePath search(DefaultMutableTreeNode node, Object object) { + if (node.getUserObject() == object) { + return new TreePath(node.getPath()); + } else { + Enumeration enumerator = node.children(); + while (enumerator.hasMoreElements()) { + DefaultMutableTreeNode current = (DefaultMutableTreeNode) enumerator.nextElement(); + TreePath result = search(current, object); + if (result != null) { + return result; + } + } + } + return null; + } + + /** + * + * + */ + public void synchronizeLeft() { + if (!changing) { + changing = true; + if (Selection.primary().size() == 1) { + Object selected = Selection.primary().iterator().next(); + TreePath path = search(root, selected); + if (path != null) { + setSelectionPath(path); + } + } + changing = false; } } *************** *** 314,318 **** --- 366,372 ---- public void flush() { if (isChanged) { + changing = true; update(); + changing = false; isChanged = false; } *************** *** 1246,1249 **** --- 1300,1314 ---- } } + + /** + * + * + */ + protected class SelectionObserver implements Observer { + /** {@inheritDoc} */ + public void update(Object entity) { + synchronizeLeft(); + } + } /** Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** SpaceTreeView.java 10 Apr 2007 13:24:45 -0000 1.24 --- SpaceTreeView.java 20 Sep 2007 09:39:32 -0000 1.25 *************** *** 10,14 **** --- 10,16 ---- import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.SelectionObserver; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; /** *************** *** 36,39 **** --- 38,43 ---- root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); model.nodeStructureChanged(root); + + Selection.primary().addObserver(new SelectionObserver()); } |
From: Michael L. <he...@us...> - 2007-09-20 07:45:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11863/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java ExtrusionTool.java AbstractPencil.java Log Message: Selection clearance Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** OffsetTool.java 3 Sep 2007 16:00:13 -0000 1.16 --- OffsetTool.java 20 Sep 2007 07:45:06 -0000 1.17 *************** *** 232,235 **** --- 232,244 ---- } + + /** + * {@inheritDoc} + */ + public void prepare() { + super.prepare(); + cleanSelection(); + } + /** * {@inheritDoc} Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ExtrusionTool.java 7 Sep 2007 13:21:10 -0000 1.67 --- ExtrusionTool.java 20 Sep 2007 07:45:06 -0000 1.68 *************** *** 330,334 **** if (start == null) { - if (!Selection.primary().isEmpty()) { extrudeEdges = new ArrayList<Edge>(); --- 330,333 ---- *************** *** 477,480 **** --- 476,486 ---- * {@inheritDoc} */ + public void prepare() { + cleanSelection(); + } + + /** + * {@inheritDoc} + */ public void cleanUp() { glv.getView().removeTempVertex(to); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** AbstractPencil.java 5 Sep 2007 11:18:50 -0000 1.95 --- AbstractPencil.java 20 Sep 2007 07:45:06 -0000 1.96 *************** *** 36,39 **** --- 36,40 ---- import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; *************** *** 428,431 **** --- 429,455 ---- /** + * See if selection is a connected contour of edges + * otherwise clear. + * + */ + protected void cleanSelection() { + Selection selection = Selection.primary(); + clean: + if (selection.size() > 1) { + List<Edge> edges = new LinkedList(); + for (Geometric current : selection) { + if (current instanceof Edge) { + edges.add((Edge) current); + } else { + selection.clear(); + break clean; + } + } + } else { + selection.clear(); + } + } + + /** * Update constructors based on start, current and incident. * @return Constructors |
From: Michael L. <he...@us...> - 2007-09-19 20:57:45
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14326/src/net/sourceforge/bprocessor/gl/tool Modified Files: Protractor.java ToolFactory.java ArcTool.java RectTool.java Log Message: Selection clearance Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** RectTool.java 7 Sep 2007 13:21:10 -0000 1.20 --- RectTool.java 19 Sep 2007 20:57:47 -0000 1.21 *************** *** 19,22 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Vertex; *************** *** 176,179 **** --- 177,187 ---- /** + * {@inheritDoc} + */ + public void prepare() { + Selection.primary().clear(); + } + + /** * do clean up */ Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** ToolFactory.java 7 Sep 2007 13:21:10 -0000 1.84 --- ToolFactory.java 19 Sep 2007 20:57:47 -0000 1.85 *************** *** 213,217 **** this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); pencilBut.setMnemonic(KeyEvent.VK_W); ! this.registerTool(Tool.ALT_PENCIL_TOOL, penciltool, "Biconpentool2.gif", "Pencil"); JToggleButton rect = this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Rectangle"); --- 213,217 ---- this.registerTool(Tool.PENCIL_TOOL, pencil, "Biconpentool.gif", "Pencil"); pencilBut.setMnemonic(KeyEvent.VK_W); ! //this.registerTool(Tool.ALT_PENCIL_TOOL, penciltool, "Biconpentool2.gif", "Pencil"); JToggleButton rect = this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Rectangle"); *************** *** 219,228 **** JToggleButton arcb = this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); arcb.setMnemonic(KeyEvent.VK_Z); - JToggleButton offBut = - this.registerTool(Tool.OFFSET_TOOL, offset, "Biconoffset.gif", "Offset"); JToggleButton eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); eraserBut.setMnemonic(KeyEvent.VK_A); tb.addSeparator(3); JToggleButton extrudeBut = registerTool(Tool.EXTRUSION_TOOL, extrude, "Biconextrudetool.gif", "Extrude"); --- 219,228 ---- JToggleButton arcb = this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); arcb.setMnemonic(KeyEvent.VK_Z); JToggleButton eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); eraserBut.setMnemonic(KeyEvent.VK_A); tb.addSeparator(3); + JToggleButton offBut = + this.registerTool(Tool.OFFSET_TOOL, offset, "Biconoffset.gif", "Offset"); JToggleButton extrudeBut = registerTool(Tool.EXTRUSION_TOOL, extrude, "Biconextrudetool.gif", "Extrude"); Index: ArcTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ArcTool.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ArcTool.java 20 Jun 2007 13:17:55 -0000 1.17 --- ArcTool.java 19 Sep 2007 20:57:47 -0000 1.18 *************** *** 19,22 **** --- 19,23 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Vertex; *************** *** 230,233 **** --- 231,241 ---- } } + + /** + * {@inheritDoc} + */ + public void prepare() { + Selection.primary().clear(); + } /** Index: Protractor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Protractor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Protractor.java 7 May 2007 13:29:48 -0000 1.6 --- Protractor.java 19 Sep 2007 20:57:47 -0000 1.7 *************** *** 16,19 **** --- 16,20 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Vertex; *************** *** 105,107 **** --- 106,115 ---- protected void released(MouseEvent e) { } + + /** + * {@inheritDoc} + */ + public void prepare() { + Selection.primary().clear(); + } } |
From: Michael L. <he...@us...> - 2007-09-19 14:45:16
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22937/src/net/sourceforge/bprocessor/gui/treeview Modified Files: CameraTreeView.java Log Message: removed unused code Index: CameraTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/CameraTreeView.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CameraTreeView.java 7 Nov 2006 10:51:28 -0000 1.11 --- CameraTreeView.java 19 Sep 2007 14:45:18 -0000 1.12 *************** *** 34,38 **** setShowsRootHandles(true); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); ! this.addTreeSelectionListener(new SelectionListener()); update(Project.getInstance().getCameras(), root); model.nodeStructureChanged(root); --- 34,38 ---- setShowsRootHandles(true); getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); ! //this.addTreeSelectionListener(new SelectionListener()); update(Project.getInstance().getCameras(), root); model.nodeStructureChanged(root); |
From: Michael L. <he...@us...> - 2007-09-19 14:14:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10227/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Refactored selection mechanism Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** GenericTreeView.java 19 Sep 2007 12:43:33 -0000 1.105 --- GenericTreeView.java 19 Sep 2007 14:14:07 -0000 1.106 *************** *** 142,167 **** /** - * Listener for the eye - */ - public class EyeListener extends MouseAdapter { - /** - * {@inheritDoc} - */ - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - log.info("Eye were clicked"); - } - - /** - * {@inheritDoc} - */ - @Override - public void mousePressed(MouseEvent e) { - super.mousePressed(e); - log.info("Clicked on " + e.getSource()); - } - } - - /** * Renderer */ --- 142,145 ---- *************** *** 252,255 **** --- 230,234 ---- } } + /** *************** *** 284,287 **** --- 263,288 ---- /** + * Synchronize the selection in graphical view to match + * selection in this GenericTreeView. + */ + public void synchronizeRight() { + TreePath[] paths = getSelectionPaths(); + LinkedList<Geometric> select = new LinkedList<Geometric>(); + for (int i = 0; i < paths.length; i++) { + Object o = paths[i].getLastPathComponent(); + if (o instanceof DefaultMutableTreeNode) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) o; + Object target = node.getUserObject(); + if (target instanceof Geometric) { + select.add((Geometric)target); + } else if (target instanceof Parametric) { + AttributeView.instance().display(target); + } + } + } + Selection.primary().set(select); + } + + /** * Tell the TreeView we are changed */ *************** *** 1241,1281 **** */ public void valueChanged(TreeSelectionEvent event) { ! if (event.isAddedPath()) { ! GenericTreeView gtv = (GenericTreeView)event.getSource(); ! TreePath[] paths = gtv.getSelectionPaths(); ! LinkedList<Geometric> select = new LinkedList<Geometric>(); ! for (int i = 0; i < paths.length; i++) { ! Object o = paths[i].getLastPathComponent(); ! if (o instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) o; ! Object target = node.getUserObject(); ! if (target instanceof Geometric) { ! select.add((Geometric)target); ! } else if (target instanceof Parametric) { ! AttributeView.instance().display(target); ! } else { ! log.error("Reached empty branch in "); ! } ! ! } else { ! log.error("It were not a defaultMutatableNode"); ! } ! } ! Selection.primary().set(select); ! } else { ! TreePath[] path = event.getPaths(); ! LinkedList<Geometric> deselect = new LinkedList<Geometric>(); ! for (int i = 0; i < path.length; i++) { ! Object object = path[i].getLastPathComponent(); ! if (object instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) object; ! Object target = node.getUserObject(); ! if (target instanceof Geometric) { ! deselect.add((Geometric)target); ! } ! } ! } ! Selection.primary().removeAll(deselect); ! } } } --- 1242,1247 ---- */ public void valueChanged(TreeSelectionEvent event) { ! GenericTreeView gtv = (GenericTreeView)event.getSource(); ! gtv.synchronizeRight(); } } |
From: Michael L. <he...@us...> - 2007-09-19 12:43:31
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4962/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: removed unused code Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** GenericTreeView.java 19 Sep 2007 12:07:08 -0000 1.104 --- GenericTreeView.java 19 Sep 2007 12:43:33 -0000 1.105 *************** *** 319,346 **** /** - * add target to selection - * @param target Object - */ - public void select(Object target) { - if (target instanceof Geometric) { - Selection.primary().add((Geometric)target); - } else { - AttributeView.instance().display(target); - } - } - - /** - * deselect target - * @param target Object - */ - public void deselect(Object target) { - if (target instanceof Geometric) { - Selection.primary().remove(target); - } else { - AttributeView.instance().display(null); - } - } - - /** * GenericNode */ --- 319,322 ---- |
From: Michael L. <he...@us...> - 2007-09-19 12:29:41
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31745/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Change back of selection strategy Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.228 retrieving revision 1.229 diff -C2 -d -r1.228 -r1.229 *** View.java 3 Sep 2007 11:22:32 -0000 1.228 --- View.java 19 Sep 2007 12:29:39 -0000 1.229 *************** *** 2014,2040 **** Collection<Surface> surfaces = new HashSet<Surface>(); Collection<Space> elements = space.getElements(); for (Space element : elements) { if (element.isUnion()) { surfaces.addAll(element.getSurfaces()); - } else { - if (element == space.getEmpty()) { - for (Surface sur : element.getEnvelope()) { - if (sur.getFrontDomain() == element && sur.getBackDomain() == element) { - surfaces.add(sur); - } - } - } else { - if (element.getSurfaces().isEmpty()) { - surfaces.addAll(element.getEnvelope()); - } else { - surfaces.addAll(element.getSurfaces()); - } - } } } surfaces.addAll(tempSurfaces); - Collection<Edge> edges = new HashSet<Edge>(); edges.addAll(space.getEdges()); --- 2014,2028 ---- Collection<Surface> surfaces = new HashSet<Surface>(); + + surfaces.addAll(space.getSurfaces()); + Collection<Space> elements = space.getElements(); for (Space element : elements) { if (element.isUnion()) { surfaces.addAll(element.getSurfaces()); } } surfaces.addAll(tempSurfaces); Collection<Edge> edges = new HashSet<Edge>(); edges.addAll(space.getEdges()); |
From: Michael L. <he...@us...> - 2007-09-19 12:07:12
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23163/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: remove some random comments Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** GenericTreeView.java 31 Aug 2007 09:45:23 -0000 1.103 --- GenericTreeView.java 19 Sep 2007 12:07:08 -0000 1.104 *************** *** 69,75 **** /** UID */ private static final long serialVersionUID = 1L; - - /** Show numbers of elements in display-string of container-nodes */ - private static final boolean SHOW_COUNTERS = false; /** Functionalspace icon */ --- 69,72 ---- *************** *** 284,293 **** isChanged = false; setCellRenderer(new Renderer()); - //changed(); } /** * Tell the TreeView we are changed - * */ public void changed() { --- 281,288 ---- *************** *** 581,591 **** super(space); if (space.isInstance()) { - // Instances makeInstanceContent(space); } else if (space.isContainer()) { - // Containers both unions and soforth makeContainerContent(space); } else { - // NON-container spaces Set surfaces = space.getEnvelope(); add(new SurfaceContainer("Surfaces", surfaces)); --- 576,583 ---- *************** *** 656,660 **** Space space = (Space)userObject; if (space.isContainer()) { - //the old object were a container as well ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ((GenericNode)getChildAt(1)).update(s.getElements()); --- 648,651 ---- *************** *** 701,705 **** } } - // Update the user object userObject = s; if (updated == s) { --- 692,695 ---- *************** *** 733,750 **** return functionalspaceicon; } - } - - // /** - // * Context menu for this SpaceNode - // * @return the menu - // */ - // public JPopupMenu menu() { - // JPopupMenu pop = PopupMenu.makeSelectionMenu(); - // if (pop == null) { - // pop = PopupMenu.getSpaceMenu((Space)this.getUserObject()); - // } - // return pop; - // } } --- 723,727 ---- *************** *** 936,943 **** public ElementContainer(String name, Collection elements) { super(name, elements); - Iterator iter = elements.iterator(); - if (iter.hasNext()) { - Space s = (Space)iter.next(); - } insertChildren(elements, true); } --- 913,916 ---- *************** *** 1271,1275 **** */ public void insertChildren(Collection elem) { - //insert int[] ins = new int[elem.size()]; int i = 0; --- 1244,1247 ---- *************** *** 1391,1398 **** Camera c = Project.getInstance().getCurrentCamera(); if (c.getHiddenGeometrics().contains(g)) { - //show the thing c.removeHiddenGeometric(g); } else { - //hide it c.addHiddenGeometric(g); } --- 1363,1368 ---- |
From: Michael L. <he...@us...> - 2007-09-19 11:58:05
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19193/src/net/sourceforge/bprocessor/gui/treeview Modified Files: TreeView.java Log Message: Removed Comment Index: TreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/TreeView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TreeView.java 26 Sep 2006 09:50:55 -0000 1.4 --- TreeView.java 19 Sep 2007 11:57:59 -0000 1.5 *************** *** 25,29 **** public TreeView() { super(); - //getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setEditable(false); Font font = new Font("Sans-serif", Font.PLAIN, 12); --- 25,28 ---- |
From: rimestad <rim...@us...> - 2007-09-19 09:30:00
|
Update of /cvsroot/bprocessor/bprocessor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25388 Modified Files: Classification.xml Log Message: Made energy calc work, made some minor tests which seems to work Index: Classification.xml =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/Classification.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Classification.xml 23 Jul 2007 13:58:03 -0000 1.2 --- Classification.xml 19 Sep 2007 09:29:58 -0000 1.3 *************** *** 1,429 **** <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <DBK xmlns="classificationNS"> ! <XMLClassification id="-1" typeId="-1" name="Constructional"> ! <XMLClassification id="-100" typeId="1189" name="Terræn"> ! <XMLClassification id="01" typeId="599" name="Jordprofil"> ! <XMLClassification id="01" typeId="-1" name="Udgravninger"/> ! <XMLClassification id="02" typeId="486" name="Fyldtyper"/> ! <XMLClassification id="03" typeId="1090" name="Sænkninger"/> ! <XMLClassification id="04" typeId="538" name="Hævninger"/> ! <XMLClassification id="05" typeId="403" name="Dræn"/> [...19731 lines suppressed...] <key>uvalue</key> --- 29787,29791 ---- </attributes> </XMLSpecificType> ! <XMLSpecificType index="8" id="1043" name="Trafiklys"> <attributes xmlns=""> <key>uvalue</key> *************** *** 29807,29811 **** </attributes> </XMLSpecificType> ! <XMLSpecificType name="Klokker" id="1044" index="9"> <attributes xmlns=""> <key>uvalue</key> --- 29807,29811 ---- </attributes> </XMLSpecificType> ! <XMLSpecificType index="9" id="1044" name="Klokker"> <attributes xmlns=""> <key>uvalue</key> |
From: rimestad <rim...@us...> - 2007-09-19 09:28:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24957/src/net/sourceforge/bprocessor/model Modified Files: Surface.java EnergyCalc.java Log Message: Made energy calc work, made some minor tests which seems to work Index: EnergyCalc.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/EnergyCalc.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** EnergyCalc.java 13 Aug 2007 11:41:25 -0000 1.11 --- EnergyCalc.java 19 Sep 2007 09:28:22 -0000 1.12 *************** *** 74,78 **** Attribute a = classification.getParameter("uvalue"); if (a != null && a.getValue() != null) { ! loss = (Double)classification.getParameter("uvalue").getValue() * current.getArea(); } else { log.warn("uvalue for " + classification + " through " + current + " were't there"); --- 74,78 ---- Attribute a = classification.getParameter("uvalue"); if (a != null && a.getValue() != null) { ! loss = (Double)classification.getParameter("uvalue").getValue() * 1000 * current.getArea(); } else { log.warn("uvalue for " + classification + " through " + current + " were't there"); Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** Surface.java 7 Sep 2007 13:21:14 -0000 1.174 --- Surface.java 19 Sep 2007 09:28:22 -0000 1.175 *************** *** 1409,1414 **** firstx = thisx; firsty = thisy; - prevx = thisx; - prevy = thisy; first = false; } else { --- 1409,1412 ---- |