bprocessor-commit Mailing List for B-processor (Page 123)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Nikolaj B. <nbr...@us...> - 2006-05-15 10:31:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16913/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: Materials can now be saved and loaded, and there is a "global" monitoring of all materials. Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Persistence.java 7 May 2006 09:33:36 -0000 1.2 --- Persistence.java 15 May 2006 10:31:45 -0000 1.3 *************** *** 11,14 **** --- 11,15 ---- import net.sourceforge.bprocessor.model.xml.EdgeType; import net.sourceforge.bprocessor.model.xml.EntityType; + import net.sourceforge.bprocessor.model.xml.MaterialType; import net.sourceforge.bprocessor.model.xml.SpaceType; import net.sourceforge.bprocessor.model.xml.SurfaceType; *************** *** 16,23 **** --- 17,26 ---- import net.sourceforge.bprocessor.model.xml.impl.BmodelImpl; import net.sourceforge.bprocessor.model.xml.impl.EdgeImpl; + import net.sourceforge.bprocessor.model.xml.impl.MaterialImpl; import net.sourceforge.bprocessor.model.xml.impl.SpaceImpl; import net.sourceforge.bprocessor.model.xml.impl.SurfaceImpl; import net.sourceforge.bprocessor.model.xml.impl.VertexImpl; + import java.awt.Color; import java.io.File; import java.io.FileInputStream; *************** *** 164,167 **** --- 167,177 ---- } } + { + Iterator iter = xml.getMaterial().iterator(); + while (iter.hasNext()) { + MaterialType current = (MaterialType) iter.next(); + space.add(internalizeMaterial(current, mapper, xmls)); + } + } return space; } *************** *** 218,221 **** --- 228,248 ---- /** * + * @param xml The MaterialType + * @param mapper The mapper + * @param xmls The xmls + * @return The Material + */ + private static Material internalizeMaterial(MaterialType xml, Map mapper, Collection xmls) { + Material material = new Material(); + mapper.put(new Long(xml.getId()), material); + xmls.add(xml); + material.setName(xml.getName()); + material.setColor(new Color((float)xml.getR(), (float)xml.getG(), (float)xml.getB()) + .getRGBColorComponents(null)); + return material; + } + + /** + * * @param object The object * @param xml The xml *************** *** 231,234 **** --- 258,263 ---- } else if (object instanceof Vertex) { internalizeReferences((Vertex) object, (VertexType) xml, map); + } else if (object instanceof Material) { + internalizeMaterial((Material) object, (MaterialType) xml, map); } } *************** *** 301,304 **** --- 330,335 ---- object.setBackDomain((Space) get(xml.getBack(), map)); object.setFrontDomain((Space) get(xml.getFront(), map)); + object.setBackMaterial((Material) get(xml.getBackMaterial(), map)); + object.setFrontMaterial((Material) get(xml.getFrontMaterial(), map)); object.setExterior((Surface) get(xml.getExterior(), map)); } *************** *** 323,326 **** --- 354,367 ---- private static void internalizeReferences(Vertex object, VertexType xml, Map map) { } + + /** + * + * @param object The object + * @param xml The xml + * @param map The map + */ + private static void internalizeMaterial(Material object, MaterialType xml, Map map) { + } + *************** *** 406,410 **** while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! xml.getSurface().add(externalizeSurface(current, map)); } } --- 447,451 ---- while (iter.hasNext()) { Surface current = (Surface) iter.next(); ! xml.getSurface().add(externalizeSurface(current, map)); } } *************** *** 423,426 **** --- 464,474 ---- } } + { + Iterator iter = space.getMaterials().iterator(); + while (iter.hasNext()) { + Material current = (Material) iter.next(); + xml.getMaterial().add(externalizeMaterial(current, map)); + } + } return xml; } *************** *** 437,440 **** --- 485,489 ---- xml.setProgid(surface.getId().longValue()); map.put(surface, xml); + return xml; } *************** *** 473,476 **** --- 522,542 ---- /** + * Create an xml MaterialImpl and place it in the map + * @param material The Material + * @param map The map + * @return The MaterialImpl + */ + private static MaterialType externalizeMaterial(Material material, Map map) { + MaterialType xml = new MaterialImpl(); + xml.setId(counter++); + map.put(material, xml); + xml.setName(material.getName()); + xml.setR((material.getColor()[0])); + xml.setG((material.getColor()[1])); + xml.setB((material.getColor()[2])); + return xml; + } + + /** * Return the id of an xml entity by looking the entity up in the map * @param map The map *************** *** 522,525 **** --- 588,593 ---- } else if (object instanceof Vertex) { externalizeReferences((Vertex) object, (VertexType) xml, map); + } else if (object instanceof Material) { + externalizeMaterial((Material) object, (MaterialType) xml, map); } } *************** *** 546,550 **** --- 614,620 ---- xml.getHole().addAll(ids(map, object.getHoles())); xml.setFront(id(map, object.getFrontDomain())); + xml.setFrontMaterial(id(map, object.getFrontMaterial())); xml.setBack(id(map, object.getBackDomain())); + xml.setBackMaterial(id(map, object.getBackMaterial())); xml.setExterior(id(map, object.getExterior())); } *************** *** 570,572 **** --- 640,651 ---- } + /** + * Externalize references + * @param object The object + * @param xml The xml entity + * @param map The map + */ + private static void externalizeMaterial(Material object, MaterialType xml, Map map) { + } + } |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 10:30:01
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16195/src/etc Modified Files: bprocessor.xsd Log Message: Materials can now be saved and loaded, and there is a "global" monitoring of all materials. Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** bprocessor.xsd 7 May 2006 09:35:07 -0000 1.11 --- bprocessor.xsd 15 May 2006 10:29:56 -0000 1.12 *************** *** 29,32 **** --- 29,33 ---- <xsd:element ref="edge" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> + <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:extension> *************** *** 41,49 **** <xsd:element name="edgeref" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="hole" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element name="back" type="xsd:long" maxOccurs="1" minOccurs="0"/> <xsd:element name="front" type="xsd:long" maxOccurs="1" minOccurs="0"/> ! <xsd:element name="exterior" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> ! </xsd:extension> </xsd:complexContent> </xsd:complexType> --- 42,52 ---- <xsd:element name="edgeref" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="hole" type="xsd:long" maxOccurs="unbounded" minOccurs="0"/> ! <xsd:element name="back" type="xsd:long" maxOccurs="1" minOccurs="0"/> <xsd:element name="front" type="xsd:long" maxOccurs="1" minOccurs="0"/> ! <xsd:element name="exterior" type="xsd:long" maxOccurs="1" minOccurs="0"/> ! <xsd:element name="frontMaterial" type="xsd:long" maxOccurs="1" minOccurs="0"/> ! <xsd:element name="backMaterial" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> ! </xsd:extension> </xsd:complexContent> </xsd:complexType> *************** *** 72,75 **** --- 75,92 ---- </xsd:complexContent> </xsd:complexType> + + <xsd:complexType name="MaterialType"> + <xsd:complexContent> + <xsd:extension base="EntityType"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string" maxOccurs="1" minOccurs="0"/> + <xsd:element name="R" type="xsd:float" maxOccurs="1" minOccurs="0"/> + <xsd:element name="G" type="xsd:float" maxOccurs="1" minOccurs="0"/> + <xsd:element name="B" type="xsd:float" maxOccurs="1" minOccurs="0"/> + </xsd:sequence> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + <!-- Element definitions --> *************** *** 78,81 **** --- 95,99 ---- <xsd:element name="edge" type="EdgeType"/> <xsd:element name="vertex" type="VertexType"/> + <xsd:element name="material" type="MaterialType"/> <!-- Main element --> *************** *** 88,91 **** --- 106,110 ---- <xsd:element ref="edge" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> + <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 10:28:52
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15834/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Spacenames are now combined with ID's Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GenericTreeView.java 15 May 2006 08:37:47 -0000 1.25 --- GenericTreeView.java 15 May 2006 10:28:49 -0000 1.26 *************** *** 420,423 **** --- 420,434 ---- /** + * Return the displaystring for this EntityNode + * @return Display string + */ + public String toString() { + Object object = this.getUserObject(); + Entity entity = (Entity) object; + String nid = entity.getName() + "-" + entity.getId().toString(); + return nid; + } + + /** * Return icon * @return icon |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 10:27:57
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15480/src/net/sourceforge/bprocessor/gui/attrview Modified Files: LinkAttribute.java Log Message: The textFields now autocomplete. Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** LinkAttribute.java 15 May 2006 09:20:23 -0000 1.7 --- LinkAttribute.java 15 May 2006 10:27:53 -0000 1.8 *************** *** 15,19 **** import java.awt.event.MouseListener; import java.net.URL; - import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; --- 15,18 ---- *************** *** 399,403 **** if (!string.equalsIgnoreCase("")) { List sort = new LinkedList(Project.getInstance().getSpaces()); ! Collections.sort((List) sort); LinkedList matches = new LinkedList(); Iterator it = sort.iterator(); --- 398,402 ---- if (!string.equalsIgnoreCase("")) { List sort = new LinkedList(Project.getInstance().getSpaces()); ! //Collections.sort((List) sort); LinkedList matches = new LinkedList(); Iterator it = sort.iterator(); |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 09:25:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21874/src/net/sourceforge/bprocessor/gl/tool Modified Files: CreateSpaceActionListener.java Log Message: Removed unique name requirement to spacenames Index: CreateSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CreateSpaceActionListener.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CreateSpaceActionListener.java 1 May 2006 10:05:58 -0000 1.8 --- CreateSpaceActionListener.java 15 May 2006 09:17:55 -0000 1.9 *************** *** 68,81 **** if (functional) { ! result = checkName(JOptionPane.showInputDialog(GUI.getInstance(), "Name", "Create Functional " + category, ! JOptionPane.QUESTION_MESSAGE)); } else { ! result = checkName(JOptionPane.showInputDialog(GUI.getInstance(), "Name", "Create Construction " + category, ! JOptionPane.QUESTION_MESSAGE)); } if (log.isDebugEnabled()) { --- 68,81 ---- if (functional) { ! result = JOptionPane.showInputDialog(GUI.getInstance(), "Name", "Create Functional " + category, ! JOptionPane.QUESTION_MESSAGE); } else { ! result = JOptionPane.showInputDialog(GUI.getInstance(), "Name", "Create Construction " + category, ! JOptionPane.QUESTION_MESSAGE); } if (log.isDebugEnabled()) { |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 09:21:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23346/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Spacenames are now combined with ID's Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** Surface.java 1 May 2006 10:08:48 -0000 1.95 --- Surface.java 15 May 2006 09:21:32 -0000 1.96 *************** *** 976,979 **** --- 976,980 ---- */ public Material getFrontMaterial() { + return frontMaterial; } *************** *** 1266,1270 **** while (it.hasNext()) { Space current = (Space) it.next(); ! if (current.getName().equals(a.getValue())) { setFrontDomain(current); } --- 1267,1272 ---- while (it.hasNext()) { Space current = (Space) it.next(); ! String nid = current.getName() + "-" + current.getId().toString(); ! if (nid.equals(a.getValue())) { setFrontDomain(current); } *************** *** 1274,1278 **** while (it.hasNext()) { Space current = (Space) it.next(); ! if (current.getName().equals(a.getValue())) { setBackDomain(current); } --- 1276,1281 ---- while (it.hasNext()) { Space current = (Space) it.next(); ! String nid = current.getName() + "-" + current.getId().toString(); ! if (nid.equals(a.getValue())) { setBackDomain(current); } |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 09:20:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22969/src/net/sourceforge/bprocessor/model Modified Files: Material.java Log Message: Materials can now be saved and loaded, and there is a "global" monitoring of all materials. Index: Material.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Material.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Material.java 13 Jan 2006 10:25:02 -0000 1.7 --- Material.java 15 May 2006 09:20:46 -0000 1.8 *************** *** 9,12 **** --- 9,17 ---- /** * The Material of a Surface + * * @hibernate.class + * table="MATERIAL" + * lazy="false" + * @hibernate.cache + * usage="read-write" */ public class Material { *************** *** 18,21 **** --- 23,29 ---- private float[] color; + /** The id */ + private Long id; + /** * Default Constructor for Material *************** *** 35,38 **** --- 43,66 ---- /** + * Get the id + * @return The id + * @hibernate.id + * column="EDGE_ID" + * generator-class="increment" + */ + public Long getId() { + return id; + } + + /** + * Set the id + * @param id The id + */ + public void setId(Long id) { + this.id = id; + } + + + /** * Get the name * @return The name |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 09:20:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22936/src/net/sourceforge/bprocessor/gui/attrview Modified Files: LinkAttribute.java Log Message: The textFields now autocomplete. Index: LinkAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/LinkAttribute.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LinkAttribute.java 24 Apr 2006 08:45:10 -0000 1.6 --- LinkAttribute.java 15 May 2006 09:20:23 -0000 1.7 *************** *** 15,18 **** --- 15,19 ---- import java.awt.event.MouseListener; import java.net.URL; + import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; *************** *** 25,37 **** import javax.swing.JLabel; import javax.swing.JTextField; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Selection; /** * The LinkAttributeView */ ! public class LinkAttribute extends GenericAttribute implements KeyListener, MouseListener { /** The listeners */ --- 26,45 ---- import javax.swing.JLabel; import javax.swing.JTextField; + import javax.swing.text.AttributeSet; + import javax.swing.text.BadLocationException; + import javax.swing.text.Document; + import javax.swing.text.PlainDocument; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Space; /** * The LinkAttributeView */ ! public class LinkAttribute extends GenericAttribute ! implements KeyListener, MouseListener { /** The listeners */ *************** *** 51,55 **** /** The editor, when this EditableAttribute is being edited */ ! private JTextField editor; --- 59,63 ---- /** The editor, when this EditableAttribute is being edited */ ! private AutoCompleteField editor; *************** *** 164,168 **** JLabel valueLabel; if (value instanceof Entity) { ! s = ((Entity)value).getName(); valueLabel = new JLabel(s); } else { --- 172,176 ---- JLabel valueLabel; if (value instanceof Entity) { ! s = ((Entity)value).getName() + "-" + ((Entity)value).getId().toString(); valueLabel = new JLabel(s); } else { *************** *** 196,200 **** s = Double.toString(rounded); } ! JTextField valueEditor = new JTextField(s); valueEditor.setFont(AttributeView.FONT_PLAIN); --- 204,208 ---- s = Double.toString(rounded); } ! AutoCompleteField valueEditor = new AutoCompleteField(s); valueEditor.setFont(AttributeView.FONT_PLAIN); *************** *** 218,222 **** if (editor == null) { component.remove(0); ! editor = (JTextField) createValueEditor(attribute.getValue()); editor.addKeyListener(this); component.add(editor); --- 226,230 ---- if (editor == null) { component.remove(0); ! editor = (AutoCompleteField) createValueEditor(attribute.getValue()); editor.addKeyListener(this); component.add(editor); *************** *** 263,266 **** --- 271,276 ---- } + + /** * Respond to the enter key by stopping editing. *************** *** 272,276 **** } else if (event.getKeyCode() == KeyEvent.VK_ESCAPE) { cancelEditing(); ! } } --- 282,286 ---- } else if (event.getKeyCode() == KeyEvent.VK_ESCAPE) { cancelEditing(); ! } } *************** *** 314,316 **** --- 324,430 ---- */ public void mouseExited(MouseEvent event) { } + + + /** + * Autocomplete textfield + */ + public class AutoCompleteField extends JTextField { + /** + * constructor of autocomplete field + * @param string is the number of colums in the field + */ + public AutoCompleteField(String string) { + super(string); + } + + /** + * creates the document + * @return a new autocompletedocument + */ + protected Document createDefaultModel() { + return new AutoCompleteDocument(this); + } + } + + /** + * The autocomplete document + */ + public class AutoCompleteDocument extends PlainDocument { + /** The typed text */ + private String typed; + + /** The textfield */ + private JTextField field; + + /** + * The AutoCompleteDocoment constructor + * @param field the Textfield + */ + public AutoCompleteDocument(JTextField field) { + this.field = field; + typed = ""; + } + + /** + * insertString, insert a string into the document + * @param offs the offset + * @param str the string to be inserted + * @param a the AttributeSet + * @throws BadLocationException is thrown if the location is out of place + */ + public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { + if (str == null) { + return; + } + if (offs < typed.length()) { + typed = typed.substring(0, offs) + str + typed.substring(offs, typed.length()); + } else { + typed = typed + str; + } + + super.remove(0, super.getLength()); + typed = autocomplete(typed); + super.insertString(0, typed, a); + field.setCaretPosition(offs + str.length()); + field.setSelectionStart(offs + str.length()); + field.setSelectionEnd(typed.length()); + } + + /** + * Autocomplete the given string + * @param string The string to autocomplete + * @return The result of the completion that is the given string if no completion + */ + public String autocomplete(String string) { + if (!string.equalsIgnoreCase("")) { + List sort = new LinkedList(Project.getInstance().getSpaces()); + Collections.sort((List) sort); + LinkedList matches = new LinkedList(); + Iterator it = sort.iterator(); + while (it.hasNext()) { + Space current = (Space) it.next(); + String name = current.getName() + "-" + current.getId().toString(); + if (name.startsWith(string) && !name.equalsIgnoreCase(string)) { + matches.add(name); + return name; + } + } + } + return string; + } + + /** + * @param offs the ofset to remove from + * @param amount The number of characters to remove + * @throws BadLocationException if characters that do not exist is beeing removed + */ + public void remove(int offs, int amount) throws BadLocationException { + //FIXME + String typed1 = typed.substring(0, offs); + String typed2 = typed.substring(offs + amount, typed.length()); + typed = typed1.concat(typed2); + //String test = autocomplete(typed); + super.remove(offs, amount); + } + } } |
From: Nikolaj B. <nbr...@us...> - 2006-05-15 09:20:00
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22573/src/net/sourceforge/bprocessor/gui/attrview Modified Files: MaterialAttribute.java Log Message: Materials can now be saved and loaded, and there is a "global" monitoring of all materials. Index: MaterialAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MaterialAttribute.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MaterialAttribute.java 10 Apr 2006 11:54:39 -0000 1.3 --- MaterialAttribute.java 15 May 2006 09:19:53 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Material; + import net.sourceforge.bprocessor.model.Project; /** *************** *** 138,142 **** "Surface Color", makeAWTColor(((Material) attribute.getValue()).getColor())); ! attribute.setValue(new Material("temp", frontColor.getRGBColorComponents(null))); valueChanged(); } --- 139,145 ---- "Surface Color", makeAWTColor(((Material) attribute.getValue()).getColor())); ! Material material = new Material("temp", frontColor.getRGBColorComponents(null)); ! Project.getInstance().add(material); ! attribute.setValue(material); valueChanged(); } |
From: Michael L. <he...@us...> - 2006-05-15 08:37:50
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6688/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Length field bugfix in TapeMeasure Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GenericTreeView.java 3 May 2006 10:14:01 -0000 1.24 --- GenericTreeView.java 15 May 2006 08:37:47 -0000 1.25 *************** *** 33,36 **** --- 33,38 ---- import javax.swing.tree.TreePath; + import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Constraint; *************** *** 49,53 **** */ public class GenericTreeView extends TreeView implements Observer { ! /** * --- 51,56 ---- */ public class GenericTreeView extends TreeView implements Observer { ! /** The logger */ ! private static Logger log = Logger.getLogger(GenericTreeView.class); /** * *************** *** 783,791 **** public void valueChanged(TreeSelectionEvent event) { TreePath path = event.getPath(); ! Object object = path.getLastPathComponent(); ! if (object instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) object; ! Object target = node.getUserObject(); ! select(target); } } --- 786,797 ---- public void valueChanged(TreeSelectionEvent event) { TreePath path = event.getPath(); ! if (event.isAddedPath()) { ! Object object = path.getLastPathComponent(); ! if (object instanceof DefaultMutableTreeNode) { ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) object; ! Object target = node.getUserObject(); ! log.info("value-changed " + event); ! select(target); ! } } } |
From: Michael L. <he...@us...> - 2006-05-15 08:37:49
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6675/src/net/sourceforge/bprocessor/gl/tool Modified Files: TapeMeasureTool.java Removed Files: PencilTool.java Log Message: Length field bugfix in TapeMeasure Index: TapeMeasureTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/TapeMeasureTool.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TapeMeasureTool.java 21 Apr 2006 15:08:25 -0000 1.14 --- TapeMeasureTool.java 15 May 2006 08:37:44 -0000 1.15 *************** *** 29,41 **** /** The logger */ private static Logger log = Logger.getLogger(TapeMeasureTool.class); - - /** The x axis */ - private Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); - - /** The y axis */ - private Edge yAxis = new Edge(new Vertex(0, -50, 0), new Vertex(0, 50, 0)); - - /**The z axis */ - private Edge zAxis = new Edge(new Vertex(0, 0, -50), new Vertex(0, 0, 50)); /** The current edge */ --- 29,32 ---- *************** *** 162,166 **** public void keyPressed(KeyEvent e) { super.keyPressed(e); ! move(); } --- 153,157 ---- public void keyPressed(KeyEvent e) { super.keyPressed(e); ! //move(); } *************** *** 178,180 **** --- 169,179 ---- } } + /** + * Finish tape measure + */ + public void onVertex() { + move(); + endTapeMeasure(); + start = null; + } } --- PencilTool.java DELETED --- |
From: Michael L. <he...@us...> - 2006-05-09 01:09:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16163/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: A selected space is show with highlighted edges and invisible surfaces Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** View.java 5 May 2006 11:40:07 -0000 1.88 --- View.java 8 May 2006 07:14:34 -0000 1.89 *************** *** 288,291 **** --- 288,297 ---- private Map colorMap; + /** Contains invisible entities during drawing */ + private Set invisibles; + + /** Contains highlighted entities during drawing */ + private Set highligts; + static { setTransparency(100); *************** *** 695,703 **** // draw selection gl.glColor3fv(SELECTED_COLOR); ! Iterator selit = selection.iterator(); ! while (selit.hasNext()) { ! Object o = selit.next(); ! if (o instanceof Surface) { ! drawObject(o); } } --- 701,733 ---- // draw selection gl.glColor3fv(SELECTED_COLOR); ! invisibles = new HashSet(); ! highligts = new HashSet(); ! ! { ! Iterator iter = selection.iterator(); ! while (iter.hasNext()) { ! Object object = iter.next(); ! if (object instanceof Space) { ! Space space = (Space) object; ! Collection envelope = space.getEnvelope(); ! Iterator i = envelope.iterator(); ! while (i.hasNext()) { ! Surface surface = (Surface) i.next(); ! highligts.addAll(surface.getEdges()); ! invisibles.add(surface); ! } ! } else { ! highligts.add(object); ! } ! } ! } ! ! { ! Iterator iter = highligts.iterator(); ! while (iter.hasNext()) { ! Object o = iter.next(); ! if (o instanceof Surface) { ! drawObject(o); ! } } } *************** *** 715,724 **** } ! gl.glColor3fv(SELECTED_COLOR); ! selit = selection.iterator(); ! while (selit.hasNext()) { ! Object o = selit.next(); ! if (!(o instanceof Surface)) { ! drawObject(o); } } --- 745,756 ---- } ! { ! gl.glColor3fv(SELECTED_COLOR); ! Iterator highlightIter = highligts.iterator(); ! while (highlightIter.hasNext()) { ! Object o = highlightIter.next(); ! if (!(o instanceof Surface)) { ! drawObject(o); ! } } } *************** *** 914,918 **** */ private boolean hide(Surface surface) { ! return false; } --- 946,950 ---- */ private boolean hide(Surface surface) { ! return invisibles.contains(surface); } |
From: Michael L. <he...@us...> - 2006-05-09 01:03:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21160/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Another attempt at fixing the orthogonal constructors - stil does not quite work Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AbstractPencil.java 8 May 2006 08:53:14 -0000 1.30 --- AbstractPencil.java 8 May 2006 12:47:33 -0000 1.31 *************** *** 385,390 **** plane = new Plane(0, 0, 1, 0); } ! CoordinateSystem system = plane.coordinateSystem(); Vertex direction = parrallel.getDirection(); direction = system.translate(direction); --- 385,391 ---- plane = new Plane(0, 0, 1, 0); } ! CoordinateSystem system = plane.coordinateSystem(); + Vertex direction = parrallel.getDirection(); direction = system.translate(direction); *************** *** 393,397 **** direction.setX(-y); direction.setY(x); ! system.unTranslate(direction); direction.scale(50 / direction.length()); Edge orthogonal = null; --- 394,398 ---- direction.setX(-y); direction.setY(x); ! direction = system.unTranslate(direction); direction.scale(50 / direction.length()); Edge orthogonal = null; |
From: Nordholt <nor...@us...> - 2006-05-09 00:56:29
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5560 Modified Files: Space.java Log Message: fixed copy method to work proper recursively Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Space.java 7 May 2006 09:33:36 -0000 1.30 --- Space.java 7 May 2006 16:58:53 -0000 1.31 *************** *** 946,1039 **** Map copiedSurfaces = new HashMap(); Map copiedSpaces = new HashMap(); ! ! Space copy = new Space("*copy of " + this.getName() + "*", this.getType(), this.isContainer()); ! ! /* Copying the envelope of this space */ ! /* vertices */ ! Iterator it = this.collect().iterator(); while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! Vertex newVertex = v.copy(); ! if (vertices.values().contains(v)) { ! copy.add(newVertex); ! } else { ! Project.getInstance().add(newVertex); } - copiedVertices.put(v, newVertex); } ! ! /* surfaces and edges */ ! it = this.envelope.iterator(); while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! Iterator edgeIt = s.getEdges().iterator(); ! List newEdges = new LinkedList(); ! while (edgeIt.hasNext()) { ! Edge e = (Edge)edgeIt.next(); ! if (copiedEdges.keySet().contains(e)) { ! newEdges.add(copiedEdges.get(e)); ! } else { ! Edge newEdge = new Edge((Vertex)copiedVertices.get(e.getTo()), ! (Vertex)copiedVertices.get(e.getFrom())); ! Project.getInstance().add(newEdge); ! copiedEdges.put(e, newEdge); ! newEdges.add(newEdge); ! } ! } ! Surface newSurface = new Surface(newEdges); ! Space worldEmpty = Project.getInstance().world().getEmpty(); ! if (s.getBackDomain() == this) { ! newSurface.setBackDomain(copy); ! } else { ! newSurface.setBackDomain(worldEmpty); ! } ! ! if (s.getFrontDomain() == this) { ! newSurface.setFrontDomain(copy); ! } else { ! newSurface.setFrontDomain(worldEmpty); ! } ! copiedSurfaces.put(s, newSurface); ! Project.getInstance().add(newSurface); } - - Set newSurfaces = new HashSet(copiedSurfaces.values()); - copy.setEnvelope(newSurfaces); - Project.getInstance().add(copy); - - /* Copying elements of this space */ - - /* edges */ it = edges.values().iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! Edge elementEdge = new Edge((Vertex)copiedVertices.get(e.getTo()), ! (Vertex)copiedVertices.get(e.getFrom())); ! copiedEdges.put(e, elementEdge); ! copy.add(elementEdge); } - - /* surfaces */ it = surfaces.values().iterator(); while (it.hasNext()) { Surface s = (Surface)it.next(); ! List edgeCopies = new LinkedList(); Iterator edgeIt = s.getEdges().iterator(); while (edgeIt.hasNext()) { ! Edge e = (Edge)edgeIt.next(); ! edgeCopies.add(copiedEdges.get(e)); } ! Surface elementSurface = new Surface(edgeCopies); ! elementSurface.setBackDomain(s.getBackDomain()); ! elementSurface.setFrontDomain(s.getFrontDomain()); ! copiedSurfaces.put(s, elementSurface); ! copy.add(elementSurface); } ! ! return copy; } } --- 946,1122 ---- Map copiedSurfaces = new HashMap(); Map copiedSpaces = new HashMap(); ! Space copy = this.copy(copiedVertices, copiedEdges, ! copiedSurfaces, copiedSpaces); ! Project.getInstance().add(copy); ! Project.getInstance().checkpoint(); ! return copy; ! } ! ! /** ! * Copy this space and return the copy ! * @param copiedVertices map of vertices and their copies. ! * @param copiedEdges map of edges and their copies. ! * @param copiedSurfaces map of surfaces and their copies. ! * @param copiedSpaces map of spaces and their copies. ! * @return the copy of this space ! */ ! private Space copy(Map copiedVertices, ! Map copiedEdges, ! Map copiedSurfaces, ! Map copiedSpaces) { Space copy = new Space("*copy of " + this.getName() + "*", this.getType(), this.isContainer()); ! Set envelopeCopy = copyEnvelope(copiedVertices, ! copiedEdges, ! copiedSurfaces, ! copy); ! copy.setEnvelope(envelopeCopy); ! if (copy.isContainer()) { ! copyInteriorGeometry(copiedVertices, ! copiedEdges, ! copiedSurfaces, ! copy); ! copyInteriorSpaces(copiedVertices, ! copiedEdges, ! copiedSurfaces, ! copiedSpaces, ! copy); ! } ! return copy; ! } ! /** ! * Copies the interior spaces of this space. ! * The method maintains the four copy maps of vertices, edges, ! * surfaces and spaces. ! * @param copiedVertices map of vertices and their copies. ! * @param copiedEdges map of edges and their copies. ! * @param copiedSurfaces map of surfaces and their copies. ! * @param copiedSpaces map of spaces and their copies. ! * @param copy the copy of this space ! */ ! private void copyInteriorSpaces(Map copiedVertices, ! Map copiedEdges, ! Map copiedSurfaces, ! Map copiedSpaces, ! Space copy) { ! Iterator it = elements.values().iterator(); while (it.hasNext()) { ! Space sp = (Space)it.next(); ! if (!(sp.toString().equals("Void"))) { ! Space newSpace = sp.copy(copiedVertices, ! copiedEdges, ! copiedSurfaces, ! copiedSpaces); ! copiedSpaces.put(sp, newSpace); ! copy.add(newSpace); } } ! } ! ! /** ! * Copies the interior surfaces edges and vertices of this space. ! * The method maintains the three copy maps of vertices, edges and ! * surfaces. ! * @param copiedVertices map of vertices and their copies. ! * @param copiedEdges map of edges and their copies. ! * @param copiedSurfaces map of surfaces and their copies. ! * @param copy the copy of this space ! */ ! private void copyInteriorGeometry(Map copiedVertices, ! Map copiedEdges, ! Map copiedSurfaces, ! Space copy) { ! Iterator it = vertices.values().iterator(); while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! Vertex vCopy = v.copy(); ! copiedVertices.put(v, vCopy); ! copy.add(vCopy); } it = edges.values().iterator(); while (it.hasNext()) { Edge e = (Edge)it.next(); ! Edge eCopy = new Edge((Vertex)copiedVertices.get(e.getTo()), ! (Vertex)copiedVertices.get(e.getFrom())); ! copiedEdges.put(e, eCopy); ! copy.add(eCopy); } it = surfaces.values().iterator(); while (it.hasNext()) { Surface s = (Surface)it.next(); ! List newEdges = new LinkedList(); Iterator edgeIt = s.getEdges().iterator(); while (edgeIt.hasNext()) { ! newEdges.add(copiedEdges.get((Edge)edgeIt.next())); } ! Surface newSurface = new Surface(newEdges); ! newSurface.setFrontDomain(copy.getEmpty()); ! newSurface.setBackDomain(copy.getEmpty()); ! copiedSurfaces.put(s, newSurface); ! copy.add(newSurface); } ! } ! ! /** ! * Copies the envelope of this space and returns the ! * set of surfaces that is the envelope. The method maintains the ! * three copy maps of vertices, edges and surfaces. ! * @param copiedVertices map of vertices and their copies. ! * @param copiedEdges map of edges and their copies. ! * @param copiedSurfaces map of surfaces and their copies. ! * @param copy the copy of this space. ! * @return the envelope set of surfaces ! */ ! private Set copyEnvelope(Map copiedVertices, ! Map copiedEdges, ! Map copiedSurfaces, ! Space copy) { ! Iterator it = this.envelope.iterator(); ! Set envelopeCopy = new HashSet(); ! while (it.hasNext()) { ! Surface s = (Surface)it.next(); ! Surface surfaceCopy; ! if (copiedSurfaces.keySet().contains(s)) { ! surfaceCopy = (Surface)copiedSurfaces.get(s); ! envelopeCopy.add(surfaceCopy); ! } else { ! /* This should only apply to the outer layer */ ! Iterator edgeIt = s.getEdges().iterator(); ! List edgeCopies = new LinkedList(); ! while (edgeIt.hasNext()) { ! Edge e = (Edge)edgeIt.next(); ! if (!copiedVertices.keySet().contains(e.getTo())) { ! copiedVertices.put(e.getTo(), e.getTo().copy()); ! Project.getInstance().add((Vertex)copiedVertices.get(e.getTo())); ! } ! if (!copiedVertices.keySet().contains(e.getFrom())) { ! copiedVertices.put(e.getFrom(), e.getFrom().copy()); ! Project.getInstance().add((Vertex)copiedVertices.get(e.getFrom())); ! } ! if (!copiedEdges.keySet().contains(e)) { ! copiedEdges.put(e, new Edge((Vertex)copiedVertices.get(e.getFrom()), ! (Vertex)copiedVertices.get(e.getTo()))); ! } ! Project.getInstance().add((Edge)copiedEdges.get(e)); ! edgeCopies.add(copiedEdges.get(e)); ! } ! surfaceCopy = new Surface(edgeCopies); ! Project.getInstance().add(surfaceCopy); ! surfaceCopy.setFrontDomain(Project.getInstance().world().getEmpty()); ! surfaceCopy.setBackDomain(Project.getInstance().world().getEmpty()); ! envelopeCopy.add(surfaceCopy); ! copiedSurfaces.put(s, surfaceCopy); ! } ! if (s.getFrontDomain() == this) { ! surfaceCopy.setFrontDomain(copy); ! } ! if (s.getBackDomain() == this) { ! surfaceCopy.setBackDomain(copy); ! } ! surfaceCopy.getVertices(); ! } ! return envelopeCopy; } } |
From: rimestad <rim...@us...> - 2006-05-08 23:58:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20672/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Have made the directions of controlled extrusion of bounded vertexes acording to the 3'rd edge and not the normal Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** Surface.java 1 May 2006 10:08:48 -0000 1.95 --- Surface.java 8 May 2006 15:21:23 -0000 1.96 *************** *** 629,633 **** } else { vmap[i] = v[i]; ! v2dir.put(v[i], new Direction(v[i], normal)); } } --- 629,657 ---- } else { vmap[i] = v[i]; ! Vertex dir = null; ! Collection c = v[i].getEdges(); ! Iterator iter = c.iterator(); ! while (iter.hasNext()) { ! Edge cur = (Edge)iter.next(); ! if (!this.contains(cur)) { ! dir = cur.getDirection(); ! if (dir.dot(normal) < 0) { ! dir.scale(-1); ! } ! dir.scale(1 / dir.length()); ! if (normal.getX() != 0) { ! dir.scale(1 / normal.dot(dir)); ! } else if (normal.getY() != 0) { ! dir.scale(1 / normal.dot(dir)); ! } else { ! dir.scale(1 / normal.dot(dir)); ! } ! log.info("Dir became: " + dir); ! } ! } ! if (dir == null) { ! dir = normal; ! } ! v2dir.put(v[i], new Direction(v[i], dir)); } } |
From: rimestad <rim...@us...> - 2006-05-08 23:56:26
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6089/src/etc Modified Files: bprocessor.xsd Log Message: The modified xml schema with the program id in it Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** bprocessor.xsd 5 Apr 2006 09:35:58 -0000 1.10 --- bprocessor.xsd 7 May 2006 09:35:07 -0000 1.11 *************** *** 11,14 **** --- 11,15 ---- <xsd:sequence> <xsd:element name="id" type="xsd:long"/> + <xsd:element name="progid" type="xsd:long"/> </xsd:sequence> </xsd:complexType> *************** *** 44,48 **** <xsd:element name="exterior" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> ! </xsd:extension> </xsd:complexContent> </xsd:complexType> --- 45,49 ---- <xsd:element name="exterior" type="xsd:long" maxOccurs="1" minOccurs="0"/> </xsd:sequence> ! </xsd:extension> </xsd:complexContent> </xsd:complexType> |
From: rimestad <rim...@us...> - 2006-05-08 23:55:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5200/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java Persistence.java Log Message: Persistens saves the entity id's to xml so that the id's matches the old ones... Have made a change to all the add(entity) methods so that is the given object already have an assigned id it will use that and set the id counter to that value... Added a id to the world space otherwise the conversion from and to xml chokes... Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Persistence.java 5 Apr 2006 09:35:58 -0000 1.1 --- Persistence.java 7 May 2006 09:33:36 -0000 1.2 *************** *** 118,121 **** --- 118,122 ---- boolean container = (empty != 0); Space space = new Space(name, type, container); + space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); mapper.put(new Long(xml.getId()), space); *************** *** 175,178 **** --- 176,180 ---- private static Surface internalizeSurface(SurfaceType xml, Map mapper, Collection xmls) { Surface surface = new Surface(); + surface.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), surface); xmls.add(xml); *************** *** 189,192 **** --- 191,195 ---- private static Edge internalizeEdge(EdgeType xml, Map mapper, Collection xmls) { Edge edge = new Edge(); + edge.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), edge); xmls.add(xml); *************** *** 204,207 **** --- 207,211 ---- private static Vertex internalizeVertex(VertexType xml, Map mapper, Collection xmls) { Vertex vertex = new Vertex(); + vertex.setId(new Long(xml.getProgid())); mapper.put(new Long(xml.getId()), vertex); xmls.add(xml); *************** *** 385,388 **** --- 389,393 ---- SpaceType xml = new SpaceImpl(); xml.setId(counter++); + xml.setProgid(space.getId().longValue()); xml.setName(space.getName()); xml.setType(space.getType()); *************** *** 430,433 **** --- 435,439 ---- SurfaceType xml = new SurfaceImpl(); xml.setId(counter++); + xml.setProgid(surface.getId().longValue()); map.put(surface, xml); return xml; *************** *** 443,446 **** --- 449,453 ---- EdgeType xml = new EdgeImpl(); xml.setId(counter++); + xml.setProgid(edge.getId().longValue()); map.put(edge, xml); xml.setConstructor(edge.getConstructor()); *************** *** 457,460 **** --- 464,468 ---- VertexType xml = new VertexImpl(); xml.setId(counter++); + xml.setProgid(vertex.getId().longValue()); map.put(vertex, xml); xml.setX(vertex.getX()); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Space.java 3 May 2006 10:12:34 -0000 1.29 --- Space.java 7 May 2006 09:33:36 -0000 1.30 *************** *** 249,254 **** public void add(Vertex vertex) { if (container) { ! Long id = new Long(nextVertexId++); ! vertex.setId(id); vertices.put(id, vertex); vertex.setOwner(this); --- 249,260 ---- public void add(Vertex vertex) { if (container) { ! Long id; ! if (vertex.getId() != null) { ! id = vertex.getId(); ! nextVertexId = Math.max(nextVertexId, id.longValue() + 1); ! } else { ! id = new Long(nextVertexId++); ! vertex.setId(id); ! } vertices.put(id, vertex); vertex.setOwner(this); *************** *** 321,326 **** public void add(Edge edge) { if (container) { ! Long id = new Long(nextEdgeId++); ! edge.setId(id); edges.put(id, edge); edge.setOwner(this); --- 327,338 ---- public void add(Edge edge) { if (container) { ! Long id; ! if (edge.getId() != null) { ! id = edge.getId(); ! nextEdgeId = Math.max(nextEdgeId, id.longValue() + 1); ! } else { ! id = new Long(nextEdgeId++); ! edge.setId(id); ! } edges.put(id, edge); edge.setOwner(this); *************** *** 501,506 **** public void add(Surface surface) { if (container) { ! Long id = new Long(nextSurfaceId++); ! surface.setId(id); surfaces.put(id, surface); surface.setOwner(this); --- 513,524 ---- public void add(Surface surface) { if (container) { ! Long id; ! if (surface.getId() != null) { ! id = surface.getId(); ! nextSurfaceId = Math.max(nextSurfaceId, id.longValue() + 1); ! } else { ! id = new Long(nextSurfaceId++); ! surface.setId(id); ! } surfaces.put(id, surface); surface.setOwner(this); *************** *** 703,708 **** public void add(Space element) { if (container) { ! Long id = new Long(nextElementId++); ! element.setId(id); elements.put(id, element); } else { --- 721,732 ---- public void add(Space element) { if (container) { ! Long id; ! if (element.getId() != null) { ! id = element.getId(); ! nextElementId = Math.max(nextElementId, id.longValue() + 1); ! } else { ! id = new Long(nextElementId++); ! element.setId(id); ! } elements.put(id, element); } else { Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Project.java 21 Apr 2006 15:23:06 -0000 1.55 --- Project.java 7 May 2006 09:33:36 -0000 1.56 *************** *** 96,99 **** --- 96,100 ---- observers = new LinkedList(); world = new Space("World", Space.FUNCTIONAL, true); + world.setId(new Long(0)); constraints = new LinkedList(); } *************** *** 659,669 **** } currentState = (Bmodel) undoStack.pop(); ! clear(); ! Persistence.internalize(currentState); } } /** ! * Redo */ public void redo() { --- 660,669 ---- } currentState = (Bmodel) undoStack.pop(); ! setState(currentState); } } /** ! * Redo the state to currentState */ public void redo() { *************** *** 673,682 **** } currentState = (Bmodel) redoStack.pop(); ! clear(); ! Persistence.internalize(currentState); } } /** * Reset undo/redo history */ --- 673,697 ---- } currentState = (Bmodel) redoStack.pop(); ! setState(currentState); } } /** + * Set the state of the program to the given state + * @param state the state to use + */ + public void setState(Bmodel state) { + clear(); + Persistence.internalize(state); + } + + /** + * Reset the state to currentState + */ + public void resetState() { + setState(currentState); + } + + /** * Reset undo/redo history */ |
From: Michael L. <he...@us...> - 2006-05-08 18:00:56
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8728/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Attempt to fix problem with orthogonal constructor Ð not fixed Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** AbstractPencil.java 5 May 2006 14:08:38 -0000 1.29 --- AbstractPencil.java 8 May 2006 08:53:14 -0000 1.30 *************** *** 377,401 **** glv.getView().changeColor(parrallel, new float[] {255f / 255f, 153f / 255f, 0}); constructors.add(parrallel); ! ! Plane xy = new Plane(0, 0, 1, 0); ! CoordinateSystem system = xy.coordinateSystem(); ! Vertex direction = parrallel.getDirection(); ! direction = system.translate(direction); ! double x = direction.getX(); ! double y = direction.getY(); ! direction.setX(-y); ! direction.setY(x); ! system.unTranslate(direction); ! direction.scale(50 / direction.length()); ! Edge orthogonal = null; ! if (start != null) { ! orthogonal = new Edge(start.vertex().minus(direction), start.vertex().add(direction)); ! } else { ! if (incident != null) { ! orthogonal = new Edge(incident.vertex().minus(direction), ! incident.vertex().add(direction)); ! } } ! if (orthogonal != null) { orthogonal.setConstructor(true); glv.getView().changeColor(orthogonal, new float[] {255f / 255f, 153f / 255f, 0}); --- 377,409 ---- glv.getView().changeColor(parrallel, new float[] {255f / 255f, 153f / 255f, 0}); constructors.add(parrallel); ! } ! Plane plane; ! ! if (View.getLastSurface() != null) { ! plane = View.getLastSurface().plane(); ! } else { ! plane = new Plane(0, 0, 1, 0); ! } ! ! CoordinateSystem system = plane.coordinateSystem(); ! Vertex direction = parrallel.getDirection(); ! direction = system.translate(direction); ! double x = direction.getX(); ! double y = direction.getY(); ! direction.setX(-y); ! direction.setY(x); ! system.unTranslate(direction); ! direction.scale(50 / direction.length()); ! Edge orthogonal = null; ! if (start != null) { ! orthogonal = new Edge(start.vertex().minus(direction), start.vertex().add(direction)); ! } else { ! if (incident != null) { ! orthogonal = new Edge(incident.vertex().minus(direction), ! incident.vertex().add(direction)); } ! } ! if (orthogonal != null) { ! if (!isAxisAligned(orthogonal)) { orthogonal.setConstructor(true); glv.getView().changeColor(orthogonal, new float[] {255f / 255f, 153f / 255f, 0}); |
From: Michael L. <he...@us...> - 2006-05-05 14:08:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28928a/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractPencil.java Log Message: Plane.coordinateSystem() implemented Orthogonal Constructor implemented in first version that only works with xy plane Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractPencil.java 5 May 2006 12:14:01 -0000 1.28 --- AbstractPencil.java 5 May 2006 14:08:38 -0000 1.29 *************** *** 24,27 **** --- 24,28 ---- import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.gl.view.View; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; *************** *** 376,379 **** --- 377,405 ---- glv.getView().changeColor(parrallel, new float[] {255f / 255f, 153f / 255f, 0}); constructors.add(parrallel); + + Plane xy = new Plane(0, 0, 1, 0); + CoordinateSystem system = xy.coordinateSystem(); + Vertex direction = parrallel.getDirection(); + direction = system.translate(direction); + double x = direction.getX(); + double y = direction.getY(); + direction.setX(-y); + direction.setY(x); + system.unTranslate(direction); + direction.scale(50 / direction.length()); + Edge orthogonal = null; + if (start != null) { + orthogonal = new Edge(start.vertex().minus(direction), start.vertex().add(direction)); + } else { + if (incident != null) { + orthogonal = new Edge(incident.vertex().minus(direction), + incident.vertex().add(direction)); + } + } + if (orthogonal != null) { + orthogonal.setConstructor(true); + glv.getView().changeColor(orthogonal, new float[] {255f / 255f, 153f / 255f, 0}); + constructors.add(orthogonal); + } } } |
From: Michael L. <he...@us...> - 2006-05-05 14:08:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28956/src/net/sourceforge/bprocessor/model Modified Files: Plane.java CoordinateSystem.java Log Message: Plane.coordinateSystem() implemented Orthogonal Constructor implemented in first version that only works with xy plane Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CoordinateSystem.java 22 Mar 2006 10:53:18 -0000 1.9 --- CoordinateSystem.java 5 May 2006 14:08:42 -0000 1.10 *************** *** 117,120 **** --- 117,128 ---- /** + * Set the origin + * @param origin The new origin + */ + public void setOrigin(Vertex origin) { + this.origin = origin; + } + + /** * Return the xy plane of this CoordinateSystem * @return The xy plane *************** *** 219,221 **** --- 227,236 ---- } + /** + * @return String + */ + public String toString() { + return "[i = " + i + " j = " + j + " n = " + n + " o = " + origin + "]"; + } + } Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Plane.java 21 Apr 2006 15:21:59 -0000 1.18 --- Plane.java 5 May 2006 14:08:42 -0000 1.19 *************** *** 255,258 **** --- 255,290 ---- /** + * A CoordinateSystem is returned for this plane. + * @return CoordinateSystem + */ + public CoordinateSystem coordinateSystem() { + Vertex origin = origin(); + Vertex n = new Vertex(a, b, c); + int index = largestCoefficient(); + Vertex i = null; + Vertex j = null; + + if (index == X) { + i = new Vertex(0, 1, 0); + } + if (index == Y) { + i = new Vertex(0, 0, 1); + } + if (index == Z) { + i = new Vertex(1, 0, 0); + } + + double t = n.dot(i); + i.setX(i.getX() - n.getX() * t); + i.setY(i.getY() - n.getY() * t); + i.setZ(i.getZ() - n.getZ() * t); + i.scale(1 / i.length()); + + j = n.cross(i); + + return new CoordinateSystem(i, j, n, origin); + } + + /** * Project a vector into this plane * @param vector The vector to project |
From: Michael L. <he...@us...> - 2006-05-05 12:14:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1591/src/net/sourceforge/bprocessor/gl/tool Modified Files: Pencil.java AbstractPencil.java Log Message: Small improvement to the parralel edge mechanism Index: Pencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Pencil.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Pencil.java 29 Mar 2006 14:12:27 -0000 1.5 --- Pencil.java 5 May 2006 12:14:01 -0000 1.6 *************** *** 78,81 **** --- 78,82 ---- edges.add(edge); insertEdges(edges); + hooverEdge = edge; if (current.type() == Intersection.VERTEX Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** AbstractPencil.java 3 May 2006 11:01:27 -0000 1.27 --- AbstractPencil.java 5 May 2006 12:14:01 -0000 1.28 *************** *** 65,68 **** --- 65,71 ---- protected Intersection incident; + /** Hoover edge */ + protected Edge hooverEdge; + /** Locked */ protected Vertex locked; *************** *** 354,368 **** if (incident != null) { constructors.addAll(xyz(incident.vertex())); ! if (incident.hasEdge()) { ! Edge edge = (Edge) incident.object(); ! Vertex v = edge.getDirection(); ! v.scale(50 / v.length()); ! Edge parrallel = null; ! if (start != null) { ! parrallel = new Edge(start.vertex().minus(v), start.vertex().add(v)); ! } else { parrallel = new Edge(incident.vertex().minus(v), incident.vertex().add(v)); } ! if (!isAxisAligned(parrallel)) { parrallel.setConstructor(true); --- 357,375 ---- if (incident != null) { constructors.addAll(xyz(incident.vertex())); ! } ! ! if (hooverEdge != null) { ! Edge edge = hooverEdge; ! Vertex v = edge.getDirection(); ! v.scale(50 / v.length()); ! Edge parrallel = null; ! if (start != null) { ! parrallel = new Edge(start.vertex().minus(v), start.vertex().add(v)); ! } else { ! if (incident != null) { parrallel = new Edge(incident.vertex().minus(v), incident.vertex().add(v)); } ! } ! if (parrallel != null) { if (!isAxisAligned(parrallel)) { parrallel.setConstructor(true); *************** *** 370,379 **** constructors.add(parrallel); } - //if (plane != null) { - //info(plane); - //info("origin = " + plane.origin()); - //} } } if (!showing) { aligners(constructors); --- 377,383 ---- constructors.add(parrallel); } } } + if (!showing) { aligners(constructors); *************** *** 509,512 **** --- 513,520 ---- } + if (current.hasEdge()) { + hooverEdge = (Edge) current.object(); + } + switch (current.type()) { case Intersection.VERTEX: *************** *** 752,755 **** --- 760,764 ---- current = null; incident = null; + hooverEdge = null; lock = false; constructors(new LinkedList()); |
From: Michael L. <he...@us...> - 2006-05-05 11:40:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16949/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Improvement of hit-detection Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** View.java 5 May 2006 11:31:04 -0000 1.87 --- View.java 5 May 2006 11:40:07 -0000 1.88 *************** *** 1813,1816 **** --- 1813,1829 ---- } else { if (edge != null) { + + { + Vertex m = edge.getFrom().add(edge.getTo()); + m.scale(0.5); + Vertex projected = transformation.project(m); + double dx = x - projected.getX(); + double dy = (height - y) - projected.getY(); + double distance = Math.sqrt(dx * dx + dy * dy); + if (distance < 5) { + return new Intersection(m, Intersection.EDGE_MIDPOINT, edge); + } + } + Edge e1 = edge; Vertex v1 = e1.getTo().minus(e1.getFrom()); *************** *** 1839,1853 **** } ! { ! Vertex m = edge.getFrom().add(edge.getTo()); ! m.scale(0.5); ! Vertex projected = transformation.project(m); ! double dx = x - projected.getX(); ! double dy = (height - y) - projected.getY(); ! double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { ! return new Intersection(m, Intersection.EDGE_MIDPOINT, edge); ! } ! } { --- 1852,1856 ---- } ! { |
From: Michael L. <he...@us...> - 2006-05-05 11:31:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12274/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Improvements to hit-detection Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** View.java 4 May 2006 12:30:08 -0000 1.86 --- View.java 5 May 2006 11:31:04 -0000 1.87 *************** *** 1783,1786 **** --- 1783,1806 ---- } + // If an construction edge is hit, see if there is a real edge + // coincident with the construction-edge. + + if (edge != null) { + edges.remove(edge); + if (edge.getConstructor()) { + Iterator iter = edges.iterator(); + + while (iter.hasNext()) { + Edge current = (Edge) iter.next(); + if (!current.getConstructor()) { + if (edge.intersects(current.getFrom()) && edge.intersects(current.getTo())) { + edge = current; + break; + } + } + } + } + } + if (intersections) { Transformation transformation = this.transformation(); *************** *** 1793,1800 **** } else { if (edge != null) { - Edge e1 = edge; Vertex v1 = e1.getTo().minus(e1.getFrom()); ! edges.remove(edge); Iterator iter = edges.iterator(); --- 1813,1819 ---- } else { if (edge != null) { Edge e1 = edge; Vertex v1 = e1.getTo().minus(e1.getFrom()); ! Iterator iter = edges.iterator(); |
From: Michael L. <he...@us...> - 2006-05-04 12:30:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11229/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Improved hit-detection (uses (near + far)/2 instead of just near). Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** View.java 3 May 2006 14:12:25 -0000 1.85 --- View.java 4 May 2006 12:30:08 -0000 1.86 *************** *** 1681,1688 **** --- 1681,1693 ---- double far = (double) z2 / (double) zMax; + near = (near + far) / 2; + bufferOffset += 2; int id = selectBuffer.get(bufferOffset); + bufferOffset += names; Object current = getName(id); + + if (!unWantedEntities.contains(current)) { if (current instanceof Surface) { *************** *** 1725,1731 **** } - - - if (surface != null) { // Test vertex and edge against surface --- 1730,1733 ---- |
From: Michael L. <he...@us...> - 2006-05-03 14:12:34
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18980a/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Surface/Edge intersections implemented Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** View.java 3 May 2006 11:01:27 -0000 1.84 --- View.java 3 May 2006 14:12:25 -0000 1.85 *************** *** 153,156 **** --- 153,159 ---- /** The size of the viewing area */ protected static double gridSize = 25.0; + + /** The last touched surface */ + protected static Surface lastSurface; /** */ *************** *** 361,364 **** --- 364,369 ---- } + + /** * The constructor *************** *** 393,396 **** --- 398,409 ---- /** + * + * @return Surface + */ + public static Surface getLastSurface() { + return lastSurface; + } + + /** * The initialization part of the 3D view * @param gld The GLDrawable object *************** *** 1747,1750 **** --- 1760,1784 ---- } + // Set the last surface pointed at: + // If pointing at something different than a surface then dont + // change the lastSurface pointed at. + // This makes it possible to find the intersection between an + // edge and a surface even when the edge belongs to some other + // surface. + // Surface may be null in which + // case the lastSurface pointed at will be cleared (happens when pointing + // into empty space. + if (object == null && vertex == null && edge == null) { + lastSurface = surface; + } + + // If lastsurface is null, then use the surface currently under + // any other object pointed at. Surface may be null in which + // case the lastSurface pointed at will be cleared (happens when pointing + // into empty space. + if (lastSurface == null) { + lastSurface = surface; + } + if (intersections) { Transformation transformation = this.transformation(); *************** *** 1776,1780 **** double dy = (height - y) - projected.getY(); double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 6) { return new Intersection(i, Intersection.EDGE_INTERSECTION, edge); } --- 1810,1814 ---- double dy = (height - y) - projected.getY(); double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { return new Intersection(i, Intersection.EDGE_INTERSECTION, edge); } *************** *** 1791,1795 **** double dy = (height - y) - projected.getY(); double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 6) { return new Intersection(m, Intersection.EDGE_MIDPOINT, edge); } --- 1825,1829 ---- double dy = (height - y) - projected.getY(); double distance = Math.sqrt(dx * dx + dy * dy); ! if (distance < 5) { return new Intersection(m, Intersection.EDGE_MIDPOINT, edge); } *************** *** 1797,1800 **** --- 1831,1851 ---- { + if (lastSurface != null) { + Plane plane = lastSurface.plane(); + Vertex intersection = plane.intersection(edge); + if (intersection != null) { + Vertex projected = transformation.project(intersection); + double dx = x - projected.getX(); + double dy = (height - y) - projected.getY(); + double distance = Math.sqrt(dx * dx + dy * dy); + if (distance < 5) { + return new Intersection(intersection, + Intersection.SURFACE_INTERSECTION, lastSurface); + } + } + } + } + + { Edge intersect = edge.intersection(ray); Vertex intersection = intersect.getFrom(); |