bprocessor-commit Mailing List for B-processor (Page 100)
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...> - 2006-09-26 09:52:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19081/src/net/sourceforge/bprocessor/model Modified Files: Space.java Project.java Persistence.java Log Message: added levels to space and added union as a boolean, now the entire program uses that change Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Persistence.java 17 Sep 2006 21:58:27 -0000 1.8 --- Persistence.java 26 Sep 2006 09:52:24 -0000 1.9 *************** *** 130,136 **** Collection elements = new LinkedList(); int type = xml.getType(); long empty = xml.getVoidref(); boolean container = (empty != 0); ! Space space = new Space(name, type, container); space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); --- 130,137 ---- Collection elements = new LinkedList(); int type = xml.getType(); + int level = xml.getLevel(); long empty = xml.getVoidref(); boolean container = (empty != 0); ! Space space = new Space(name, type, level, container); space.setId(new Long(xml.getProgid())); space.setDescription(xml.getDescription()); *************** *** 539,542 **** --- 540,544 ---- xml.setName(space.getName()); xml.setType(space.getType()); + xml.setLevel(space.getLevel()); xml.setDescription(space.getDescription().toString()); xml.setClassification(space.getClassification().toString()); Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** Space.java 19 Sep 2006 10:00:09 -0000 1.65 --- Space.java 26 Sep 2006 09:52:24 -0000 1.66 *************** *** 41,47 **** public static final int CONSTRUCTION = 0; ! /** Functional Type */ public static final int FUNCTIONAL = 1; /** The logger */ private static Logger log = Logger.getLogger(Space.class); --- 41,62 ---- public static final int CONSTRUCTION = 0; ! /** functional Type */ public static final int FUNCTIONAL = 1; + /** project level */ + public static final int PROJECT_LEVEL = 2; + + /** Space level */ + public static final int SPACE_LEVEL = 3; + + /** Element level */ + public static final int ELEMENT_LEVEL = 4; + + /** part level */ + public static final int PART_LEVEL = 5; + + /** part Functional Type */ + private boolean isUnion = false; + /** The logger */ private static Logger log = Logger.getLogger(Space.class); *************** *** 75,78 **** --- 90,94 ---- /** The elements (a list of spaces) */ private HashMap elements; + /** The next element id */ private long nextElementId; *************** *** 140,146 **** --- 156,166 ---- /** The modellor */ private Modellor modellor; + /** type */ private int type; + /** level Space element or part */ + private int level; + /** *************** *** 154,163 **** * @param name The name * @param type The type * @param container The container flag */ ! public Space(String name, int type, boolean container) { super(); setName(name); setType(type); setTransparent(false); setClassification("None"); --- 174,185 ---- * @param name The name * @param type The type + * @param level The level * @param container The container flag */ ! public Space(String name, int type, int level, boolean container) { super(); setName(name); setType(type); + this.level = level; setTransparent(false); setClassification("None"); *************** *** 179,183 **** constructors = new HashMap(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, false); this.add(empty); } --- 201,205 ---- constructors = new HashMap(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, level + 1, false); this.add(empty); } *************** *** 188,194 **** * @param name The name * @return The space */ ! public static Space createConstructionSpace(String name) { ! return new Space(name, Space.CONSTRUCTION, true); } --- 210,229 ---- * @param name The name * @return The space + * @throws Exception If a part is being extended */ ! public Space createConstructionSpace(String name) throws Exception { ! if (this.level == PART_LEVEL) { ! throw new Exception("Not leagal to make further levels of detail, max level is PART"); ! } ! if (this.level == ELEMENT_LEVEL) { ! return new Space(name, Space.CONSTRUCTION, PART_LEVEL, false); ! } ! if (this.level == SPACE_LEVEL) { ! return new Space(name, Space.CONSTRUCTION, ELEMENT_LEVEL, true); ! } ! if (this.level == PROJECT_LEVEL) { ! return new Space(name, Space.CONSTRUCTION, SPACE_LEVEL, true); ! } ! return null; } *************** *** 197,203 **** * @param name The name * @return The space */ ! public static Space createFunctionalSpace(String name) { ! return new Space(name, Space.FUNCTIONAL, true); } --- 232,251 ---- * @param name The name * @return The space + * @throws Exception If a part is being extended */ ! public Space createFunctionalSpace(String name) throws Exception { ! if (this.level == PART_LEVEL) { ! throw new Exception("Not leagal to make further levels of detail, max level is PART"); ! } ! if (this.level == ELEMENT_LEVEL) { ! return new Space(name, Space.FUNCTIONAL, PART_LEVEL, true); ! } ! if (this.level == SPACE_LEVEL) { ! return new Space(name, Space.FUNCTIONAL, ELEMENT_LEVEL, true); ! } ! if (this.level == PROJECT_LEVEL) { ! return new Space(name, Space.FUNCTIONAL, SPACE_LEVEL, true); ! } ! return null; } *************** *** 339,343 **** constructors.clear(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, false); this.add(empty); } --- 387,391 ---- constructors.clear(); nextConstructorId = 1; ! empty = new Space("Void", FUNCTIONAL, this.level, false); this.add(empty); } *************** *** 1202,1209 **** } if (getOwner().getModellor() != null) { ! Project.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); if (parameters != null) { ! Project.info("owner has parameters"); res.add(new Attribute(parameters.getGeneralName(), parameters)); } --- 1250,1257 ---- } if (getOwner().getModellor() != null) { ! log.info("owner has modellor"); Parametric parameters = getOwner().getModellor().get(this); if (parameters != null) { ! log.info("owner has parameters"); res.add(new Attribute(parameters.getGeneralName(), parameters)); } *************** *** 1221,1231 **** */ public String getGeneralName() { ! if (isConstructionSpace()) { ! return "Construction Space"; } ! if (isFunctionalSpace()) { ! return "Functional Space"; } ! return "Space"; } --- 1269,1299 ---- */ public String getGeneralName() { ! if (proto != null) { ! return "Instance"; } ! String res = ""; ! switch (type) { ! case CONSTRUCTION: ! res = res.concat("Constructional "); ! break; ! case FUNCTIONAL: ! res = res.concat("Functional "); ! break; } ! switch (level) { ! case SPACE_LEVEL: ! res = res.concat("Space"); ! break; ! case ELEMENT_LEVEL: ! res = res.concat("Element"); ! break; ! case PART_LEVEL: ! res = res.concat("Part"); ! break; ! } ! if (isUnion()) { ! res = res.concat("(Union)"); ! } ! return res; } *************** *** 1325,1330 **** --- 1393,1400 ---- Space copy = new Space("", this.getType(), + this.getLevel(), this.isContainer()); copy.setName(this.getName()); + copy.setUnion(this.isUnion()); Set envelopeCopy = copyEnvelope(copiedVertices, copiedEdges, *************** *** 1929,1931 **** --- 1999,2022 ---- return true; } + + /** + * @return Returns the isUnion. + */ + public boolean isUnion() { + return isUnion; + } + + /** + * @param isUnion The isUnion to set. + */ + public void setUnion(boolean isUnion) { + this.isUnion = isUnion; + } + + /** + * @return Returns the level. + */ + public int getLevel() { + return level; + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Project.java 17 Sep 2006 22:00:02 -0000 1.74 --- Project.java 26 Sep 2006 09:52:24 -0000 1.75 *************** *** 114,118 **** addCams(); observers = new LinkedList(); ! world = new Space("Project", Space.FUNCTIONAL, true); world.setId(new Long(0)); activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), --- 114,118 ---- addCams(); observers = new LinkedList(); ! world = new Space("Project", Space.FUNCTIONAL, Space.PROJECT_LEVEL, true); world.setId(new Long(0)); activeCoordinateSystem = new CoordinateSystem(new Vertex(1, 0, 0), new Vertex(0, 1, 0), *************** *** 881,892 **** setSavePath(null); } - - /** - * Attribute Info - * @param info String - */ - public static void info(Object info) { - log.info(info); - } /** --- 881,884 ---- |
From: rimestad <rim...@us...> - 2006-09-26 09:51:05
|
Update of /cvsroot/bprocessor/gui/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18226/src/gfx Added Files: .cvsignore Log Message: moved popup generation to a static gui class along with actions --- NEW FILE: .cvsignore --- *.db |
From: rimestad <rim...@us...> - 2006-09-26 09:51:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18226/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Added Files: PopupMenu.java Log Message: moved popup generation to a static gui class along with actions --- NEW FILE: PopupMenu.java --- //--------------------------------------------------------------------------------- // $Id: PopupMenu.java,v 1.1 2006/09/26 09:50:55 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui; import java.awt.event.ActionEvent; import java.util.Collection; import java.util.Iterator; import javax.swing.AbstractAction; import javax.swing.JMenu; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import net.sourceforge.bprocessor.gui.actions.AttributeMenuAction; import net.sourceforge.bprocessor.gui.actions.EntitiesMenuAction; import net.sourceforge.bprocessor.gui.actions.EntityMenuAction; import net.sourceforge.bprocessor.gui.actions.ModellorMenuAction; import net.sourceforge.bprocessor.gui.actions.SpaceMenuAction; import net.sourceforge.bprocessor.gui.attrview.AttributeView; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.FullRotate; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Rotate; import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.modellor.Modellor; /** * The static popup menu generator */ public class PopupMenu { /** * A popup generator for a space * @param s the space * @return the popup menu */ public static JPopupMenu getSpaceMenu(Space s) { JPopupMenu pm = PopupMenu.getEntityMenu(s); pm.addSeparator(); if (s != null) { AbstractAction copy = new SpaceMenuAction(s, "Duplicate") { public void actionPerformed(ActionEvent arg0) { if (space != null) { Space spaceCopy = space.copy(); Selection.primary().clear(); Selection.primary().add(spaceCopy); } } }; pm.add(copy); AbstractAction instantiate = new SpaceMenuAction(s, "Instantiate") { public void actionPerformed(ActionEvent arg0) { if (space != null) { Space instance = new Space("Instance of " + space.getName(), Space.CONSTRUCTION, space.getLevel(), false); instance.setProto(space); space.getOwner().add(instance); Project.getInstance().changed(Project.getInstance()); } } }; pm.add(instantiate); if (s.getLevel() < Space.PART_LEVEL) { AbstractAction edit = new SpaceMenuAction(s, "Edit") { public void actionPerformed(ActionEvent arg0) { Selection.primary().clear(); Project.getInstance().setActiveSpace(space); } }; pm.add(edit); } if (s.getEnvelope().isEmpty()) { AbstractAction envelope = new SpaceMenuAction(s, "Compute Envelope") { public void actionPerformed(ActionEvent arg0) { if (space != null) { space.computeEnvelope(); Project.getInstance().changed(Project.getInstance()); } } }; pm.add(envelope); } AbstractAction flip = new SpaceMenuAction(s, "Rotate 90 degrees CCW") { public void actionPerformed(ActionEvent arg0) { Iterator it = space.collect().iterator(); Vertex center = space.center(); while (it.hasNext()) { Geometry.rotate(Math.PI / 2, 0, 0, 1, (Vertex)it.next(), center); } space.changed(); } }; pm.add(flip); AbstractAction check = new SpaceMenuAction(s, "Check") { public void actionPerformed(ActionEvent arg0) { space.check(); } }; pm.add(check); AbstractAction translate = new SpaceMenuAction(s, "Translate") { public void actionPerformed(ActionEvent arg0) { space.addTransform(new Translate()); space.changed(); } }; pm.add(translate); AbstractAction rotate = new SpaceMenuAction(s, "Rotate") { public void actionPerformed(ActionEvent arg0) { space.addTransform(new Rotate()); space.changed(); } }; pm.add(rotate); AbstractAction scale = new SpaceMenuAction(s, "Scale") { public void actionPerformed(ActionEvent arg0) { space.addTransform(new Scale()); space.changed(); } }; pm.add(scale); AbstractAction fullrotate = new SpaceMenuAction(s, "Full Rotate") { public void actionPerformed(ActionEvent arg0) { space.addTransform(new FullRotate()); space.changed(); } }; pm.add(fullrotate); // Adding all modellors JMenu mm = new JMenu("Modellors"); Collection c = Modellor.getRegisteredModellors(); Iterator iter = c.iterator(); while (iter.hasNext()) { Modellor m = (Modellor)iter.next(); AbstractAction modellor = new ModellorMenuAction(s, m) { public void actionPerformed(ActionEvent arg0) { Modellor created = modellor.newInstance(space); if (created != null) { space.setModellor(created); AttributeView.instance().display(created); space.changed(); } else { JOptionPane.showMessageDialog( null, "The chosen space havn't been assigned to any surface", "No envolope surface error", JOptionPane.ERROR_MESSAGE); } } }; mm.add(modellor); } pm.add(mm); } return pm; } /** * a popup generator for a single entity * @param e The entity * @return the popup menu */ public static JPopupMenu getEntityMenu(Entity e) { JPopupMenu pm = new JPopupMenu(); AbstractAction delete = new EntityMenuAction(e, "Delete") { public void actionPerformed(ActionEvent arg0) { if (entity != null) { entity.delete(); Selection.primary().clear(); Project.getInstance().changed(entity); Project.getInstance().checkpoint(); } } }; pm.add(delete); return pm; } /** * A generator of the attribute popup menu * @param attribute the attribute to make popup for * @return The popupmenu */ public static JPopupMenu getAttributeMenu(Attribute attribute) { JPopupMenu pm = new JPopupMenu(); AbstractAction delete = new AttributeMenuAction(attribute, "Delete") { public void actionPerformed(ActionEvent arg0) { Project p = Project.getInstance(); p.getGlobals().remove(attribute); p.changed(p); p.checkpoint(); } }; pm.add(delete); return pm; } /** * A popupmenu generator for entities * @param entities the entity list to make popup for * @return the popupmenu */ public static JPopupMenu getEntiesMenu(Collection entities) { JPopupMenu pm = new JPopupMenu(); AbstractAction delete = new EntitiesMenuAction(entities, "Delete") { public void actionPerformed(ActionEvent arg0) { if (entities != null) { Iterator iter = entities.iterator(); while (iter.hasNext()) { ((Entity)iter.next()).delete(); } Project.getInstance().changed(Geometry.collect(entities)); Project.getInstance().checkpoint(); Selection.primary().clear(); } } }; pm.add(delete); return pm; } } Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** GUI.java 31 Aug 2006 13:01:49 -0000 1.42 --- GUI.java 26 Sep 2006 09:50:55 -0000 1.43 *************** *** 10,14 **** import net.sourceforge.bprocessor.gui.actions.CreateConstructorActionListener; import net.sourceforge.bprocessor.gui.actions.CreateFunctionalSpaceActionListener; - import net.sourceforge.bprocessor.gui.actions.CreateSurfaceActionListener; import net.sourceforge.bprocessor.gui.actions.FileCloseActionListener; import net.sourceforge.bprocessor.gui.actions.FileExitActionListener; --- 10,13 ---- *************** *** 286,290 **** create.add(createConstructionSpace); ! JMenuItem createElement = new JMenuItem("Element"); createElement.setMnemonic(KeyEvent.VK_E); createElement.setEnabled(false); --- 285,289 ---- create.add(createConstructionSpace); ! /*JMenuItem createElement = new JMenuItem("Element"); createElement.setMnemonic(KeyEvent.VK_E); createElement.setEnabled(false); *************** *** 300,304 **** createSurface.addActionListener(new CreateSurfaceActionListener()); createSurface.setEnabled(false); ! create.add(createSurface); menu.registerMenu(create); --- 299,303 ---- createSurface.addActionListener(new CreateSurfaceActionListener()); createSurface.setEnabled(false); ! create.add(createSurface);*/ menu.registerMenu(create); |
From: rimestad <rim...@us...> - 2006-09-26 09:51:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18226/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateFunctionalSpaceActionListener.java CreateConstructionSpaceActionListener.java Added Files: AttributeMenuAction.java EntityMenuAction.java SpaceMenuAction.java ModellorMenuAction.java EntitiesMenuAction.java Log Message: moved popup generation to a static gui class along with actions --- NEW FILE: AttributeMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: AttributeMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Attribute; /** * Actions for a attribute */ public abstract class AttributeMenuAction extends AbstractAction { /** The entity */ protected Attribute attribute; /** * The constructor * @param a the attribute * @param name the name of the action */ public AttributeMenuAction(Attribute a, String name) { super(name); this.attribute = a; } } --- NEW FILE: EntityMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: EntityMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Entity; /** * Actions for a entity */ public abstract class EntityMenuAction extends AbstractAction { /** The entity */ protected Entity entity; /** * The constructor * @param ent the entity * @param name the name of the action */ public EntityMenuAction(Entity ent, String name) { super(name); this.entity = ent; } } --- NEW FILE: EntitiesMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: EntitiesMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import java.util.Collection; import javax.swing.AbstractAction; /** * Actions for a entity */ public abstract class EntitiesMenuAction extends AbstractAction { /** The entity */ protected Collection entities; /** * The constructor * @param ent the entity * @param name the name of the action */ public EntitiesMenuAction(Collection ent, String name) { super(name); this.entities = ent; } } --- NEW FILE: SpaceMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: SpaceMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Space; /** * Actions for a entity */ public abstract class SpaceMenuAction extends AbstractAction { /** The entity */ protected Space space; /** * The constructor * @param s the space * @param name the name of the action */ public SpaceMenuAction(Space s, String name) { super(name); this.space = s; } } Index: CreateConstructionSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructionSpaceActionListener.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CreateConstructionSpaceActionListener.java 14 Sep 2006 13:38:02 -0000 1.9 --- CreateConstructionSpaceActionListener.java 26 Sep 2006 09:50:54 -0000 1.10 *************** *** 44,51 **** if (result != null && !result.trim().equals("")) { ! Space cs = Space.createConstructionSpace(result.trim()); ! Project.getInstance().getActiveSpace().add(cs); ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); } } --- 44,55 ---- if (result != null && !result.trim().equals("")) { ! try { ! Space cs = Project.getInstance().getActiveSpace().createConstructionSpace(result.trim()); ! Project.getInstance().getActiveSpace().add(cs); ! Project.getInstance().changed(Project.getInstance()); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } } } Index: CreateFunctionalSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateFunctionalSpaceActionListener.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CreateFunctionalSpaceActionListener.java 24 Jan 2006 14:10:37 -0000 1.8 --- CreateFunctionalSpaceActionListener.java 26 Sep 2006 09:50:54 -0000 1.9 *************** *** 44,49 **** if (result != null && !result.trim().equals("")) { ! Space fs = Space.createFunctionalSpace(result.trim()); ! Project.getInstance().add(fs); } } --- 44,54 ---- if (result != null && !result.trim().equals("")) { ! try { ! Space fs = Project.getInstance().getActiveSpace().createFunctionalSpace(result.trim()); ! Project.getInstance().add(fs); ! Project.getInstance().checkpoint(); ! } catch (Exception ex) { ! ex.printStackTrace(); ! } } } --- NEW FILE: ModellorMenuAction.java --- //--------------------------------------------------------------------------------- // $Id: ModellorMenuAction.java,v 1.1 2006/09/26 09:50:54 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.actions; import javax.swing.AbstractAction; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.modellor.Modellor; /** * Actions for a entity */ public abstract class ModellorMenuAction extends AbstractAction { /** The space */ protected Space space; /** The modellor */ protected Modellor modellor; /** * The constructor * @param s the space * @param m the modellor */ public ModellorMenuAction(Space s, Modellor m) { super(m.getGeneralName()); this.space = s; this.modellor = m; } } |
From: rimestad <rim...@us...> - 2006-09-26 09:51:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18226/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java TreeView.java Log Message: moved popup generation to a static gui class along with actions Index: TreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/TreeView.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TreeView.java 5 Apr 2006 09:35:50 -0000 1.3 --- TreeView.java 26 Sep 2006 09:50:55 -0000 1.4 *************** *** 10,14 **** import javax.swing.JTree; - import javax.swing.tree.TreeSelectionModel; import org.apache.log4j.Logger; --- 10,13 ---- *************** *** 26,30 **** public TreeView() { super(); ! getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setEditable(false); Font font = new Font("Sans-serif", Font.PLAIN, 12); --- 25,29 ---- public TreeView() { super(); ! //getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); setEditable(false); Font font = new Font("Sans-serif", Font.PLAIN, 12); Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** GenericTreeView.java 20 Sep 2006 11:01:37 -0000 1.48 --- GenericTreeView.java 26 Sep 2006 09:50:54 -0000 1.49 *************** *** 25,30 **** import javax.swing.ImageIcon; - import javax.swing.JMenu; - import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTree; --- 25,28 ---- *************** *** 46,64 **** import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; - import net.sourceforge.bprocessor.model.FullRotate; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.ParameterBlock; import net.sourceforge.bprocessor.model.Project; - import net.sourceforge.bprocessor.model.Rotate; - import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; - import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; - import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.attrview.AttributeView; --- 44,58 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.ParameterBlock; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.modellor.Modellor; import net.sourceforge.bprocessor.gui.GUI; + import net.sourceforge.bprocessor.gui.PopupMenu; import net.sourceforge.bprocessor.gui.attrview.AttributeView; *************** *** 254,263 **** /** ! * Set selection to target * @param target Object */ public void select(Object target) { if (target instanceof Geometric) { ! Selection.primary().set(target); } else { AttributeView.instance().display(target); --- 248,257 ---- /** ! * add target to selection * @param target Object */ public void select(Object target) { if (target instanceof Geometric) { ! Selection.primary().add(target); } else { AttributeView.instance().display(target); *************** *** 266,269 **** --- 260,275 ---- /** + * deselect target + * @param target Object + */ + public void deselect(Object target) { + if (target instanceof Geometric) { + Selection.primary().remove(target); + } else { + AttributeView.instance().display(null); + } + } + + /** * GenericNode */ *************** *** 385,469 **** */ public JPopupMenu menu() { ! JPopupMenu pm = new JPopupMenu(); Object object = this.getUserObject(); if (object instanceof Entity) { ! AbstractAction delete = new EntityAction((Entity)object, "Delete") { ! public void actionPerformed(ActionEvent arg0) { ! if (entity != null) { ! entity.delete(); ! Project.getInstance().checkpoint(); ! } ! } ! }; ! pm.add(delete); } else if (object instanceof Attribute) { ! AbstractAction delete = new AttributeAction((Attribute)object, "Delete") { ! public void actionPerformed(ActionEvent arg0) { ! Project p = Project.getInstance(); ! p.getGlobals().remove(attribute); ! p.changed(p); ! p.checkpoint(); ! } ! }; ! pm.add(delete); ! } else { ! return null; } return pm; } } - - /** - * Actions for a entity - */ - public abstract class EntityAction extends AbstractAction { - /** The entity */ - protected Entity entity; - - /** - * The constructor - * @param ent the entity - * @param name the name of the action - */ - public EntityAction(Entity ent, String name) { - super(name); - this.entity = ent; - } - } - - /** - * Actions for a attribute - */ - public abstract class AttributeAction extends AbstractAction { - /** The entity */ - protected Attribute attribute; - - /** - * The constructor - * @param a the attribute - * @param name the name of the action - */ - public AttributeAction(Attribute a, String name) { - super(name); - this.attribute = a; - } - } - - /** - * Actions for a entity - */ - public abstract class EntityModellorAction extends EntityAction { - /** The modellor number */ - protected Modellor which; - /** - * The constructor - * @param ent the entity - * @param m the modellor object - */ - public EntityModellorAction(Entity ent, Modellor m) { - super(ent, m.getName()); - this.which = m; - } - } /** --- 391,404 ---- */ public JPopupMenu menu() { ! JPopupMenu pm = null; Object object = this.getUserObject(); if (object instanceof Entity) { ! pm = PopupMenu.getEntityMenu((Entity)object); } else if (object instanceof Attribute) { ! pm = PopupMenu.getAttributeMenu((Attribute)object); } return pm; } } /** *************** *** 520,648 **** */ public JPopupMenu menu() { ! JPopupMenu pm = super.menu(); ! Object object = this.getUserObject(); ! if (object != null) { ! AbstractAction copy = new EntityAction((Entity)object, "Duplicate") { ! public void actionPerformed(ActionEvent arg0) { ! if (entity != null) { ! Space spaceCopy = ((Space)entity).copy(); ! select(spaceCopy); ! } ! } ! }; ! pm.add(copy); ! AbstractAction instantiate = new EntityAction((Entity)object, "Instantiate") { ! public void actionPerformed(ActionEvent arg0) { ! if (entity != null) { ! Space prototype = (Space) entity; ! ! Space space = new Space("Instance of " + prototype.getName(), ! Space.CONSTRUCTION, false); ! space.setProto(prototype); ! prototype.getOwner().add(space); ! Project.getInstance().changed(Project.getInstance()); ! } ! } ! }; ! pm.add(instantiate); ! AbstractAction edit = new EntityAction((Entity)object, "Edit") { ! public void actionPerformed(ActionEvent arg0) { ! Selection.primary().clear(); ! Project.getInstance().setActiveSpace((Space)entity); ! } ! }; ! pm.add(edit); ! AbstractAction envelope = new EntityAction((Entity)object, "Compute Envelope") { ! public void actionPerformed(ActionEvent arg0) { ! if (entity != null) { ! Space space = (Space) entity; ! space.computeEnvelope(); ! Project.getInstance().changed(Project.getInstance()); ! } ! } ! }; ! pm.add(envelope); ! ! AbstractAction flip = new EntityAction((Entity)object, "Rotate 90 degrees CCW") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space)entity; ! Iterator it = space.collect().iterator(); ! Vertex center = space.center(); ! while (it.hasNext()) { ! Geometry.rotate(Math.PI / 2, ! 0, 0, 1, ! (Vertex)it.next(), ! center); ! } ! space.changed(); ! } ! }; ! pm.add(flip); ! AbstractAction check = new EntityAction((Entity) object, "Check") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.check(); ! } ! }; ! pm.add(check); ! AbstractAction translate = new EntityAction((Entity) object, "Translate") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.addTransform(new Translate()); ! space.changed(); ! } ! }; ! pm.add(translate); ! AbstractAction rotate = new EntityAction((Entity) object, "Rotate") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.addTransform(new Rotate()); ! space.changed(); ! } ! }; ! pm.add(rotate); ! AbstractAction scale = new EntityAction((Entity) object, "Scale") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.addTransform(new Scale()); ! space.changed(); ! } ! }; ! pm.add(scale); ! AbstractAction fullrotate = new EntityAction((Entity) object, "Full Rotate") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.addTransform(new FullRotate()); ! space.changed(); ! } ! }; ! pm.add(fullrotate); ! // Adding all modellors ! JMenu mm = new JMenu("Modellors"); ! Collection c = Modellor.getRegisteredModellors(); ! Iterator iter = c.iterator(); ! while (iter.hasNext()) { ! Modellor m = (Modellor)iter.next(); ! AbstractAction modellor = new EntityModellorAction((Entity)object, m) { ! public void actionPerformed(ActionEvent arg0) { ! Space current = (Space)entity; ! Modellor created = which.newInstance(current); ! if (created != null) { ! current.setModellor(created); ! AttributeView.instance().display(created); ! current.changed(); ! } else { ! JOptionPane.showMessageDialog( ! null, ! "The chosen space havn't been assigned to any surface", ! "No envolope surface error", JOptionPane.ERROR_MESSAGE); ! } ! } ! }; ! mm.add(modellor); ! } ! pm.add(mm); ! } ! return pm; } } --- 455,459 ---- */ public JPopupMenu menu() { ! return PopupMenu.getSpaceMenu((Space)this.getUserObject()); } } *************** *** 1114,1117 **** --- 925,946 ---- /** + * Actions for a entity + */ + public abstract class EntityAction extends AbstractAction { + /** The entity */ + protected Entity entity; + + /** + * The constructor + * @param ent the entity + * @param name the name of the action + */ + public EntityAction(Entity ent, String name) { + super(name); + this.entity = ent; + } + } + + /** * AttributeNode */ *************** *** 1177,1180 **** --- 1006,1013 ---- if (event.isAddedPath()) { TreePath path = event.getPath(); + GenericTreeView gtv = (GenericTreeView)event.getSource(); + if (gtv.getSelectionPaths().length == 1) { + Selection.primary().clear(); + } Object object = path.getLastPathComponent(); if (object instanceof DefaultMutableTreeNode) { *************** *** 1183,1186 **** --- 1016,1029 ---- select(target); } + } else { + TreePath[] path = event.getPaths(); + for (int i = 0; i < path.length; i++) { + Object object = path[i].getLastPathComponent(); + if (object instanceof DefaultMutableTreeNode) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode) object; + Object target = node.getUserObject(); + deselect(target); + } + } } } *************** *** 1240,1248 **** TreePath tp = selectionModel.getSelectionPath(); Object o = tp.getLastPathComponent(); - System.out.println("The object were " + o); if (o instanceof GenericNode) { GenericNode node = (GenericNode) o; o = node.getUserObject(); - System.out.println("The object were " + o); if (o instanceof Entity) { HashSet set = new HashSet(); --- 1083,1089 ---- |
From: rimestad <rim...@us...> - 2006-09-26 09:51:03
|
Update of /cvsroot/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18226 Modified Files: build.xml Log Message: moved popup generation to a static gui class along with actions Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/gui/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 21 Oct 2005 08:42:47 -0000 1.2 --- build.xml 26 Sep 2006 09:50:54 -0000 1.3 *************** *** 57,60 **** --- 57,65 ---- </copy> <copy todir="${lib.dir}"> + <fileset dir="${tools.dir}/antlr"> + <include name="**/*"/> + </fileset> + </copy> + <copy todir="${lib.dir}"> <fileset dir="${kernel.dir}/dist"> <include name="**/kernel*"/> |
From: Nordholt <nor...@us...> - 2006-09-25 14:07:38
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9475/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: fixed checkstyle Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FacadeModellor.java 25 Sep 2006 13:43:58 -0000 1.14 --- FacadeModellor.java 25 Sep 2006 14:07:36 -0000 1.15 *************** *** 28,32 **** import org.apache.log4j.Logger; - import sun.net.www.http.PosterOutputStream; /** * The facade modellor models the elements for a facade space. --- 28,31 ---- *************** *** 449,453 **** } } ! private void createSegmentLines() { removeSegmentLines(); --- 448,455 ---- } } ! /** ! * Creates segment lines based on the post constructors ! * ! */ private void createSegmentLines() { removeSegmentLines(); *************** *** 493,497 **** } } ! private void removeSegmentLines() { for (int i = 0; i < vertPosts; i++) { --- 495,502 ---- } } ! /** ! * Removes segment lines ! * ! */ private void removeSegmentLines() { for (int i = 0; i < vertPosts; i++) { |
From: Nordholt <nor...@us...> - 2006-09-25 14:07:28
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9454/src/net/sourceforge/bprocessor/gl/tool Modified Files: VectorMoveTool.java Log Message: fixed checkstyle Index: VectorMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/VectorMoveTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** VectorMoveTool.java 25 Sep 2006 13:40:30 -0000 1.6 --- VectorMoveTool.java 25 Sep 2006 14:07:18 -0000 1.7 *************** *** 14,18 **** import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Geometric; - import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; --- 14,17 ---- |
From: Nordholt <nor...@us...> - 2006-09-25 13:44:50
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8303/src/net/sourceforge/bprocessor/facade/modellor Modified Files: WindowModellor.java Log Message: Fixed memory bug when moveing edges in the window Index: WindowModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/WindowModellor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WindowModellor.java 11 Sep 2006 12:10:02 -0000 1.7 --- WindowModellor.java 25 Sep 2006 13:44:40 -0000 1.8 *************** *** 25,33 **** import net.sourceforge.bprocessor.model.modellor.Modellor; /** A modellor to make windows */ public class WindowModellor extends Modellor { /** Id */ private static final long serialVersionUID = 1L; ! /** The width of the frame */ private double framewidth = 0.054; --- 25,38 ---- import net.sourceforge.bprocessor.model.modellor.Modellor; + import org.apache.log4j.Logger; + /** A modellor to make windows */ public class WindowModellor extends Modellor { /** Id */ private static final long serialVersionUID = 1L; ! ! /** The logger */ ! private static Logger log = Logger.getLogger(WindowModellor.class); ! /** The width of the frame */ private double framewidth = 0.054; *************** *** 133,137 **** cleanUp(); drawWindow(); - Project.getInstance().checkpoint(); } } --- 138,141 ---- *************** *** 192,197 **** Surface s = (Surface)iter.next(); s.delete(); ! } ! space.setModellor(null); } --- 196,200 ---- Surface s = (Surface)iter.next(); s.delete(); ! } space.setModellor(null); } *************** *** 201,204 **** --- 204,213 ---- */ private void cleanUp() { + Iterator it = elements.iterator(); + while (it.hasNext()) { + ((Surface)it.next()).delete(); + } + elements = new LinkedList(); + extension = new HashSet(); space.clear(); } |
From: Nordholt <nor...@us...> - 2006-09-25 13:44:08
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8232/src/net/sourceforge/bprocessor/facade/modellor Modified Files: FacadeModellor.java Log Message: Made segment-constructors for each segment of a post. Now each segment can be moved individually Index: FacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/FacadeModellor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FacadeModellor.java 8 Sep 2006 14:08:40 -0000 1.13 --- FacadeModellor.java 25 Sep 2006 13:43:58 -0000 1.14 *************** *** 7,12 **** --- 7,14 ---- package net.sourceforge.bprocessor.facade.modellor; + import java.util.HashMap; import java.util.List; import java.util.LinkedList; + import java.util.Map; import java.util.Set; import java.util.HashSet; *************** *** 25,28 **** --- 27,32 ---- import org.apache.log4j.Logger; + + import sun.net.www.http.PosterOutputStream; /** * The facade modellor models the elements for a facade space. *************** *** 31,110 **** /** Default */ private static final long serialVersionUID = 1L; ! /** Dobbelt bar-type facade */ private static final int DOUBLE_BAR = 1; ! /** Dobbelt bar-type facade */ private static final int SINGLE_BAR = 2; ! /** The logger */ private static Logger log = Logger.getLogger(FacadeModellor.class); ! /** Name of the modellor */ private String name; ! /** Number of vertical posts */ private int vertPosts = 0; ! /** Number of horizontal posts */ private int horPosts = 0; ! /** Default vertical post width */ private double vertPostWidth = 0; ! /** Default horizontal post width */ private double horPostWidth = 0; ! /** The space this modellor is connected to */ private Space space; ! /** The front surface of the facade */ private Surface front = null; ! ! /** A copy of the front surface but on element-level */ ! private Surface eFront = null; ! /** The set of vertical constructor lines */ private List vertCons = new LinkedList(); ! /** The set of horizontal constructor lines */ private List horCons = new LinkedList(); ! /** Thickness of the frame */ private double frameThickness = 0; ! /** Facade depth */ private double depth = 0; ! /** The frame space */ private Space frame; ! /** Set of surfaces that forms the holes for windows*/ private Set windows = new HashSet(); ! /** The surfaces of the frame */ private Set frameSurfaces = new HashSet(); ! /** edge marking leftmost boundry of the facade */ private Line leftBound; ! /** edge marking rightmost boundry of the facade */ private Line rightBound; ! /** edge marking top boundry of the facade */ private Line topBound; ! /** edge marking leftmost boundry of the facade */ private Line bottomBound; ! /** Set of window elements */ private Set windowElements = new HashSet(); ! /** Set of window modellors */ private Set windowModellors = new HashSet(); ! ! /** Type facade */ private int type; /** The constructor */ public FacadeModellor() { --- 35,121 ---- /** Default */ private static final long serialVersionUID = 1L; ! /** Dobbelt bar-type facade */ private static final int DOUBLE_BAR = 1; ! /** Dobbelt bar-type facade */ private static final int SINGLE_BAR = 2; ! /** The logger */ private static Logger log = Logger.getLogger(FacadeModellor.class); ! /** Name of the modellor */ private String name; ! /** Number of vertical posts */ private int vertPosts = 0; ! /** Number of horizontal posts */ private int horPosts = 0; ! /** Default vertical post width */ private double vertPostWidth = 0; ! /** Default horizontal post width */ private double horPostWidth = 0; ! /** The space this modellor is connected to */ private Space space; ! /** The front surface of the facade */ private Surface front = null; ! /** The set of vertical constructor lines */ private List vertCons = new LinkedList(); ! /** The set of horizontal constructor lines */ private List horCons = new LinkedList(); ! /** Thickness of the frame */ private double frameThickness = 0; ! /** Facade depth */ private double depth = 0; ! /** The frame space */ private Space frame; ! /** Set of surfaces that forms the holes for windows*/ private Set windows = new HashSet(); ! /** The surfaces of the frame */ private Set frameSurfaces = new HashSet(); ! /** edge marking leftmost boundry of the facade */ private Line leftBound; ! /** edge marking rightmost boundry of the facade */ private Line rightBound; ! /** edge marking top boundry of the facade */ private Line topBound; ! /** edge marking leftmost boundry of the facade */ private Line bottomBound; ! /** Set of window elements */ private Set windowElements = new HashSet(); ! /** Set of window modellors */ private Set windowModellors = new HashSet(); ! ! /** Type of facade */ private int type; + /** The horizontal post-segments */ + private Line[][] horSegs; + + /** The vertical post-segments */ + private Line[][] vertSegs; + + /** Mapping from a segment to a boolean + * indicating which if the segment is to be drawn*/ + private Map drawSeg = new HashMap(); + /** The constructor */ public FacadeModellor() { *************** *** 112,116 **** this.name = "Facade Modellor"; } ! /** The constructor for the modellor * @param s the space this modellor models for. --- 123,127 ---- this.name = "Facade Modellor"; } ! /** The constructor for the modellor * @param s the space this modellor models for. *************** *** 126,130 **** } } ! /** * Create a new instance of the modellor, based on a space --- 137,141 ---- } } ! /** * Create a new instance of the modellor, based on a space *************** *** 135,139 **** return new FacadeModellor(s); } ! /** * The update method --- 146,150 ---- return new FacadeModellor(s); } ! /** * The update method *************** *** 148,152 **** } } ! /** * Creates the facade based on its type. --- 159,163 ---- } } ! /** * Creates the facade based on its type. *************** *** 160,164 **** createWindows(); } ! /** --- 171,175 ---- createWindows(); } ! /** *************** *** 181,185 **** } } ! /** * Set the attributes of the object to the values in the list --- 192,196 ---- } } ! /** * Set the attributes of the object to the values in the list *************** *** 260,264 **** Project.getInstance().changed(space); } ! /** * Retrn a list of the attributes in the object --- 271,275 ---- Project.getInstance().changed(space); } ! /** * Retrn a list of the attributes in the object *************** *** 285,289 **** return attributes; } ! /** * Get the name --- 296,300 ---- return attributes; } ! /** * Get the name *************** *** 293,297 **** return name; } ! /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() --- 304,308 ---- return name; } ! /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() *************** *** 300,309 **** return "Facade Modellor"; } ! /** Delete */ public void delete() { space.setModellor(null); } ! /** * Creates the frame for this facade based on frame thickness and depth. --- 311,320 ---- return "Facade Modellor"; } ! /** Delete */ public void delete() { space.setModellor(null); } ! /** * Creates the frame for this facade based on frame thickness and depth. *************** *** 315,319 **** frame = new Space("Frame", Space.CONSTRUCTION, true); space.add(frame); ! eFront = front.copy(space); frameSurfaces.add(eFront); if (front.getBackDomain() == space) { --- 326,330 ---- frame = new Space("Frame", Space.CONSTRUCTION, true); space.add(frame); ! Surface eFront = front.copy(space); frameSurfaces.add(eFront); if (front.getBackDomain() == space) { *************** *** 342,345 **** --- 353,357 ---- frameSurfaces = new HashSet(); if (frame != null) { + frame.clear(); frame.delete(); } *************** *** 347,430 **** removeWindows(); removeConstructors(); } ! ! /** * Creates the post constructors for this facade based on the number of posts. */ private void createPostConstructors() { ! log.info("created new posts"); ! if (front != null && depth > 0) { List edges = front.getEdges(); removeConstructors(); vertCons = new LinkedList(); horCons = new LinkedList(); ! if (edges.size() == 4) { ! Iterator it = edges.iterator(); ! Edge vertEdge = null; ! Edge horEdge = null; ! while (it.hasNext() && ! (vertEdge == null || ! horEdge == null)) { ! Edge e = (Edge)it.next(); ! if (Math.abs(e.getDirection().dot(new Vertex(0, 0, 1))) < 0.0001) { ! horEdge = e; ! } else if (Math.abs(e.getDirection().dot(new Vertex(1, 0, 0))) < 0.0001 && ! Math.abs(e.getDirection().dot(new Vertex(0, 1, 0))) < 0.0001) { ! vertEdge = e; ! } } ! if (horEdge != null && vertEdge != null) { ! Vertex cross; ! if (horEdge.contains(vertEdge.getFrom())) { ! cross = vertEdge.getFrom(); ! } else { ! cross = vertEdge.getTo(); ! } ! Vertex horDir = horEdge.otherVertex(cross).minus(cross); ! Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); ! Vertex offset = horDir.copy(); ! double intervalV = ((horEdge.getLength() - frameThickness * 2) - ! vertPostWidth * vertPosts) / (vertPosts + 1); ! double lengthV = intervalV + frameThickness; for (int i = 0; i < vertPosts; i++) { - lengthV += (vertPostWidth / 2); offset.scale(lengthV / offset.length()); Constructor l = new Line(cross.add(offset), vertDir.copy(), horEdge, true, true); ! lengthV += (intervalV + (vertPostWidth / 2)); ! vertCons.add(l); space.add(l); } offset = vertDir.copy(); ! double intervalH = ((vertEdge.getLength() - frameThickness * 2) - ! horPostWidth * horPosts) / (horPosts + 1); ! double lengthH = intervalH + frameThickness; for (int i = 0; i < horPosts; i++) { - lengthH += (horPostWidth / 2); offset.scale(lengthH / offset.length()); ! Constructor l = new Line(cross.add(offset), horDir.copy(), vertEdge, true, true); ! lengthH += (intervalH + (horPostWidth / 2)); horCons.add(l); space.add(l); } ! { ! Vertex topOffset = vertDir.copy(); ! topOffset.scale(frameThickness / topOffset.length()); ! topBound = new Line(cross.add(topOffset), horDir); ! Vertex bottomOffset = vertDir.copy(); ! bottomOffset.scale((vertEdge.getLength() - frameThickness) / bottomOffset.length()); ! bottomBound = new Line(cross.add(bottomOffset), horDir); ! Vertex leftOffset = horDir.copy(); ! leftOffset.scale(frameThickness / leftOffset.length()); ! leftBound = new Line(cross.add(leftOffset), vertDir); ! Vertex rightOffset = horDir.copy(); ! rightOffset.scale((horEdge.getLength() - frameThickness) / rightOffset.length()); ! rightBound = new Line(cross.add(rightOffset), vertDir); } } } } } /** * Creates the holes for windows in the facade based on the post constructors, --- 359,511 ---- removeWindows(); removeConstructors(); + space.clear(); } ! ! /** * Creates the post constructors for this facade based on the number of posts. */ private void createPostConstructors() { ! if (front != null && front.getEdges().size() == 4 && depth > 0) { ! //Finding horizontal and vertical edge List edges = front.getEdges(); removeConstructors(); vertCons = new LinkedList(); horCons = new LinkedList(); ! Iterator it = edges.iterator(); ! Edge vertEdge = null; ! Edge horEdge = null; ! while (it.hasNext() && ! (vertEdge == null || ! horEdge == null)) { ! Edge e = (Edge)it.next(); ! if (Math.abs(e.getDirection().dot(new Vertex(0, 0, 1))) < 0.0001) { ! horEdge = e; ! } else if (Math.abs(e.getDirection().dot(new Vertex(1, 0, 0))) < 0.0001 && ! Math.abs(e.getDirection().dot(new Vertex(0, 1, 0))) < 0.0001) { ! vertEdge = e; } ! } ! Vertex cross = null; ! if (horEdge != null && vertEdge != null) { ! ! if (horEdge.contains(vertEdge.getFrom())) { ! cross = vertEdge.getFrom(); ! } else { ! cross = vertEdge.getTo(); ! } ! } ! if (cross != null) { ! horSegs = new Line[vertPosts][horPosts]; ! vertSegs = new Line[vertPosts][horPosts]; ! Vertex horDir = horEdge.otherVertex(cross).minus(cross); ! Vertex vertDir = vertEdge.otherVertex(cross).minus(cross); ! double intervalV = ((horEdge.getLength() - frameThickness * 2) - ! vertPostWidth * vertPosts) / (vertPosts + 1); ! double intervalH = ((vertEdge.getLength() - frameThickness * 2) - ! horPostWidth * horPosts) / (horPosts + 1); ! Vertex offset; ! //vertical constructors ! { ! offset = horDir.copy(); ! double lengthV = intervalV + frameThickness + (vertPostWidth / 2); for (int i = 0; i < vertPosts; i++) { offset.scale(lengthV / offset.length()); Constructor l = new Line(cross.add(offset), vertDir.copy(), horEdge, true, true); ! lengthV += (intervalV + vertPostWidth); space.add(l); + vertCons.add(l); } + } + //horizontal constructors + { offset = vertDir.copy(); ! double lengthH = intervalH + frameThickness + (horPostWidth / 2); for (int i = 0; i < horPosts; i++) { offset.scale(lengthH / offset.length()); ! Line l = new Line(cross.add(offset), horDir.copy(), vertEdge, true, true); ! lengthH += (intervalH + horPostWidth); horCons.add(l); space.add(l); } ! } ! //boundries ! { ! Vertex topOffset = vertDir.copy(); ! topOffset.scale(frameThickness / topOffset.length()); ! topBound = new Line(cross.add(topOffset), horDir); ! Vertex bottomOffset = vertDir.copy(); ! bottomOffset.scale((vertEdge.getLength() - frameThickness) / bottomOffset.length()); ! bottomBound = new Line(cross.add(bottomOffset), horDir); ! Vertex leftOffset = horDir.copy(); ! leftOffset.scale(frameThickness / leftOffset.length()); ! leftBound = new Line(cross.add(leftOffset), vertDir); ! Vertex rightOffset = horDir.copy(); ! rightOffset.scale((horEdge.getLength() - frameThickness) / rightOffset.length()); ! rightBound = new Line(cross.add(rightOffset), vertDir); ! } ! createSegmentLines(); ! } ! } ! } ! ! private void createSegmentLines() { ! removeSegmentLines(); ! int i = 0; ! int j = 0; ! List vert = new LinkedList(); ! List hor = new LinkedList(); ! vert.add(leftBound); ! vert.addAll(vertCons); ! vert.add(rightBound); ! hor.add(topBound); ! hor.addAll(horCons); ! hor.add(bottomBound); ! Iterator vIt = vert.iterator(); ! while (vIt.hasNext()) { ! Line v = (Line)vIt.next(); ! Iterator hIt = hor.iterator(); ! j = 0; ! while (hIt.hasNext()) { ! Line h = (Line)hIt.next(); ! Vertex origin = h.intersection(v); ! Vertex hDir = h.getDirection().copy(); ! Vertex vDir = v.getDirection().copy(); ! Line hSeg = new Line(origin.copy(), hDir, false, true); ! Line vSeg = new Line(origin.copy(), vDir, false, true); ! horSegs[i][j] = hSeg; ! vertSegs[i][j] = vSeg; ! drawSeg.put(hSeg, Boolean.TRUE); ! drawSeg.put(vSeg, Boolean.TRUE); ! h.connect(hSeg); ! v.connect(vSeg); ! if ((j < horPosts + 1 && i < vertPosts + 1)) { ! if (j > 0) { ! space.add(hSeg); ! } ! if (i > 0) { ! space.add(vSeg); } } + j++; } + i++; } } + private void removeSegmentLines() { + for (int i = 0; i < vertPosts; i++) { + for (int j = 0; j < horPosts; j++) { + if (vertSegs[i][j] != null && horSegs[i][j] != null) { + vertSegs[i][j].delete(); + horSegs[i][j].delete(); + } + } + } + horSegs = new Line[vertPosts + 2][horPosts + 2]; + vertSegs = new Line[vertPosts + 2][horPosts + 2]; + drawSeg = new HashMap(); + } + /** * Creates the holes for windows in the facade based on the post constructors, *************** *** 439,451 **** Line currentV = null; Iterator vIt = vertCons.iterator(); while (vIt.hasNext()) { Line vL = (Line)vIt.next(); currentV = new Line(vL.getOrigin().minus(horDir), vL.getDirection()); ! horizontalRun(oldV, currentV); oldV = new Line(vL.getOrigin().add(horDir), vL.getDirection()); ! vL.connect(currentV); ! vL.connect(oldV); } ! horizontalRun(oldV, rightBound); } } --- 520,534 ---- Line currentV = null; Iterator vIt = vertCons.iterator(); + int i = 0; while (vIt.hasNext()) { Line vL = (Line)vIt.next(); currentV = new Line(vL.getOrigin().minus(horDir), vL.getDirection()); ! horizontalRun(oldV, currentV, i); oldV = new Line(vL.getOrigin().add(horDir), vL.getDirection()); ! //vL.connect(currentV); ! //vL.connect(oldV); ! i++; } ! horizontalRun(oldV, rightBound, i); } } *************** *** 455,474 **** * @param oldV left boundry * @param currentV right boundry */ ! private void horizontalRun(Line oldV, Line currentV) { Line currentH; Vertex vertDir = leftBound.getDirection().copy(); vertDir.scale(horPostWidth / 2); Line oldH = topBound; Iterator hIt = horCons.iterator(); while (hIt.hasNext()) { Line hL = (Line)hIt.next(); currentH = new Line(hL.getOrigin().minus(vertDir), hL.getDirection()); ! createHole(oldV, currentV, oldH, currentH); oldH = new Line(hL.getOrigin().add(vertDir), hL.getDirection()); ! hL.connect(currentH); ! hL.connect(oldH); } ! createHole(oldV, currentV, oldH, bottomBound); } --- 538,571 ---- * @param oldV left boundry * @param currentV right boundry + * @param i index of oldv */ ! private void horizontalRun(Line oldV, Line currentV, int i) { Line currentH; Vertex vertDir = leftBound.getDirection().copy(); vertDir.scale(horPostWidth / 2); Line oldH = topBound; + int j = 0; Iterator hIt = horCons.iterator(); while (hIt.hasNext()) { Line hL = (Line)hIt.next(); + Line copyOldV = new Line(oldV.getOrigin().copy(), oldV.getDirection().copy()); + Line copyCurrentV = new Line(currentV.getOrigin().copy(), currentV.getDirection().copy()); currentH = new Line(hL.getOrigin().minus(vertDir), hL.getDirection()); ! createHole(copyOldV, copyCurrentV, oldH, currentH); ! horSegs[i][j].connect(oldH); ! horSegs[i][j + 1].connect(currentH); ! vertSegs[i][j].connect(copyOldV); ! vertSegs[i + 1][j].connect(copyCurrentV); oldH = new Line(hL.getOrigin().add(vertDir), hL.getDirection()); ! //hL.connect(currentH); ! //hL.connect(oldH); ! j++; } ! Line copyOldV = new Line(oldV.getOrigin().copy(), oldV.getDirection().copy()); ! Line copyCurrentV = new Line(currentV.getOrigin().copy(), currentV.getDirection().copy()); ! createHole(copyOldV, copyCurrentV, oldH, bottomBound); ! horSegs[i][j].connect(oldH); ! vertSegs[i][j].connect(copyOldV); ! vertSegs[i + 1][j].connect(copyCurrentV); } *************** *** 482,559 **** private void createHole(Line left, Line right, Line top, Line bottom) { Vertex c1 = top.intersection(left); Vertex c2 = top.intersection(right); Vertex c3 = bottom.intersection(right); Vertex c4 = bottom.intersection(left); ! // log.info("c1: " + c1); ! // log.info("c2: " + c2); ! // log.info("c3: " + c3); ! // log.info("c4: " + c4); ! List edges = new LinkedList(); ! Edge e1 = new Edge(c1, c2); ! space.add(e1); ! edges.add(e1); ! Edge e2 = new Edge(c2, c3); ! space.add(e2); ! edges.add(e2); ! Edge e3 = new Edge(c3, c4); ! space.add(e3); ! edges.add(e3); ! Edge e4 = new Edge(c4, c1); ! space.add(e4); ! edges.add(e4); ! Surface s = new Surface(edges); ! windows.add(s); ! space.add(s); ! // log.info("left: " + left); ! // log.info("right: " + right); ! // log.info("top: " + top); ! // log.info("bottom: " + bottom); ! Geometry.holeAnalysis(s); ! if (type == DOUBLE_BAR) { ! Vertex sn = s.normal(); ! Vertex fn = front.normal(); ! Space wf = new Space("Window", Space.CONSTRUCTION, true); ! space.add(wf); ! windowElements.add(wf); ! if (sn.dot(fn) > 0) { ! if (front.getFrontDomain() == space) { ! s.setFrontDomain(wf); } else { ! s.setBackDomain(wf); } } else { ! if (front.getBackDomain() == space) { ! s.setFrontDomain(wf); ! } else { ! s.setBackDomain(wf); } ! } ! Modellor wm = new WindowModellor(wf, s); ! wf.setModellor(wm); ! windowModellors.add(wm); ! } ! Set sides = new HashSet(); ! Surface t = extrudeIntoSpace(s, depth, sides); ! windows.add(t); ! windows.addAll(sides); ! Iterator it = sides.iterator(); ! while (it.hasNext()) { ! Surface side = (Surface)it.next(); ! if (side.contains(e1)) { ! top.connect(side); ! } else if (side.contains(e2)) { ! right.connect(side); ! } else if (side.contains(e3)) { ! bottom.connect(side); ! } else if (side.contains(e4)) { ! left.connect(side); ! } ! space.add(side); } - Geometry.holeAnalysis(t); } - - /** * Removes the windows of the facade. --- 579,659 ---- private void createHole(Line left, Line right, Line top, Line bottom) { Vertex c1 = top.intersection(left); + space.add(c1); Vertex c2 = top.intersection(right); + space.add(c2); Vertex c3 = bottom.intersection(right); + space.add(c3); Vertex c4 = bottom.intersection(left); ! space.add(c4); ! if (c1 != null && c2 != null && c3 != null && c4 != null) { ! List edges = new LinkedList(); ! Edge e1 = new Edge(c1, c2); ! space.add(e1); ! edges.add(e1); ! Edge e2 = new Edge(c2, c3); ! space.add(e2); ! edges.add(e2); ! Edge e3 = new Edge(c3, c4); ! space.add(e3); ! edges.add(e3); ! Edge e4 = new Edge(c4, c1); ! space.add(e4); ! edges.add(e4); ! Surface s = new Surface(edges); ! windows.add(s); ! space.add(s); ! Geometry.holeAnalysis(s); ! if (type == DOUBLE_BAR) { ! Vertex sn = s.normal(); ! Vertex fn = front.normal(); ! Space wf = new Space("Window", Space.CONSTRUCTION, true); ! space.add(wf); ! windowElements.add(wf); ! if (sn.dot(fn) > 0) { ! if (front.getFrontDomain() == space) { ! s.setFrontDomain(wf); ! } else { ! s.setBackDomain(wf); ! } } else { ! if (front.getBackDomain() == space) { ! s.setFrontDomain(wf); ! } else { ! s.setBackDomain(wf); ! } } + Modellor wm = new WindowModellor(wf, s); + wf.setModellor(wm); + windowModellors.add(wm); + top.connect(e1); + right.connect(e2); + bottom.connect(e3); + left.connect(e4); } else { ! Set sides = new HashSet(); ! Surface t = extrudeIntoSpace(s, depth, sides); ! windows.add(t); ! windows.addAll(sides); ! Iterator it = sides.iterator(); ! while (it.hasNext()) { ! Surface side = (Surface)it.next(); ! if (side.contains(e1)) { ! top.connect(side); ! } else if (side.contains(e2)) { ! right.connect(side); ! } else if (side.contains(e3)) { ! bottom.connect(side); ! } else if (side.contains(e4)) { ! left.connect(side); ! } ! space.add(side); } ! Geometry.holeAnalysis(t); ! } ! } else { ! log.warn("Unable to create windows, some intersections were NULL"); } } /** * Removes the windows of the facade. *************** *** 570,574 **** it = windowElements.iterator(); while (it.hasNext()) { ! ((Space)it.next()).delete(); } windowModellors = new HashSet(); --- 670,676 ---- it = windowElements.iterator(); while (it.hasNext()) { ! Space sp = (Space)it.next(); ! sp.clear(); ! sp.delete(); } windowModellors = new HashSet(); *************** *** 576,580 **** windows = new HashSet(); } ! /** * Makes sure to extrude the a surface to the right side --- 678,682 ---- windows = new HashSet(); } ! /** * Makes sure to extrude the a surface to the right side *************** *** 630,633 **** createWindows(); } ! } } --- 732,735 ---- createWindows(); } ! } } |
From: Nordholt <nor...@us...> - 2006-09-25 13:40:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8070/src/net/sourceforge/bprocessor/gl/tool Modified Files: VectorMoveTool.java Log Message: changed allready called in movetool, no reason to call it twice Index: VectorMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/VectorMoveTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** VectorMoveTool.java 5 Sep 2006 11:01:43 -0000 1.5 --- VectorMoveTool.java 25 Sep 2006 13:40:30 -0000 1.6 *************** *** 53,57 **** } } - Project.getInstance().changed(vertices); } return delta; --- 53,56 ---- |
From: Michael L. <he...@us...> - 2006-09-20 11:01:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7006/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: A rotation experiment Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** View.java 19 Sep 2006 10:00:18 -0000 1.151 --- View.java 20 Sep 2006 11:01:42 -0000 1.152 *************** *** 16,19 **** --- 16,20 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; + import net.sourceforge.bprocessor.model.FullRotate; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; *************** *** 1019,1022 **** --- 1020,1027 ---- gl.glRotated(rotate.rz(), 0, 0, 1); } + if (current instanceof FullRotate) { + FullRotate rotate = (FullRotate) current; + gl.glRotated(rotate.angle(), rotate.rx(), rotate.ry(), rotate.rz()); + } } } |
From: Michael L. <he...@us...> - 2006-09-20 11:01:49
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7019/src/net/sourceforge/bprocessor/model Added Files: FullRotate.java Log Message: A rotation experiment --- NEW FILE: FullRotate.java --- //--------------------------------------------------------------------------------- // $Id: FullRotate.java,v 1.1 2006/09/20 11:01:46 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.model; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * Rotate */ public class FullRotate extends Transform { /** rotate x */ private double rx; /** rotate y */ private double ry; /** rotate z */ private double rz; /** angle */ private double angle; /** * Constructor */ public FullRotate() { super(); rx = 0; ry = 0; rz = 1; angle = 0; } /** * @param value new value */ public void rx(double value) { rx = value; } /** * * @return rx */ public double rx() { return rx; } /** * @param value new value */ public void ry(double value) { ry = value; } /** * * @return ry */ public double ry() { return ry; } /** * @param value new value */ public void rz(double value) { rz = value; } /** * * @return rz */ public double rz() { return rz; } /** * * @param value new value */ public void angle(double value) { angle = value; } /** * * @return angle */ public double angle() { return angle; } /** * Set attributes * @param attributes List */ public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); if (a.getName().equals("Rotate X")) { rx(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Rotate Y")) { ry(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Rotate Z")) { rz(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Angle")) { angle(((Double)a.getValue()).doubleValue()); } } Project.getInstance().changed(Project.getInstance()); } /** * Get attributes * @return List */ public List getAttributes() { ArrayList res = new ArrayList(); res.add(new Attribute("Rotate X", new Double(rx()))); res.add(new Attribute("Rotate Y", new Double(ry()))); res.add(new Attribute("Rotate Z", new Double(rz()))); res.add(new Attribute("Angle", new Double(angle()))); return res; } /** * @param vertex Vertex * @return Vertex */ public Vertex transform(Vertex vertex) { return vertex; } /** * Get display name * @return name */ public String getGeneralName() { return "Rotate"; } } |
From: Michael L. <he...@us...> - 2006-09-20 11:01:41
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6993/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: A rotation experiment Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** GenericTreeView.java 19 Sep 2006 10:00:04 -0000 1.47 --- GenericTreeView.java 20 Sep 2006 11:01:37 -0000 1.48 *************** *** 46,49 **** --- 46,50 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Entity; + import net.sourceforge.bprocessor.model.FullRotate; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Observer; *************** *** 609,612 **** --- 610,621 ---- }; pm.add(scale); + AbstractAction fullrotate = new EntityAction((Entity) object, "Full Rotate") { + public void actionPerformed(ActionEvent arg0) { + Space space = (Space) entity; + space.addTransform(new FullRotate()); + space.changed(); + } + }; + pm.add(fullrotate); // Adding all modellors JMenu mm = new JMenu("Modellors"); |
From: Michael L. <he...@us...> - 2006-09-20 08:52:18
|
Update of /cvsroot/bprocessor/facade/dist In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20173/dist Added Files: .cvsignore Removed Files: facade.jar Log Message: Removed the jar file in dist Ð added dist and added *.jar to cvsignore --- NEW FILE: .cvsignore --- *.jar *.zip --- facade.jar DELETED --- |
From: Michael L. <he...@us...> - 2006-09-20 08:52:10
|
Update of /cvsroot/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20173 Modified Files: build.xml Log Message: Removed the jar file in dist Ð added dist and added *.jar to cvsignore Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/facade/build.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** build.xml 10 Aug 2006 15:37:34 -0000 1.2 --- build.xml 20 Sep 2006 08:52:08 -0000 1.3 *************** *** 27,31 **** <target name="clean" depends="init"> <delete dir="${build.dir}"/> - <delete dir="${dist.dir}"/> <delete dir="${doc.api.dir}"/> <delete> --- 27,30 ---- *************** *** 34,37 **** --- 33,41 ---- </fileset> </delete> + <delete> + <fileset dir="${dist.dir}"> + <include name="**/*.jar"/> + </fileset> + </delete> <delete> <fileset dir="${basedir}" defaultexcludes="no"> |
From: Michael L. <he...@us...> - 2006-09-19 19:22:44
|
Update of /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12669/src/net/sourceforge/bprocessor/model/evaluator Modified Files: Environment.java Call.java Log Message: Fixed problems with scripting Index: Call.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Call.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Call.java 17 Sep 2006 17:29:21 -0000 1.5 --- Call.java 19 Sep 2006 19:22:42 -0000 1.6 *************** *** 60,64 **** } } ! Environment activation = new Environment(env, locals, arguments); invokable.evaluate(activation, stack); } else { --- 60,64 ---- } } ! Environment activation = new Environment(env.origin(), locals, arguments); invokable.evaluate(activation, stack); } else { Index: Environment.java =================================================================== RCS file: /cvsroot/bprocessor/bscript/src/net/sourceforge/bprocessor/model/evaluator/Environment.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Environment.java 17 Sep 2006 17:29:21 -0000 1.4 --- Environment.java 19 Sep 2006 19:22:42 -0000 1.5 *************** *** 50,53 **** --- 50,61 ---- /** + * + * @return origin + */ + public Environment origin() { + return origin; + } + + /** * Return a copy with locals replaced * @param locals List |
From: Michael L. <he...@us...> - 2006-09-19 19:22:42
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12655/src/net/sourceforge/bprocessor/gl/tool Modified Files: SpaceTool.java Log Message: Fixed problems with scripting Index: SpaceTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/SpaceTool.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** SpaceTool.java 17 Sep 2006 17:29:05 -0000 1.39 --- SpaceTool.java 19 Sep 2006 19:22:34 -0000 1.40 *************** *** 622,626 **** try { Project.info("evaluate '" + value + "'"); ! Environment env = new Environment(globals, null); Reader input = new StringReader(value); ScriptLexer lexer = new ScriptLexer(input); --- 622,627 ---- try { Project.info("evaluate '" + value + "'"); ! Environment global = new Environment(globals, null); ! Environment env = new Environment(global, new HashMap(), new LinkedList()); Reader input = new StringReader(value); ScriptLexer lexer = new ScriptLexer(input); |
From: rimestad <rim...@us...> - 2006-09-19 12:22:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31346/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java Log Message: cleaned up Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** OffsetTool.java 19 Sep 2006 08:22:14 -0000 1.8 --- OffsetTool.java 19 Sep 2006 12:22:05 -0000 1.9 *************** *** 60,66 **** private Edge edge; - /** edges */ - private LinkedList edges; - /** * Constructor fo OffsetTool --- 60,63 ---- *************** *** 92,96 **** surfaceFound = true; Surface surface = (Surface)current.object(); ! edges = new LinkedList(); edges.addAll(surface.getEdges()); Collection selection = Selection.primary(); --- 89,93 ---- surfaceFound = true; Surface surface = (Surface)current.object(); ! List edges = new LinkedList(); edges.addAll(surface.getEdges()); Collection selection = Selection.primary(); |
From: Michael L. <he...@us...> - 2006-09-19 10:00:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6689/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Refactored transform into scale, translate and rotate Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** View.java 18 Sep 2006 08:19:34 -0000 1.150 --- View.java 19 Sep 2006 10:00:18 -0000 1.151 *************** *** 24,29 **** --- 24,32 ---- import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Rotate; + import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; + import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 1001,1011 **** Iterator iter = transforms.iterator(); while (iter.hasNext()) { ! Transform t = (Transform) iter.next(); ! if (t != null) { ! gl.glTranslated(t.tx(), t.ty(), t.tz()); ! gl.glRotated(t.rx(), 1, 0, 0); ! gl.glRotated(t.ry(), 0, 1, 0); ! gl.glRotated(t.rz(), 0, 0, 1); ! gl.glScaled(t.sx(), t.sy(), t.sz()); } } --- 1004,1021 ---- Iterator iter = transforms.iterator(); while (iter.hasNext()) { ! Transform current = (Transform) iter.next(); ! if (current instanceof Translate) { ! Translate translate = (Translate) current; ! gl.glTranslated(translate.tx(), translate.ty(), translate.tz()); ! } ! if (current instanceof Scale) { ! Scale scale = (Scale) current; ! gl.glScaled(scale.sx(), scale.sy(), scale.sz()); ! } ! if (current instanceof Rotate) { ! Rotate rotate = (Rotate) current; ! gl.glRotated(rotate.rx(), 1, 0, 0); ! gl.glRotated(rotate.ry(), 0, 1, 0); ! gl.glRotated(rotate.rz(), 0, 0, 1); } } |
From: Michael L. <he...@us...> - 2006-09-19 10:00:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6495/src/net/sourceforge/bprocessor/model Modified Files: Space.java Transform.java Added Files: Translate.java Rotate.java Scale.java Log Message: Refactored transform into scale, translate and rotate Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Space.java 19 Sep 2006 09:17:44 -0000 1.64 --- Space.java 19 Sep 2006 10:00:09 -0000 1.65 *************** *** 1211,1215 **** Iterator iter = getTransformations().iterator(); while (iter.hasNext()) { ! res.add(new Attribute("Transform", iter.next())); } return res; --- 1211,1216 ---- Iterator iter = getTransformations().iterator(); while (iter.hasNext()) { ! Transform current = (Transform) iter.next(); ! res.add(new Attribute(current.getGeneralName(), current)); } return res; Index: Transform.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Transform.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Transform.java 15 Sep 2006 12:06:38 -0000 1.2 --- Transform.java 19 Sep 2006 10:00:09 -0000 1.3 *************** *** 8,46 **** package net.sourceforge.bprocessor.model; - import java.util.ArrayList; - import java.util.Iterator; - import java.util.List; - /** * Transform */ ! public class Transform implements Parametric { ! /** translate x */ ! private double tx; ! ! /** translate y */ ! private double ty; ! ! /** translate z */ ! private double tz; ! ! /** rotate x */ ! private double rx; ! ! /** rotate y */ ! private double ry; ! ! /** rotate z */ ! private double rz; ! ! /** scale x */ ! private double sx; ! ! /** scale y */ ! private double sy; ! ! /** scale z */ ! private double sz; ! /** * Constructor --- 8,15 ---- package net.sourceforge.bprocessor.model; /** * Transform */ ! public abstract class Transform implements Parametric { /** * Constructor *************** *** 48,245 **** public Transform() { super(); - tx = 0; - ty = 0; - tz = 0; - rx = 0; - ry = 0; - rz = 0; - sx = 1; - sy = 1; - sz = 1; } ! ! /** ! * @param value new value ! */ ! public void tx(double value) { ! tx = value; ! } ! /** ! * ! * @return tx ! */ ! public double tx() { ! return tx; ! } ! ! /** ! * @param value new value ! */ ! public void ty(double value) { ! ty = value; ! } ! /** ! * ! * @return ty ! */ ! public double ty() { ! return ty; ! } ! ! /** ! * @param value new value ! */ ! public void tz(double value) { ! tz = value; ! } ! /** ! * ! * @return tz ! */ ! public double tz() { ! return tz; ! } ! ! /** ! * @param value new value ! */ ! public void rx(double value) { ! rx = value; ! } ! /** ! * ! * @return rx ! */ ! public double rx() { ! return rx; ! } ! ! /** ! * @param value new value ! */ ! public void ry(double value) { ! ry = value; ! } ! /** ! * ! * @return ry ! */ ! public double ry() { ! return ry; ! } ! ! /** ! * @param value new value ! */ ! public void rz(double value) { ! rz = value; ! } ! /** ! * ! * @return rz ! */ ! public double rz() { ! return rz; ! } ! ! /** ! * @param value new value ! */ ! public void sx(double value) { ! sx = value; ! } ! /** ! * ! * @return sx ! */ ! public double sx() { ! return sx; ! } ! ! /** ! * @param value new value ! */ ! public void sy(double value) { ! sy = value; ! } ! /** ! * ! * @return sy ! */ ! public double sy() { ! return sy; ! } ! ! /** ! * @param value new value ! */ ! public void sz(double value) { ! sz = value; ! } ! /** ! * ! * @return sz ! */ ! public double sz() { ! return sz; ! } ! ! ! /** ! * Set attributes ! * @param attributes List ! */ ! public void setAttributes(List attributes) { ! Iterator iter = attributes.iterator(); ! while (iter.hasNext()) { ! Attribute a = (Attribute)iter.next(); ! if (a.getName().equals("Translate X")) { ! tx(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Translate Y")) { ! ty(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Translate Z")) { ! tz(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Rotate X")) { ! rx(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Rotate Y")) { ! ry(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Rotate Z")) { ! rz(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Scale X")) { ! sx(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Scale Y")) { ! sy(((Double)a.getValue()).doubleValue()); ! } else if (a.getName().equals("Scale Z")) { ! sz(((Double)a.getValue()).doubleValue()); ! } ! } ! Project.getInstance().changed(Project.getInstance()); ! } ! ! /** ! * Get attributes ! * @return List ! */ ! public List getAttributes() { ! ArrayList res = new ArrayList(); ! res.add(new Attribute("Translate X", new Double(tx()))); ! res.add(new Attribute("Translate Y", new Double(ty()))); ! res.add(new Attribute("Translate Z", new Double(tz()))); ! res.add(new Attribute("Rotate X", new Double(rx()))); ! res.add(new Attribute("Rotate Y", new Double(ry()))); ! res.add(new Attribute("Rotate Z", new Double(rz()))); ! res.add(new Attribute("Scale X", new Double(sx()))); ! res.add(new Attribute("Scale Y", new Double(sy()))); ! res.add(new Attribute("Scale Z", new Double(sz()))); ! return res; ! } ! /** ! * Get display name ! * @return name */ ! public String getGeneralName() { ! return "Transform"; ! } ! } --- 17,26 ---- public Transform() { super(); } ! /** ! * @param vertex Vertex ! * @return Vertex */ ! public abstract Vertex transform(Vertex vertex); } --- NEW FILE: Scale.java --- //--------------------------------------------------------------------------------- // $Id: Scale.java,v 1.1 2006/09/19 10:00:09 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.model; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * Scale */ public class Scale extends Transform { /** scale x */ private double sx; /** scale y */ private double sy; /** scale z */ private double sz; /** * Constructor */ public Scale() { super(); sx = 1; sy = 1; sz = 1; } /** * @param value new value */ public void sx(double value) { sx = value; } /** * * @return sx */ public double sx() { return sx; } /** * @param value new value */ public void sy(double value) { sy = value; } /** * * @return sy */ public double sy() { return sy; } /** * @param value new value */ public void sz(double value) { sz = value; } /** * * @return sz */ public double sz() { return sz; } /** * Set attributes * @param attributes List */ public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); if (a.getName().equals("Scale X")) { sx(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Scale Y")) { sy(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Scale Z")) { sz(((Double)a.getValue()).doubleValue()); } } Project.getInstance().changed(Project.getInstance()); } /** * Get attributes * @return List */ public List getAttributes() { ArrayList res = new ArrayList(); res.add(new Attribute("Scale X", new Double(sx()))); res.add(new Attribute("Scale Y", new Double(sy()))); res.add(new Attribute("Scale Z", new Double(sz()))); return res; } /** * @param vertex Vertex * @return Vertex */ public Vertex transform(Vertex vertex) { return vertex; } /** * Get display name * @return name */ public String getGeneralName() { return "Scale"; } } --- NEW FILE: Translate.java --- //--------------------------------------------------------------------------------- // $Id: Translate.java,v 1.1 2006/09/19 10:00:09 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.model; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * Translate */ public class Translate extends Transform { /** translate x */ private double tx; /** translate y */ private double ty; /** translate z */ private double tz; /** * Constructor */ public Translate() { super(); tx = 0; ty = 0; tz = 0; } /** * @param value new value */ public void tx(double value) { tx = value; } /** * * @return tx */ public double tx() { return tx; } /** * @param value new value */ public void ty(double value) { ty = value; } /** * * @return ty */ public double ty() { return ty; } /** * @param value new value */ public void tz(double value) { tz = value; } /** * * @return tz */ public double tz() { return tz; } /** * Set attributes * @param attributes List */ public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); if (a.getName().equals("Translate X")) { tx(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Translate Y")) { ty(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Translate Z")) { tz(((Double)a.getValue()).doubleValue()); } } Project.getInstance().changed(Project.getInstance()); } /** * Get attributes * @return List */ public List getAttributes() { ArrayList res = new ArrayList(); res.add(new Attribute("Translate X", new Double(tx()))); res.add(new Attribute("Translate Y", new Double(ty()))); res.add(new Attribute("Translate Z", new Double(tz()))); return res; } /** * @param vertex Vertex * @return Vertex */ public Vertex transform(Vertex vertex) { return vertex; } /** * Get display name * @return name */ public String getGeneralName() { return "Translate"; } } --- NEW FILE: Rotate.java --- //--------------------------------------------------------------------------------- // $Id: Rotate.java,v 1.1 2006/09/19 10:00:09 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.model; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /** * Rotate */ public class Rotate extends Transform { /** rotate x */ private double rx; /** rotate y */ private double ry; /** rotate z */ private double rz; /** * Constructor */ public Rotate() { super(); rx = 0; ry = 0; rz = 0; } /** * @param value new value */ public void rx(double value) { rx = value; } /** * * @return rx */ public double rx() { return rx; } /** * @param value new value */ public void ry(double value) { ry = value; } /** * * @return ry */ public double ry() { return ry; } /** * @param value new value */ public void rz(double value) { rz = value; } /** * * @return rz */ public double rz() { return rz; } /** * Set attributes * @param attributes List */ public void setAttributes(List attributes) { Iterator iter = attributes.iterator(); while (iter.hasNext()) { Attribute a = (Attribute)iter.next(); if (a.getName().equals("Rotate X")) { rx(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Rotate Y")) { ry(((Double)a.getValue()).doubleValue()); } else if (a.getName().equals("Rotate Z")) { rz(((Double)a.getValue()).doubleValue()); } } Project.getInstance().changed(Project.getInstance()); } /** * Get attributes * @return List */ public List getAttributes() { ArrayList res = new ArrayList(); res.add(new Attribute("Rotate X", new Double(rx()))); res.add(new Attribute("Rotate Y", new Double(ry()))); res.add(new Attribute("Rotate Z", new Double(rz()))); return res; } /** * @param vertex Vertex * @return Vertex */ public Vertex transform(Vertex vertex) { return vertex; } /** * Get display name * @return name */ public String getGeneralName() { return "Rotate"; } } |
From: Michael L. <he...@us...> - 2006-09-19 10:00:07
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6355/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Refactored transform into scale, translate and rotate Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** GenericTreeView.java 19 Sep 2006 09:17:40 -0000 1.46 --- GenericTreeView.java 19 Sep 2006 10:00:04 -0000 1.47 *************** *** 50,57 **** import net.sourceforge.bprocessor.model.ParameterBlock; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; ! import net.sourceforge.bprocessor.model.Transform; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Geometry; --- 50,59 ---- import net.sourceforge.bprocessor.model.ParameterBlock; import net.sourceforge.bprocessor.model.Project; + import net.sourceforge.bprocessor.model.Rotate; + import net.sourceforge.bprocessor.model.Scale; import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; ! import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Geometry; *************** *** 583,594 **** }; pm.add(check); ! AbstractAction transform = new EntityAction((Entity) object, "Transform") { public void actionPerformed(ActionEvent arg0) { Space space = (Space) entity; ! space.addTransform(new Transform()); space.changed(); } }; ! pm.add(transform); // Adding all modellors JMenu mm = new JMenu("Modellors"); --- 585,612 ---- }; pm.add(check); ! AbstractAction translate = new EntityAction((Entity) object, "Translate") { public void actionPerformed(ActionEvent arg0) { Space space = (Space) entity; ! space.addTransform(new Translate()); space.changed(); } }; ! pm.add(translate); ! AbstractAction rotate = new EntityAction((Entity) object, "Rotate") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.addTransform(new Rotate()); ! space.changed(); ! } ! }; ! pm.add(rotate); ! AbstractAction scale = new EntityAction((Entity) object, "Scale") { ! public void actionPerformed(ActionEvent arg0) { ! Space space = (Space) entity; ! space.addTransform(new Scale()); ! space.changed(); ! } ! }; ! pm.add(scale); // Adding all modellors JMenu mm = new JMenu("Modellors"); |
From: Michael L. <he...@us...> - 2006-09-19 09:17:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22012/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: Envelope computation Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** Space.java 18 Sep 2006 08:19:25 -0000 1.63 --- Space.java 19 Sep 2006 09:17:44 -0000 1.64 *************** *** 1240,1243 **** --- 1240,1256 ---- } if (container) { + result.addAll(collectInterior()); + } + return result; + } + + /** + * + * @return the interior set of vertices + */ + public Set collectInterior() { + Set result = new HashSet(); + Iterator it; + if (container) { it = elements.values().iterator(); while (it.hasNext()) { *************** *** 1537,1540 **** --- 1550,1616 ---- } + /** + * Calculate the envelope + */ + public void computeEnvelope() { + Collection vertices = collectInterior(); + double xmin = Double.MAX_VALUE; + double xmax = Double.MIN_VALUE; + double ymin = Double.MAX_VALUE; + double ymax = Double.MIN_VALUE; + double zmin = Double.MAX_VALUE; + double zmax = Double.MIN_VALUE; + Iterator iter = vertices.iterator(); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + double x = current.getX(); + double y = current.getY(); + double z = current.getZ(); + if (x < xmin) { + xmin = x; + } + if (x > xmax) { + xmax = x; + } + if (y < ymin) { + ymin = y; + } + if (y > ymax) { + ymax = y; + } + if (z < zmin) { + zmin = z; + } + if (z > zmax) { + zmax = z; + } + } + Vertex p4 = new Vertex(xmin, ymin, zmin); + Vertex p3 = new Vertex (xmin, ymax, zmin); + Vertex p2 = new Vertex(xmax, ymax, zmin); + Vertex p1 = new Vertex(xmax, ymin, zmin); + getOwner().insert(p1); + getOwner().insert(p2); + getOwner().insert(p3); + getOwner().insert(p4); + Edge e1 = new Edge(p1, p2); + Edge e2 = new Edge(p2, p3); + Edge e3 = new Edge(p3, p4); + Edge e4 = new Edge(p4, p1); + getOwner().insert(e1); + getOwner().insert(e2); + getOwner().insert(e3); + getOwner().insert(e4); + List edges = new LinkedList(); + edges.add(e1); + edges.add(e2); + edges.add(e3); + edges.add(e4); + Surface bottom = new Surface(edges); + getOwner().insert(bottom); + bottom.setFrontDomain(this); + bottom.extrude(zmax - zmin, new HashSet()); + } + /** * Finds out if this space is closed or not. |
From: Michael L. <he...@us...> - 2006-09-19 09:17:42
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22003/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Envelope computation Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** GenericTreeView.java 18 Sep 2006 14:37:49 -0000 1.45 --- GenericTreeView.java 19 Sep 2006 09:17:40 -0000 1.46 *************** *** 532,538 **** public void actionPerformed(ActionEvent arg0) { if (entity != null) { ! Space space = new Space("Copy", Space.CONSTRUCTION, false); ! space.setProto((Space) entity); ! ((Space) entity).getOwner().add(space); } } --- 532,542 ---- public void actionPerformed(ActionEvent arg0) { if (entity != null) { ! Space prototype = (Space) entity; ! ! Space space = new Space("Instance of " + prototype.getName(), ! Space.CONSTRUCTION, false); ! space.setProto(prototype); ! prototype.getOwner().add(space); ! Project.getInstance().changed(Project.getInstance()); } } *************** *** 546,549 **** --- 550,564 ---- }; pm.add(edit); + AbstractAction envelope = new EntityAction((Entity)object, "Compute Envelope") { + public void actionPerformed(ActionEvent arg0) { + if (entity != null) { + Space space = (Space) entity; + space.computeEnvelope(); + Project.getInstance().changed(Project.getInstance()); + } + } + }; + pm.add(envelope); + AbstractAction flip = new EntityAction((Entity)object, "Rotate 90 degrees CCW") { public void actionPerformed(ActionEvent arg0) { |
From: Michael L. <he...@us...> - 2006-09-19 08:22:25
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32639/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java Log Message: Fixed stylecheck error Ð removed model.jar Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OffsetTool.java 18 Sep 2006 14:09:58 -0000 1.7 --- OffsetTool.java 19 Sep 2006 08:22:14 -0000 1.8 *************** *** 60,63 **** --- 60,64 ---- private Edge edge; + /** edges */ private LinkedList edges; |