bprocessor-commit Mailing List for B-processor (Page 43)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2007-11-08 09:19:56
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26916/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Subdivide command Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** PopupMenu.java 6 Nov 2007 18:27:09 -0000 1.67 --- PopupMenu.java 8 Nov 2007 09:19:58 -0000 1.68 *************** *** 212,216 **** AbstractAction action = new SpaceMenuAction(sp, "Subdivide...") { public void actionPerformed(ActionEvent event) { ! Command command = new Command.SmoothSpace(space); AttributeView.instance().display(command); } --- 212,216 ---- AbstractAction action = new SpaceMenuAction(sp, "Subdivide...") { public void actionPerformed(ActionEvent event) { ! Command command = new Command.Subdivide(space); AttributeView.instance().display(command); } |
From: Michael L. <he...@us...> - 2007-11-08 09:11:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23683/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: Simplification of the subdivide command Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Command.java 5 Nov 2007 18:08:54 -0000 1.21 --- Command.java 8 Nov 2007 09:11:29 -0000 1.22 *************** *** 308,312 **** * */ ! public static class SmoothSpace extends Command { /** --- 308,312 ---- * */ ! public static class Subdivide extends Command { /** *************** *** 314,321 **** * @param space Space */ ! public SmoothSpace(Space space) { parameters.put("space", space); ! parameters.putDouble("n", 2); ! parameters.putBoolean("envelope", true); } --- 314,320 ---- * @param space Space */ ! public Subdivide(Space space) { parameters.put("space", space); ! parameters.putDouble("n", 1); } *************** *** 480,524 **** Space space = (Space) parameters.get("space"); int n = (int) parameters.getDouble("n"); - boolean envelope = parameters.getBoolean("envelope"); ! List<Surface> faces; ! if (envelope) { ! faces = new ArrayList(space.getEnvelope()); ! } else { ! faces = new ArrayList(space.getSurfaces()); ! } for (int i = 0; i < n; i++) { faces = subdivide(faces); } ! if (envelope) { ! Collection<Surface> env = new LinkedList(space.getEnvelope()); ! for (Surface current : env) { ! current.erase(); ! } ! Space owner = space.getOwner(); ! for (Surface quad : faces) { ! owner.insert(quad); ! } ! } else { ! space.clear(); ! for (Surface quad : faces) { ! for (Edge current : quad.getEdges()) { ! if (current.from.getOwner() == null) { ! space.add(current.from); ! } ! if (current.to.getOwner() == null) { ! space.add(current.to); ! } ! if (current.getOwner() == null) { ! space.add(current); ! } } - space.add(quad); } } - - Project.getInstance().changed(Project.getInstance()); } --- 479,505 ---- Space space = (Space) parameters.get("space"); int n = (int) parameters.getDouble("n"); ! List<Surface> faces = new ArrayList(space.getSurfaces()); ! for (int i = 0; i < n; i++) { faces = subdivide(faces); } ! space.clear(); ! for (Surface quad : faces) { ! for (Edge current : quad.getEdges()) { ! if (current.from.getOwner() == null) { ! space.add(current.from); ! } ! if (current.to.getOwner() == null) { ! space.add(current.to); ! } ! if (current.getOwner() == null) { ! space.add(current); } } + space.add(quad); } Project.getInstance().changed(Project.getInstance()); } |
From: Michael L. <he...@us...> - 2007-11-08 08:27:03
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7506/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: Vector move made default Improvement to grouping Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Mesh.java 6 Nov 2007 15:29:02 -0000 1.24 --- Mesh.java 8 Nov 2007 08:26:55 -0000 1.25 *************** *** 282,285 **** --- 282,307 ---- public Mesh copy(Map map) { Mesh copy = copyGeometry(map); + for (Space current : elements) { + Space shallow = current.shallowCopy(); + map.put(current, shallow); + copy.elements().add(shallow); + } + for (Surface current : surfaces) { + Surface surface = (Surface) map.get(current); + if (current.getBackDomain() != null) { + Space back = (Space) map.get(current.getBackDomain()); + surface.setBackDomain(back); + } + if (current.getFrontDomain() != null) { + Space front = (Space) map.get(current.getFrontDomain()); + surface.setFrontDomain(front); + } + if (current.getExterior() != null) { + Surface exterior = (Surface) map.get(current.getExterior()); + if (exterior != null) { + exterior.addHole(surface); + } + } + } return copy; } |
From: Michael L. <he...@us...> - 2007-11-08 08:27:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7496/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: Vector move made default Improvement to grouping Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** FinalMoveTool.java 6 Nov 2007 14:02:31 -0000 1.30 --- FinalMoveTool.java 8 Nov 2007 08:26:50 -0000 1.31 *************** *** 437,441 **** vertices = Geometry.collect(geometrics); ! mover = new SlidingMove(vertices); affected = getAffected(geometrics); --- 437,441 ---- vertices = Geometry.collect(geometrics); ! mover = new VectorMove(vertices); affected = getAffected(geometrics); |
From: rimestad <rim...@us...> - 2007-11-06 19:00:46
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21069/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Project.java Log Message: started on making the library lay on disk Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Persistence.java 6 Nov 2007 18:26:55 -0000 1.53 --- Persistence.java 6 Nov 2007 19:00:43 -0000 1.54 *************** *** 337,340 **** --- 337,345 ---- }*/ { + if (xml.getAnchor() != null) { + space.setInstanceAnchor(internalizeCoordinateSystem(xml.getAnchor(), mapper, xmls)); + } + } + { Iterator iter = xml.getConstructor().iterator(); while (iter.hasNext()) { *************** *** 978,981 **** --- 983,988 ---- } } + } else { + xml.setAnchor(externalizeCoordinateSystem(space.getInstanceAnchor(), map)); } { *************** *** 1580,1582 **** --- 1587,1597 ---- return res; } + + /** + * Load all lbr files in the library folder + * @return A collection of library objects + */ + public static Collection<Space> loadLibrary() { + return new LinkedList<Space>(); + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.202 retrieving revision 1.203 diff -C2 -d -r1.202 -r1.203 *** Space.java 6 Nov 2007 18:26:54 -0000 1.202 --- Space.java 6 Nov 2007 19:00:43 -0000 1.203 *************** *** 3020,3022 **** --- 3020,3032 ---- } } + + /** + * set the anchor for a instance + * @param cs the coordinatesystem to use as anchor + */ + public void setInstanceAnchor(CoordinateSystem cs) { + if (isInstance()) { + anchor = cs; + } + } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** Project.java 5 Nov 2007 18:09:18 -0000 1.138 --- Project.java 6 Nov 2007 19:00:43 -0000 1.139 *************** *** 64,67 **** --- 64,69 ---- private static Collection<ClassificationType> classificationTypes; + private static Collection<Space> library; + /** The cameras */ private HashMap cameras = new HashMap(); *************** *** 119,123 **** private long nextMaterialId; ! private List<Space> catalogObjects; /** --- 121,125 ---- private long nextMaterialId; ! private List<Space> catalog; /** *************** *** 130,133 **** --- 132,136 ---- try { Object[] loaded = Persistence.loadDBK(new File("Classification.xml")); + library = Persistence.loadLibrary(); constructionClas = (Classification)loaded[0]; functionalClas = (Classification)loaded[1]; *************** *** 154,158 **** redoStack = new Stack(); copyBuffer = new LinkedList(); ! catalogObjects = new LinkedList<Space>(); resetCam(); observers = new LinkedList(); --- 157,161 ---- redoStack = new Stack(); copyBuffer = new LinkedList(); ! catalog = new LinkedList<Space>(); resetCam(); observers = new LinkedList(); *************** *** 1042,1046 **** */ public List<Space> getCatalogObjects() { ! return catalogObjects; } --- 1045,1049 ---- */ public List<Space> getCatalogObjects() { ! return catalog; } *************** *** 1050,1054 **** */ public void addCalalogObject(Space s) { ! catalogObjects.add(s); } } --- 1053,1057 ---- */ public void addCalalogObject(Space s) { ! catalog.add(s); } } |
From: rimestad <rim...@us...> - 2007-11-06 19:00:44
|
Update of /cvsroot/bprocessor/model/src/etc In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21069/src/etc Modified Files: bprocessor.xsd Log Message: started on making the library lay on disk Index: bprocessor.xsd =================================================================== RCS file: /cvsroot/bprocessor/model/src/etc/bprocessor.xsd,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** bprocessor.xsd 2 Nov 2007 13:22:07 -0000 1.34 --- bprocessor.xsd 6 Nov 2007 19:00:43 -0000 1.35 *************** *** 91,94 **** --- 91,95 ---- <xsd:element name="modellor" type="ModellorType" maxOccurs="1" minOccurs="0"/> <xsd:element name="transforms" type="TransformType" maxOccurs="unbounded" minOccurs="0"/> + <xsd:element name="anchor" type="CoordinateSystemType" maxOccurs="1" minOccurs="0"/> <xsd:element ref="space" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="surface" maxOccurs="unbounded" minOccurs="0"/> *************** *** 96,104 **** <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> <xsd:attribute name="type" type="xsd:int" use="required"/> <xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="voidref" type="xsd:long"/> ! <xsd:attribute name="protoref" type="xsd:long"/> <xsd:attribute name="transparent" type="xsd:boolean" use="required"/> <xsd:attribute name="level" type="xsd:int" use="required"/> --- 97,106 ---- <xsd:element ref="vertex" maxOccurs="unbounded" minOccurs="0"/> <xsd:element ref="material" maxOccurs="unbounded" minOccurs="0"/> + </xsd:sequence> <xsd:attribute name="type" type="xsd:int" use="required"/> <xsd:attribute name="name" type="xsd:string"/> <xsd:attribute name="voidref" type="xsd:long"/> ! <xsd:attribute name="protoref" type="xsd:long" use="optional"/> <xsd:attribute name="transparent" type="xsd:boolean" use="required"/> <xsd:attribute name="level" type="xsd:int" use="required"/> *************** *** 376,382 **** --- 378,392 ---- <xsd:element name="camera" type="CameraType" maxOccurs="unbounded" minOccurs="0"/> <xsd:element name="global" type="MapElementType" maxOccurs="unbounded" minOccurs="0"/> + <xsd:element name="catalogObjects" type="SpaceType" maxOccurs="unbounded" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> + <xsd:element name="Library"> + <xsd:complexType> + <xsd:sequence> + <xsd:element ref="space" maxOccurs="unbounded" minOccurs="1"/> + </xsd:sequence> + </xsd:complexType> + </xsd:element> </xsd:schema> |
From: rimestad <rim...@us...> - 2007-11-06 18:27:50
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7640/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Added Files: LibraryTreeView.java Log Message: Added library tab to view --- NEW FILE: LibraryTreeView.java --- //--------------------------------------------------------------------------------- // $Id: LibraryTreeView.java,v 1.1 2007/11/06 18:27:53 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.treeview; import net.sourceforge.bprocessor.model.Project; /** * A class for the tree structure og the library tree view * @author rimestad */ public class LibraryTreeView extends GenericTreeView { /** * Constrcutor */ public LibraryTreeView() { super(); root.removeAllChildren(); root.add(new CatalogContainer(Project.getInstance())); model.nodeStructureChanged(root); } /** {@inheritDoc} */ @Override public void update() { ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); } } Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** GenericTreeView.java 6 Nov 2007 08:06:12 -0000 1.118 --- GenericTreeView.java 6 Nov 2007 18:27:53 -0000 1.119 *************** *** 670,679 **** ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); - if (space.isUnion()) { - ContainerNode tc = - new TransformationContainer("Transformations", space.getTransformations().stack()); - tc.update(space.getTransformations().stack()); - add(tc); - } if (space.getModellor() != null) { add(new ModellorNode(space.getModellor())); --- 670,673 ---- *************** *** 690,697 **** SpaceNode proto = new SpaceNode(space.getProto()); add(proto); ! ContainerNode tc = ! new TransformationContainer("Transformations", space.getTransformations().stack()); ! tc.update(space.getTransformations().stack()); ! add(tc); } --- 684,691 ---- SpaceNode proto = new SpaceNode(space.getProto()); add(proto); ! CoordinateSystem cs = space.getInstanceAnchor(); ! if (cs != null) { ! add(new ConstructorNode(cs)); ! } } *************** *** 707,711 **** ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ((GenericNode)getChildAt(1)).update(s.getProto()); ! ((GenericNode)getChildAt(2)).update(s.getTransformations().stack()); } else { removeAllChildren(); --- 701,705 ---- ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ((GenericNode)getChildAt(1)).update(s.getProto()); ! ((GenericNode)getChildAt(2)).update(s.getInstanceAnchor()); } else { removeAllChildren(); *************** *** 721,735 **** ((GenericNode)getChildAt(3)).update(s.getConstructors()); int placement = 4; - if (s.isUnion()) { - if (getChildCount() >= placement + 1) { - ((GenericNode)getChildAt(placement)).update(s.getTransformations().stack()); - } else { - ContainerNode tc = new TransformationContainer("Transformations", - space.getTransformations().stack()); - this.add(tc); - model.nodesWereInserted(this, new int[]{placement}); - } - placement++; - } if (s.getModellor() != null) { if (getChildCount() >= placement + 1) { --- 715,718 ---- *************** *** 1184,1188 **** */ public CatalogContainer(Project p) { ! super("Catalog objects", p.getCatalogObjects(), true); insertChildren(p.getCatalogObjects()); } --- 1167,1171 ---- */ public CatalogContainer(Project p) { ! super("Catalog", p.getCatalogObjects(), true); insertChildren(p.getCatalogObjects()); } *************** *** 1238,1244 **** if (o instanceof Space) { Space s = (Space)o; ! ((GenericNode)root.getChildAt(0)).update(s.getSurfaces()); ! ((GenericNode)root.getChildAt(1)).update(s.getEdges()); ! ((GenericNode)root.getChildAt(2)).update(s.getVertices()); } } --- 1221,1227 ---- if (o instanceof Space) { Space s = (Space)o; ! ((GenericNode)this.getChildAt(0)).update(s.getSurfaces()); ! ((GenericNode)this.getChildAt(1)).update(s.getEdges()); ! ((GenericNode)this.getChildAt(2)).update(s.getVertices()); } } |
From: rimestad <rim...@us...> - 2007-11-06 18:27:32
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7618/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Added library tab to view Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** GUI.java 29 Oct 2007 18:13:04 -0000 1.79 --- GUI.java 6 Nov 2007 18:27:31 -0000 1.80 *************** *** 26,29 **** --- 26,30 ---- import net.sourceforge.bprocessor.gui.splash.SplashWindow; import net.sourceforge.bprocessor.gui.treeview.DBKTreeView; + import net.sourceforge.bprocessor.gui.treeview.LibraryTreeView; import net.sourceforge.bprocessor.gui.treeview.SpaceTreeView; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 694,697 **** --- 695,699 ---- tree.addTab("Views", new CameraView()); tree.addTab("DBK", new JScrollPane (new DBKTreeView())); + tree.addTab("Library", new JScrollPane (new LibraryTreeView())); tree.setMinimumSize(new Dimension(180, 240)); tree.setPreferredSize(new Dimension(240, 240)); |
From: rimestad <rim...@us...> - 2007-11-06 18:27:08
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7571/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: Removed transformations from a space and removed all of its uses through space. Added a anchor to space to be used with instances. Changed the display code to use that. Added try catch clause arround display.draw to be able to continue using the tool even if the display method throws exceptions Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** PopupMenu.java 6 Nov 2007 15:29:06 -0000 1.66 --- PopupMenu.java 6 Nov 2007 18:27:09 -0000 1.67 *************** *** 36,47 **** import net.sourceforge.bprocessor.model.Mesh; 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.SurfaceAnalysis; - import net.sourceforge.bprocessor.model.Transform; - import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.modellor.Modellor; --- 36,43 ---- *************** *** 130,202 **** /** - * @param s Space - * @return Transform Menu - */ - public static JMenu getTransformMenu(Space s) { - JMenu pm = new JMenu("Transform"); - AbstractAction translate = new SpaceMenuAction(s, "Translate") { - public void actionPerformed(ActionEvent arg0) { - Transform t = new Translate(); - space.addTransform(t); - space.changed(); - AttributeView.instance().display(t); - Project.getInstance().checkpoint(); - } - }; - pm.add(translate); - AbstractAction rotate = new SpaceMenuAction(s, "Rotate") { - public void actionPerformed(ActionEvent arg0) { - Transform t = new Rotate(); - space.addTransform(t); - space.changed(); - AttributeView.instance().display(t); - Project.getInstance().checkpoint(); - } - }; - pm.add(rotate); - AbstractAction scale = new SpaceMenuAction(s, "Scale") { - public void actionPerformed(ActionEvent arg0) { - Transform t = new Scale(); - space.addTransform(t); - space.changed(); - AttributeView.instance().display(t); - Project.getInstance().checkpoint(); - } - }; - pm.add(scale); - AbstractAction translatelocal = new SpaceMenuAction(s, "Translate Local") { - public void actionPerformed(ActionEvent arg0) { - Transform t = new Translate(); - space.pushTransform(t); - space.changed(); - AttributeView.instance().display(t); - Project.getInstance().checkpoint(); - } - }; - pm.add(translatelocal); - AbstractAction rotatelocal = new SpaceMenuAction(s, "Rotate Local") { - public void actionPerformed(ActionEvent arg0) { - Transform t = new Rotate(); - space.pushTransform(t); - space.changed(); - AttributeView.instance().display(t); - Project.getInstance().checkpoint(); - } - }; - pm.add(rotatelocal); - AbstractAction scalelocal = new SpaceMenuAction(s, "Scale Local") { - public void actionPerformed(ActionEvent arg0) { - Transform t = new Scale(); - space.pushTransform(t); - space.changed(); - AttributeView.instance().display(t); - Project.getInstance().checkpoint(); - } - }; - pm.add(scalelocal); - return pm; - } - - /** * A popup generator for a space * @param space the space --- 126,129 ---- *************** *** 315,320 **** menu.add(modCheck); } - - menu.add(getTransformMenu(sp)); for (Modellor current : Modellor.getRegisteredModellors()) { --- 242,245 ---- |
From: rimestad <rim...@us...> - 2007-11-06 18:27:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7212/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: Removed transformations from a space and removed all of its uses through space. Added a anchor to space to be used with instances. Changed the display code to use that. Added try catch clause arround display.draw to be able to continue using the tool even if the display method throws exceptions Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Display.java 6 Nov 2007 14:02:31 -0000 1.48 --- Display.java 6 Nov 2007 18:27:03 -0000 1.49 *************** *** 40,44 **** import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; - import net.sourceforge.bprocessor.model.TransformStack; import net.sourceforge.bprocessor.model.Vertex; --- 40,43 ---- *************** *** 47,51 **** */ public class Display { - private static final boolean TRUE = true; --- 46,49 ---- *************** *** 1037,1048 **** */ private static void translateToCoordinatesystem(Space space) { ! TransformStack ts = space.getTransformations(); ! Vertex center = ts.transform(new Vertex(0, 0, 0)); ! Vertex i = ts.transform(new Vertex(1, 0, 0)).minus(center); ! Vertex j = ts.transform(new Vertex(0, 1, 0)).minus(center); ! Vertex k = ts.transform(new Vertex(0, 0, 1)).minus(center); ! ! //CoordinateSystem cs = space.getCoordinateSystems().iterator().next(); ! //Vertex translation = cs.center(); gl.glPushMatrix(); double[] matrix = new double[]{ --- 1035,1043 ---- */ private static void translateToCoordinatesystem(Space space) { ! CoordinateSystem cs = space.getInstanceAnchor(); ! Vertex i = cs.getI(); ! Vertex j = cs.getJ(); ! Vertex k = cs.getN(); ! Vertex center = cs.center(); gl.glPushMatrix(); double[] matrix = new double[]{ *************** *** 1052,1056 **** center.getX(), center.getY(), center.getZ(), 1}; gl.glMultMatrixd(matrix, 0); - //gl.glTranslated(translation.getX(), translation.getY(), translation.getZ()); } --- 1047,1050 ---- Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.254 retrieving revision 1.255 diff -C2 -d -r1.254 -r1.255 *** View.java 24 Oct 2007 07:45:10 -0000 1.254 --- View.java 6 Nov 2007 18:27:00 -0000 1.255 *************** *** 20,24 **** import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; - import net.sourceforge.bprocessor.model.AxisRotate; import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Plane; --- 20,23 ---- *************** *** 26,38 **** import net.sourceforge.bprocessor.model.Edge; 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.TransformStack; - import net.sourceforge.bprocessor.model.Translate; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; - import net.sourceforge.bprocessor.model.Transform; import java.util.ArrayList; --- 25,32 ---- *************** *** 644,648 **** Display.extras(extras); Display.glos(glObjects3D); ! Display.draw(gld, gl, glu); Display.selecting(false); Display.intersecting(false); --- 638,646 ---- Display.extras(extras); Display.glos(glObjects3D); ! try { ! Display.draw(gld, gl, glu); ! } catch (Exception e) { ! e.printStackTrace(); ! } Display.selecting(false); Display.intersecting(false); *************** *** 877,923 **** /** - * - * @param space Space - */ - public void transformTo(Space space) { - if (space != null) { - transformTo(space.getOwner()); - transform(space.getTransformations()); - } - } - - /** - * Apply transformations - * @param transformations List of transformations - */ - private void transform(TransformStack transformations) { - Iterator iter = transformations.stack().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; - double xaxis[] = new double[]{1, 0, 0, 0}; - double yaxis[] = new double[]{0, 1, 0, 0}; - double zaxis[] = new double[]{0, 0, 1, 0}; - gl.glRotated(rotate.rz(), zaxis[0], zaxis[1], zaxis[2]); - gl.glRotated(rotate.ry(), yaxis[0], yaxis[1], yaxis[2]); - gl.glRotated(rotate.rx(), xaxis[0], xaxis[1], xaxis[2]); - } - if (current instanceof AxisRotate) { - AxisRotate rotate = (AxisRotate) current; - gl.glRotated(rotate.angle(), rotate.rx(), rotate.ry(), rotate.rz()); - } - } - } - - /** * Draw string at specified position * @param x The x position --- 875,878 ---- |
From: rimestad <rim...@us...> - 2007-11-06 18:26:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7199/src/net/sourceforge/bprocessor/model Modified Files: Space.java Persistence.java Log Message: Removed transformations from a space and removed all of its uses through space. Added a anchor to space to be used with instances. Changed the display code to use that. Added try catch clause arround display.draw to be able to continue using the tool even if the display method throws exceptions Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Persistence.java 5 Nov 2007 12:26:22 -0000 1.52 --- Persistence.java 6 Nov 2007 18:26:55 -0000 1.53 *************** *** 78,82 **** import java.io.InputStream; import java.io.OutputStream; - import java.util.ArrayList; import java.util.Collection; import java.util.Collections; --- 78,81 ---- *************** *** 338,352 **** }*/ { - Iterator iter = xml.getTransforms().iterator(); - ArrayList trans = new ArrayList(); - while (iter.hasNext()) { - TransformType current = (TransformType) iter.next(); - trans.add(internalizeTransformation(current, new HashSet())); - } - for (int i = trans.size() - 1; i >= 0; i--) { - space.addTransform((Transform)trans.get(i)); - } - } - { Iterator iter = xml.getConstructor().iterator(); while (iter.hasNext()) { --- 337,340 ---- *************** *** 992,1002 **** } { - Iterator iter = space.getTransformations().stack().iterator(); - while (iter.hasNext()) { - Transform t = (Transform)iter.next(); - xml.getTransforms().add(externalizeTransformation(t, new HashMap())); - } - } - { if (space.getModellor() != null) { xml.setModellor(externalizeModellor(space.getModellor(), map)); --- 980,983 ---- Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** Space.java 6 Nov 2007 15:29:02 -0000 1.201 --- Space.java 6 Nov 2007 18:26:54 -0000 1.202 *************** *** 124,130 **** private long nextConstructorId; - /** The transformation */ - private TransformStack transform; - /** The modellor */ private Modellor modellor; --- 124,127 ---- *************** *** 140,143 **** --- 137,143 ---- private LinkedHashMap<String, Object> ownParameters = new LinkedHashMap<String, Object>(); + + /** A anchor for instances */ + private CoordinateSystem anchor; /** *************** *** 178,182 **** super(); envelope = new HashSet<Surface>(); - transform = new TransformStack(); initializeContainers(); } --- 178,181 ---- *************** *** 216,220 **** description = new Description(""); envelope = new HashSet<Surface>(); - transform = new TransformStack(); if (container) { initializeContainers(); --- 215,218 ---- *************** *** 285,319 **** /** - * Get transformation - * @return transformations - */ - public TransformStack getTransformations() { - return transform; - } - - /** - * Add transformation - * @param transform Transform - */ - public void addTransform(Transform transform) { - this.transform.insert(transform); - } - - /** - * push transformation - * @param transform Transform - */ - public void pushTransform(Transform transform) { - this.transform.push(transform); - } - - /** - * pop transformation - */ - public void popTransform() { - this.transform.pop(); - } - - /** * Set proto * @param space Space --- 283,286 ---- *************** *** 321,324 **** --- 288,296 ---- public void setProto(Space space) { this.proto = space; + if (proto != null) { + this.anchor = Project.getInstance().getActiveCoordinateSystem().copy(); + } else { + this.anchor = null; + } } *************** *** 453,456 **** --- 425,430 ---- constructors.put(id, c); c.setOwner(this); + } else if (isInstance()) { + proto.add(c); } else { throw new Error("adding constructor to non-container " + this); *************** *** 463,470 **** */ public void remove(Constructor c) { ! if (c.getId() != null && c != Project.getInstance().getActiveCoordinateSystem()) { ! constructors.remove(c.getId()); ! c.setId(null); ! c.setOwner(null); } } --- 437,448 ---- */ public void remove(Constructor c) { ! if (container) { ! if (c.getId() != null && c != Project.getInstance().getActiveCoordinateSystem()) { ! constructors.remove(c.getId()); ! c.setId(null); ! c.setOwner(null); ! } ! } else if (isInstance()) { ! proto.remove(c); } } *************** *** 547,553 **** */ public void remove(Vertex vertex) { ! vertices.remove(vertex.getId()); ! vertex.setId(null); ! vertex.setOwner(null); } --- 525,535 ---- */ public void remove(Vertex vertex) { ! if (container) { ! vertices.remove(vertex.getId()); ! vertex.setId(null); ! vertex.setOwner(null); ! } else if (isInstance()) { ! proto.remove(vertex); ! } } *************** *** 635,641 **** */ public void remove(Edge edge) { ! edges.remove(edge.getId()); ! edge.setId(null); ! edge.setOwner(null); } --- 617,627 ---- */ public void remove(Edge edge) { ! if (container) { ! edges.remove(edge.getId()); ! edge.setId(null); ! edge.setOwner(null); ! } else if (isInstance()) { ! proto.remove(edge); ! } } *************** *** 772,778 **** */ public void remove(Surface surface) { ! surfaces.remove(surface.getId()); ! surface.setId(null); ! surface.setOwner(null); } --- 758,768 ---- */ public void remove(Surface surface) { ! if (container) { ! surfaces.remove(surface.getId()); ! surface.setId(null); ! surface.setOwner(null); ! } else if (isInstance()) { ! proto.remove(surface); ! } } *************** *** 1093,1121 **** */ public void remove(Space element) { ! Set surfs = element.getEnvelope(); ! element.setEnvelope(new HashSet<Surface>()); ! if (surfs != null) { ! Iterator iter = surfs.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface)iter.next(); ! Space back = current.getBackDomain(); ! Space front = current.getFrontDomain(); ! if (back == element) { ! current.setBackDomain(empty); } ! if (front == element) { ! current.setFrontDomain(empty); } } ! } ! if (element != null) { ! Space superSpace = findElement(element); ! if (superSpace != null) { ! superSpace.elements.remove(element.getId()); ! element.setId(null); } ! } ! if (element.getModellor() != null) { ! element.getModellor().delete(); } } --- 1083,1115 ---- */ public void remove(Space element) { ! if (container) { ! Set surfs = element.getEnvelope(); ! element.setEnvelope(new HashSet<Surface>()); ! if (surfs != null) { ! Iterator iter = surfs.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface)iter.next(); ! Space back = current.getBackDomain(); ! Space front = current.getFrontDomain(); ! if (back == element) { ! current.setBackDomain(empty); ! } ! if (front == element) { ! current.setFrontDomain(empty); ! } } ! } ! if (element != null) { ! Space superSpace = findElement(element); ! if (superSpace != null) { ! superSpace.elements.remove(element.getId()); ! element.setId(null); } } ! if (element.getModellor() != null) { ! element.getModellor().delete(); } ! } else if (isInstance()) { ! proto.remove(element); } } *************** *** 1337,1345 **** } } - Iterator iter = getTransformations().stack().iterator(); - while (iter.hasNext()) { - Transform current = (Transform) iter.next(); - res.add(new Attribute(current.getGeneralName(), current)); - } return res; } --- 1331,1334 ---- *************** *** 1448,1457 **** result.addAll(s.collect()); } ! if (isUnion() && !getConstructors().isEmpty()) { ! result.add(getConstructors().iterator().next().center()); ! } else { ! if (container) { ! result.addAll(collectInterior()); ! } } return result; --- 1437,1445 ---- result.addAll(s.collect()); } ! if (isInstance()) { ! result.add(anchor.center()); ! } ! if (container) { ! result.addAll(collectInterior()); } return result; *************** *** 2222,2241 **** */ public void removeProtected(Surface surface) { ! if (surface.getOwner() == this) { ! if (surface.protect()) { ! Space back = surface.getBackDomain(); ! if (back != null) { ! back.removeSurface(surface); } ! Space front = surface.getFrontDomain(); ! if (front != null) { ! front.removeSurface(surface); } - remove(surface); - surface.protect(false); - } - for (Edge edge : surface.getEdges()) { - removeProtected(edge); } } } --- 2210,2233 ---- */ public void removeProtected(Surface surface) { ! if (container) { ! if (surface.getOwner() == this) { ! if (surface.protect()) { ! Space back = surface.getBackDomain(); ! if (back != null) { ! back.removeSurface(surface); ! } ! Space front = surface.getFrontDomain(); ! if (front != null) { ! front.removeSurface(surface); ! } ! remove(surface); ! surface.protect(false); } ! for (Edge edge : surface.getEdges()) { ! removeProtected(edge); } } + } else if (isInstance()) { + proto.remove(surface); } } *************** *** 2246,2256 **** */ public void removeProtected(Edge edge) { ! if (edge.getOwner() == this) { ! if (edge.protect()) { ! remove(edge); ! edge.protect(false); } ! removeProtected(edge.from); ! removeProtected(edge.to); } } --- 2238,2252 ---- */ public void removeProtected(Edge edge) { ! if (container) { ! if (edge.getOwner() == this) { ! if (edge.protect()) { ! remove(edge); ! edge.protect(false); ! } ! removeProtected(edge.from); ! removeProtected(edge.to); } ! } else if (isInstance()) { ! proto.remove(edge); } } *************** *** 2261,2269 **** */ public void removeProtected(Vertex vertex) { ! if (vertex.getOwner() == this) { ! if (vertex.protect()) { ! remove(vertex); ! vertex.protect(false); } } } --- 2257,2269 ---- */ public void removeProtected(Vertex vertex) { ! if (container) { ! if (vertex.getOwner() == this) { ! if (vertex.protect()) { ! remove(vertex); ! vertex.protect(false); ! } } + } else if (isInstance()) { + proto.remove(vertex); } } *************** *** 2298,2307 **** */ public void addProtected(Surface surface) { ! for (Edge edge : surface.getEdges()) { ! addProtected(edge); ! } ! if (surface.getOwner() == null) { ! surface.protect(true); ! add(surface); } } --- 2298,2311 ---- */ public void addProtected(Surface surface) { ! if (container) { ! for (Edge edge : surface.getEdges()) { ! addProtected(edge); ! } ! if (surface.getOwner() == null) { ! surface.protect(true); ! add(surface); ! } ! } else if (isInstance()) { ! proto.addProtected(surface); } } *************** *** 2312,2320 **** */ public void addProtected(Edge edge) { ! addProtected(edge.from); ! addProtected(edge.to); ! if (edge.getOwner() == null) { ! edge.protect(true); ! add(edge); } } --- 2316,2328 ---- */ public void addProtected(Edge edge) { ! if (container) { ! addProtected(edge.from); ! addProtected(edge.to); ! if (edge.getOwner() == null) { ! edge.protect(true); ! add(edge); ! } ! } else if (isInstance()) { ! proto.addProtected(edge); } } *************** *** 2325,2331 **** */ public void addProtected(Vertex vertex) { ! if (vertex.getOwner() == null) { ! vertex.protect(true); ! add(vertex); } } --- 2333,2343 ---- */ public void addProtected(Vertex vertex) { ! if (container) { ! if (vertex.getOwner() == null) { ! vertex.protect(true); ! add(vertex); ! } ! } else if (isInstance()) { ! proto.addProtected(vertex); } } *************** *** 2993,2995 **** --- 3005,3022 ---- } } + + /** + * Getter for anchor + * @return The anchor + */ + public CoordinateSystem getInstanceAnchor() { + if (isInstance()) { + if (anchor == null) { + anchor = Project.getInstance().getActiveCoordinateSystem().copy(); + } + return anchor; + } else { + return null; + } + } } |
From: rimestad <rim...@us...> - 2007-11-06 18:20:41
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4700/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: changed controlled extrude back to previus setting Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** Surface.java 31 Oct 2007 15:46:28 -0000 1.199 --- Surface.java 6 Nov 2007 18:20:30 -0000 1.200 *************** *** 941,945 **** Vertex normal = normal(); Plane p = new Plane(normal.getX(), normal.getY(), normal.getZ(), this.getFirstVertex()); ! boolean makeNewTop = false; List<Vertex> vertices = getVertices(); --- 941,945 ---- Vertex normal = normal(); Plane p = new Plane(normal.getX(), normal.getY(), normal.getZ(), this.getFirstVertex()); ! boolean makeNewTop = true; List<Vertex> vertices = getVertices(); *************** *** 996,1002 **** v2dir.put(v[i], new Direction(vmap[i], tempNormal, min, max)); } - makeNewTop = true; } else { // We just have to move the existing point Collection<Edge> connected = v[i].getEdges(); connected.removeAll(this.getEdges()); --- 996,1002 ---- v2dir.put(v[i], new Direction(vmap[i], tempNormal, min, max)); } } else { // We just have to move the existing point + makeNewTop = false; Collection<Edge> connected = v[i].getEdges(); connected.removeAll(this.getEdges()); *************** *** 1107,1111 **** } } ! //this.setEdges(lst); for (int i = 0; i < n; i++) { --- 1107,1111 ---- } } ! this.setEdges(lst); for (int i = 0; i < n; i++) { *************** *** 1113,1158 **** facemap[i] = (Surface)e2s.get(e[i]); } else { ! if (sidemap[i] != null) { ! if (sidemap[(i + 1) % n] != null) { ! //New quadratic surface ! Edge b = e[i]; ! Edge r = sidemap[i]; ! Edge l = sidemap[(i + 1) % n]; ! Edge t = topmap[i]; ! List<Edge> newEdges = new LinkedList<Edge>(); ! newEdges.add(r); ! newEdges.add(t); ! newEdges.add(l); ! newEdges.add(b); ! facemap[i] = new Surface(newEdges); ! e2s.put(b, facemap[i]); ! extrusion.add(facemap[i]); ! } else { ! //new triangular surface with the prev edge. ! Edge b = e[i]; ! Edge r = sidemap[i]; ! Edge t = topmap[i]; ! List<Edge> newEdges = new LinkedList<Edge>(); ! newEdges.add(b); ! newEdges.add(r); ! newEdges.add(t); ! facemap[i] = new Surface(newEdges); ! e2s.put(b, facemap[i]); ! extrusion.add(facemap[i]); ! } } else { ! if (sidemap[(i + 1) % n] != null) { ! // new triangular surface with the next edge ! Edge b = e[i]; ! Edge l = sidemap[(i + 1) % n]; ! Edge t = topmap[i]; ! List<Edge> newEdges = new LinkedList<Edge>(); ! newEdges.add(t); ! newEdges.add(l); ! newEdges.add(b); ! facemap[i] = new Surface(newEdges); ! e2s.put(b, facemap[i]); ! extrusion.add(facemap[i]); ! } } } --- 1113,1131 ---- facemap[i] = (Surface)e2s.get(e[i]); } else { ! if (sidemap[i] == null || sidemap[(i + 1) % n] == null) { ! // We should not make a new surface } else { ! Edge b = e[i]; ! Edge r = sidemap[i]; ! Edge l = sidemap[(i + 1) % n]; ! Edge t = topmap[i]; ! List<Edge> newEdges = new LinkedList<Edge>(); ! newEdges.add(r); ! newEdges.add(t); ! newEdges.add(l); ! newEdges.add(b); ! facemap[i] = new Surface(newEdges); ! e2s.put(b, facemap[i]); ! extrusion.add(facemap[i]); } } |
From: Michael L. <he...@us...> - 2007-11-06 15:29:03
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28582/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: More work on grouping Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** PopupMenu.java 6 Nov 2007 14:02:38 -0000 1.65 --- PopupMenu.java 6 Nov 2007 15:29:06 -0000 1.66 *************** *** 444,447 **** --- 444,450 ---- union.add(current); } + for (Space current : copy.elements()) { + union.add(current); + } for (Geometric current : entities) { current.delete(); |
From: Michael L. <he...@us...> - 2007-11-06 15:29:00
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28323/src/net/sourceforge/bprocessor/model Modified Files: Space.java Mesh.java Log Message: More work on grouping Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.200 retrieving revision 1.201 diff -C2 -d -r1.200 -r1.201 *** Space.java 5 Nov 2007 18:10:29 -0000 1.200 --- Space.java 6 Nov 2007 15:29:02 -0000 1.201 *************** *** 1540,1544 **** * @return new space */ ! public Space simpleCopy() { Space copy = new Space(); copy.classification = classification; --- 1540,1544 ---- * @return new space */ ! public Space shallowCopy() { Space copy = new Space(); copy.classification = classification; *************** *** 1546,1549 **** --- 1546,1553 ---- copy.description = description; copy.name = name; + copy.isNet = isNet; + copy.isUnion = isUnion; + copy.transparent = transparent; + copy.type = type; return copy; } Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Mesh.java 6 Nov 2007 14:02:35 -0000 1.23 --- Mesh.java 6 Nov 2007 15:29:02 -0000 1.24 *************** *** 42,45 **** --- 42,46 ---- this.edges = edges; this.vertices = vertices; + this.elements = new LinkedList(); } *************** *** 252,255 **** --- 253,257 ---- } + /** * Returns a copy of this mesh *************** *** 257,261 **** * @return copy of this Mesh */ ! public Mesh copy(Map map) { Collection<Vertex> vs = new LinkedList(); Collection<Edge> es = new LinkedList(); --- 259,263 ---- * @return copy of this Mesh */ ! public Mesh copyGeometry(Map map) { Collection<Vertex> vs = new LinkedList(); Collection<Edge> es = new LinkedList(); *************** *** 274,277 **** --- 276,289 ---- /** + * Returns a copy of this mesh + * @param map Map + * @return copy of this Mesh + */ + public Mesh copy(Map map) { + Mesh copy = copyGeometry(map); + return copy; + } + + /** * Copy and assign original spaces * @param map HashMap *************** *** 279,283 **** */ public Mesh copyAndAssign(Map map) { ! Mesh copy = copy(map); for (Surface current : surfaces) { Surface surface = (Surface) map.get(current); --- 291,295 ---- */ public Mesh copyAndAssign(Map map) { ! Mesh copy = copyGeometry(map); for (Surface current : surfaces) { Surface surface = (Surface) map.get(current); |
From: Michael L. <he...@us...> - 2007-11-06 14:02:41
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24969/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: group mechanism implemented, that moves geometry into a space Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** PopupMenu.java 5 Nov 2007 15:05:16 -0000 1.64 --- PopupMenu.java 6 Nov 2007 14:02:38 -0000 1.65 *************** *** 58,62 **** private static final boolean CHECKS = false; ! private static final boolean GROUPS = false; /** * make a popup menu for a surface --- 58,62 ---- private static final boolean CHECKS = false; ! private static final boolean GROUPS = true; /** * make a popup menu for a surface *************** *** 431,446 **** AbstractAction action = new GeometricMenuAction(arguments, "Group") { public void actionPerformed(ActionEvent event) { - System.out.println("-- selection --"); - for (Geometric current : entities) { - System.out.println(" " + current); - } Mesh mesh = new Mesh(entities); HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! copy.identify(); ! System.out.println("-- copy --"); ! for (Geometric current : copy.geometrics()) { ! System.out.println(" " + current); } } }; --- 431,453 ---- AbstractAction action = new GeometricMenuAction(arguments, "Group") { public void actionPerformed(ActionEvent event) { Mesh mesh = new Mesh(entities); HashMap map = new HashMap(); Mesh copy = mesh.copy(map); ! Space union = new Space("Union", Space.CONSTRUCTION, true); ! for (Vertex current : copy.vertices()) { ! union.add(current); } + for (Edge current : copy.edges()) { + union.add(current); + } + for (Surface current : copy.surfaces()) { + union.add(current); + } + for (Geometric current : entities) { + current.delete(); + } + Selection.primary().clear(); + Project.getInstance().getActiveSpace().add(union); + Project.getInstance().changed(Project.getInstance()); } }; |
From: Michael L. <he...@us...> - 2007-11-06 14:02:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24960/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: group mechanism implemented, that moves geometry into a space Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Mesh.java 29 Sep 2007 14:29:05 -0000 1.22 --- Mesh.java 6 Nov 2007 14:02:35 -0000 1.23 *************** *** 270,273 **** --- 270,283 ---- ss.add((Surface) current.copy(map)); } + return new Mesh(ss, es, vs); + } + + /** + * Copy and assign original spaces + * @param map HashMap + * @return Mesh + */ + public Mesh copyAndAssign(Map map) { + Mesh copy = copy(map); for (Surface current : surfaces) { Surface surface = (Surface) map.get(current); *************** *** 285,289 **** } } ! return new Mesh(ss, es, vs); } } --- 295,299 ---- } } ! return copy; } } |
From: Michael L. <he...@us...> - 2007-11-06 14:02:38
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24945/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: group mechanism implemented, that moves geometry into a space Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Display.java 5 Nov 2007 18:12:12 -0000 1.47 --- Display.java 6 Nov 2007 14:02:31 -0000 1.48 *************** *** 98,102 **** new HashMap<Geometric, Integer>(); ! private static final boolean USEDL = false; /** --- 98,102 ---- new HashMap<Geometric, Integer>(); ! private static final boolean USEDL = true; /** *************** *** 780,787 **** } ! private static boolean hidden(Surface surface) { ! Space front = surface.getFrontDomain(); ! Space back = surface.getBackDomain(); ! return hidden(front) && hidden(back); } --- 780,793 ---- } ! private static boolean active(Space space) { ! if (space == null) { ! return false; ! } else if (space == active) { ! return true; ! } else if (space.getEnvelope().isEmpty()) { ! return active(space.getOwner()); ! } else { ! return false; ! } } *************** *** 797,808 **** return; } else { - //if there aint any start generation of one index = gl.glGenLists(1); displayListsSelecting.put(space, index); - System.out.println(index + " for " + space); gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } } else { - //Locate displaylist for space and draw it Integer index = displayLists.get(space); if (index != null) { --- 803,811 ---- *************** *** 810,817 **** return; } else { - //if there aint any start generation of one index = gl.glGenLists(1); displayLists.put(space, index); - System.out.println(index + " for " + space); gl.glNewList(index, GL.GL_COMPILE_AND_EXECUTE); } --- 813,818 ---- *************** *** 831,839 **** if (selecting) { if (!intersecting && transparency) { ! if (space == active) { ! interior = true; ! } else { ! interior = false; ! } } else { interior = true; --- 832,836 ---- if (selecting) { if (!intersecting && transparency) { ! interior = active(space); } else { interior = true; |
From: Michael L. <he...@us...> - 2007-11-06 14:02:35
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24945/src/net/sourceforge/bprocessor/gl/tool Modified Files: FinalMoveTool.java Log Message: group mechanism implemented, that moves geometry into a space Index: FinalMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/FinalMoveTool.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** FinalMoveTool.java 25 Oct 2007 09:35:41 -0000 1.29 --- FinalMoveTool.java 6 Nov 2007 14:02:31 -0000 1.30 *************** *** 380,384 **** Vertex v = direction.copy(); v.scale(i); ! Mesh copy = mesh.copy(new HashMap()); for (Vertex current : copy.vertices()) { current.setX(current.getX() + v.getX()); --- 380,384 ---- Vertex v = direction.copy(); v.scale(i); ! Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { current.setX(current.getX() + v.getX()); *************** *** 395,399 **** v.scale(d / v.length()); ! Mesh copy = mesh.copy(new HashMap()); for (Vertex current : copy.vertices()) { current.setX(current.getX() + v.getX()); --- 395,399 ---- v.scale(d / v.length()); ! Mesh copy = mesh.copyAndAssign(new HashMap()); for (Vertex current : copy.vertices()) { current.setX(current.getX() + v.getX()); *************** *** 431,435 **** if (copy) { mesh = new Mesh(geometrics); ! mesh = mesh.copy(new HashMap()); geometrics = mesh.geometrics(); Project.getInstance().getActiveSpace().addProtected(geometrics); --- 431,435 ---- if (copy) { mesh = new Mesh(geometrics); ! mesh = mesh.copyAndAssign(new HashMap()); geometrics = mesh.geometrics(); Project.getInstance().getActiveSpace().addProtected(geometrics); |
From: rimestad <rim...@us...> - 2007-11-06 08:06:10
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14714/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** GenericTreeView.java 31 Oct 2007 11:33:27 -0000 1.117 --- GenericTreeView.java 6 Nov 2007 08:06:12 -0000 1.118 *************** *** 44,47 **** --- 44,48 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 49,52 **** --- 50,54 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Observer; import net.sourceforge.bprocessor.model.ParameterBlock; *************** *** 61,64 **** --- 63,67 ---- import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.PopupMenu; + import net.sourceforge.bprocessor.gui.actions.GeometricMenuAction; import net.sourceforge.bprocessor.gui.attrview.AttributeView; *************** *** 512,535 **** public void update(Object object) { if (object instanceof Collection) { ! content = (Collection) object; ! Set<Entity> elements = new HashSet<Entity>(); ! elements.addAll(content); ! Set<GenericNode> children = new HashSet<GenericNode>(); ! Enumeration enumeration = this.children(); ! while (enumeration.hasMoreElements()) { ! GenericNode node = (GenericNode)enumeration.nextElement(); ! Entity entity = (Entity)node.getUserObject(); ! if (elements.contains(entity)) { ! node.update(entity); ! elements.remove(entity); ! } else { ! children.add(node); } - } - if (elements.size() > 0) { - this.insertChildren(elements); - } - if (children.size() > 0) { - this.removeChildren(children); } } else { --- 515,557 ---- public void update(Object object) { if (object instanceof Collection) { ! if (sort) { ! content = (Collection) object; ! Set<Entity> elements = new HashSet<Entity>(); ! elements.addAll(content); ! Set<GenericNode> children = new HashSet<GenericNode>(); ! Enumeration enumeration = this.children(); ! while (enumeration.hasMoreElements()) { ! GenericNode node = (GenericNode)enumeration.nextElement(); ! Entity entity = (Entity)node.getUserObject(); ! if (elements.contains(entity)) { ! node.update(entity); ! elements.remove(entity); ! } else { ! children.add(node); ! } ! } ! if (elements.size() > 0) { ! this.insertChildren(elements); ! } ! if (children.size() > 0) { ! this.removeChildren(children); ! } ! } else { ! boolean insert = false; ! Collection c = (Collection) object; ! HashSet set = new HashSet(c); ! Enumeration children = this.children(); ! while (children.hasMoreElements()) { ! GenericNode node = (GenericNode)children.nextElement(); ! if (!set.contains(node.getUserObject())) { ! this.removeAllChildren(); ! insert = true; ! break; ! } ! } ! if (insert) { ! this.insertChildren(c); ! model.nodeStructureChanged(this); } } } else { *************** *** 550,553 **** --- 572,580 ---- int i = 0; for (Entity current : sorted) { + if (current == null) { + log.error("There is a consistency problem cause " + getUserObject() + + " hold null objects"); + continue; + } this.add(nodeFor(current)); ins[i] = this.getChildCount() - 1; *************** *** 1006,1009 **** --- 1033,1086 ---- /** + * Menu container for materials + */ + public class MaterialContainer extends ContainerNode { + /** + * Create a container for materials + * @param label The container label + * @param object The list of objects + * @param sort if the list should be sorted before displayed + */ + public MaterialContainer(Object label, Collection<Material> object, boolean sort) { + super(label, object, sort); + insertChildren(object); + } + + /** + * Return icon + * @return icon + */ + public ImageIcon icon() { + //TODO make a proper icon + return genericgroupicon; + } + + /** {@inheritDoc} */ + public EntityNode nodeFor(Object entity) { + return new EntityNode((Material) entity); + } + + /** + * Context menu for ParameterBlockNode + * @return the menu + */ + public JPopupMenu menu() { + JPopupMenu pm = new JPopupMenu(); + AbstractAction add = new EntityAction(null, "Add Material") { + public void actionPerformed(ActionEvent arg0) { + Material m = new Material(); + m.setName("new material"); + Project.getInstance().add(m); + AttributeView.instance().display(m); + Project.getInstance().changed(Project.getInstance()); + Project.getInstance().checkpoint(); + } + }; + pm.add(add); + return pm; + } + } + + /** * Constructor Container */ *************** *** 1014,1018 **** * @param constructors The constructors */ ! public ConstructorContainer(String name, Collection constructors) { super(name, constructors, true); insertChildren(constructors); --- 1091,1095 ---- * @param constructors The constructors */ ! public ConstructorContainer(String name, Collection<Constructor> constructors) { super(name, constructors, true); insertChildren(constructors); *************** *** 1043,1047 **** * @param sort Sort the edges */ ! public EdgeContainer(String name, Collection edges, boolean sort) { super(name, edges, sort); insertChildren(edges); --- 1120,1124 ---- * @param sort Sort the edges */ ! public EdgeContainer(String name, Collection<Edge> edges, boolean sort) { super(name, edges, sort); insertChildren(edges); *************** *** 1101,1104 **** --- 1178,1272 ---- * CameraNode */ + public class CatalogContainer extends ContainerNode { + /** + * Constructor for EdgeContainer + * @param p The project + */ + public CatalogContainer(Project p) { + super("Catalog objects", p.getCatalogObjects(), true); + insertChildren(p.getCatalogObjects()); + } + + /** + * Update the node with the given object + * @param o The object + */ + public void update(Object o) { + if (o instanceof Project) { + Project proj = (Project)o; + if (proj == updated) { + model.nodeChanged(this); + } + super.update(proj.getCatalogObjects()); + } else { + log.warn("Were a " + o + " not a Project"); + } + } + + /** {@inheritDoc} */ + public EntityNode nodeFor(Object entity) { + Space s = (Space) entity; + return new CatalogNode(s); + } + } + + /** + * A container for catalog items + * @author rimestad + */ + public class CatalogNode extends EntityNode { + /** + * Constructor + * @param s The space that represent the catalog object + */ + public CatalogNode(Space s) { + super(s); + this.add(new SurfaceContainer("Surfaces", s.getSurfaces())); + this.add(new EdgeContainer("Edges", s.getEdges(), true)); + this.add(new VertexContainer("Vertices", s.getVertices(), true)); + } + + /** {@inheritDoc} */ + @Override + public String toString() { + return ((Space)getUserObject()).getName(); + } + + /** {@inheritDoc} */ + @Override + public void update(Object o) { + if (o instanceof Space) { + Space s = (Space)o; + ((GenericNode)root.getChildAt(0)).update(s.getSurfaces()); + ((GenericNode)root.getChildAt(1)).update(s.getEdges()); + ((GenericNode)root.getChildAt(2)).update(s.getVertices()); + } + } + + /** {@inheritDoc} */ + @Override + public JPopupMenu menu() { + JPopupMenu menu = new JPopupMenu(); + Collection<Space> spaces = new LinkedList<Space>(); + spaces.add((Space)getUserObject()); + menu.add(new GeometricMenuAction(spaces, "Duplicate") { + public void actionPerformed(ActionEvent e) { + Command command = new Command.Duplicate((Space) entities.iterator().next()); + AttributeView.instance().display(command); + }; + }); + menu.add(new GeometricMenuAction(spaces, "Instanciate") { + public void actionPerformed(ActionEvent e) { + Command command = new Command.Instance((Space) entities.iterator().next()); + AttributeView.instance().display(command); + }; + }); + return menu; + } + } + + /** + * CameraNode + */ public class CameraNode extends ContainerNode { /** *************** *** 1353,1357 **** GenericNode node = (GenericNode) selected; if (event.isPopupTrigger()) { ! setSelectionPath(path); JPopupMenu menu = node.menu(); if (menu != null) { --- 1521,1527 ---- GenericNode node = (GenericNode) selected; if (event.isPopupTrigger()) { ! if (!isPathSelected(path)) { ! setSelectionPath(path); ! } JPopupMenu menu = node.menu(); if (menu != null) { Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** SpaceTreeView.java 20 Sep 2007 09:39:32 -0000 1.25 --- SpaceTreeView.java 6 Nov 2007 08:06:12 -0000 1.26 *************** *** 10,14 **** import org.apache.log4j.Logger; - import net.sourceforge.bprocessor.gui.treeview.GenericTreeView.SelectionObserver; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; --- 10,13 ---- *************** *** 31,40 **** public SpaceTreeView() { super(); root.removeAllChildren(); ! root.add(new ProjectNode(Project.getInstance())); ! root.add(new GeometryContainer("Geometry", Project.getInstance().world())); ! root.add(new ConstraintContainer("Constraints", Project.getInstance().getConstraints())); ! root.add(new ParameterBlockNode("Globals", Project.getInstance().getGlobals())); ! root.add(new ConstructorContainer("Constructors", Project.getInstance().getConstructors())); model.nodeStructureChanged(root); --- 30,42 ---- public SpaceTreeView() { super(); + Project p = Project.getInstance(); root.removeAllChildren(); ! root.add(new ProjectNode(p)); ! root.add(new GeometryContainer("Geometry", p.world())); ! root.add(new ConstraintContainer("Constraints", p.getConstraints())); ! root.add(new MaterialContainer("Materials", p.getMaterials(), true)); ! root.add(new ParameterBlockNode("Globals", p.getGlobals())); ! root.add(new ConstructorContainer("Constructors", p.getConstructors())); ! root.add(new CatalogContainer(p)); model.nodeStructureChanged(root); *************** *** 47,55 **** public void update() { try { ! ((GenericNode)root.getChildAt(0)).update(Project.getInstance()); ! ((GenericNode)root.getChildAt(1)).update(Project.getInstance().world()); ! ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ! ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); } catch (ArrayIndexOutOfBoundsException e) { log.error("There were a inconsistent number of nodes attached to " + --- 49,60 ---- public void update() { try { ! Project p = Project.getInstance(); ! ((GenericNode)root.getChildAt(0)).update(p); ! ((GenericNode)root.getChildAt(1)).update(p.world()); ! ((GenericNode)root.getChildAt(2)).update(p.getConstraints()); ! ((GenericNode)root.getChildAt(3)).update(p.getMaterials()); ! ((GenericNode)root.getChildAt(4)).update(p.getGlobals()); ! ((GenericNode)root.getChildAt(5)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(6)).update(p); } catch (ArrayIndexOutOfBoundsException e) { log.error("There were a inconsistent number of nodes attached to " + |
From: rimestad <rim...@us...> - 2007-11-05 18:12:11
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9090/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: instance transformations used on gl before instance drawing Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Display.java 2 Nov 2007 12:51:29 -0000 1.46 --- Display.java 5 Nov 2007 18:12:12 -0000 1.47 *************** *** 40,43 **** --- 40,44 ---- import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; + import net.sourceforge.bprocessor.model.TransformStack; import net.sourceforge.bprocessor.model.Vertex; *************** *** 786,794 **** private static void draw(Space space, boolean inside) { ! if (space.isUnion()) { ! CoordinateSystem cs = space.getCoordinateSystems().iterator().next(); ! Vertex translation = cs.center(); ! gl.glPushMatrix(); ! gl.glTranslated(translation.getX(), translation.getY(), translation.getZ()); } if (space.isLocked() && USEDL) { --- 787,792 ---- private static void draw(Space space, boolean inside) { ! if (space.isInstance()) { ! translateToCoordinatesystem(space); } if (space.isLocked() && USEDL) { *************** *** 1033,1040 **** draw(current, inside || (current == active)); } ! if (space.isUnion()) { gl.glPopMatrix(); } } private static void hilite(Collection<Geometric> geometrics) { --- 1031,1060 ---- draw(current, inside || (current == active)); } ! if (space.isInstance()) { gl.glPopMatrix(); } } + + /** + * @param space + */ + private static void translateToCoordinatesystem(Space space) { + TransformStack ts = space.getTransformations(); + Vertex center = ts.transform(new Vertex(0, 0, 0)); + Vertex i = ts.transform(new Vertex(1, 0, 0)).minus(center); + Vertex j = ts.transform(new Vertex(0, 1, 0)).minus(center); + Vertex k = ts.transform(new Vertex(0, 0, 1)).minus(center); + + //CoordinateSystem cs = space.getCoordinateSystems().iterator().next(); + //Vertex translation = cs.center(); + gl.glPushMatrix(); + double[] matrix = new double[]{ + i.getX(), i.getY(), i.getZ(), 0, + j.getX(), j.getY(), j.getZ(), 0, + k.getX(), k.getY(), k.getZ(), 0, + center.getX(), center.getY(), center.getZ(), 1}; + gl.glMultMatrixd(matrix, 0); + //gl.glTranslated(translation.getX(), translation.getY(), translation.getZ()); + } private static void hilite(Collection<Geometric> geometrics) { *************** *** 1060,1064 **** if (current instanceof Space) { Space space = (Space) current; ! Collection<Surface> envelope = new LinkedList(space.getEnvelope()); if (envelope.isEmpty()) { --- 1080,1086 ---- if (current instanceof Space) { Space space = (Space) current; ! if (space.isInstance()) { ! translateToCoordinatesystem(space); ! } Collection<Surface> envelope = new LinkedList(space.getEnvelope()); if (envelope.isEmpty()) { *************** *** 1068,1071 **** --- 1090,1096 ---- Collection<Edge> edges = Surface.edges(envelope); paintEdges(edges, redish, 2.0f); + if (space.isInstance()) { + gl.glPopMatrix(); + } } } |
From: rimestad <rim...@us...> - 2007-11-05 18:11:19
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8678/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileImportActionListener.java Log Message: import add to catalog list and dont insert Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FileImportActionListener.java 31 Oct 2007 11:35:17 -0000 1.12 --- FileImportActionListener.java 5 Nov 2007 18:11:22 -0000 1.13 *************** *** 109,116 **** Space into = Project.getInstance().getActiveSpace(); Space s = into.createUnion(lfile.getName()); ! into.add(s); ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(), info.objPanel.getDirection(), info.objPanel.getCalcNormals()); ! s.computeEnvelope(); Project.getInstance().changed(s); Project.getInstance().checkpoint(); --- 109,116 ---- Space into = Project.getInstance().getActiveSpace(); Space s = into.createUnion(lfile.getName()); ! Project.getInstance().addCalalogObject(s); ImportFileReader.importObjFile(lfile, s, info.objPanel.getScale(), info.objPanel.getDirection(), info.objPanel.getCalcNormals()); ! //s.computeEnvelope(); Project.getInstance().changed(s); Project.getInstance().checkpoint(); |
From: rimestad <rim...@us...> - 2007-11-05 18:10:26
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8240/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: some null pointer trouble Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** Space.java 5 Nov 2007 12:02:29 -0000 1.199 --- Space.java 5 Nov 2007 18:10:29 -0000 1.200 *************** *** 1287,1291 **** } else { if (isConstructionSpace()) { ! if (getOwner().getClassification() != null) { res.add(new Attribute("Classification", getOwner().getClassification(), getClassification(), true)); --- 1287,1291 ---- } else { if (isConstructionSpace()) { ! if (getOwner() != null && getOwner().getClassification() != null) { res.add(new Attribute("Classification", getOwner().getClassification(), getClassification(), true)); *************** *** 1318,1322 **** res.add(new Attribute("Room", getRoom(), true)); } ! res.add(new Attribute("ID", getId().toString(), false)); res.add(new Attribute("Owner", getOwner(), false)); if (isConstructionSpace() || isFunctionalSpace()) { --- 1318,1322 ---- res.add(new Attribute("Room", getRoom(), true)); } ! res.add(new Attribute("ID", getId() != null ? getId().toString() : "", false)); res.add(new Attribute("Owner", getOwner(), false)); if (isConstructionSpace() || isFunctionalSpace()) { *************** *** 1448,1452 **** result.addAll(s.collect()); } ! if (isUnion()) { result.add(getConstructors().iterator().next().center()); } else { --- 1448,1452 ---- result.addAll(s.collect()); } ! if (isUnion() && !getConstructors().isEmpty()) { result.add(getConstructors().iterator().next().center()); } else { |
From: rimestad <rim...@us...> - 2007-11-05 18:09:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7391/src/net/sourceforge/bprocessor/model Modified Files: Command.java Log Message: added duplicate and instanciate as commands Index: Command.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Command.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Command.java 1 Nov 2007 12:48:07 -0000 1.20 --- Command.java 5 Nov 2007 18:08:54 -0000 1.21 *************** *** 827,829 **** --- 827,888 ---- } + /** + * a command for instanciating a union + * @author rimestad + */ + public static class Instance extends Command { + private Space space; + /** + * Create a instance + * @param s the space to instanciate + */ + public Instance(Space s) { + space = s; + parameters.put(new Attribute("scale", 1.0)); + } + + /** {@inheritDoc} */ + @Override + public void evaluate() { + Project proj = Project.getInstance(); + Space world = proj.getActiveSpace(); + double scale = parameters.getDouble("scale"); + Space instance = new Space(space.getName() + " instance ", space.getType(), false); + instance.setProto(space); + world.add(instance); + proj.changed(world); + proj.checkpoint(); + } + } + + /** + * a command for instanciating a union + * @author rimestad + */ + public static class Duplicate extends Command { + private Space space; + /** + * Create a duplicate + * @param s the space to duplicate + */ + public Duplicate(Space s) { + space = s; + parameters.put(new Attribute("scale", 1.0)); + } + + /** {@inheritDoc} */ + @Override + public void evaluate() { + Project proj = Project.getInstance(); + Space world = proj.getActiveSpace(); + double scale = parameters.getDouble("scale"); + Space created = space.copy(); + for (Vertex v : created.collect()) { + v.scale(scale); + } + world.add(created); + proj.changed(world); + proj.checkpoint(); + } + } } |
From: rimestad <rim...@us...> - 2007-11-05 18:09:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7819/src/net/sourceforge/bprocessor/model Modified Files: Rotate.java Log Message: implemented the transform operation on rotation Index: Rotate.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Rotate.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Rotate.java 16 Apr 2007 15:55:22 -0000 1.4 --- Rotate.java 5 Nov 2007 18:09:53 -0000 1.5 *************** *** 126,130 **** */ public Vertex transform(Vertex vertex) { ! return vertex; } --- 126,141 ---- */ public Vertex transform(Vertex vertex) { ! Matrix matrix = Matrix.rotation(rx, 1, 0, 0); ! double values[] = new double[4]; ! values[0] = vertex.getX(); ! values[1] = vertex.getY(); ! values[2] = vertex.getZ(); ! values[3] = 1; ! values = matrix.multiply(values); ! matrix = Matrix.rotation(ry, 0, 1, 0); ! values = matrix.multiply(values); ! matrix = Matrix.rotation(rz, 0, 0, 1); ! values = matrix.multiply(values); ! return new Vertex(values[0], values[1], values[2]); } |
From: rimestad <rim...@us...> - 2007-11-05 18:09:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv7782/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: Added catalog objects as a list to project Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** Project.java 5 Nov 2007 10:18:50 -0000 1.137 --- Project.java 5 Nov 2007 18:09:18 -0000 1.138 *************** *** 119,122 **** --- 119,124 ---- private long nextMaterialId; + private List<Space> catalogObjects; + /** * Get the instance *************** *** 152,155 **** --- 154,158 ---- redoStack = new Stack(); copyBuffer = new LinkedList(); + catalogObjects = new LinkedList<Space>(); resetCam(); observers = new LinkedList(); *************** *** 1033,1035 **** --- 1036,1054 ---- Project.classificationTypes = classificatioTypes; } + + /** + * Get a list of catalog spaces + * @return the list of spaces + */ + public List<Space> getCatalogObjects() { + return catalogObjects; + } + + /** + * Add a catalog spaces to til list of catalog objects + * @param s the space object to add + */ + public void addCalalogObject(Space s) { + catalogObjects.add(s); + } } |