bprocessor-commit Mailing List for B-processor (Page 65)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
| 2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
| 2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
| 2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
| 2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
| 2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: rimestad <rim...@us...> - 2007-05-09 08:57:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19231/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: by mistake made nets invisible Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** View.java 9 May 2007 08:33:27 -0000 1.208 --- View.java 9 May 2007 08:57:19 -0000 1.209 *************** *** 624,630 **** } if (attributes.getDrawVertices()) { ! gl.glPointSize(10.0f); } else { ! gl.glPointSize(1.0f); } } --- 624,630 ---- } if (attributes.getDrawVertices()) { ! gl.glDisable(GL.GL_DEPTH_TEST); } else { ! gl.glEnable(GL.GL_DEPTH_TEST); } } *************** *** 1165,1169 **** while (iter.hasNext()) { Space current = (Space) iter.next(); ! if (!(current instanceof Net)) { drawSpace(current, active, selected); } --- 1165,1169 ---- while (iter.hasNext()) { Space current = (Space) iter.next(); ! if (!(current instanceof Net) || Project.getInstance().getActiveSpace() == current) { drawSpace(current, active, selected); } |
|
From: Michael L. <he...@us...> - 2007-05-09 08:33:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10841/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: A little progress on final move Improved handling of ignored geometry in hitdetection: Cannot click through a surface Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FinalMoveTool.java 8 May 2007 13:24:04 -0000 1.1 --- FinalMoveTool.java 9 May 2007 08:33:27 -0000 1.2 *************** *** 10,15 **** --- 10,22 ---- import java.awt.Cursor; import java.awt.event.MouseEvent; + import java.util.Collection; + import java.util.LinkedList; import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Vertex; /** *************** *** 18,21 **** --- 25,32 ---- public class FinalMoveTool extends AbstractPencil { + private Collection<Geometric> geometrics; + private Collection<Vertex> vertices; + + /** * @param glv GLView *************** *** 27,30 **** --- 38,62 ---- } + private void updateFeedback() { + if (geometrics == null) { + if (!Selection.primary().isEmpty()) { + if (current != null) { + makeTarget(current); + updateConstructors(); + } + } + } else { + if (current != null) { + Edge edge = new Edge(start.vertex(), current.vertex()); + edge.setStrippled(true); + Collection feedback = new LinkedList(); + feedback.add(edge); + feedback(feedback); + makeTarget(current); + updateConstructors(); + } + } + } + /** {@inheritDoc} */ @Override *************** *** 33,42 **** } ! /** {@inheritDoc} */ @Override protected void moved(MouseEvent e) { ! // TODO Auto-generated method stub ! } --- 65,87 ---- } ! /** {@inheritDoc} */ @Override protected void moved(MouseEvent e) { ! if (geometrics == null) { ! if (Selection.primary().isEmpty()) { ! findTarget(e, View.HANDLES); ! glv.getView().makeTarget(target); ! } else { ! current = findIntersection(e); ! if (current != null) { ! current = current.copy(); ! updateFeedback(); ! } ! } ! } else { ! current = findIntersection(e); ! updateFeedback(); ! } } *************** *** 44,50 **** @Override protected void pressed(MouseEvent e) { ! // TODO Auto-generated method stub ! } } --- 89,113 ---- @Override protected void pressed(MouseEvent e) { ! if (geometrics == null) { ! geometrics = new LinkedList(); ! if (Selection.primary().isEmpty()) { ! geometrics.add((Geometric) target); ! } else { ! geometrics.addAll(Selection.primary()); ! } ! current = findIntersection(e); ! start = current.copy(); ! updateFeedback(); ! } else { ! cleanUp(); ! } } + /** + * {@inheritDoc} + */ + public void cleanUp() { + super.cleanUp(); + geometrics = null; + } } |
|
From: Michael L. <he...@us...> - 2007-05-09 08:33:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10841/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: A little progress on final move Improved handling of ignored geometry in hitdetection: Cannot click through a surface Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** View.java 8 May 2007 08:26:15 -0000 1.207 --- View.java 9 May 2007 08:33:27 -0000 1.208 *************** *** 2477,2481 **** Object current = getName(id); ! if (!unWantedEntities.contains(current)) { if (current instanceof Surface) { if (near < nearestSurface) { --- 2477,2481 ---- Object current = getName(id); ! if ((current instanceof Surface) || !unWantedEntities.contains(current)) { if (current instanceof Surface) { if (near < nearestSurface) { *************** *** 2525,2528 **** --- 2525,2531 ---- } + + + if (surface != null) { // Test vertex and edge against surface *************** *** 2544,2548 **** } ! if (edge != null && vertex != null) { --- 2547,2555 ---- } ! if (surface != null) { ! if (unWantedEntities.contains(surface)) { ! surface = null; ! } ! } if (edge != null && vertex != null) { |
|
From: Michael L. <he...@us...> - 2007-05-08 13:24:11
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2211/src/gfx Added Files: Bmovetool.gif Log Message: New move tool Ð not yet implemented --- NEW FILE: Bmovetool.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Michael L. <he...@us...> - 2007-05-08 13:24:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2211/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java ToolFactory.java Added Files: FinalMoveTool.java Log Message: New move tool Ð not yet implemented Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** ToolFactory.java 22 Mar 2007 11:47:06 -0000 1.79 --- ToolFactory.java 8 May 2007 13:24:04 -0000 1.80 *************** *** 121,124 **** --- 121,125 ---- /** The tool for moving alternatively */ private AltMoveTool altMoveTool; + private FinalMoveTool finalMoveTool; /** The tool for moving edges alternatively */ *************** *** 217,220 **** --- 218,222 ---- focusTool = new FocusTool(glv, null); altMoveTool = new AltMoveTool(glv, pencilcursor); + finalMoveTool = new FinalMoveTool(glv, pencilcursor); edgeMoveTool = new EdgeMoveTool(glv, pencilcursor); *************** *** 242,245 **** --- 244,248 ---- registerTool(Tool.ALT_MOVE_TOOL, altMoveTool, "Biconmovetool.gif", "Alternative Moving"); registerTool(Tool.EDGE_MOVE_TOOL, edgeMoveTool, "Biconmovetool.gif", "Edge moving"); + registerTool(Tool.FINAL_MOVE_TOOL, finalMoveTool, "Bmovetool.gif", "Final Move"); rotationBut = this.registerTool(Tool.ROTATION_TOOL, rotation, "Biconrotaxe.gif", "Rotate"); tb.addSeparator(3); --- NEW FILE: FinalMoveTool.java --- //--------------------------------------------------------------------------------- // $Id: FinalMoveTool.java,v 1.1 2007/05/08 13:24:04 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.tool; import java.awt.Cursor; import java.awt.event.MouseEvent; import net.sourceforge.bprocessor.gl.GLView; /** * */ public class FinalMoveTool extends AbstractPencil { /** * @param glv GLView * @param cursor Cursor */ public FinalMoveTool(GLView glv, Cursor cursor) { super(glv, cursor); // TODO Auto-generated constructor stub } /** {@inheritDoc} */ @Override public void onVertex() { // TODO Auto-generated method stub } /** {@inheritDoc} */ @Override protected void moved(MouseEvent e) { // TODO Auto-generated method stub } /** {@inheritDoc} */ @Override protected void pressed(MouseEvent e) { // TODO Auto-generated method stub } } Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Tool.java 22 Mar 2007 11:47:06 -0000 1.31 --- Tool.java 8 May 2007 13:24:04 -0000 1.32 *************** *** 68,71 **** --- 68,73 ---- /** the tool for alternative moving of edges */ public static final int EDGE_MOVE_TOOL = 23; + /** the final tool to move them all */ + public static final int FINAL_MOVE_TOOL = 24; /** |
|
From: rimestad <rim...@us...> - 2007-05-08 12:35:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16189/src/net/sourceforge/bprocessor/model Modified Files: Attribute.java Surface.java Parametric.java Project.java Log Message: removed extra update calls in classes extending both parametic and Entity since the gui call change on these elements, there need to be added a checkpoint somewhere. Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Attribute.java 16 Apr 2007 15:55:22 -0000 1.19 --- Attribute.java 8 May 2007 12:35:38 -0000 1.20 *************** *** 198,202 **** current.update(); } - Project.getInstance().changed(this); } --- 198,201 ---- Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.158 retrieving revision 1.159 diff -C2 -d -r1.158 -r1.159 *** Surface.java 7 May 2007 15:43:58 -0000 1.158 --- Surface.java 8 May 2007 12:35:38 -0000 1.159 *************** *** 1737,1741 **** } } - changed(); } --- 1737,1740 ---- Index: Parametric.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Parametric.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Parametric.java 14 Apr 2007 15:00:47 -0000 1.4 --- Parametric.java 8 May 2007 12:35:38 -0000 1.5 *************** *** 16,19 **** --- 16,21 ---- /** * Set the attributes of the object to the values in the list + * DO NOT CALL CHANGE ON ITSELF THE GUI DOES THAT + * @see {net.sourceforge.bprocessor.GUI.attrview.GenericPanel} * @param attributes The attributes to set */ Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** Project.java 8 May 2007 11:08:11 -0000 1.122 --- Project.java 8 May 2007 12:35:38 -0000 1.123 *************** *** 282,285 **** --- 282,286 ---- */ public void changed(Object entity) { + log.debug("-------Changed(" + entity + ")----------"); // FIXME: temporary hack. There should be better handling of the observers List allObservers = new LinkedList(observers); *************** *** 619,622 **** --- 620,624 ---- } currentState = Persistence.externalize(); + log.debug("--------CheckPoint--------"); } |
|
From: rimestad <rim...@us...> - 2007-05-08 12:34:06
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15924/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java ClassificationTextAttribute.java Log Message: forgot ClassificationNode in generictreeview, so moved that one as well... Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GenericPanel.java 19 Mar 2007 13:03:25 -0000 1.36 --- GenericPanel.java 8 May 2007 12:34:06 -0000 1.37 *************** *** 244,247 **** --- 244,249 ---- obj.setAttributes(attributes); ((Entity)obj).changed(); + } else if (obj instanceof Camera) { + Project.getInstance().changed((Camera)obj); } } Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ClassificationTextAttribute.java 8 May 2007 11:08:18 -0000 1.7 --- ClassificationTextAttribute.java 8 May 2007 12:34:06 -0000 1.8 *************** *** 35,38 **** --- 35,40 ---- import javax.swing.text.PlainDocument; + import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Classification; *************** *** 44,48 **** public class ClassificationTextAttribute extends GenericAttribute implements ActionListener, MouseListener, KeyListener { ! /** The listeners */ private List listeners; --- 46,52 ---- public class ClassificationTextAttribute extends GenericAttribute implements ActionListener, MouseListener, KeyListener { ! /** The logger */ ! private static Logger log = Logger.getLogger(ClassificationTextAttribute.class); ! /** The listeners */ private List listeners; *************** *** 335,347 **** attribute.setClassification(entered); } else { ! Classification newclas; if (((Classification) attribute.getValue()).getType() == 0) { ! Classification egne = Project.getInstance().getClassification("-99", 0); newclas = new Classification("-1", editor.getText(), egne, 0); - egne.addChild(newclas); } else { ! Classification egne = Project.getInstance().getClassification("-99", 1); newclas = new Classification("-1", editor.getText(), egne, 1); egne.addChild(newclas); } --- 339,354 ---- attribute.setClassification(entered); } else { ! Classification newclas, egne; if (((Classification) attribute.getValue()).getType() == 0) { ! egne = Project.getInstance().getClassification("-99", 0); newclas = new Classification("-1", editor.getText(), egne, 0); } else { ! egne = Project.getInstance().getClassification("-99", 1); newclas = new Classification("-1", editor.getText(), egne, 1); + } + if (egne != null && newclas != null) { egne.addChild(newclas); + } else { + log.warn("Tried to create classification in " + egne + " as " + newclas); } |
|
From: rimestad <rim...@us...> - 2007-05-08 12:34:06
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15924/src/net/sourceforge/bprocessor/gui/treeview Modified Files: DBKTreeView.java GenericTreeView.java Log Message: forgot ClassificationNode in generictreeview, so moved that one as well... Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** GenericTreeView.java 8 May 2007 11:08:18 -0000 1.98 --- GenericTreeView.java 8 May 2007 12:34:06 -0000 1.99 *************** *** 42,46 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; - import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; --- 42,45 ---- *************** *** 866,889 **** /** - * ClassificationNode - */ - public class ClassificationNode extends EntityNode { - /** - * Constructor for ClassificationNode - * @param clas The classification - */ - public ClassificationNode(Classification clas) { - super(clas); - if (!clas.getChildren().isEmpty()) { - Iterator it = clas.getChildren().iterator(); - while (it.hasNext()) { - add(new ClassificationNode((Classification) it.next())); - } - } - } - - } - - /** * ModellorNode */ --- 865,868 ---- Index: DBKTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/DBKTreeView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DBKTreeView.java 8 May 2007 11:08:18 -0000 1.3 --- DBKTreeView.java 8 May 2007 12:34:06 -0000 1.4 *************** *** 44,48 **** } - /** * ClassificationContainer --- 44,47 ---- *************** *** 60,67 **** } - /** {@inheritDoc} */ - public EntityNode nodeFor(Object entity) { - return new ClassificationNode((Classification) entity); - } /** * Return icon --- 59,62 ---- |
|
From: rimestad <rim...@us...> - 2007-05-08 12:32:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15347/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: fixed indent checkstyle problem Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** AbstractTool.java 8 May 2007 11:13:13 -0000 1.119 --- AbstractTool.java 8 May 2007 12:32:06 -0000 1.120 *************** *** 348,353 **** } else { if (e.getWhen() > pressedTime + MIN_DRAG_TIME_MS) { ! dragged(e); ! } } } --- 348,353 ---- } else { if (e.getWhen() > pressedTime + MIN_DRAG_TIME_MS) { ! dragged(e); ! } } } |
|
From: rimestad <rim...@us...> - 2007-05-08 12:32:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15248/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: fixed indent checkstyle problem Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Camera.java 8 May 2007 11:11:02 -0000 1.41 --- Camera.java 8 May 2007 12:32:00 -0000 1.42 *************** *** 475,488 **** for (Geometric g : c) { if (g instanceof Space) { ! if (((Space)g).getLevel() == Space.PROJECT_LEVEL) { ! allVertices.addAll(Geometry.collect(((Space)g).getSurfaces())); ! } else { ! allVertices.addAll(Geometry.collect(((Space)g).getEnvelope())); ! } } else { allVertices.addAll(g.collect()); } } ! if (!allVertices.isEmpty()) { //Computing center and radius of the minimal bounding sphere --- 475,488 ---- for (Geometric g : c) { if (g instanceof Space) { ! if (((Space)g).getLevel() == Space.PROJECT_LEVEL) { ! allVertices.addAll(Geometry.collect(((Space)g).getSurfaces())); ! } else { ! allVertices.addAll(Geometry.collect(((Space)g).getEnvelope())); ! } } else { allVertices.addAll(g.collect()); } } ! if (!allVertices.isEmpty()) { //Computing center and radius of the minimal bounding sphere |
|
From: rimestad <rim...@us...> - 2007-05-08 11:51:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16885/src/net/sourceforge/bprocessor/model Modified Files: Entity.java Classification.java Project.java Log Message: refactored DBKtree containers out of genericTreeView to make sorting of nodes based on entitys only be on entitys and get rid of casting in the wild... made some cahanges so that the DBKtree are in deed updated on changes as well. There are still a error when adding own classifacations several times, but I think the error are in persistence not in the tree Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Classification.java 7 May 2007 15:40:59 -0000 1.13 --- Classification.java 8 May 2007 11:08:11 -0000 1.14 *************** *** 81,85 **** setName(name); setType(type); ! setId(new String("-1")); setProdukt(""); } --- 81,85 ---- setName(name); setType(type); ! setId("-1"); setProdukt(""); } *************** *** 91,95 **** public Classification(int type) { setName("Classification"); ! setId(new String("0")); setType(type); setProdukt(""); --- 91,95 ---- public Classification(int type) { setName("Classification"); ! setId("0"); setType(type); setProdukt(""); *************** *** 193,197 **** } else { ! while (!par.getName().equalsIgnoreCase("Classification")) { fullId = par.getId() + "." + fullId; par = par.getParent(); --- 193,197 ---- } else { ! while (par != null) { fullId = par.getId() + "." + fullId; par = par.getParent(); Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Entity.java 23 Apr 2007 14:48:38 -0000 1.17 --- Entity.java 8 May 2007 11:08:11 -0000 1.18 *************** *** 67,75 **** * @param entities List of entities to be sorted */ ! public static void sort(List< ? > entities) { ! final Comparator<Object> comparator = new Comparator<Object>() { ! public int compare(Object s1, Object s2) { ! Entity ent1 = (Entity) s1; ! Entity ent2 = (Entity) s2; Long id1 = ent1.getId(); Long id2 = ent2.getId(); --- 67,73 ---- * @param entities List of entities to be sorted */ ! public static void sort(List<? extends Entity> entities) { ! final Comparator<Entity> comparator = new Comparator<Entity>() { ! public int compare(Entity ent1, Entity ent2) { Long id1 = ent1.getId(); Long id2 = ent2.getId(); Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** Project.java 23 Apr 2007 14:50:13 -0000 1.121 --- Project.java 8 May 2007 11:08:11 -0000 1.122 *************** *** 59,66 **** /** The classification */ ! private Classification constructionClas = new Classification(0); /** The classification */ ! private Classification functionalClas = new Classification(1); /** The classification */ --- 59,66 ---- /** The classification */ ! private Classification constructionClas = new Classification("Constructional", 0); /** The classification */ ! private Classification functionalClas = new Classification("Functional", 1); /** The classification */ *************** *** 139,146 **** redoStack = new Stack(); copyBuffer = new LinkedList(); ! currentCamera = new Camera("(Current)", ! new double[]{6, 3, 2}, ! new double[]{7, -12, 16}, ! new double[]{0, 0, 1}, Camera.PERSPECTIVE); observers = new LinkedList(); staticObservers = new LinkedList(); --- 139,143 ---- redoStack = new Stack(); copyBuffer = new LinkedList(); ! resetCam(); observers = new LinkedList(); staticObservers = new LinkedList(); *************** *** 176,179 **** --- 173,186 ---- makeClean(); } + + /** + * + */ + public void resetCam() { + currentCamera = new Camera("(Current)", + new double[]{6, 3, 2}, + new double[]{7, -12, 16}, + new double[]{0, 0, 1}, Camera.PERSPECTIVE); + } /** *************** *** 861,865 **** bf = new BufferedReader( new InputStreamReader(new FileInputStream("construction2.txt"), "ISO-8859-1")); ! clas = new Classification(0); parent = new Classification(0); last = new Classification(0); --- 868,872 ---- bf = new BufferedReader( new InputStreamReader(new FileInputStream("construction2.txt"), "ISO-8859-1")); ! clas = new Classification("Constructional", 0); parent = new Classification(0); last = new Classification(0); *************** *** 867,871 **** bf = new BufferedReader( new InputStreamReader(new FileInputStream("functionals.txt"), "ISO-8859-1")); ! clas = new Classification(1); parent = new Classification(1); last = new Classification(1); --- 874,878 ---- bf = new BufferedReader( new InputStreamReader(new FileInputStream("functionals.txt"), "ISO-8859-1")); ! clas = new Classification("Functional", 1); parent = new Classification(1); last = new Classification(1); |
|
From: rimestad <rim...@us...> - 2007-05-08 11:26:12
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16922/src/net/sourceforge/bprocessor/gui/treeview Modified Files: DBKTreeView.java GenericTreeView.java Log Message: refactored DBKtree containers out of genericTreeView to make sorting of nodes based on entitys only be on entitys and get rid of casting in the wild... made some cahanges so that the DBKtree are in deed updated on changes as well. There are still a error when adding own classifacations several times, but I think the error are in persistence not in the tree Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** GenericTreeView.java 7 May 2007 15:40:09 -0000 1.97 --- GenericTreeView.java 8 May 2007 11:08:18 -0000 1.98 *************** *** 410,414 **** * @param label The label for the container node */ ! public ContainerNode(Object label, Collection object) { super(label); this.content = object; --- 410,414 ---- * @param label The label for the container node */ ! public ContainerNode(Object label, Collection< ? extends Entity> object) { super(label); this.content = object; *************** *** 472,478 **** if (object instanceof Collection) { content = (Collection) object; ! Set<Entity> elements = new HashSet(); elements.addAll(content); ! Set<GenericNode> children = new HashSet(); Enumeration enumeration = this.children(); while (enumeration.hasMoreElements()) { --- 472,478 ---- if (object instanceof Collection) { content = (Collection) object; ! Set<Entity> elements = new HashSet<Entity>(); elements.addAll(content); ! Set<GenericNode> children = new HashSet<GenericNode>(); Enumeration enumeration = this.children(); while (enumeration.hasMoreElements()) { *************** *** 502,507 **** * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection entities, boolean sort) { ! LinkedList sorted = new LinkedList(entities); if (sort) { Entity.sort(sorted); --- 502,507 ---- * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection<? extends Entity> entities, boolean sort) { ! LinkedList<Entity> sorted = new LinkedList<Entity>(entities); if (sort) { Entity.sort(sorted); *************** *** 509,513 **** int[] ins = new int[sorted.size()]; int i = 0; ! for (Object current : sorted) { this.add(nodeFor(current)); ins[i] = this.getChildCount() - 1; --- 509,513 ---- int[] ins = new int[sorted.size()]; int i = 0; ! for (Entity current : sorted) { this.add(nodeFor(current)); ins[i] = this.getChildCount() - 1; *************** *** 960,992 **** /** - * ClassificationContainer - */ - public class ClassificationContainer extends ContainerNode { - /** - * Constructor for ClassificationContainer - * @param name The name - * @param clas The classification - */ - public ClassificationContainer(String name, Classification clas) { - super(name, clas.getChildren()); - insertChildren(clas.getChildren(), false); - } - - /** {@inheritDoc} */ - public EntityNode nodeFor(Object entity) { - return new ClassificationNode((Classification) entity); - } - /** - * Return icon - * @return Icon - */ - public ImageIcon icon() { - return surfacegroupicon; - } - } - - - - /** * Geometry Container */ --- 960,963 ---- *************** *** 1021,1058 **** /** - * DBK Container - */ - public class DBKContainer extends ContainerNode { - /** - * Constructor - * @param name The name - * @param project The project - */ - public DBKContainer(String name, Project project) { - super(name, null); - add(new ClassificationContainer("Construction", project.getConstructionClas())); - add(new ClassificationContainer("Functional", project.getFunctionalClas())); - } - - /** - * Update the node with the given object - * @param o The object - */ - public void update(Object o) { - if (o instanceof Project) { - Project c = (Project) o; - /* - ((ClassificationContainer)this.getChildAt(0)). - update(c.getConstructionClas().getChildren()); - ((ClassificationContainer)this.getChildAt(1)). - update(c.getFunctionalClas().getChildren()); - */ - } else { - log.warn("Expected a Classification but found a " + o.getClass().getName()); - } - } - } - - /** * Constructor Container */ --- 992,995 ---- *************** *** 1369,1373 **** if (target instanceof Geometric) { select.add((Geometric)target); ! } else if (paths.length == 1 && target instanceof Parametric) { AttributeView.instance().display(target); } else { --- 1306,1310 ---- if (target instanceof Geometric) { select.add((Geometric)target); ! } else if (target instanceof Parametric) { AttributeView.instance().display(target); } else { Index: DBKTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/DBKTreeView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DBKTreeView.java 30 Mar 2007 11:23:25 -0000 1.2 --- DBKTreeView.java 8 May 2007 11:08:18 -0000 1.3 *************** *** 8,11 **** --- 8,14 ---- package net.sourceforge.bprocessor.gui.treeview; + import javax.swing.ImageIcon; + + import net.sourceforge.bprocessor.model.Classification; import net.sourceforge.bprocessor.model.Project; *************** *** 26,33 **** super(); root.removeAllChildren(); ! root.add(new ClassificationContainer("Construction", ! Project.getInstance().getConstructionClas())); ! root.add(new ClassificationContainer("Functional", ! Project.getInstance().getFunctionalClas())); model.nodeStructureChanged(root); } --- 29,34 ---- super(); root.removeAllChildren(); ! root.add(new ClassificationContainer(Project.getInstance().getConstructionClas())); ! root.add(new ClassificationContainer(Project.getInstance().getFunctionalClas())); model.nodeStructureChanged(root); } *************** *** 37,42 **** */ public void update() { ! if (root.getChildCount() == 1) { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); } } --- 38,99 ---- */ public void update() { ! if (root.getChildCount() == 2) { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance().getConstructionClas()); ! ((GenericNode)root.getChildAt(1)).update(Project.getInstance().getFunctionalClas()); ! } ! } ! ! ! /** ! * ClassificationContainer ! */ ! public class ClassificationContainer extends GenericNode { ! /** ! * Constructor for ClassificationContainer ! * @param clas The classification ! */ ! public ClassificationContainer(Classification clas) { ! super(clas); ! for (Classification cl : clas.getChildren()) { ! this.add(new ClassificationContainer(cl)); ! } ! } ! ! /** {@inheritDoc} */ ! public EntityNode nodeFor(Object entity) { ! return new ClassificationNode((Classification) entity); ! } ! /** ! * Return icon ! * @return Icon ! */ ! public ImageIcon icon() { ! return surfacegroupicon; ! } ! ! /** ! * @param c the object to update with ! */ ! public void update(Object c) { ! if (c != null && c instanceof Classification) { ! Classification clas = (Classification)c; ! if (!this.toString().equals(clas.getName())) { ! this.userObject = clas; ! model.nodeChanged(this); ! } ! if (this.getChildCount() != clas.getChildren().size()) { ! this.removeAllChildren(); ! for (Classification cl : clas.getChildren()) { ! this.add(new ClassificationContainer(cl)); ! } ! model.nodeStructureChanged(this); ! } else { ! int index = 0; ! for (Classification cl : clas.getChildren()) { ! ((ClassificationContainer)(this.getChildAt(index))).update(cl); ! index++; ! } ! } ! } } } |
|
From: rimestad <rim...@us...> - 2007-05-08 11:20:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18921/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: changed the delay of drag to be time based instead of distance based, seem to work nice... Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** AbstractTool.java 8 May 2007 07:19:33 -0000 1.118 --- AbstractTool.java 8 May 2007 11:13:13 -0000 1.119 *************** *** 58,63 **** private static Logger log = Logger.getLogger(AbstractTool.class); ! /** The minimum drag length */ ! private static final int MIN_DRAG_LENGTH = 5; /** Simple selection mechanism **/ --- 58,63 ---- private static Logger log = Logger.getLogger(AbstractTool.class); ! /** The minimum drag time */ ! private static final int MIN_DRAG_TIME_MS = 200; /** Simple selection mechanism **/ *************** *** 132,135 **** --- 132,138 ---- /** The gl Cameras */ private Set<GlCamera> glCams = new HashSet<GlCamera> (); + + /** The time at wich the last mouse press accured */ + private long pressedTime; /** *************** *** 343,348 **** } else if (selectMode) { select.dragged(e); ! } else if (Math.sqrt(dx * dx + dy * dy) > MIN_DRAG_LENGTH) { ! dragged(e); } } --- 346,353 ---- } else if (selectMode) { select.dragged(e); ! } else { ! if (e.getWhen() > pressedTime + MIN_DRAG_TIME_MS) { ! dragged(e); ! } } } *************** *** 395,398 **** --- 400,404 ---- */ public void mousePressed(MouseEvent e) { + pressedTime = e.getWhen(); pressPos[0] = e.getX(); pressPos[1] = e.getY(); |
|
From: rimestad <rim...@us...> - 2007-05-08 11:11:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17795/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: "optimized" the zoomOn method by only collecting vertices from the envelope for spaces on levels below project level Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Camera.java 16 Apr 2007 15:55:22 -0000 1.40 --- Camera.java 8 May 2007 11:11:02 -0000 1.41 *************** *** 471,476 **** * @param c the Collection of object to zoom on to. */ ! public void zoomOn(Collection c, double aspect) { ! Set<Vertex> allVertices = Geometry.collect(c); if (!allVertices.isEmpty()) { --- 471,487 ---- * @param c the Collection of object to zoom on to. */ ! public void zoomOn(Collection<? extends Geometric> c, double aspect) { ! Set<Vertex> allVertices = new HashSet<Vertex>(); ! for (Geometric g : c) { ! if (g instanceof Space) { ! if (((Space)g).getLevel() == Space.PROJECT_LEVEL) { ! allVertices.addAll(Geometry.collect(((Space)g).getSurfaces())); ! } else { ! allVertices.addAll(Geometry.collect(((Space)g).getEnvelope())); ! } ! } else { ! allVertices.addAll(g.collect()); ! } ! } if (!allVertices.isEmpty()) { |
|
From: rimestad <rim...@us...> - 2007-05-08 11:08:19
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16922/src/net/sourceforge/bprocessor/gui/attrview Modified Files: ClassificationTextAttribute.java Log Message: refactored DBKtree containers out of genericTreeView to make sorting of nodes based on entitys only be on entitys and get rid of casting in the wild... made some cahanges so that the DBKtree are in deed updated on changes as well. There are still a error when adding own classifacations several times, but I think the error are in persistence not in the tree Index: ClassificationTextAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/ClassificationTextAttribute.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ClassificationTextAttribute.java 31 Jan 2007 15:22:19 -0000 1.6 --- ClassificationTextAttribute.java 8 May 2007 11:08:18 -0000 1.7 *************** *** 337,347 **** Classification newclas; if (((Classification) attribute.getValue()).getType() == 0) { ! newclas = new Classification("-1", editor.getText(), ! Project.getInstance().getClassification("-99", 0), 0); ! Project.getInstance().getClassification("-99", 0).addChild(newclas); } else { ! newclas = new Classification("-1", editor.getText(), ! Project.getInstance().getClassification("-99", 1), 1); ! Project.getInstance().getClassification("-99", 1).addChild(newclas); } --- 337,347 ---- Classification newclas; if (((Classification) attribute.getValue()).getType() == 0) { ! Classification egne = Project.getInstance().getClassification("-99", 0); ! newclas = new Classification("-1", editor.getText(), egne, 0); ! egne.addChild(newclas); } else { ! Classification egne = Project.getInstance().getClassification("-99", 1); ! newclas = new Classification("-1", editor.getText(), egne, 1); ! egne.addChild(newclas); } |
|
From: Michael L. <he...@us...> - 2007-05-08 10:26:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32759/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Changed scripting to expect mm instead of m Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** SpaceTool.java 8 May 2007 09:36:49 -0000 1.76 --- SpaceTool.java 8 May 2007 10:26:39 -0000 1.77 *************** *** 479,483 **** Double y = (Double) env.get(1); Double z = (Double) env.get(2); ! Vertex result = new Vertex(x.doubleValue(), y.doubleValue(), z.doubleValue()); result = transform.transform(result); stack.push(result); --- 479,485 ---- Double y = (Double) env.get(1); Double z = (Double) env.get(2); ! Vertex result = new Vertex(x.doubleValue() / 1000, ! y.doubleValue() / 1000, ! z.doubleValue() / 1000); result = transform.transform(result); stack.push(result); *************** *** 570,574 **** Double distance = (Double) env.get(1); HashSet sides = new HashSet(); ! Surface top = surface.extrusion(distance.doubleValue(), sides); stack.push(surface); Iterator iter = sides.iterator(); --- 572,576 ---- Double distance = (Double) env.get(1); HashSet sides = new HashSet(); ! Surface top = surface.extrusion(distance.doubleValue() / 1000, sides); stack.push(surface); Iterator iter = sides.iterator(); *************** *** 587,591 **** HashSet sides = new HashSet(); HashSet tops = new HashSet(); ! surface.extrusionall(distance.doubleValue(), sides, tops); stack.push(surface); { --- 589,593 ---- HashSet sides = new HashSet(); HashSet tops = new HashSet(); ! surface.extrusionall(distance.doubleValue() / 1000, sides, tops); stack.push(surface); { |
|
From: rimestad <rim...@us...> - 2007-05-08 09:36:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13965/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: changed the popup surface label menu back to the old way Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** SpaceTool.java 8 May 2007 07:19:33 -0000 1.75 --- SpaceTool.java 8 May 2007 09:36:49 -0000 1.76 *************** *** 9,13 **** import java.awt.Cursor; - import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; --- 9,12 ---- *************** *** 26,32 **** import javax.swing.JMenu; import javax.swing.JMenuItem; - import javax.swing.JPanel; import javax.swing.JPopupMenu; - import javax.swing.JScrollPane; import org.apache.log4j.Logger; --- 25,29 ---- *************** *** 375,389 **** JMenu funcMenu = new JMenu("Functional " + category + "s"); - JPanel funcs = new JPanel(); - JScrollPane funcScroll = new JScrollPane(funcs, - JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, - JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); - funcScroll.setSize(new Dimension(150, 400)); - funcScroll.setPreferredSize(new Dimension(150, 400)); JMenu constMenu = new JMenu("Construction " + category + "s"); ! JScrollPane constScroll = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, ! JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ! constScroll.setSize(new Dimension(150, 400)); ! constScroll.setPreferredSize(new Dimension(150, 400)); if (domains != null) { Iterator domIt = domains.iterator(); --- 372,380 ---- JMenu funcMenu = new JMenu("Functional " + category + "s"); JMenu constMenu = new JMenu("Construction " + category + "s"); ! constMenu.add(createConstItem); ! constMenu.addSeparator(); ! funcMenu.add(createFuncItem); ! funcMenu.addSeparator(); if (domains != null) { Iterator domIt = domains.iterator(); *************** *** 396,400 **** domainItem.addActionListener(ml); if (domain.isFunctionalSpace()) { ! funcs.add(domainItem); } else { constMenu.add(domainItem); --- 387,391 ---- domainItem.addActionListener(ml); if (domain.isFunctionalSpace()) { ! funcMenu.add(domainItem); } else { constMenu.add(domainItem); *************** *** 403,411 **** } } - funcMenu.add(funcScroll); - funcMenu.addSeparator(); - funcMenu.add(createFuncItem); - constMenu.addSeparator(); - constMenu.add(createConstItem); menu.add(selectSpaceItem); menu.add(funcMenu); --- 394,397 ---- |
|
From: Michael L. <he...@us...> - 2007-05-08 08:26:15
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14960/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Introduced a global flag controlling the usage of display-lists Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** View.java 8 May 2007 08:16:40 -0000 1.206 --- View.java 8 May 2007 08:26:15 -0000 1.207 *************** *** 85,88 **** --- 85,89 ---- private static final boolean FALSE = false; + private static final boolean DISP = false; /** OBJECTS flag */ *************** *** 1650,1656 **** Integer list = displayLists.get(s); if (list == null) { ! list = gl.glGenLists(1); ! displayLists.put(s, list); ! gl.glNewList(list, GL.GL_COMPILE); glu.gluTessBeginPolygon(tess, null); Vertex norm = s.normal(); --- 1651,1659 ---- Integer list = displayLists.get(s); if (list == null) { ! if (DISP) { ! list = gl.glGenLists(1); ! displayLists.put(s, list); ! gl.glNewList(list, GL.GL_COMPILE); ! } glu.gluTessBeginPolygon(tess, null); Vertex norm = s.normal(); *************** *** 1679,1685 **** } glu.gluTessEndPolygon(tess); ! gl.glEndList(); } - gl.glCallList(list); } --- 1682,1692 ---- } glu.gluTessEndPolygon(tess); ! if (DISP) { ! gl.glEndList(); ! } ! } ! if (DISP) { ! gl.glCallList(list); } } *************** *** 3371,3396 **** if (entity instanceof Space) { for (Surface s : ((Space)entity).getSurfaces()) { ! Integer which = displayLists.remove(s); ! if (which != null) { ! deletedLists.add(which); } } } else if (entity instanceof Surface) { ! Integer which = displayLists.remove((Surface)entity); ! if (which != null) { ! deletedLists.add(which); ! } ! } else if (entity instanceof Geometric) { ! Geometric g = (Geometric)entity; ! Space sp = g.getOwner(); ! for (Surface s : sp.getSurfaces()) { ! Integer which = displayLists.remove(s); if (which != null) { deletedLists.add(which); } } } else if (entity instanceof Project) { ! deletedLists.addAll(displayLists.values()); ! displayLists.clear(); } else if (entity instanceof Selection) { /*for (Geometric g : (Selection)entity) { --- 3378,3411 ---- if (entity instanceof Space) { for (Surface s : ((Space)entity).getSurfaces()) { ! if (DISP) { ! Integer which = displayLists.remove(s); ! if (which != null) { ! deletedLists.add(which); ! } } } } else if (entity instanceof Surface) { ! if (DISP) { ! Integer which = displayLists.remove((Surface)entity); if (which != null) { deletedLists.add(which); } } + } else if (entity instanceof Geometric) { + if (DISP) { + Geometric g = (Geometric)entity; + Space sp = g.getOwner(); + for (Surface s : sp.getSurfaces()) { + Integer which = displayLists.remove(s); + if (which != null) { + deletedLists.add(which); + } + } + } } else if (entity instanceof Project) { ! if (DISP) { ! deletedLists.addAll(displayLists.values()); ! displayLists.clear(); ! } } else if (entity instanceof Selection) { /*for (Geometric g : (Selection)entity) { |
|
From: Michael L. <he...@us...> - 2007-05-08 08:16:42
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10587/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Removed some comments Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** View.java 7 May 2007 15:31:27 -0000 1.205 --- View.java 8 May 2007 08:16:40 -0000 1.206 *************** *** 83,86 **** --- 83,88 ---- /** The logger */ private static Logger log = Logger.getLogger(View.class); + + private static final boolean FALSE = false; /** OBJECTS flag */ *************** *** 1651,1666 **** displayLists.put(s, list); gl.glNewList(list, GL.GL_COMPILE); - //begining the polygon, we are not using userdata for now (hence the null) glu.gluTessBeginPolygon(tess, null); - //light stuff Vertex norm = s.normal(); if (norm != null) { gl.glNormal3d(norm.getX(), norm.getY(), norm.getZ()); } - - //drawing the outer contour drawContour(s, tess); - - //drawing the inner conturs Collection innerSurfaces = s.getHoles(); if (innerSurfaces != null) { --- 1653,1662 ---- *************** *** 1671,1682 **** drawContour(surface, tess); } ! /*if (hit) { ! // Meant to prevent selecting inner geometry in a space ! if (surface.getOwner() == s.getOwner()) { drawContour(surface, tess); } ! } else { ! drawContour(surface, tess); ! }*/ } } --- 1667,1679 ---- drawContour(surface, tess); } ! if (FALSE) { ! if (hit) { ! if (surface.getOwner() == s.getOwner()) { ! drawContour(surface, tess); ! } ! } else { drawContour(surface, tess); } ! } } } |
|
From: Michael L. <he...@us...> - 2007-05-08 07:19:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16764/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java SpaceTool.java Log Message: More length stuff Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** SpaceTool.java 8 May 2007 06:08:15 -0000 1.74 --- SpaceTool.java 8 May 2007 07:19:33 -0000 1.75 *************** *** 12,16 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.io.Reader; --- 12,15 ---- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** AbstractTool.java 8 May 2007 06:08:15 -0000 1.117 --- AbstractTool.java 8 May 2007 07:19:33 -0000 1.118 *************** *** 561,565 **** /** * Evaluate the value ! * @param value */ public Object evaluate(String value) { --- 561,566 ---- /** * Evaluate the value ! * @param value String ! * @return result */ public Object evaluate(String value) { |
|
From: Michael L. <he...@us...> - 2007-05-08 07:19:29
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16750/src/net/sourceforge/bprocessor/gui/attrview Modified Files: StringAttribute.java Log Message: More length stuff Index: StringAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/StringAttribute.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** StringAttribute.java 29 Mar 2007 22:02:37 -0000 1.13 --- StringAttribute.java 8 May 2007 07:19:29 -0000 1.14 *************** *** 99,103 **** */ protected double round(double value) { ! int i = (int) (value * 100000); return ((double) i) / 100000.0; } --- 99,103 ---- */ protected double round(double value) { ! int i = (int) (value * 100000000); return ((double) i) / 100000.0; } *************** *** 237,241 **** attribute.setValue(editor.getText()); } else if (val instanceof Double) { ! attribute.setValue(Double.valueOf(editor.getText())); } component.remove(editor); --- 237,241 ---- attribute.setValue(editor.getText()); } else if (val instanceof Double) { ! attribute.setValue(Double.valueOf(editor.getText()) / 1000); } component.remove(editor); |
|
From: Michael L. <he...@us...> - 2007-05-08 06:08:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15982/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java SpaceTool.java AbstractPencil.java Log Message: Length field stuff Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** SpaceTool.java 7 May 2007 13:29:48 -0000 1.73 --- SpaceTool.java 8 May 2007 06:08:15 -0000 1.74 *************** *** 688,729 **** /** - * @param event KeyEvent - */ - public void key(KeyEvent event) { - if (!event.isControlDown() && !event.isMetaDown()) { - String value; - if (typing) { - value = glv.getLengthValue(); - } else { - value = ""; - } - char ch = event.getKeyChar(); - if (ch > 31 && ch < 256) { - value = value + ch; - glv.setLengthValue(value); - typing = true; - } else { - if (event.getKeyCode() == KeyEvent.VK_ENTER) { - evaluate(value); - } - } - } - } - - /** * Delete */ @Override ! public void delete() { ! if (typing) { ! String value = glv.getLengthValue(); ! int length = value.length(); ! if (length > 0) { ! value = value.substring(0, length - 1); ! glv.setLengthValue(value); ! } ! return; ! } ! Iterator it = Selection.primary().iterator(); List<Geometric> edges = new ArrayList<Geometric>(); --- 688,695 ---- /** * Delete */ @Override ! public void remove() { Iterator it = Selection.primary().iterator(); List<Geometric> edges = new ArrayList<Geometric>(); Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** AbstractPencil.java 7 May 2007 13:29:48 -0000 1.76 --- AbstractPencil.java 8 May 2007 06:08:15 -0000 1.77 *************** *** 703,789 **** } - /** - * Delete - */ - public void delete() { - int length = number.length(); - if (length > 1) { - number = number.substring(0, length - 1); - } else { - number = String.valueOf(0); - } - try { - double d = Double.parseDouble(number); - setLength(d / 1000); - } catch (NumberFormatException exp) { - log.warn(exp); - } - } /** ! * Invoked when a key has been pressed. ! * @param e The KeyEvent */ ! public void key(KeyEvent e) { ! boolean changed = false; ! if (number == null) { ! number = ""; ! } ! if (e.getKeyCode() == KeyEvent.VK_CAPS_LOCK) { ! lock = true; ! } else if (e.getKeyCode() == KeyEvent.VK_1) { ! number += "1"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_2) { ! number += "2"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_3) { ! number += "3"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_4) { ! number += "4"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_5) { ! number += "5"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_6) { ! number += "6"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_7) { ! number += "7"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_8) { ! number += "8"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_9) { ! number += "9"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_0) { ! number += "0"; ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { ! int length = number.length(); ! if (length > 1) { ! number = number.substring(0, length - 1); ! } else { ! number = String.valueOf(0); ! } ! changed = true; ! } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { ! try { ! double d = Double.parseDouble(number); ! apply(d / 1000); ! } catch (NumberFormatException exp) { ! log.warn(exp); ! } ! } ! if (changed) { ! try { ! double d = Double.parseDouble(number); ! setLength(d / 1000); ! } catch (NumberFormatException exp) { ! log.warn(exp); ! } ! } } --- 703,714 ---- } /** ! * {@inheritDoc} */ ! public Object evaluate(String value) { ! double d = Double.parseDouble(value); ! apply(d / 1000); ! return null; } Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** AbstractTool.java 7 May 2007 13:19:07 -0000 1.116 --- AbstractTool.java 8 May 2007 06:08:15 -0000 1.117 *************** *** 511,518 **** /** * Invoked when a key has been pressed ! * @param e KeyEvent */ ! protected void key(KeyEvent e) { ! } --- 511,535 ---- /** * Invoked when a key has been pressed ! * @param event KeyEvent */ ! protected void key(KeyEvent event) { ! if (!event.isControlDown() && !event.isMetaDown()) { ! String value; ! if (typing) { ! value = glv.getLengthValue(); ! } else { ! value = ""; ! } ! char ch = event.getKeyChar(); ! if (ch > 31 && ch < 256) { ! value = value + ch; ! glv.setLengthValue(value); ! typing = true; ! } else { ! if (event.getKeyCode() == KeyEvent.VK_ENTER) { ! evaluate(value); ! } ! } ! } } *************** *** 522,529 **** --- 539,572 ---- */ protected void delete() { + if (typing) { + String value = glv.getLengthValue(); + int length = value.length(); + if (length > 0) { + value = value.substring(0, length - 1); + glv.setLengthValue(value); + } + } else { + remove(); + } + } + + /** + * + * + */ + protected void remove() { } /** + * Evaluate the value + * @param value + */ + public Object evaluate(String value) { + System.out.println("evaluate " + value); + return null; + } + + /** * The escape key has been pressed * |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:44:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32369/src/net/sourceforge/bprocessor/model/modellor Modified Files: InnerWallModellor.java Log Message: improved drawing of the innerwall Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InnerWallModellor.java 23 Apr 2007 14:50:36 -0000 1.1 --- InnerWallModellor.java 7 May 2007 15:44:38 -0000 1.2 *************** *** 7,12 **** package net.sourceforge.bprocessor.model.modellor; import java.util.HashSet; - import java.util.Iterator; import java.util.LinkedList; import java.util.List; --- 7,13 ---- package net.sourceforge.bprocessor.model.modellor; + import java.util.Collection; + import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; *************** *** 15,21 **** --- 16,25 ---- import net.sourceforge.bprocessor.model.Attribute; + import net.sourceforge.bprocessor.model.Classification; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Net; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Space; *************** *** 31,37 **** --- 35,55 ---- public class InnerWallModellor extends Modellor { + /** + * Id + */ + private static final long serialVersionUID = 1L; + /** The logger */ private static Logger log = Logger.getLogger(InnerWallModellor.class); + /** The width of a standart joist */ + public static final double JOIST_WIDTH = 0.035; + + /** The depth of a standart joist */ + public static final double JOIST_DEPTH = 0.070; + + /** The classification id for a innerwall */ + public static final String INNERWALL_CLASS = "-205"; + /** The space of this modellor */ private Space space; *************** *** 41,53 **** /** The interval between joists */ ! private static double joistInterval = 0.5; ! ! /** The spaces for the joists */ ! private Set<Space> joists; /** Says whether or not the modellor should be build, * is false when there is no-need to rebuild the innerwall */ ! private boolean build = true; ! /** * The empty constructor --- 59,73 ---- /** The interval between joists */ ! private double joistInterval = 0.5; /** Says whether or not the modellor should be build, * is false when there is no-need to rebuild the innerwall */ ! private boolean build = true; ! ! /** Coordinate system of the modellor */ ! private CoordinateSystem cs; ! ! /** The net of the modellor */ ! private Net net; /** * The empty constructor *************** *** 95,99 **** public Modellor newInstance(Space s) { InnerWallModellor mod = new InnerWallModellor(s); - //mod.setSurface(surface); Project.getInstance().addObserver(mod); return mod; --- 115,118 ---- *************** *** 107,113 **** Attribute a = m.get("Joist Interval"); if (a != null && a.getValue() instanceof Double) { ! joistInterval = (Double)a.getValue(); ! space.clear(); ! build = true; } } --- 126,130 ---- Attribute a = m.get("Joist Interval"); if (a != null && a.getValue() instanceof Double) { ! joistInterval = buildIfDifferent(joistInterval, (Double)a.getValue()); } } *************** *** 118,123 **** @Override public void setSubContent(Map<String, Object> c) { - // TODO Auto-generated method stub - } --- 135,138 ---- *************** *** 129,176 **** public void update(Object entity) { if (build) { ! Net n = null; ! space.add(buildNet()); ! for (Space net : space.getElements()) { ! if (net instanceof Net) { ! n = (Net)net; ! break; } } ! if (n != null) { ! Vertex x = new Vertex(0.05, 0, 0); ! Vertex y = new Vertex(0, 0.05, 0); ! Vertex z = new Vertex(0, 0, 0.05); ! for (Edge e : n.getEdges()) { ! Space joist = new Space("joist", Space.CONSTRUCTION, space.getLevel() + 1, true); ! space.add(joist); ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! Vertex dir = e.getDirection(); ! Surface base = null; ! if (Math.abs(to.getZ() - from.getZ()) < Geometry.EPS) { ! base = joistBase(from, y, z); } else { ! base = joistBase(from, x, y); } - space.add(base); - if (dir.dot(base.normal()) < 0) { - base.flip(); - } - base.setFrontDomain(joist); - Set<Surface> sides = new HashSet<Surface>(); - base.extrude(e.getLength(), sides); - space.addAll(sides); } - build = false; } } } ! private static Surface joistBase(Vertex origin, Vertex x, Vertex y) { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = origin; ! vl.add(origin.add(x)); ! vl.add(origin.add(x).add(y)); ! vl.add(origin.add(y)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 144,273 ---- public void update(Object entity) { if (build) { ! if (net == null) { ! for (Space net : space.getElements()) { ! if (net instanceof Net) { ! net = (Net)net; ! break; ! } } } ! if (net == null) { ! net = buildNet(); ! } ! if (net != null) { ! addSupport(); ! space.clear(); ! space.add(net); ! buildFramework(net); ! build = false; ! } ! } ! } ! ! private void buildFramework(Net net) { ! Map<Edge, Edge> edge2Run = getRuns(net); ! Set<Edge> runs = new HashSet<Edge>(edge2Run.values()); ! Edge right = null; ! Edge bottom = null; ! double maxX = Double.NEGATIVE_INFINITY; ! double minZ = Double.POSITIVE_INFINITY; ! for (Edge e : runs) { ! Vertex v = cs.translate(e.getFrom()); ! if (vertical(e) && maxX < v.getX()) { ! right = e; ! maxX = v.getX(); ! } else if (horizontal(e) && minZ > v.getZ()) { ! bottom = e; ! minZ = v.getZ(); ! } ! } ! runs.remove(bottom); ! runs.remove(right); ! ! Edge topCopy = bottom.copy(); ! Edge rightCopy = right.copy(); ! Vertex up = cs.getN().copy(JOIST_WIDTH / cs.getN().length()); ! Vertex left = cs.getI().copy(-JOIST_WIDTH / cs.getI().length()); ! topCopy.move(up); ! rightCopy.move(left); ! runs.add(topCopy); ! runs.add(rightCopy); ! ! for (Edge e : runs) { ! Surface base = joistBase(); ! space.add(base); ! Space joist = new Space("joist", Space.CONSTRUCTION, space.getLevel() + 1, true); ! space.add(joist); ! Vertex dir = e.getDirection(); ! Vertex i; ! Vertex j; ! Vertex n; ! Vertex o; ! double length; ! if (vertical(e)) { ! dir.normalize(); ! dir.scale(JOIST_WIDTH); ! o = e.getFrom(); ! o = o.add(dir); ! i = cs.getI().copy(); ! j = cs.getJ().copy(); ! n = cs.getN().copy(); ! length = e.getLength() - (JOIST_WIDTH * 2); ! } else if (horizontal(e)) { ! i = cs.getN().copy(-1); ! j = cs.getJ().copy(); ! n = cs.getI().copy(); ! o = e.getFrom(); ! length = e.getLength(); ! } else { ! log.info("Can currently only work with horizontal and vertical edges"); ! continue; ! } ! CoordinateSystem local = new CoordinateSystem(i, j, n, o); ! Geometry.unTranslateGeometry(base.collect(), local); ! if (dir.dot(base.normal()) < 0) { ! base.flip(); ! } ! base.setFrontDomain(joist); ! Set<Surface> sides = new HashSet<Surface>(); ! base.extrude(length, sides); ! space.addAll(sides); ! } ! } ! ! private Map<Edge, Edge> getRuns(Net net) { ! Map<Edge, Edge> edge2Run = new HashMap<Edge, Edge>(); ! if (net != null) { ! Collection<Edge> netEdges = net.getEdges(); ! for (Edge e : netEdges) { ! if (edge2Run.get(e) == null) { ! List<Edge> run = e.parrallelRun(); ! int size = run.size(); ! if (size > 1) { ! Edge first = run.get(0); ! Edge second = run.get(1); ! Edge last = run.get(size - 1); ! Edge secondLast = run.get(size - 2); ! Vertex from = first.otherVertex(Edge.commonVertex(first, second)); ! Vertex to = last.otherVertex(Edge.commonVertex(last, secondLast)); ! Edge runEdge = new Edge(from, to); ! for (Edge r : run) { ! edge2Run.put(r, runEdge); ! } } else { ! edge2Run.put(e, e); } } } } + return edge2Run; } ! private static Surface joistBase() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0, 0); ! vl.add(new Vertex(JOIST_WIDTH, 0, 0)); ! vl.add(new Vertex(JOIST_WIDTH, JOIST_DEPTH, 0)); ! vl.add(new Vertex(0, JOIST_DEPTH, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 182,186 **** Surface base = new Surface(el); return base; ! } private Net buildNet() { --- 279,283 ---- Surface base = new Surface(el); return base; ! } private Net buildNet() { *************** *** 188,223 **** Net net = new Net("net"); space.add(net); ! surface = space.getEnvelope().iterator().next(); ! surface.copy(net); Edge vertical = null; Edge horizontal = null; ! for (Edge e : surface.getEdges()) { ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! if (Math.abs(to.getZ() - from.getZ()) < Geometry.EPS) { horizontal = e; } } ! for (Edge e : surface.getEdges()) { ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! if (!(Math.abs(to.getZ() - from.getZ()) < Geometry.EPS) && ! Edge.commonVertex(horizontal, e) == horizontal.getFrom()) { vertical = e; } } ! Vertex origin = horizontal.getFrom(); ! Vertex verticalV = vertical.otherVertex(origin).minus(origin); ! Vertex interval = horizontal.getDirection(); ! interval.scale(joistInterval / interval.length()); ! Vertex current = origin.copy(); ! current.move(interval.getX(), interval.getY(), interval.getZ()); ! while (origin.minus(current).length() < horizontal.getLength()) { ! Vertex from = current.copy(); ! Vertex to = from.add(verticalV); ! net.insert(from); ! net.insert(to); ! net.insert(new Edge(from, to)); current.move(interval.getX(), interval.getY(), interval.getZ()); } return net; --- 285,334 ---- Net net = new Net("net"); space.add(net); ! surface = findSurface(); ! Surface netSurface = surface.copy(net); Edge vertical = null; Edge horizontal = null; ! for (Edge e : netSurface.getEdges()) { ! if (horizontal(e)) { horizontal = e; } } ! for (Edge e : netSurface.getEdges()) { ! Vertex common = Edge.commonVertex(horizontal, e); ! if (common == horizontal.getFrom() && vertical(e)) { vertical = e; } } ! if (horizontal != null && vertical != null) { ! Vertex origin = horizontal.getFrom(); ! Vertex topToBottom = vertical.otherVertex(origin).minus(origin); ! Vertex interval = horizontal.getDirection(); ! interval.scale(joistInterval / interval.length()); ! Vertex current = origin.copy(); current.move(interval.getX(), interval.getY(), interval.getZ()); + while (origin.minus(current).length() < horizontal.getLength() - joistInterval) { + Vertex from = current.copy(); + Vertex to = from.add(topToBottom); + net.insert(from); + net.insert(to); + net.insert(new Edge(from, to)); + current.move(interval.getX(), interval.getY(), interval.getZ()); + } + Vertex i; + Vertex j; + Vertex n; + n = new Vertex(0, 0, 1); + j = surface.normal(); + if (surface.getBackDomain() == space) { + j.scale(-1); + } + i = j.cross(n); + i.normalize(); + j.normalize(); + n.normalize(); + cs = new CoordinateSystem(i, j, n, origin); + } else { + log.error("The surface found did not meet the requirements"); + return null; } return net; *************** *** 227,235 **** /** * {@inheritDoc} */ @Override public void delete() { ! // TODO Auto-generated method stub } --- 338,421 ---- /** + * Adds edges to the net of this modellor to support other + * innerwalls. + */ + private void addSupport() { + if (net != null) { + log.info("net not null"); + Set<Surface> envelope = space.getEnvelope(); + for (Surface s : envelope) { + Space front = s.getFrontDomain(); + Space back = s.getBackDomain(); + Classification frontClass = front.getClassification(); + Classification backClass = back.getClassification(); + if ((frontClass != null && backClass != null) && + ((frontClass.getFullId(front).equalsIgnoreCase(INNERWALL_CLASS) && front != space) || + (backClass.getFullId(back).equalsIgnoreCase(INNERWALL_CLASS) && back != space))) { + log.info("found suiteable surface"); + Edge left = null; + double minX = Double.POSITIVE_INFINITY; + double maxX = Double.NEGATIVE_INFINITY; + for (Edge e : s.getEdges()) { + Vertex from = cs.translate(e.getFrom()); + double x = from.getX(); + if (vertical(e)) { + if (minX > x) { + minX = x; + left = e; + } + if (maxX < x) { + maxX = x; + } + } + } + if (maxX > minX) { + log.info("found left succesfully"); + Vertex to = cs.translate(left.getTo()); + Vertex from = cs.translate(left.getFrom()); + to.setY(0); + from.setY(0); + to = cs.unTranslate(to); + from = cs.unTranslate(from); + Edge support1 = new Edge(to, from); + net.insert(support1); + Edge support2 = support1.copy(); + Vertex move = cs.getI().copy(JOIST_WIDTH / cs.getI().length()); + support2.move(move); + net.insert(support2); + } + } + } + } + } + + private Surface findSurface() { + Surface surface = space.getEnvelope().iterator().next(); + for (Surface s : space.getEnvelope()) { + Space front = s.getFrontDomain(); + Space back = s.getBackDomain(); + Classification frontClass = front.getClassification(); + Classification backClass = back.getClassification(); + if ((frontClass != null && backClass != null) && + ((frontClass.getFullId(front).equalsIgnoreCase("-80") && front != space) || + (backClass.getFullId(back).equalsIgnoreCase("-80") && back != space))) { + surface = s; + break; + } + } + return surface; + } + + + /** * {@inheritDoc} */ @Override public void delete() { ! space.clear(); ! if (space.getModellor() == this) { ! space.setModellor(null); ! } ! build = false; } *************** *** 261,324 **** public void setSurface(Surface surface) { this.surface = surface; ! } ! /** ! * Finds the outline of a net, if it makes sence. ! * The outline must be a sequence of connected outer edges, so that ! * the last edge is connected to the first. Also all outer edges most be ! * in the outline. ! * @param net a net ! * @return a list of connected edges making up the net outline */ ! private List netOutline(Net net) { ! /*Find outer edges*/ ! Iterator edges = net.getEdges().iterator(); ! Set<Edge> outer = new HashSet<Edge>(); ! while (edges.hasNext()) { ! Edge current = (Edge)edges.next(); ! if (current.getSurfaces().size() == 1) { ! outer.add(current); } } ! /*If there are outer edges sort them in order*/ ! if (!outer.isEmpty()) { ! LinkedList<Edge> outline = new LinkedList<Edge>(); ! Edge first = (Edge)outer.iterator().next(); ! outline.add(first); ! outer.remove(first); ! Vertex nextVertex = first.getTo(); ! boolean doneAll = false; ! while (!doneAll) { ! Edge next = null; ! Iterator nextEdges = nextVertex.getEdges().iterator(); ! while (nextEdges.hasNext()) { ! Object e = nextEdges.next(); ! if (outer.contains(e)) { ! next = (Edge)e; ! break; ! } ! } ! if (next != null) { ! outer.remove(next); ! nextVertex = next.otherVertex(nextVertex); ! outline.add(next); ! } else { ! doneAll = true; ! } ! } ! /*If all outer edges are in the outline, ! * and the last edge is connected to the first, ! * return the outline */ ! if (outer.isEmpty() && ! first.getFrom().getEdges().contains(outline.getLast())) { ! return outline; ! } else { ! log.warn("Outline not well defined, " + ! " outer edges left: " + outer.size() + ! " outline connected: " + first.getFrom().getEdges().contains(outline.getLast())); ! } } ! return new LinkedList(); } } --- 447,503 ---- public void setSurface(Surface surface) { this.surface = surface; ! } ! /** ! * Checks if all of a net is in a given plane. ! * @param net the net ! * @param p the plane ! * @return true if all geometry in the net is in the plane, false otherwise */ ! private boolean getPlaneCheck(Net net, Plane p) { ! for (Edge e : net.getEdges()) { ! if (!p.contains(e)) { ! return false; } } ! return true; ! } ! ! /** ! * For setting attributes. If the candidate is different from the current ! * the space is cleared, the build flag is set and the candidate is returned. Otherwise ! * the current value is returned. ! * @param <Type> ! * @param current current value ! * @param candidate candidate value ! * @return the result ! */ ! private <Type> Type buildIfDifferent(Type current, Type candidate) { ! if (candidate != null && !current.equals(candidate)) { ! build = true; ! return candidate; } ! return current; ! } ! ! private boolean horizontal(Edge e) { ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! return Math.abs(to.getZ() - from.getZ()) < Geometry.EPS; ! } ! ! private boolean vertical(Edge e) { ! Vertex to = e.getTo(); ! Vertex from = e.getFrom(); ! return (Math.abs(to.getX() - from.getX()) < Geometry.EPS && ! Math.abs(to.getY() - from.getY()) < Geometry.EPS); } + /** + * Gets the net + * @return the net of this modellor + */ + public Net getNet() { + return net; + } } |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:43:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31990/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: method to replace a single edge Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** Surface.java 16 Apr 2007 15:55:22 -0000 1.157 --- Surface.java 7 May 2007 15:43:58 -0000 1.158 *************** *** 357,360 **** --- 357,371 ---- } + /** + * Replacing a single edge with an other edge + * @param replaceEdge the edge to replace + * @param newEdge the new edge. + */ + public void replaceSingle(Edge replaceEdge, Edge newEdge) { + List<Edge> wrap = new LinkedList<Edge>(); + wrap.add(replaceEdge); + replace(wrap, newEdge); + } + /** Replaces a set of edges in this surface with a single edge * @param replacedEdges Set of edges to replace *************** *** 1256,1263 **** public void setBackDomain(Space back) { if (backDomain != back) { ! if (backDomain != null) { ! if (backDomain != frontDomain) { ! backDomain.removeSurface(this); ! } } backDomain = back; --- 1267,1273 ---- public void setBackDomain(Space back) { if (backDomain != back) { ! if (backDomain != null && ! backDomain != frontDomain) { ! backDomain.removeSurface(this); } backDomain = back; *************** *** 1265,1269 **** backDomain.addSurface(this); } - //changed(); } } --- 1275,1278 ---- |
|
From: Nordholt <nor...@us...> - 2007-05-07 15:43:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31967/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: corrected doc Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** Space.java 7 May 2007 13:34:18 -0000 1.138 --- Space.java 7 May 2007 15:43:26 -0000 1.139 *************** *** 834,838 **** * the a specified edge in the list is the first edge in the list * @param surface the surface ! * @param first the edge the should be first in the edgelist * @return a list of the surfaces edges arranged correctly, returns * unaltered edgelist if the edge is not in the surface. --- 834,838 ---- * the a specified edge in the list is the first edge in the list * @param surface the surface ! * @param first the edge that should be first in the edgelist * @return a list of the surfaces edges arranged correctly, returns * unaltered edgelist if the edge is not in the surface. |