bprocessor-commit Mailing List for B-processor (Page 119)
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...> - 2006-07-07 10:44:56
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25305/src/gfx Added Files: Biconconstructor.gif Log Message: Constructor icon --- NEW FILE: Biconconstructor.gif --- (This appears to be a binary file; contents omitted.) |
|
From: rimestad <rim...@us...> - 2006-07-06 15:10:40
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22938/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changed the Drawing of point and line, and changed the implementation of getDirection in Line Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** View.java 6 Jul 2006 10:43:00 -0000 1.97 --- View.java 6 Jul 2006 15:10:26 -0000 1.98 *************** *** 13,19 **** import net.sourceforge.bprocessor.model.ClippingPlane; - import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; --- 13,19 ---- import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; + import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Camera; *************** *** 920,925 **** Iterator iter = cons.iterator(); while (iter.hasNext()) { ! Constructor c = (Constructor)iter.next(); ! drawVertexHit(c.getOrigin()); } } else { --- 920,933 ---- Iterator iter = cons.iterator(); while (iter.hasNext()) { ! Object o = iter.next(); ! if (o instanceof net.sourceforge.bprocessor.model.Point) { ! drawConstructorPoint((net.sourceforge.bprocessor.model.Point)o); ! } else if (o instanceof Line) { ! drawConstructorLine((Line)o); ! } else if (o instanceof Plane) { ! drawConstructorPlane((Plane)o); ! } else if (o instanceof CoordinateSystem) { ! drawConstructorCS((CoordinateSystem)o); ! } } } else { *************** *** 931,934 **** --- 939,997 ---- /** + * Draw the constructor Coordinate system + * @param system the coordinate system + */ + private void drawConstructorCS(CoordinateSystem system) { + // TODO Auto-generated method stub + + } + + /** + * Draw the plane constructor + * @param plane the constructorplane + */ + private void drawConstructorPlane(Plane plane) { + // TODO Auto-generated method stub + + } + + /** + * Draw the line constructor + * @param line the line the constructor represent + */ + private void drawConstructorLine(Line line) { + Vertex from = line.getOrigin(); + Vertex dir = line.getDirection(); + System.out.println(line); + gl.glColor3fv(CONSTRUCTOR_COLOR); + gl.glBegin(GL.GL_LINES); + gl.glVertex3d(from.getX(), from.getY(), from.getZ()); + gl.glVertex3d(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); + gl.glEnd(); + GLUquadric quad = glu.gluNewQuadric(); + gl.glPushMatrix(); + gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); + //gl.glRotated(-line.getDegreeZ(), 1, 0, 0); + gl.glRotated(line.getDegreeY(), 0, 0, 1); + gl.glRotated(-line.getDegreeX(), 0, 1, 0); + gl.glRotated(90, 0, 1, 0); + glu.gluCylinder(quad, 0.15, 0, 0.5, 10, 10); + gl.glPopMatrix(); + } + + /** + * Draw a constructor point + * @param point The constructor point + */ + private void drawConstructorPoint(net.sourceforge.bprocessor.model.Point point) { + Vertex origin = point.getOrigin(); + gl.glPointSize(8); + gl.glBegin(GL.GL_POINTS); + gl.glColor4fv(CONSTRUCTOR_COLOR); + gl.glVertex3d(origin.getX(), origin.getY(), origin.getZ()); + gl.glEnd(); + } + + /** * * @param gld The GLDrawable |
|
From: rimestad <rim...@us...> - 2006-07-06 15:10:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22924/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: Changed the Drawing of point and line, and changed the implementation of getDirection in Line Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Line.java 6 Jul 2006 10:42:08 -0000 1.3 --- Line.java 6 Jul 2006 15:10:21 -0000 1.4 *************** *** 49,61 **** /** ! * Get a direction vertex from the line ! * @return A non stored vertex in the direction of the line */ public Vertex getDirection() { ! Vertex dir = new Vertex(1, 0, 0); ! Geometry.rotate(degreeX, 0, 1, 0, dir, getOrigin()); ! Geometry.rotate(degreeY, 0, 0, 1, dir, getOrigin()); ! Geometry.rotate(degreeZ, 1, 0, 0, dir, getOrigin()); ! return dir.add(getOrigin()); } --- 49,62 ---- /** ! * Get a direction vector for the line ! * @return A non stored vertex that points in the direction of the line and are of length 1 */ public Vertex getDirection() { ! Vertex dir = new Vertex(Math.cos(Math.toRadians(degreeX)), ! Math.sin(Math.toRadians(degreeY)), ! Math.sin(Math.toRadians(degreeZ))); ! dir.scale(1 / dir.length()); ! System.out.println("Direction: " + dir); ! return dir; } *************** *** 154,156 **** --- 155,166 ---- return "Constructor-Line"; } + + /** + * Print a line + * @return The string + */ + public String toString() { + return "Line: " + getOrigin() + " AngleX: " + getDegreeX() + + " Angle Y: " + getDegreeY() + " Angle Z : " + getDegreeZ(); + } } |
|
From: Michael L. <he...@us...> - 2006-07-06 13:13:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3932/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: Added Tool to creating constructors that currently can only create Points Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Vertex.java 3 Jul 2006 14:25:07 -0000 1.35 --- Vertex.java 6 Jul 2006 13:13:53 -0000 1.36 *************** *** 292,295 **** --- 292,308 ---- /** + * Tests if this vertex is sufficiently close to another vertex + * @param other The other vertex + * @return True if close + */ + public boolean equalEps(Vertex other) { + double dx = x - other.x; + double dy = y - other.y; + double dz = z - other.z; + return ((Math.abs(dx) < 0.0000001) && + (Math.abs(dy) < 0.0000001) && (Math.abs(dz) < 0.0000001)); + } + + /** * Moves the Vertex a distance * @param dx The x distance |
|
From: Michael L. <he...@us...> - 2006-07-06 13:13:54
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3916/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java ToolFactory.java Added Files: ConstructorTool.java Log Message: Added Tool to creating constructors that currently can only create Points Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** ToolFactory.java 6 Jul 2006 10:39:38 -0000 1.50 --- ToolFactory.java 6 Jul 2006 13:13:50 -0000 1.51 *************** *** 108,111 **** --- 108,114 ---- private Protractor protractor; + /** Constructor tool */ + private ConstructorTool constructor; + /** The previous tool */ private Tool previousTool; *************** *** 197,200 **** --- 200,204 ---- fly = new CameraFlyTool(glv, flyCursor); walk = new CameraWalkTool(glv, walkCursor); + constructor = new ConstructorTool(glv, pencilcursor); Toolbar tb = Toolbar.getInstance(); *************** *** 222,226 **** "Bclip.gif", "Clipping"); ! tb.addSeparator(3); --- 226,230 ---- "Bclip.gif", "Clipping"); ! this.registerTool(Tool.CONSTRUCTOR_TOOL, constructor, "Biconconstructor.gif", "Constructor"); tb.addSeparator(3); --- NEW FILE: ConstructorTool.java --- //--------------------------------------------------------------------------------- // $Id: ConstructorTool.java,v 1.1 2006/07/06 13:13:50 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.awt.Cursor; import java.awt.event.MouseEvent; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; /** * ConstructorTool */ public class ConstructorTool extends AbstractPencil { /** * Constructor for ConstructorTool * @param glv The GLView * @param cursor The Cursor */ public ConstructorTool(GLView glv, Cursor cursor) { super(glv, cursor); } /** * Insert a point into current space * @param vertex The vertex */ protected void insertPoint(Vertex vertex) { Point point = new Point(vertex.copy()); Project.getInstance().getActiveSpace().add(point); Project.getInstance().changed(Project.getInstance()); } /** * @param e MouseEvent */ protected void moved(MouseEvent e) { current = findIntersection(e); if (current != null) { makeTarget(current); updateConstructors(); } } /** * @param e MouseEvent */ protected void pressed(MouseEvent e) { if (start == null) { start = current; } else { if (start.vertex().equalEps(current.vertex())) { insertPoint(current.vertex()); start = null; } } } /** * @param e MouseEvent */ protected void dragged(MouseEvent e) { } /** * @param e MouseEvent */ protected void released(MouseEvent e) { } } Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Tool.java 6 Jul 2006 10:39:38 -0000 1.22 --- Tool.java 6 Jul 2006 13:13:50 -0000 1.23 *************** *** 48,53 **** /** The Protractor tool */ public static final int PROTRACTOR_TOOL = 13; /** The controlled extrude tool */ ! public static final int MULTI_EXTRUDE_TOOL = 14; /** --- 48,55 ---- /** The Protractor tool */ public static final int PROTRACTOR_TOOL = 13; + /** The Constructor tool */ + public static final int CONSTRUCTOR_TOOL = 14; /** The controlled extrude tool */ ! public static final int MULTI_EXTRUDE_TOOL = 15; /** |
|
From: rimestad <rim...@us...> - 2006-07-06 12:57:15
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29205/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: change to getActivespace so that world is returned when no space is active Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Project.java 16 Jun 2006 09:42:08 -0000 1.59 --- Project.java 6 Jul 2006 12:57:11 -0000 1.60 *************** *** 102,105 **** --- 102,110 ---- observers = new LinkedList(); world = new Space("World", Space.FUNCTIONAL, true); + //TODO Remember to remove the next + world.add(new Point(new Vertex(10, 10, 10))); + world.add(new Plane(new Vertex(0, 1, 0), new Vertex(0, 0, 1), new Vertex(10, 5, 5))); + world.add(new Line(new Vertex(10, 5, 5), 45, 45, 45)); + world.setId(new Long(0)); constraints = new LinkedList(); *************** *** 653,656 **** --- 658,664 ---- */ public Space getActiveSpace() { + if (activeSpace == null) { + return world; + } return activeSpace; } |
|
From: rimestad <rim...@us...> - 2006-07-06 10:43:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4914/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Added drawing of constructors (the new type) Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** View.java 4 Jul 2006 09:37:00 -0000 1.96 --- View.java 6 Jul 2006 10:43:00 -0000 1.97 *************** *** 13,16 **** --- 13,17 ---- import net.sourceforge.bprocessor.model.ClippingPlane; + import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; *************** *** 761,764 **** --- 762,768 ---- } + //Draw constructors + drawConstructors(); + { gl.glColor3fv(SELECTED_COLOR); *************** *** 883,887 **** Space active = Project.getInstance().getActiveSpace(); ! if (active != null) { Set edges = new HashSet(); { --- 887,891 ---- Space active = Project.getInstance().getActiveSpace(); ! if (active != Project.getInstance().world()) { Set edges = new HashSet(); { *************** *** 907,910 **** --- 911,934 ---- /** + * Draw all constructors in this level and all above + */ + private void drawConstructors() { + Space active = Project.getInstance().getActiveSpace(); + while (true) { + if (active != null) { + Collection cons = active.getConstructors(); + Iterator iter = cons.iterator(); + while (iter.hasNext()) { + Constructor c = (Constructor)iter.next(); + drawVertexHit(c.getOrigin()); + } + } else { + break; + } + active = active.getOwner(); + } + } + + /** * * @param gld The GLDrawable |
|
From: rimestad <rim...@us...> - 2006-07-06 10:42:13
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4779/src/net/sourceforge/bprocessor/model Modified Files: Line.java Point.java Plane.java CoordinateSystem.java Log Message: Implemented some of the missing methods Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Point.java 4 Jul 2006 11:53:43 -0000 1.2 --- Point.java 6 Jul 2006 10:42:08 -0000 1.3 *************** *** 45,49 **** */ public void delete() { ! //TODO implement delete } --- 45,49 ---- */ public void delete() { ! getOwner().delete(this); } *************** *** 68,73 **** */ public String getGeneralName() { ! // TODO Auto-generated method stub ! return null; } } --- 68,72 ---- */ public String getGeneralName() { ! return "Constructor-Point"; } } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CoordinateSystem.java 4 Jul 2006 09:36:54 -0000 1.11 --- CoordinateSystem.java 6 Jul 2006 10:42:09 -0000 1.12 *************** *** 236,240 **** */ public void delete() { ! // TODO Auto-generated method stub } --- 236,240 ---- */ public void delete() { ! getOwner().delete(this); } *************** *** 258,263 **** */ public String getGeneralName() { ! // TODO Auto-generated method stub ! return null; } --- 258,262 ---- */ public String getGeneralName() { ! return "Constructor-Coordinatesystem"; } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Line.java 4 Jul 2006 11:53:43 -0000 1.2 --- Line.java 6 Jul 2006 10:42:08 -0000 1.3 *************** *** 82,86 **** */ public void delete() { ! // TODO implement delete } --- 82,86 ---- */ public void delete() { ! getOwner().delete(this); } Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Plane.java 4 Jul 2006 09:36:54 -0000 1.20 --- Plane.java 6 Jul 2006 10:42:08 -0000 1.21 *************** *** 363,367 **** */ public void delete() { ! // TODO Auto-generated method stub } --- 363,367 ---- */ public void delete() { ! getOwner().delete(this); } *************** *** 385,390 **** */ public String getGeneralName() { ! // TODO Auto-generated method stub ! return null; } } --- 385,389 ---- */ public String getGeneralName() { ! return "Constructor-Plane"; } } |
|
From: rimestad <rim...@us...> - 2006-07-06 10:41:30
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4422/src/net/sourceforge/bprocessor/gui/treeview Modified Files: CameraTreeView.java Log Message: fixed strange noclassdeffound error of CameraNode could possibly also be fixed by some includes or classdefs, but this seems to work as well Index: CameraTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/CameraTreeView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CameraTreeView.java 21 Jun 2006 08:26:39 -0000 1.4 --- CameraTreeView.java 6 Jul 2006 10:41:27 -0000 1.5 *************** *** 53,57 **** while (iter.hasNext()) { Camera current = (Camera) iter.next(); ! CameraNode cn = new CameraNode(current); Iterator clipIt = current.getClipplanes().iterator(); while (clipIt.hasNext()) { --- 53,57 ---- while (iter.hasNext()) { Camera current = (Camera) iter.next(); ! GenericTreeView.CameraNode cn = new GenericTreeView.CameraNode(current); Iterator clipIt = current.getClipplanes().iterator(); while (clipIt.hasNext()) { *************** *** 73,78 **** while (en.hasMoreElements()) { Object o = en.nextElement(); ! if (o instanceof CameraNode) { ! CameraNode cn = (CameraNode)o; if (cn.getUserObject() == cam) { selectionModel.clearSelection(); --- 73,78 ---- while (en.hasMoreElements()) { Object o = en.nextElement(); ! if (o instanceof GenericTreeView.CameraNode) { ! GenericTreeView.CameraNode cn = (GenericTreeView.CameraNode)o; if (cn.getUserObject() == cam) { selectionModel.clearSelection(); |
|
From: rimestad <rim...@us...> - 2006-07-06 10:39:42
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3640/src/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java ToolFactory.java Log Message: Added controlled extrude to the toolbar Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ToolFactory.java 16 Jun 2006 09:53:46 -0000 1.49 --- ToolFactory.java 6 Jul 2006 10:39:38 -0000 1.50 *************** *** 73,77 **** /** extrusion tool */ ! private AbstractTool extrusion; /** pencil tool */ --- 73,80 ---- /** extrusion tool */ ! private ExtrudeTool extrusion; ! ! /** multi extrusion tool */ ! private MultiExtrudeTool mulextrusion; /** pencil tool */ *************** *** 127,131 **** /** The extrude button */ ! private JToggleButton extrudBut; /** The clipplane button */ --- 130,137 ---- /** The extrude button */ ! private JToggleButton extrudeBut; ! ! /** The multi extrude button */ ! private JToggleButton mulextrudeBut; /** The clipplane button */ *************** *** 184,187 **** --- 190,194 ---- rotation = new RotationTool(glv, pencilcursor); extrusion = new ExtrudeTool(glv, pencilcursor); + mulextrusion = new MultiExtrudeTool(glv, pencilcursor); clipplane = new ClipplaneTool(glv, pencilcursor); tapeMeasure = new TapeMeasureTool(glv, pencilcursor); *************** *** 200,205 **** tb.addSeparator(3); ! extrudBut = this.registerTool(Tool.EXTRUSION_TOOL, extrusion, "Biconextrudetool.gif", "Extrude"); moveBut = this.registerTool(Tool.MOVE_TOOL, move, "Biconmovetool.gif", "Move"); moveBut.addMouseListener(new MoveButtonMouseListener(moveBut)); --- 207,214 ---- tb.addSeparator(3); ! extrudeBut = this.registerTool(Tool.EXTRUSION_TOOL, extrusion, "Biconextrudetool.gif", "Extrude"); + mulextrudeBut = this.registerTool(Tool.MULTI_EXTRUDE_TOOL, mulextrusion, + "Biconextrudetool2.gif", "Controlled Extrude"); moveBut = this.registerTool(Tool.MOVE_TOOL, move, "Biconmovetool.gif", "Move"); moveBut.addMouseListener(new MoveButtonMouseListener(moveBut)); Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Tool.java 22 Mar 2006 11:42:44 -0000 1.21 --- Tool.java 6 Jul 2006 10:39:38 -0000 1.22 *************** *** 48,51 **** --- 48,53 ---- /** The Protractor tool */ public static final int PROTRACTOR_TOOL = 13; + /** The controlled extrude tool */ + public static final int MULTI_EXTRUDE_TOOL = 14; /** |
|
From: rimestad <rim...@us...> - 2006-07-06 09:03:27
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31059/src/gfx Added Files: Biconextrudetool2.gif Log Message: additional extrude icon --- NEW FILE: Biconextrudetool2.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Michael L. <he...@us...> - 2006-07-05 13:39:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1176/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Space-bar activates orbit tool Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** AbstractTool.java 3 Jul 2006 14:25:02 -0000 1.83 --- AbstractTool.java 5 Jul 2006 13:39:06 -0000 1.84 *************** *** 57,60 **** --- 57,63 ---- protected static Strategy select; + /** Orbit strategy */ + protected static Strategy orbit; + /** The x axis */ protected Edge xAxis = new Edge(new Vertex(-50, 0, 0), new Vertex(50, 0, 0)); *************** *** 99,102 **** --- 102,108 ---- private Cursor dragCursor; + /** The cursor for orbit */ + private Cursor orbitCursor; + static { selection = Selection.primary(); *************** *** 118,121 **** --- 124,133 ---- Toolkit.getDefaultToolkit().createCustomCursor(dragImage, new Point(7, 8), "Drag"); + + url = cl.getResource("Bcursorrotcam.gif"); + Image rotationImage = Toolkit.getDefaultToolkit().getImage(url); + orbitCursor = + Toolkit.getDefaultToolkit().createCustomCursor(rotationImage, new Point(7, 8), "Rotation"); + if (pan == null) { pan = new PanStrategy(glv); *************** *** 124,127 **** --- 136,142 ---- select = new SelectStrategy(glv); } + if (orbit == null) { + orbit = new OrbitStrategy(glv); + } } *************** *** 204,213 **** sidewards.scale(2 / sidewards.length()); up.scale(2 / up.length()); - - - log.info(e); - if (e.getKeyCode() == KeyEvent.VK_META) { - log.info("meta-pressed"); glv.setCursor(null); return; --- 219,223 ---- *************** *** 215,219 **** if (e.getKeyCode() == KeyEvent.VK_CONTROL) { - log.info("control-pressed"); glv.setCursor(null); return; --- 225,228 ---- *************** *** 221,226 **** if (e.getKeyCode() == KeyEvent.VK_SPACE) { - log.info("space-pressed"); cameraMode = true; return; } --- 230,235 ---- if (e.getKeyCode() == KeyEvent.VK_SPACE) { cameraMode = true; + glv.setCursor(orbitCursor); return; } *************** *** 287,300 **** public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_META) { - log.info("meta-released"); glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_CONTROL) { - log.info("control-released"); glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_SPACE) { - log.info("space-released"); cameraMode = false; } } --- 296,307 ---- public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_META) { glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_CONTROL) { glv.setCursor(cursor); } if (e.getKeyCode() == KeyEvent.VK_SPACE) { cameraMode = false; + glv.setCursor(cursor); } } *************** *** 321,325 **** pan.dragged(e); } else { ! dragged(e); } --- 328,336 ---- pan.dragged(e); } else { ! if (cameraMode) { ! orbit.dragged(e); ! } else { ! dragged(e); ! } } *************** *** 373,399 **** */ public void mousePressed(MouseEvent e) { - - - log.info("pressed button " + e.getButton()); - - if (e.isAltDown()) { - log.info("alt-down"); - } - if (e.isAltGraphDown()) { - log.info("alt-graph-down"); - } - if (e.isControlDown()) { - log.info("control-down"); - } - if (e.isMetaDown()) { - log.info("meta-down"); - } - if (e.isShiftDown()) { - log.info("shift-down"); - } - if (e.isPopupTrigger()) { - log.info("down popup-trigger"); - } - if (!e.isPopupTrigger()) { if (e.getButton() == 1) { --- 384,387 ---- *************** *** 415,419 **** pan.pressed(e); } else { ! pressed(e); } glv.repaint(true); --- 403,411 ---- pan.pressed(e); } else { ! if (cameraMode) { ! orbit.pressed(e); ! } else { ! pressed(e); ! } } glv.repaint(true); *************** *** 425,429 **** */ public void mouseReleased(MouseEvent e) { - log.info("released button " + e.getButton()); if (e.isPopupTrigger()) { log.info("up popup-trigger"); --- 417,420 ---- *************** *** 434,438 **** pan.released(e); } else { ! released(e); } glv.repaint(true); --- 425,433 ---- pan.released(e); } else { ! if (cameraMode) { ! orbit.released(e); ! } else { ! released(e); ! } } glv.repaint(true); |
|
From: rimestad <rim...@us...> - 2006-07-04 11:53:45
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21437/src/net/sourceforge/bprocessor/model Modified Files: Line.java Space.java Point.java Constructor.java Log Message: fixed checkstyle problem and added add remove of constructors to Space Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Space.java 26 Jun 2006 11:36:26 -0000 1.38 --- Space.java 4 Jul 2006 11:53:43 -0000 1.39 *************** *** 82,85 **** --- 82,90 ---- private long nextSurfaceId; + /** The co0nstructors */ + private HashMap constructors; + /** The next constructor id */ + private long nextConstructorId; + /** The materials */ private HashMap materials; *************** *** 99,104 **** {"None", "Exterior", "Livingroom", "Bathroom", "Bedroom"}; - - /** The modellor */ private Modellor modellor; --- 104,107 ---- *************** *** 133,136 **** --- 136,140 ---- elements = new HashMap(); materials = new HashMap(); + constructors = new HashMap(); empty = new Space("Void", FUNCTIONAL, false); this.add(empty); *************** *** 259,262 **** --- 263,268 ---- elements.clear(); nextElementId = 0; + constructors.clear(); + nextConstructorId = 0; empty = new Space("Void", FUNCTIONAL, false); this.add(empty); *************** *** 265,268 **** --- 271,337 ---- /** + * Add a constructor + * @param c The constructor element + */ + public void add(Constructor c) { + if (container) { + Long id; + if (c.getId() != null) { + id = c.getId(); + nextConstructorId = Math.max(nextConstructorId, id.longValue() + 1); + } else { + id = new Long(nextConstructorId++); + c.setId(id); + } + constructors.put(id, c); + c.setOwner(this); + } else { + throw new Error("adding constructor to non-container " + this); + } + } + + /** + * Remove a constructor + * @param c The constructor element + */ + public void remove(Constructor c) { + constructors.remove(c.getId()); + c.setId(null); + c.setOwner(null); + } + + /** + * Insert a constructor + * @param c The constructor + * @return The constructor + */ + public Constructor insert(Constructor c) { + add(c); + return c; + } + + /** + * Delete a constructor + * @param c The constructor + */ + public void delete(Constructor c) { + if (c.getId() != null) { + remove(c); + } + } + + /** + * Return the constructors + * @return The constructors + */ + public Collection getConstructors() { + if (container) { + return constructors.values(); + } else { + return EMPTY; + } + } + + /** * Add a vertex * @param vertex The vertex |
|
From: rimestad <rim...@us...> - 2006-07-04 09:37:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30596/src/net/sourceforge/bprocessor/gl/tool Modified Files: ClipplaneTool.java Log Message: Made Plane and coordinatesystem extend constructor, and created Point and Line. Made some adjustments to the existing files that uses Plane allready... Index: ClipplaneTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ClipplaneTool.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ClipplaneTool.java 16 Jun 2006 09:56:51 -0000 1.8 --- ClipplaneTool.java 4 Jul 2006 09:37:00 -0000 1.9 *************** *** 49,53 **** Vertex i = system.getI(); Vertex j = system.getJ(); ! Vertex o = system.origin(); boolean front = glv.getView().facingFront(system); if (front) { --- 49,53 ---- Vertex i = system.getI(); Vertex j = system.getJ(); ! Vertex o = system.getOrigin(); boolean front = glv.getView().facingFront(system); if (front) { |
|
From: rimestad <rim...@us...> - 2006-07-04 09:37:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30596/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Made Plane and coordinatesystem extend constructor, and created Point and Line. Made some adjustments to the existing files that uses Plane allready... Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** View.java 19 Jun 2006 13:15:13 -0000 1.95 --- View.java 4 Jul 2006 09:37:00 -0000 1.96 *************** *** 2206,2210 **** Vertex normal = system.getN(); Transformation transformation = transformation(); ! Vertex origin = transformation.project(system.origin()); Vertex from = new Vertex(origin.getX(), origin.getY(), 0.0); Vertex to = new Vertex(origin.getX(), origin.getY(), 1.0); --- 2206,2210 ---- Vertex normal = system.getN(); Transformation transformation = transformation(); ! Vertex origin = transformation.project(system.getOrigin()); Vertex from = new Vertex(origin.getX(), origin.getY(), 0.0); Vertex to = new Vertex(origin.getX(), origin.getY(), 1.0); |
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30570/src/net/sourceforge/bprocessor/model Modified Files: ClippingPlane.java Plane.java CoordinateSystem.java Entity.java Added Files: Line.java Point.java Constructor.java Log Message: Made Plane and coordinatesystem extend constructor, and created Point and Line. Made some adjustments to the existing files that uses Plane allready... --- NEW FILE: Constructor.java --- //--------------------------------------------------------------------------------- // $Id$ // // 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.Set; /** * The superclass for constructors * */ public abstract class Constructor extends Geometric implements Parametric { /** The origin of the constructor */ private Vertex origin; /** * The constructor method * @param origin The origin of the constructor */ public Constructor(Vertex origin) { this.origin = origin; } /** * Getter for the origin * @return The origin */ public Vertex getOrigin() { return origin; } /** * @see net.sourceforge.bprocessor.model.Geometric#collect() */ public abstract Set collect(); /** * @see net.sourceforge.bprocessor.model.Entity#center() */ public abstract Vertex center(); /** * @see net.sourceforge.bprocessor.model.Entity#delete() */ public abstract void delete(); } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CoordinateSystem.java 5 May 2006 14:08:42 -0000 1.10 --- CoordinateSystem.java 4 Jul 2006 09:36:54 -0000 1.11 *************** *** 9,14 **** --- 9,16 ---- import java.util.ArrayList; + import java.util.HashSet; import java.util.Iterator; import java.util.List; + import java.util.Set; /** *************** *** 21,25 **** * to the global coordinate system. */ ! public class CoordinateSystem { /** The i unit vector (x-direction) */ --- 23,27 ---- * to the global coordinate system. */ ! public class CoordinateSystem extends Constructor { /** The i unit vector (x-direction) */ *************** *** 32,38 **** protected Vertex n; - /** The origin of the coordinate system */ - protected Vertex origin; - /** * Constructor --- 34,37 ---- *************** *** 43,51 **** */ public CoordinateSystem(Vertex i, Vertex j, Vertex n, Vertex origin) { ! super(); this.i = i; this.j = j; this.n = n; - this.origin = origin; } --- 42,49 ---- */ public CoordinateSystem(Vertex i, Vertex j, Vertex n, Vertex origin) { ! super(origin); this.i = i; this.j = j; this.n = n; } *************** *** 109,128 **** /** - * Return the origin - * @return The origin - */ - public Vertex origin() { - return origin; - } - - /** - * Set the origin - * @param origin The new origin - */ - public void setOrigin(Vertex origin) { - this.origin = origin; - } - - /** * Return the xy plane of this CoordinateSystem * @return The xy plane --- 107,110 ---- *************** *** 133,137 **** double b = n.getY(); double c = n.getZ(); ! d = -(a * origin.getX() + b * origin.getY() + c * origin.getZ()); return new Plane(a, b, c, d); } --- 115,119 ---- double b = n.getY(); double c = n.getZ(); ! d = -(a * getOrigin().getX() + b * getOrigin().getY() + c * getOrigin().getZ()); return new Plane(a, b, c, d); } *************** *** 168,172 **** */ public Vertex translate(Vertex vertex) { ! Vertex v = vertex.minus(origin); double x = i.dot(v); double y = j.dot(v); --- 150,154 ---- */ public Vertex translate(Vertex vertex) { ! Vertex v = vertex.minus(getOrigin()); double x = i.dot(v); double y = j.dot(v); *************** *** 191,195 **** Vertex nn = n.copy(); nn.scale(vertex.getZ()); ! return origin.add(ii).add(jj).add(nn); } --- 173,177 ---- Vertex nn = n.copy(); nn.scale(vertex.getZ()); ! return getOrigin().add(ii).add(jj).add(nn); } *************** *** 231,235 **** */ public String toString() { ! return "[i = " + i + " j = " + j + " n = " + n + " o = " + origin + "]"; } --- 213,263 ---- */ public String toString() { ! return "[i = " + i + " j = " + j + " n = " + n + " o = " + getOrigin() + "]"; ! } ! ! /** ! * @see net.sourceforge.bprocessor.model.Geometric#collect() ! */ ! public Set collect() { ! HashSet res = new HashSet(); ! res.add(getOrigin()); ! return res; ! } ! ! /** ! * @see net.sourceforge.bprocessor.model.Entity#center() ! */ ! public Vertex center() { ! return getOrigin(); ! } ! ! /** ! * @see net.sourceforge.bprocessor.model.Entity#delete() ! */ ! public void delete() { ! // TODO Auto-generated method stub ! } ! ! /** ! * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() ! */ ! public void setAttributes(List attributes) { ! // TODO Auto-generated method stub ! } ! ! /** ! * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() ! */ ! public List getAttributes() { ! // TODO Auto-generated method stub ! return null; ! } ! ! /** ! * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() ! */ ! public String getGeneralName() { ! // TODO Auto-generated method stub ! return null; } Index: ClippingPlane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/ClippingPlane.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClippingPlane.java 16 Jun 2006 09:43:37 -0000 1.2 --- ClippingPlane.java 4 Jul 2006 09:36:54 -0000 1.3 *************** *** 59,63 **** */ public Vertex origin() { ! Vertex origin = origin = system.origin(); // FIXME Interning the origin to give it an ID.. // It needs an ID to be in a hashtable, but this --- 59,63 ---- */ public Vertex origin() { ! Vertex origin = origin = system.getOrigin(); // FIXME Interning the origin to give it an ID.. // It needs an ID to be in a hashtable, but this Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Plane.java 5 May 2006 14:08:42 -0000 1.19 --- Plane.java 4 Jul 2006 09:36:54 -0000 1.20 *************** *** 9,12 **** --- 9,14 ---- import java.util.Collection; import java.util.Iterator; + import java.util.List; + import java.util.Set; import org.apache.log4j.Logger; *************** *** 20,24 **** * ax + by + cz - (ah + bi + cj) = 0 */ ! public class Plane { /** The logger */ private static Logger log = Logger.getLogger(Plane.class); --- 22,26 ---- * ax + by + cz - (ah + bi + cj) = 0 */ ! public class Plane extends Constructor { /** The logger */ private static Logger log = Logger.getLogger(Plane.class); *************** *** 54,58 **** */ public Plane(double a, double b, double c, double d) { ! super(); this.a = a; this.b = b; --- 56,60 ---- */ public Plane(double a, double b, double c, double d) { ! super(new Vertex(-d / a, 0, 0)); this.a = a; this.b = b; *************** *** 62,65 **** --- 64,83 ---- /** + * Constructor + * @param a the first vector in the plane + * @param b the second vector in the plane + * @param origin a point in the plane + */ + public Plane(Vertex a, Vertex b, Vertex origin) { + super(origin); + Vertex normal = b.cross(a); + normal.scale(1 / (normal.length())); + this.a = normal.getX(); + this.b = normal.getY(); + this.c = normal.getZ(); + this.d = -this.a * (origin.getX()) - this.b * (origin.getY()) - this.c * (origin.getZ()); + } + + /** * Return a doublearray {a,b,c,d} * @return The array *************** *** 323,325 **** --- 341,390 ---- log.info(info); } + + /** + * @see net.sourceforge.bprocessor.model.Geometric#collect() + */ + public Set collect() { + + // TODO Auto-generated method stub + return null; + } + + /** + * @see net.sourceforge.bprocessor.model.Entity#center() + */ + public Vertex center() { + // TODO Auto-generated method stub + return null; + } + + /** + * @see net.sourceforge.bprocessor.model.Entity#delete() + */ + public void delete() { + // TODO Auto-generated method stub + } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() + */ + public void setAttributes(List attributes) { + // TODO Auto-generated method stub + } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() + */ + public List getAttributes() { + // TODO Auto-generated method stub + return null; + } + + /** + * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() + */ + public String getGeneralName() { + // TODO Auto-generated method stub + return null; + } } --- NEW FILE: Point.java --- //--------------------------------------------------------------------------------- // $Id$ // // 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.HashSet; import java.util.List; import java.util.Set; /** * The constructor point */ public class Point extends Constructor { /** * The constructor * @param origin the point itself */ public Point(Vertex origin) { super(origin); } /** * Collects the set of vertices in this geometric * @return the set of vertices */ public Set collect() { Set res = new HashSet(); res.add(getOrigin()); return res; } /** * Return the center for the entity * @return The center as a vertex */ public Vertex center() { return getOrigin(); } /** * Delete the entity from the model */ public void delete() { //TODO implement delete } /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() */ public void setAttributes(List attributes) { // TODO Auto-generated method stub } /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() */ public List getAttributes() { // TODO Auto-generated method stub return null; } /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() */ public String getGeneralName() { // TODO Auto-generated method stub return null; } } --- NEW FILE: Line.java --- //--------------------------------------------------------------------------------- // $Id$ // // 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.HashSet; import java.util.List; import java.util.Set; /** * The line constructor type */ public class Line extends Constructor { /** The rotation of the x - axis (arround the y axis) */ private int degreeX; /** The rotation of the y - axis (arround the z axis) */ private int degreeY; /** The rotation of the z - axis (arround the x axis) */ private int degreeZ; /** * Constuctor of Line with only the origin * @param origin The origin */ public Line(Vertex origin) { super(origin); this.degreeX = 0; this.degreeY = 0; this.degreeZ = 0; } /** * Constructor of the Line with orgin and three angles * @param origin The origin * @param degreeX The angle around the X axis * @param degreeY The angle around the Y axis * @param degreeZ The angle around the Z axis */ public Line(Vertex origin, int degreeX, int degreeY, int degreeZ) { super(origin); this.degreeX = degreeX; this.degreeY = degreeY; this.degreeZ = degreeZ; } /** * Get a direction vertex from the line * @return A non stored vertex in the direction of the line */ public Vertex getDirection() { Vertex dir = new Vertex(1, 0, 0); Geometry.rotate(degreeX, 0, 1, 0, dir, getOrigin()); Geometry.rotate(degreeY, 0, 0, 1, dir, getOrigin()); Geometry.rotate(degreeZ, 1, 0, 0, dir, getOrigin()); return dir.add(getOrigin()); } /** * Collects the set of vertices in this geometric * @return the set of vertices */ public Set collect() { HashSet res = new HashSet(); res.add(getOrigin()); return res; } /** * Return the center for the entity * @return The center as a vertex */ public Vertex center() { return getOrigin(); } /** * Delete the entity from the model */ public void delete() { // TODO implement delete } /** * @return Returns the degreeX. */ public int getDegreeX() { return degreeX; } /** * @param degreeX The degreeX to set. */ public void setDegreeX(int degreeX) { this.degreeX = degreeX; } /** * @return Returns the degreeY. */ public int getDegreeY() { return degreeY; } /** * @param degreeY The degreeY to set. */ public void setDegreeY(int degreeY) { this.degreeY = degreeY; } /** * @return Returns the degreeZ. */ public int getDegreeZ() { return degreeZ; } /** * @param degreeZ The degreeZ to set. */ public void setDegreeZ(int degreeZ) { this.degreeZ = degreeZ; } /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() */ public void setAttributes(List attributes) { //TODO implement method } /** * @see net.sourceforge.bprocessor.model.Parametric#getAttributes() */ public List getAttributes() { //FIXME finish the method ArrayList res = new ArrayList(); res.add(new Attribute("Origin", getOrigin())); res.add(new Attribute("Angle X", new Double(getDegreeX()))); res.add(new Attribute("Angle Y", new Double(getDegreeY()))); res.add(new Attribute("Angle Z", new Double(getDegreeZ()))); return res; } /** * @see net.sourceforge.bprocessor.model.Parametric#getGeneralName() */ public String getGeneralName() { return "Constructor-Line"; } } Index: Entity.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Entity.java 12 Apr 2006 14:29:27 -0000 1.7 --- Entity.java 4 Jul 2006 09:36:54 -0000 1.8 *************** *** 58,62 **** /** * Delete the entity from the model - * */ public abstract void delete(); --- 58,61 ---- |
|
From: rimestad <rim...@us...> - 2006-07-04 09:36:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30570/src/net/sourceforge/bprocessor/model/constraints Modified Files: OffsetConstraint.java Log Message: Made Plane and coordinatesystem extend constructor, and created Point and Line. Made some adjustments to the existing files that uses Plane allready... Index: OffsetConstraint.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/constraints/OffsetConstraint.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OffsetConstraint.java 30 May 2006 09:28:56 -0000 1.4 --- OffsetConstraint.java 4 Jul 2006 09:36:55 -0000 1.5 *************** *** 108,112 **** Surface slave = (Surface) getSlave(); CoordinateSystem system = master.coordinateSystem(); ! Vertex origin = system.origin(); Vertex n = system.getN(); n.scale(1 / n.length()); --- 108,112 ---- Surface slave = (Surface) getSlave(); CoordinateSystem system = master.coordinateSystem(); ! Vertex origin = system.getOrigin(); Vertex n = system.getN(); n.scale(1 / n.length()); |
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18436/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java MoveTool.java ExtrudeTool.java AbstractPencil.java CameraTool.java Added Files: OrbitStrategy.java Log Message: Refactored CameraTool into Tool + Strategy Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ExtrudeTool.java 28 Jun 2006 13:26:02 -0000 1.20 --- ExtrudeTool.java 3 Jul 2006 14:25:02 -0000 1.21 *************** *** 518,521 **** --- 518,522 ---- */ public void keyReleased(KeyEvent e) { + super.keyReleased(e); if ((e.getModifiersEx() & KeyEvent.ALT_DOWN_MASK) == 0) { /* Alt were not pressed so we should extrude holes anyway */ Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** MoveTool.java 6 Jun 2006 09:22:25 -0000 1.58 --- MoveTool.java 3 Jul 2006 14:25:02 -0000 1.59 *************** *** 229,232 **** --- 229,233 ---- */ public void keyReleased(KeyEvent e) { + super.keyReleased(e); if (strategy != null) { strategy.keyReleased(e); Index: CameraTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraTool.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CameraTool.java 16 Jun 2006 09:56:51 -0000 1.10 --- CameraTool.java 3 Jul 2006 14:25:03 -0000 1.11 *************** *** 8,18 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gl.view.View; - import net.sourceforge.bprocessor.model.Camera; - import net.sourceforge.bprocessor.model.Project; //import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; - import java.awt.event.InputEvent; import java.awt.Cursor; --- 8,14 ---- *************** *** 32,40 **** private static Logger log = Logger.getLogger(CameraTool.class); - /** The current rotation mode */ - protected int mode = ROTATION; - /** The cursor for rotation */ private Cursor rotationCursor; /** --- 28,36 ---- private static Logger log = Logger.getLogger(CameraTool.class); /** The cursor for rotation */ private Cursor rotationCursor; + + /** Orbit strategy */ + private Strategy orbit; /** *************** *** 45,48 **** --- 41,45 ---- public CameraTool(GLView glv, Cursor cursor1) { super(glv, cursor1); + orbit = new OrbitStrategy(glv); rotationCursor = cursor1; } *************** *** 53,61 **** */ protected void moved(MouseEvent e) { ! if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { ! mode = ROLL; ! } else { ! mode = ROTATION; ! } } --- 50,54 ---- */ protected void moved(MouseEvent e) { ! orbit.moved((e)); } *************** *** 65,95 **** */ protected void dragged(MouseEvent e) { ! View view = glv.getView(); ! Camera c = Project.getInstance().getCurrentCamera(); ! double[] roll = c.getRoll(); ! if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == ! MouseEvent.BUTTON1_DOWN_MASK || e.getButton() == MouseEvent.BUTTON1) { ! double angleX = ((double)(e.getX() - previousPos[0]) / 360) * Math.PI; ! double angleY = ((double)(e.getY() - previousPos[1]) / 360) * Math.PI; ! double turn = 1; ! if (roll[2] < 0) { ! turn = -1; ! } ! ! if (e.isShiftDown()) { ! // roll camera ! Camera.rollCamera(c, turn * (-angleY - angleX) / 2); ! } else if (e.isAltDown()) { ! // rotate camera about itself ! Camera.rotateHorizontallyEye(c, -angleX); ! Camera.rotateVerticallyEye(c, angleY); ! } else { ! // rotate camera about point of view (or selection if any) ! double[] pivot = super.selectionCenter(); ! Camera.rotateHorizontally(c, -angleX, pivot); ! Camera.rotateVertically(c, angleY, pivot); ! } ! Project.getInstance().changed(c); ! } } --- 58,62 ---- */ protected void dragged(MouseEvent e) { ! orbit.dragged((e)); } *************** *** 99,112 **** */ protected void pressed(MouseEvent e) { ! glv.setCursor(rotationCursor); ! if (e.getButton() == MouseEvent.BUTTON1) { ! if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { ! mode = ROLL; ! } else { ! mode = ROTATION; ! } ! } else if (e.getButton() == MouseEvent.BUTTON3) { ! glv.changeTool(Tool.PREVIOUS_TOOL); ! } } /** --- 66,70 ---- */ protected void pressed(MouseEvent e) { ! orbit.pressed((e)); } /** *************** *** 115,118 **** --- 73,77 ---- */ protected void released(MouseEvent e) { + orbit.released(e); } } --- NEW FILE: OrbitStrategy.java --- //--------------------------------------------------------------------------------- // $Id: OrbitStrategy.java,v 1.1 2006/07/03 14:25:02 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Project; //import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.InputEvent; import org.apache.log4j.Logger; /** * The rotationtool */ public class OrbitStrategy implements Strategy { /** Rotation mode */ public static final int ROTATION = 0; /** Roll mode */ public static final int ROLL = 1; /** The logger */ private static Logger log = Logger.getLogger(OrbitStrategy.class); /** The current rotation mode */ protected int mode = ROTATION; /** GLView */ protected GLView glv; /** The x position */ private int x; /** The y position */ private int y; /** * KeyListener for the GL Canvas * @param glv The 3D canvas */ public OrbitStrategy(GLView glv) { this.glv = glv; } /** * Invoked when the mouse cursor has been moved * @param e The MouseEvent object */ public void moved(MouseEvent e) { if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { mode = ROLL; } else { mode = ROTATION; } } /** * Invoked when the mouse is held pressed and moved * @param e The MouseEvent object */ public void dragged(MouseEvent e) { View view = glv.getView(); Camera c = Project.getInstance().getCurrentCamera(); double[] roll = c.getRoll(); if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK || e.getButton() == MouseEvent.BUTTON1) { double angleX = ((double)(e.getX() - x) / 360) * Math.PI; double angleY = ((double)(e.getY() - y) / 360) * Math.PI; double turn = 1; if (roll[2] < 0) { turn = -1; } if (e.isShiftDown()) { // roll camera Camera.rollCamera(c, turn * (-angleY - angleX) / 2); } else if (e.isAltDown()) { // rotate camera about itself Camera.rotateHorizontallyEye(c, -angleX); Camera.rotateVerticallyEye(c, angleY); } else { // rotate camera about point of view (or selection if any) double[] pivot = AbstractTool.selectionCenter(); Camera.rotateHorizontally(c, -angleX, pivot); Camera.rotateVertically(c, angleY, pivot); } Project.getInstance().changed(c); x = e.getX(); y = e.getY(); } } /** * Invoked when a mouse button has been pressed on a component. * @param e The MouseEvent object */ public void pressed(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { if ((e.getModifiersEx() & InputEvent.SHIFT_DOWN_MASK) == InputEvent.SHIFT_DOWN_MASK) { mode = ROLL; } else { mode = ROTATION; } } x = e.getX(); y = e.getY(); } /** * Invoked when a mouse button has been released on a component. * @param e The MouseEvent */ public void released(MouseEvent e) { } } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** AbstractPencil.java 28 Jun 2006 13:26:02 -0000 1.34 --- AbstractPencil.java 3 Jul 2006 14:25:02 -0000 1.35 *************** *** 777,780 **** --- 777,781 ---- */ public void keyReleased(KeyEvent e) { + super.keyReleased(e); if (e.getKeyCode() == KeyEvent.VK_SHIFT) { lock = false; Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** AbstractTool.java 28 Jun 2006 14:19:16 -0000 1.82 --- AbstractTool.java 3 Jul 2006 14:25:02 -0000 1.83 *************** *** 48,51 **** --- 48,54 ---- protected boolean directMode = false; + /** Camera active */ + protected boolean cameraMode = false; + /** Pan strategy */ protected static Strategy pan; *************** *** 164,170 **** * @return The center of the selection */ ! public double[] selectionCenter() { double[] center = Project.getInstance().getCurrentCamera().getCenter(); ! Iterator it = selection.iterator(); if (it.hasNext()) { Object o = it.next(); --- 167,173 ---- * @return The center of the selection */ ! public static double[] selectionCenter() { double[] center = Project.getInstance().getCurrentCamera().getCenter(); ! Iterator it = Selection.primary().iterator(); if (it.hasNext()) { Object o = it.next(); *************** *** 219,222 **** --- 222,226 ---- if (e.getKeyCode() == KeyEvent.VK_SPACE) { log.info("space-pressed"); + cameraMode = true; return; } *************** *** 292,295 **** --- 296,300 ---- if (e.getKeyCode() == KeyEvent.VK_SPACE) { log.info("space-released"); + cameraMode = false; } } |
|
From: Michael L. <he...@us...> - 2006-07-03 14:25:17
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18654/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Selection.java Log Message: Refactored CameraTool into Tool + Strategy Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Vertex.java 12 Apr 2006 14:29:27 -0000 1.34 --- Vertex.java 3 Jul 2006 14:25:07 -0000 1.35 *************** *** 126,129 **** --- 126,137 ---- /** + * Return x, y, z in a double array + * @return Values + */ + public double[] values() { + return new double[] {x, y, z}; + } + + /** * returns the edges connected to this vertex * @return The connected vertexes Index: Selection.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Selection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Selection.java 16 Jun 2006 09:41:37 -0000 1.9 --- Selection.java 3 Jul 2006 14:25:07 -0000 1.10 *************** *** 247,249 **** --- 247,266 ---- return true; } + + /** + * Calculate center of selection + * @return Center + */ + public Vertex center() { + Vertex center = null; + Iterator it = iterator(); + if (it.hasNext()) { + Object o = it.next(); + if (o instanceof Entity) { + Vertex v = ((Entity)o).center(); + center = v; + } + } + return center; + } } |
|
From: Michael L. <he...@us...> - 2006-06-28 14:19:24
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30170/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: Fixed usage of getButton() in drag (does not work) Ð extended modifiers needed Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** AbstractTool.java 28 Jun 2006 13:41:32 -0000 1.81 --- AbstractTool.java 28 Jun 2006 14:19:16 -0000 1.82 *************** *** 27,31 **** import java.awt.Point; import java.awt.Toolkit; - import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; --- 27,30 ---- *************** *** 314,320 **** AbstractTool.dy = y - pressPos[1]; ! log.info("dragged button " + e.getButton()); ! log.info(InputEvent.getModifiersExText(e.getModifiersEx())); ! if (e.getButton() == MouseEvent.BUTTON2) { pan.dragged(e); } else { --- 313,317 ---- AbstractTool.dy = y - pressPos[1]; ! if ((e.getModifiersEx() | MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK) { pan.dragged(e); } else { |
|
From: Michael L. <he...@us...> - 2006-06-28 13:41:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1172/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java Log Message: test Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** AbstractTool.java 28 Jun 2006 13:26:02 -0000 1.80 --- AbstractTool.java 28 Jun 2006 13:41:32 -0000 1.81 *************** *** 27,30 **** --- 27,31 ---- import java.awt.Point; import java.awt.Toolkit; + import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; *************** *** 314,318 **** log.info("dragged button " + e.getButton()); ! if (e.getButton() == MouseEvent.BUTTON2) { pan.dragged(e); --- 315,319 ---- log.info("dragged button " + e.getButton()); ! log.info(InputEvent.getModifiersExText(e.getModifiersEx())); if (e.getButton() == MouseEvent.BUTTON2) { pan.dragged(e); |
|
From: Michael L. <he...@us...> - 2006-06-28 13:26:09
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19974/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ExtrudeTool.java AbstractPencil.java Log Message: Key event refactoring Index: ExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrudeTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ExtrudeTool.java 7 Jun 2006 08:22:34 -0000 1.19 --- ExtrudeTool.java 28 Jun 2006 13:26:02 -0000 1.20 *************** *** 455,463 **** * @param e The KeyEvent */ ! public void keyPressed(KeyEvent e) { /*a length can only be typed in if some surface is selected for extrusion, and if the "number"-variable has been initialised */ - super.keyPressed(e); if (extrudeSurface != null && number != null) { if (e.getKeyCode() == KeyEvent.VK_1) { --- 455,462 ---- * @param e The KeyEvent */ ! public void key(KeyEvent e) { /*a length can only be typed in if some surface is selected for extrusion, and if the "number"-variable has been initialised */ if (extrudeSurface != null && number != null) { if (e.getKeyCode() == KeyEvent.VK_1) { *************** *** 512,516 **** } } - super.keyPressed(e); } --- 511,514 ---- Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** AbstractPencil.java 19 Jun 2006 13:15:12 -0000 1.33 --- AbstractPencil.java 28 Jun 2006 13:26:02 -0000 1.34 *************** *** 687,694 **** /** * Invoked when a key has been pressed. * @param e The KeyEvent */ ! public void keyPressed(KeyEvent e) { boolean changed = false; if (number == null) { --- 687,701 ---- /** + * Escape + */ + public void escape() { + cleanUp(); + } + + /** * Invoked when a key has been pressed. * @param e The KeyEvent */ ! public void key(KeyEvent e) { boolean changed = false; if (number == null) { Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** AbstractTool.java 23 Jun 2006 13:00:17 -0000 1.79 --- AbstractTool.java 28 Jun 2006 13:26:02 -0000 1.80 *************** *** 208,211 **** --- 208,212 ---- log.info("meta-pressed"); glv.setCursor(null); + return; } *************** *** 213,220 **** --- 214,223 ---- log.info("control-pressed"); glv.setCursor(null); + return; } if (e.getKeyCode() == KeyEvent.VK_SPACE) { log.info("space-pressed"); + return; } *************** *** 266,269 **** --- 269,274 ---- } else if (e.getKeyCode() == KeyEvent.VK_F7) { glv.getView().changeDrawMode(View.LIGHTING_MODE); + } else { + key(e); } } |
|
From: Nikolaj B. <nbr...@us...> - 2006-06-26 11:39:36
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32745/src/net/sourceforge/bprocessor/gui/actions Modified Files: ToolsEnergyActionListener.java Log Message: Small ui tweak Index: ToolsEnergyActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ToolsEnergyActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ToolsEnergyActionListener.java 26 Jun 2006 11:37:53 -0000 1.1 --- ToolsEnergyActionListener.java 26 Jun 2006 11:39:33 -0000 1.2 *************** *** 50,54 **** } ! JOptionPane.showMessageDialog(null, "The total energytransmission loss is:" + totalloss); --- 50,54 ---- } ! JOptionPane.showMessageDialog(null, "The total energytransmission loss is: " + totalloss); |
|
From: Nikolaj B. <nbr...@us...> - 2006-06-26 11:38:00
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31918/src/net/sourceforge/bprocessor/gui/actions Added Files: ToolsEnergyActionListener.java Log Message: Spaces now have simple classification, and based on this classification an energy transmission loss can be calculated --- NEW FILE: ToolsEnergyActionListener.java --- //--------------------------------------------------------------------------------- // $Id: ToolsEnergyActionListener.java,v 1.1 2006/06/26 11:37:53 nbramsen 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 net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Iterator; import javax.swing.JOptionPane; import org.apache.log4j.Logger; /** * The tools->enery calc action listener */ public class ToolsEnergyActionListener implements ActionListener { /** The logger */ private static Logger log = Logger.getLogger(ToolsEnergyActionListener.class); /** * ToolsEnergyActionListener */ public ToolsEnergyActionListener() { } /** * Action performed * @param e The action event */ public void actionPerformed(ActionEvent e) { Iterator it = Project.getInstance().getSurfaces().iterator(); double totalloss = 0; while (it.hasNext()) { Surface current = (Surface) it.next(); if (current.getFrontDomain().getClassification().equalsIgnoreCase("Exterior")) { totalloss = totalloss + calcloss(current.getBackDomain().getClassification(), current); } if (current.getBackDomain().getClassification().equalsIgnoreCase("Exterior")) { totalloss = totalloss + calcloss(current.getFrontDomain().getClassification(), current); } } JOptionPane.showMessageDialog(null, "The total energytransmission loss is:" + totalloss); } /** * Calculates energyloss of a surface * @param classification The classifaction of the surface * @param current The current Surface * @return the loss */ private double calcloss(String classification, Surface current) { double loss = 0; if (classification.equalsIgnoreCase("Terrandæk")) { loss = 0.15 * current.getArea(); return loss; } if (classification.equalsIgnoreCase("Tagkonstruktion")) { loss = 0.15 * current.getArea(); return loss; } if (classification.equalsIgnoreCase("Ydervæg")) { loss = 0.25 * current.getArea(); return loss; } if (classification.equalsIgnoreCase("Ældre termovindue")) { loss = 2.5 * current.getArea(); return loss; } if (classification.equalsIgnoreCase("2-lags lavenergivindue")) { loss = 1.5 * current.getArea(); return loss; } if (classification.equalsIgnoreCase("3-lags lavenergivindue")) { loss = 0.8 * current.getArea(); return loss; } if (classification.equalsIgnoreCase("Dør")) { loss = 1.5 * current.getArea(); return loss; } return loss; } } |
|
From: Nikolaj B. <nbr...@us...> - 2006-06-26 11:37:55
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31918/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: Spaces now have simple classification, and based on this classification an energy transmission loss can be calculated Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** GUI.java 24 Apr 2006 08:43:02 -0000 1.33 --- GUI.java 26 Jun 2006 11:37:53 -0000 1.34 *************** *** 21,24 **** --- 21,25 ---- import net.sourceforge.bprocessor.gui.actions.FileSaveAsActionListener; import net.sourceforge.bprocessor.gui.actions.ToolsDetachActionListener; + import net.sourceforge.bprocessor.gui.actions.ToolsEnergyActionListener; import net.sourceforge.bprocessor.gui.actions.ToolsJoinActionListener; import net.sourceforge.bprocessor.gui.attrview.AttributeView; *************** *** 296,300 **** toolsDetach.addActionListener(new ToolsDetachActionListener()); tools.add(toolsDetach); ! menu.registerMenu(tools); --- 297,308 ---- toolsDetach.addActionListener(new ToolsDetachActionListener()); tools.add(toolsDetach); ! ! tools.addSeparator(); ! ! JMenuItem toolsEnergy = new JMenuItem("Energy calc"); ! toolsEnergy.setMnemonic(KeyEvent.VK_T); ! toolsEnergy.addActionListener(new ToolsEnergyActionListener()); ! tools.add(toolsEnergy); ! menu.registerMenu(tools); |