bprocessor-commit Mailing List for B-processor (Page 117)
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-18 11:19:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14228/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Move origin of constructors Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** View.java 17 Jul 2006 14:47:01 -0000 1.110 --- View.java 18 Jul 2006 11:18:58 -0000 1.111 *************** *** 127,135 **** private static final int SURFACES = 1; ! /** Select for for selecting vertices */ private static final int VERTICES = 2; ! /** Select for for selecting clipplanes */ private static final int CLIPPLANES = 3; /** Select mode for selecting ALL **/ --- 127,138 ---- private static final int SURFACES = 1; ! /** Select mode for selecting vertices */ private static final int VERTICES = 2; ! /** Select mode for selecting clipplanes */ private static final int CLIPPLANES = 3; + + /** Select mode for selecting constructors */ + private static final int CONSTRUCTORS = 4; /** Select mode for selecting ALL **/ *************** *** 1560,1565 **** } } - - Iterator tempSurfaceIt = tempSurfaces.iterator(); while (tempSurfaceIt.hasNext()) { --- 1563,1566 ---- *************** *** 1588,1591 **** --- 1589,1603 ---- } } + if (selectMode == CONSTRUCTORS || selectMode == ALL) { + { + Iterator iter = space.getConstructors().iterator(); + while (iter.hasNext()) { + Constructor current = (Constructor) iter.next(); + pushName(gl, current.getOrigin()); + drawVertexHit(current.getOrigin()); + popName(gl); + } + } + } } *************** *** 1653,1657 **** --- 1665,1671 ---- private void drawConstructor(Edge e) { gl.glEnable(GL.GL_LINE_STIPPLE); + gl.glLineWidth(0.5f); drawEdge(e); + gl.glLineWidth(1.0f); gl.glDisable(GL.GL_LINE_STIPPLE); } |
From: Michael L. <he...@us...> - 2006-07-17 14:47:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11754/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Experimenting with drawing styles Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** View.java 17 Jul 2006 14:14:56 -0000 1.109 --- View.java 17 Jul 2006 14:47:01 -0000 1.110 *************** *** 660,669 **** protected void grid() { double size = View.gridSize(); ! ! Project.info("size = " + size); ! ! ! Project.info("adjusted size = " + size); ! gl.glColor4fv(gridColor); gl.glDisable(GL.GL_DEPTH_TEST); --- 660,664 ---- protected void grid() { double size = View.gridSize(); ! gl.glLineWidth(0.5f); gl.glColor4fv(gridColor); gl.glDisable(GL.GL_DEPTH_TEST); *************** *** 689,693 **** protected void coords() { double size = View.gridSize(); ! gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); --- 684,688 ---- protected void coords() { double size = View.gridSize(); ! gl.glLineWidth(0.5f); gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); *************** *** 775,781 **** //Draw constructors ! gl.glEnable(GL.GL_LIGHTING); drawConstructors(); - gl.glDisable(GL.GL_LIGHTING); { --- 770,775 ---- //Draw constructors ! drawConstructors(); { *************** *** 1000,1024 **** * Draw a point, line and cone * @param from the initial vertex ! * @param dir the direction vector * @param dist the distance from the cam */ ! private void drawConstructorVector(Vertex from, Vertex dir, double dist) { gl.glLineWidth(2); double scale = 500 / height; ! dir.scale(scale * dist / 16); ! Vertex to = from.add(dir); gl.glBegin(GL.GL_LINES); gl.glVertex3d(from.getX(), from.getY(), from.getZ()); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); gl.glEnd(); GLUquadric quad = glu.gluNewQuadric(); glu.gluQuadricNormals(quad, GLU.GLU_SMOOTH); gl.glPushMatrix(); gl.glTranslated(to.getX(), to.getY(), to.getZ()); ! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(dir)), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(dir)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); glu.gluCylinder(quad, (dist / 90) * scale, 0, (dist / 20) * scale, 10, 10); ! gl.glPopMatrix(); } --- 994,1037 ---- * Draw a point, line and cone * @param from the initial vertex ! * @param direction the direction vector * @param dist the distance from the cam */ ! private void drawConstructorVector(Vertex from, Vertex direction, double dist) { gl.glLineWidth(2); double scale = 500 / height; ! Vertex d = direction.copy(); ! d.scale(scale * dist / 16); ! Vertex to = from.add(d); gl.glBegin(GL.GL_LINES); gl.glVertex3d(from.getX(), from.getY(), from.getZ()); gl.glVertex3d(to.getX(), to.getY(), to.getZ()); gl.glEnd(); + + gl.glEnable(GL.GL_LIGHTING); GLUquadric quad = glu.gluNewQuadric(); glu.gluQuadricNormals(quad, GLU.GLU_SMOOTH); gl.glPushMatrix(); gl.glTranslated(to.getX(), to.getY(), to.getZ()); ! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(d)), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(d)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); glu.gluCylinder(quad, (dist / 90) * scale, 0, (dist / 20) * scale, 10, 10); ! gl.glPopMatrix(); ! gl.glDisable(GL.GL_LIGHTING); ! ! { ! Vertex dir = direction.copy(); ! dir.scale(View.gridSize() * 2); ! Vertex a = from.minus(dir); ! Vertex b = from.add(dir); ! gl.glLineWidth(0.5f); ! gl.glEnable(GL.GL_LINE_STIPPLE); ! gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3d(a.getX(), a.getY(), a.getZ()); ! gl.glVertex3d(b.getX(), b.getY(), b.getZ()); ! gl.glEnd(); ! gl.glDisable(GL.GL_LINE_STIPPLE); ! } ! } |
From: Michael L. <he...@us...> - 2006-07-17 14:14:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30500/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Light on constructors to better see there cone-shapes Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** View.java 17 Jul 2006 13:56:28 -0000 1.108 --- View.java 17 Jul 2006 14:14:56 -0000 1.109 *************** *** 775,779 **** --- 775,781 ---- //Draw constructors + gl.glEnable(GL.GL_LIGHTING); drawConstructors(); + gl.glDisable(GL.GL_LIGHTING); { *************** *** 1011,1014 **** --- 1013,1017 ---- gl.glEnd(); GLUquadric quad = glu.gluNewQuadric(); + glu.gluQuadricNormals(quad, GLU.GLU_SMOOTH); gl.glPushMatrix(); gl.glTranslated(to.getX(), to.getY(), to.getZ()); |
From: Michael L. <he...@us...> - 2006-07-17 13:56:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23548/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Adjusted size of grid Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** View.java 17 Jul 2006 09:08:42 -0000 1.107 --- View.java 17 Jul 2006 13:56:28 -0000 1.108 *************** *** 155,159 **** /** The size of the viewing area */ ! protected static double gridSize = 25.0; /** The last touched surface */ --- 155,162 ---- /** The size of the viewing area */ ! protected static double gridSize = 70.0; ! ! /** Adjust the size of the grid based on aspect ? */ ! protected static boolean adjustGridSize = true; /** The last touched surface */ *************** *** 330,333 **** --- 333,353 ---- /** + * Calculate the grid size + * @return The grid size + */ + public static double gridSize() { + double size = gridSize; + if (adjustGridSize) { + if (aspect > 1) { + size *= aspect; + } else { + size /= aspect; + } + size /= 2; + } + return size; + } + + /** * Set the highlight pattern */ *************** *** 639,652 **** */ protected void grid() { ! double size = View.gridSize; ! if (aspect > 1) { ! size *= aspect; ! } else { ! size /= aspect; ! } gl.glColor4fv(gridColor); gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); ! size /= 2; for (int x = -(int)size; x <= (int)size; x++) { --- 659,675 ---- */ protected void grid() { ! double size = View.gridSize(); ! ! Project.info("size = " + size); ! ! ! Project.info("adjusted size = " + size); ! gl.glColor4fv(gridColor); gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); ! ! ! for (int x = -(int)size; x <= (int)size; x++) { *************** *** 665,682 **** */ protected void coords() { ! double size = View.gridSize; ! if (aspect > 1) { ! size *= aspect; ! } else { ! size /= aspect; ! } gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); gl.glColor3fv(X_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(size, 0.0, 0.0); gl.glColor3fv(Y_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, size, 0.0); gl.glEnd(); gl.glEnable(GL.GL_DEPTH_TEST); --- 688,701 ---- */ protected void coords() { ! double size = View.gridSize(); ! gl.glBegin(GL.GL_LINES); gl.glDisable(GL.GL_DEPTH_TEST); gl.glColor3fv(X_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(size * 2, 0.0, 0.0); gl.glColor3fv(Y_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, size * 2, 0.0); gl.glEnd(); gl.glEnable(GL.GL_DEPTH_TEST); *************** *** 684,688 **** gl.glColor3fv(Z_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, 0.0, size); gl.glEnd(); } --- 703,707 ---- gl.glColor3fv(Z_AXIS_COLOR); gl.glVertex3d(0.0, 0.0, 0.0); ! gl.glVertex3d(0.0, 0.0, size * 2); gl.glEnd(); } |
From: Michael L. <he...@us...> - 2006-07-17 12:38:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24539/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java Log Message: Constructor Tool creates plane as well Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConstructorTool.java 17 Jul 2006 09:08:42 -0000 1.2 --- ConstructorTool.java 17 Jul 2006 12:38:16 -0000 1.3 *************** *** 17,20 **** --- 17,21 ---- import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; *************** *** 69,72 **** --- 70,85 ---- /** + * Insert a plane defined by p1, p3 and p3 + * @param p1 Vertex + * @param p2 Vertex + * @param p3 Vertex + */ + protected void insertPlane(Vertex p1, Vertex p2, Vertex p3) { + Plane plane = new Plane(p2.minus(p1), p3.minus(p1), p1); + Project.getInstance().getActiveSpace().add(plane); + Project.getInstance().changed(Project.getInstance()); + } + + /** * Update Constructors */ *************** *** 124,127 **** --- 137,144 ---- if (p2 == null) { p2 = current; + } else { + insertPlane(p1.vertex(), p2.vertex(), current.vertex()); + p1 = null; + p2 = null; } } |
From: Michael L. <he...@us...> - 2006-07-17 09:08:46
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4883/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: ConstructorTool now also creates vectors Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** View.java 17 Jul 2006 08:31:01 -0000 1.106 --- View.java 17 Jul 2006 09:08:42 -0000 1.107 *************** *** 769,772 **** --- 769,781 ---- } + { + gl.glColor3fv(CONSTRUCTOR_COLOR); + Iterator it = tempVertices.iterator(); + while (it.hasNext()) { + drawObject(it.next()); + } + } + + // draw target if (target != null) { *************** *** 775,778 **** --- 784,788 ---- } + gl.glDisable(GL.GL_DEPTH_TEST); *************** *** 782,788 **** drawObject(it.next()); } ! } } /** * Draw space --- 792,800 ---- drawObject(it.next()); } ! } ! } + /** * Draw space |
From: Michael L. <he...@us...> - 2006-07-17 09:08:46
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4883/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java AbstractPencil.java Log Message: ConstructorTool now also creates vectors Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConstructorTool.java 6 Jul 2006 13:13:50 -0000 1.1 --- ConstructorTool.java 17 Jul 2006 09:08:42 -0000 1.2 *************** *** 10,15 **** --- 10,20 ---- import java.awt.Cursor; import java.awt.event.MouseEvent; + import java.util.LinkedList; + import java.util.List; import net.sourceforge.bprocessor.gl.GLView; + import net.sourceforge.bprocessor.gl.model.Intersection; + import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Point; import net.sourceforge.bprocessor.model.Project; *************** *** 21,24 **** --- 26,41 ---- public class ConstructorTool extends AbstractPencil { + /** P1 */ + private Intersection p1; + + /** P2 */ + private Intersection p2; + + /** P3 */ + private Intersection p3; + + /** P4 */ + private Intersection p4; + /** * Constructor for ConstructorTool *************** *** 41,44 **** --- 58,99 ---- /** + * Insert a line defined by p1 and p2 + * @param p1 Vertex + * @param p2 Vertex + */ + protected void insertLine(Vertex p1, Vertex p2) { + Line line = new Line(p1, p2.minus(p1)); + Project.getInstance().getActiveSpace().add(line); + Project.getInstance().changed(Project.getInstance()); + } + + /** + * Update Constructors + */ + protected void updateConstructors() { + List constructors = new LinkedList(); + List points = new LinkedList(); + List excluded = new LinkedList(); + if (p1 != null) { + points.add(p1.vertex()); + if (p2 != null) { + Edge edge = new Edge(p1.vertex(), p2.vertex()); + edge.setConstructor(true); + constructors.add(edge); + points.add(p2.vertex()); + } + if (current != null) { + Edge edge = new Edge(p1.vertex(), current.vertex()); + edge.setConstructor(true); + constructors.add(edge); + } + } + excluded.addAll(constructors); + points(points); + constructors(constructors); + excluded(excluded); + } + + /** * @param e MouseEvent */ *************** *** 55,66 **** */ protected void pressed(MouseEvent e) { ! if (start == null) { ! start = current; } else { ! if (start.vertex().equalEps(current.vertex())) { ! insertPoint(current.vertex()); ! start = null; } } } --- 110,131 ---- */ protected void pressed(MouseEvent e) { ! if (p1 == null) { ! p1 = current; } else { ! if (p1.vertex().equalEps(current.vertex())) { ! if (p2 == null) { ! insertPoint(current.vertex()); ! } else { ! insertLine(p1.vertex(), p2.vertex()); ! } ! p1 = null; ! p2 = null; ! } else { ! if (p2 == null) { ! p2 = current; ! } } } + updateConstructors(); } Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** AbstractPencil.java 10 Jul 2006 15:29:23 -0000 1.37 --- AbstractPencil.java 17 Jul 2006 09:08:42 -0000 1.38 *************** *** 54,57 **** --- 54,60 ---- protected Collection constructors = new HashSet(); + /** Vertices */ + protected Collection points = new HashSet(); + /** The aligning elements */ protected Collection aligners = new HashSet(); *************** *** 336,339 **** --- 339,376 ---- /** + * Show Points + */ + protected void showPoints() { + Iterator iter = points.iterator(); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + glv.getView().addTempVertex(current); + } + } + + /** + * Hide Points + */ + protected void hidePoints() { + Iterator iter = points.iterator(); + while (iter.hasNext()) { + Vertex current = (Vertex) iter.next(); + glv.getView().removeTempVertex(current); + } + } + + /** + * Supply points + * @param feed Collection of points + */ + protected void points(Collection feed) { + hidePoints(); + points.clear(); + points.addAll(feed); + showPoints(); + } + + + /** * Test if an edge is parrallel with an axiz (x, y or z) * @param edge The edge to test |
From: Nikolaj B. <nbr...@us...> - 2006-07-17 08:37:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24954/src/net/sourceforge/bprocessor/model Modified Files: Space.java Attribute.java Log Message: Constructionspaces can now be transparent Index: Attribute.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Attribute.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Attribute.java 26 Jun 2006 11:36:26 -0000 1.11 --- Attribute.java 17 Jul 2006 08:37:00 -0000 1.12 *************** *** 86,89 **** --- 86,90 ---- } + /** * Constructor *************** *** 206,208 **** --- 207,211 ---- return "Parameter"; } + + } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Space.java 4 Jul 2006 11:53:43 -0000 1.39 --- Space.java 17 Jul 2006 08:37:00 -0000 1.40 *************** *** 95,106 **** private String classification; /** The construcstionspace classification options */ private String[] constructionOptions = {"None", "Terrandæk", "Tagkonstruktion", "Ydervæg", "Ældre termovindue", ! "2-lags lavenergivindue", "3-lags lavenergivindue", "Dør"}; /** The functionalspace classification options */ private String[] functionalOptions = ! {"None", "Exterior", "Livingroom", "Bathroom", "Bedroom"}; /** The modellor */ --- 95,109 ---- private String classification; + /** If the constructionspace is transparent */ + private boolean transparent; + /** The construcstionspace classification options */ private String[] constructionOptions = {"None", "Terrandæk", "Tagkonstruktion", "Ydervæg", "Ældre termovindue", ! "2-lags lavenergivindue", "3-lags lavenergivindue", "Dør", "Loft"}; /** The functionalspace classification options */ private String[] functionalOptions = ! {"None", "Exteriør", "Stue", "Badeværelse", "Uopvarmet rum"}; /** The modellor */ *************** *** 126,129 **** --- 129,133 ---- setName(name); setType(type); + setTransparent(false); setClassification("None"); this.container = container; *************** *** 1041,1044 **** --- 1045,1050 ---- } else if (a.getName().equals("Classification")) { setClassification(((String)a.getValue().toString())); + } else if (a.getName().equals("Transparent")) { + setTransparent((((Boolean)a.getValue()).booleanValue())); } else if (a.getName().equals("Description")) { setDescription(((String)a.getValue().toString())); *************** *** 1062,1065 **** --- 1068,1078 ---- res.add(new Attribute("Classification", functionalOptions, getClassification())); } + if (isConstructionSpace()) { + if (isTransparent()) { + res.add(new Attribute("Transparent", Boolean.TRUE)); + } else { + res.add(new Attribute("Transparent", Boolean.FALSE)); + } + } res.add(new Attribute("Description", getDescription())); return res; *************** *** 1359,1362 **** --- 1372,1389 ---- return surfaceCopy; } + + /** + * @return Returns true if its transparent + */ + public boolean isTransparent() { + return transparent; + } + + /** + * @param transparent If its transparent or not + */ + public void setTransparent(boolean transparent) { + this.transparent = transparent; + } } |
From: Nikolaj B. <nbr...@us...> - 2006-07-17 08:32:05
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23042/src/net/sourceforge/bprocessor/gui/actions Modified Files: ToolsEnergyActionListener.java Log Message: Constructionspaces can now be transparent Index: ToolsEnergyActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ToolsEnergyActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ToolsEnergyActionListener.java 26 Jun 2006 11:39:33 -0000 1.2 --- ToolsEnergyActionListener.java 17 Jul 2006 08:32:00 -0000 1.3 *************** *** 42,49 **** 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); } --- 42,55 ---- while (it.hasNext()) { Surface current = (Surface) it.next(); ! if (current.getFrontDomain().getClassification().equalsIgnoreCase("Exteriør")) { totalloss = totalloss + calcloss(current.getBackDomain().getClassification(), current); } ! if (current.getFrontDomain().getClassification().equalsIgnoreCase("Uopvarmet rum")) { ! totalloss = totalloss + calcloss(current.getBackDomain().getClassification(), current); ! } ! if (current.getBackDomain().getClassification().equalsIgnoreCase("Exteriør")) { ! totalloss = totalloss + calcloss(current.getFrontDomain().getClassification(), current); ! } ! if (current.getBackDomain().getClassification().equalsIgnoreCase("Uopvarmet rum")) { totalloss = totalloss + calcloss(current.getFrontDomain().getClassification(), current); } *************** *** 71,74 **** --- 77,84 ---- return loss; } + if (classification.equalsIgnoreCase("Loft")) { + loss = 0.15 * current.getArea(); + return loss; + } if (classification.equalsIgnoreCase("Ydervæg")) { loss = 0.25 * current.getArea(); |
From: Nikolaj B. <nbr...@us...> - 2006-07-17 08:32:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23042/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java Added Files: BooleanAttribute.java Log Message: Constructionspaces can now be transparent Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GenericPanel.java 26 Jun 2006 11:37:52 -0000 1.18 --- GenericPanel.java 17 Jul 2006 08:32:00 -0000 1.19 *************** *** 175,178 **** --- 175,195 ---- }); where.add(new AttributeRow(ma)); + } else if (a.getValue() instanceof Boolean) { + // Handles the booleans + BooleanAttribute ba = new BooleanAttribute(a); + ba.addBooleanAttributeListener(new AttributeListener() { + public void valueChanged(Attribute a) { + obj.setAttributes(attributes); + if (obj instanceof Entity) { + simpleUpdate = true; + ((Entity)obj).changed(); + } else if (obj instanceof Camera) { + Project.getInstance().changed((Camera)obj); + } else { + log.info("Were not a Entity object " + obj); + } + } + }); + where.add(new AttributeRow(ba)); } else if (a.getValue() instanceof String[]) { // Handles the classification --- NEW FILE: BooleanAttribute.java --- //--------------------------------------------------------------------------------- // $Id: BooleanAttribute.java,v 1.1 2006/07/17 08:32:00 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.attrview; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JCheckBox; import javax.swing.JComponent; import javax.swing.JLabel; import net.sourceforge.bprocessor.model.Attribute; /** * The BooleanAttributeView */ public class BooleanAttribute extends GenericAttribute implements ItemListener { /** The listeners */ private List listeners; /** The attribute this gui represents */ private Attribute attribute; /** The component */ private JComponent component; /** The Label */ private JLabel label; /** The valueLabel */ private JCheckBox valueLabel; /** * Constructor for BooleanAttribute * @param attribute The attribute */ public BooleanAttribute(Attribute attribute) { super(BoxLayout.X_AXIS); this.attribute = attribute; this.listeners = new LinkedList(); label = createLabel(attribute.getName()); Box header = Box.createHorizontalBox(); Box column = Box.createVerticalBox(); header.add(Box.createHorizontalStrut(7)); header.add(label); header.add(Box.createHorizontalGlue()); column.add(Box.createRigidArea(new Dimension(70, 3))); column.add(header); column.add(Box.createRigidArea(new Dimension(70, 3))); column.setMaximumSize(new Dimension(60, Short.MAX_VALUE)); this.add(column); component = Box.createHorizontalBox(); component.add(createValueLabel(attribute.getValue())); this.add(component); this.add(Box.createHorizontalGlue()); } /** * Create a label for the * @param key The key * @return A JLabel */ private JLabel createLabel(String key) { JLabel keyLabel = new JLabel(key + " :"); keyLabel.setFont(AttributeView.FONT_BOLD); return keyLabel; } /** * Add a listener that are notified when the value is changed * @param listener The listener */ public void addBooleanAttributeListener(AttributeListener listener) { listeners.add(listener); } /** * Remove a listener * @param listener The listener */ public void removeBooleanAttributeListener(AttributeListener listener) { listeners.remove(listener); } /** * Send valueChanged to all listeners */ protected void valueChanged() { Iterator iter = listeners.iterator(); while (iter.hasNext()) { AttributeListener current = (AttributeListener) iter.next(); current.valueChanged(attribute); } } /** * Create a value label * @param value The value * @return The label */ private JComponent createValueLabel(Object value) { valueLabel = new JCheckBox(); if (((Boolean) value).booleanValue()) { valueLabel.setSelected(true); } valueLabel.addItemListener(this); return valueLabel; } /** * Return the attribute * @return The attribute */ public Attribute attribute() { return attribute; } /** Listens to the check boxes. * @param e the itemevent*/ public void itemStateChanged(ItemEvent e) { Object source = e.getItemSelectable(); if (source == valueLabel) { if (e.getStateChange() == ItemEvent.DESELECTED) { attribute.setValue(Boolean.FALSE); } else { attribute.setValue(Boolean.TRUE); } valueChanged(); } } /** * Not in use */ public void startEditing() { // TODO Auto-generated method stub } /** * Not in use */ public void stopEditing() { // TODO Auto-generated method stub } /** * Not in use */ public void cancelEditing() { // TODO Auto-generated method stub } } |
From: Nikolaj B. <nbr...@us...> - 2006-07-17 08:31:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22633/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Constructionspaces can now be transparent Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** View.java 13 Jul 2006 13:35:00 -0000 1.105 --- View.java 17 Jul 2006 08:31:01 -0000 1.106 *************** *** 1643,1647 **** */ private boolean isVisible(Space space) { ! return (space.isConstructionSpace() && space.getSurfaces().isEmpty()); } --- 1643,1647 ---- */ private boolean isVisible(Space space) { ! return (space.isConstructionSpace() && !space.isTransparent() && space.getSurfaces().isEmpty()); } |
From: rimestad <rim...@us...> - 2006-07-13 13:35:05
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10787/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Changed the initcamera method so that pers. and ortho cameras are placed and aligned equal, that is same visible area, fixed the inverting of the ortho camera as well. Implemented it so that as gluPerspective the FOW is in the height, so that extending the width will make the visible area bigger. Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** View.java 12 Jul 2006 14:35:11 -0000 1.104 --- View.java 13 Jul 2006 13:35:00 -0000 1.105 *************** *** 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; *************** *** 610,628 **** far = far < 20 ? far = 20 : far; double focalwidth = camera.getFocalwidth(); ! if (aspect < 1.0) { ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(focalwidth) * length; ! glu.gluOrtho2D(tal, -tal, tal, -tal); //TODO find the best pararms ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(focalwidth, aspect, near, far); ! } ! } else { ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(focalwidth) * length; ! gl.glOrtho(tal, -tal, tal, -tal, near, far); ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! glu.gluPerspective(focalwidth, aspect, near, far); ! } } --- 611,620 ---- far = far < 20 ? far = 20 : far; double focalwidth = camera.getFocalwidth(); ! if (camera.getType() == Camera.ORTHOGRAPHIC) { ! double tal = Math.tan(Math.toRadians(focalwidth / 2)) * length; ! gl.glOrtho(-tal * aspect, tal * aspect, -tal, tal, near, far); ! } else if (camera.getType() == Camera.PERSPECTIVE) { ! // fovy, aspect, near, far (relative to camera position) ! glu.gluPerspective(focalwidth, aspect, near, far); } *************** *** 920,945 **** Collection cons = active.getConstructors(); 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).getOrigin()); } else if (o instanceof Line) { Line l = (Line)o; ! drawConstructorPoint(l.getOrigin()); ! drawConstructorVector(l.getOrigin(), l.getDirection()); } else if (o instanceof Plane) { Plane p = (Plane)o; ! drawConstructorPoint(p.getOrigin()); ! drawConstructorVector(p.getOrigin(), p.getI()); ! drawConstructorVector(p.getOrigin(), p.getJ()); } else if (o instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)o; ! drawConstructorPoint(cs.getOrigin()); Vertex i = cs.getI(); Vertex j = cs.getJ(); Vertex n = cs.getN(); ! drawConstructorVector(cs.getOrigin(), i); ! drawConstructorVector(cs.getOrigin(), j); ! drawConstructorVector(cs.getOrigin(), n); } } --- 912,945 ---- Collection cons = active.getConstructors(); Iterator iter = cons.iterator(); + Camera current = Project.getInstance().getCurrentCamera(); + Vertex v = new Vertex(current.getCamera()); + double scale = scale = current.getFocalwidth() / 65; + double dist = v.minus(new Vertex(current.getCenter())).length() * scale; while (iter.hasNext()) { Object o = iter.next(); + Constructor c = (Constructor)o; + if (current.getType() == Camera.PERSPECTIVE) { + dist = (c.getOrigin().minus(v)).length() * scale; + } if (o instanceof net.sourceforge.bprocessor.model.Point) { ! drawConstructorPoint(((net.sourceforge.bprocessor.model.Point)o).getOrigin(), dist); } else if (o instanceof Line) { Line l = (Line)o; ! drawConstructorPoint(l.getOrigin(), dist); ! drawConstructorVector(l.getOrigin(), l.getDirection(), dist); } else if (o instanceof Plane) { Plane p = (Plane)o; ! drawConstructorPoint(p.getOrigin(), dist); ! drawConstructorVector(p.getOrigin(), p.getI(), dist); ! drawConstructorVector(p.getOrigin(), p.getJ(), dist); } else if (o instanceof CoordinateSystem) { CoordinateSystem cs = (CoordinateSystem)o; ! drawConstructorPoint(cs.getOrigin(), dist); Vertex i = cs.getI(); Vertex j = cs.getJ(); Vertex n = cs.getN(); ! drawConstructorVector(cs.getOrigin(), i, dist); ! drawConstructorVector(cs.getOrigin(), j, dist); ! drawConstructorVector(cs.getOrigin(), n, dist); } } *************** *** 954,959 **** * Draw a point in the location of center * @param center The location for the point */ ! private void drawConstructorPoint(Vertex center) { gl.glPointSize(8); gl.glColor3fv(CONSTRUCTOR_COLOR); --- 954,960 ---- * Draw a point in the location of center * @param center The location for the point + * @param dist the distance from the cam */ ! private void drawConstructorPoint(Vertex center, double dist) { gl.glPointSize(8); gl.glColor3fv(CONSTRUCTOR_COLOR); *************** *** 967,989 **** * @param from the initial vertex * @param dir the direction vector */ ! private void drawConstructorVector(Vertex from, Vertex dir) { ! gl.glPointSize(8); ! gl.glColor3fv(CONSTRUCTOR_COLOR); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glEnd(); gl.glLineWidth(2); 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(Math.toDegrees(Geometry.degreesAboutZ(dir)), 0, 0, 1); gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(dir)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); ! glu.gluCylinder(quad, 0.15, 0, 0.5, 10, 10); gl.glPopMatrix(); } --- 968,989 ---- * @param from the initial vertex * @param dir the direction vector + * @param dist the distance from the cam */ ! private void drawConstructorVector(Vertex from, Vertex dir, double dist) { gl.glLineWidth(2); + double scale = 500 / height; + dir.scale(scale * dist / 16); + Vertex to = from.add(dir); gl.glBegin(GL.GL_LINES); gl.glVertex3d(from.getX(), from.getY(), from.getZ()); ! gl.glVertex3d(to.getX(), to.getY(), to.getZ()); gl.glEnd(); GLUquadric quad = glu.gluNewQuadric(); gl.glPushMatrix(); ! gl.glTranslated(to.getX(), to.getY(), to.getZ()); gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(dir)), 0, 0, 1); gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(dir)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); ! glu.gluCylinder(quad, (dist / 90) * scale, 0, (dist / 20) * scale, 10, 10); gl.glPopMatrix(); } |
From: rimestad <rim...@us...> - 2006-07-13 13:31:28
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9576/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Added copy of the FOW variable to copy... so that the var can be changed in the databaseview and reflect on the camera setting Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Camera.java 7 Jul 2006 14:09:35 -0000 1.18 --- Camera.java 13 Jul 2006 13:31:26 -0000 1.19 *************** *** 98,101 **** --- 98,102 ---- new double[]{c.camera[0], c.camera[1], c.camera[2]}, new double[]{c.roll[0], c.roll[1], c.roll[2]}, c.getType()); + this.setFocalwidth(c.getFocalwidth()); } |
From: rimestad <rim...@us...> - 2006-07-13 13:30:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9143/src/net/sourceforge/bprocessor/model Modified Files: Line.java CoordinateSystem.java Log Message: changed the getters to return a copy of the vectors so that noone can change them without using a setter method Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CoordinateSystem.java 6 Jul 2006 10:42:09 -0000 1.12 --- CoordinateSystem.java 13 Jul 2006 13:30:14 -0000 1.13 *************** *** 87,91 **** */ public Vertex getI() { ! return i; } --- 87,91 ---- */ public Vertex getI() { ! return i.copy(); } *************** *** 95,99 **** */ public Vertex getJ() { ! return j; } --- 95,99 ---- */ public Vertex getJ() { ! return j.copy(); } *************** *** 103,107 **** */ public Vertex getN() { ! return n; } --- 103,107 ---- */ public Vertex getN() { ! return n.copy(); } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Line.java 12 Jul 2006 14:30:36 -0000 1.8 --- Line.java 13 Jul 2006 13:30:14 -0000 1.9 *************** *** 44,48 **** */ public Vertex getDirection() { ! return dir; } --- 44,48 ---- */ public Vertex getDirection() { ! return dir.copy(); } |
From: rimestad <rim...@us...> - 2006-07-13 13:28:30
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8353/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: added new constructor taking a array of the arguments x y z Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Vertex.java 12 Jul 2006 12:08:35 -0000 1.37 --- Vertex.java 13 Jul 2006 13:28:24 -0000 1.38 *************** *** 60,63 **** --- 60,77 ---- /** + * Constructor taking a double array with the three coordinates + * @param v the array with three coordinates + */ + public Vertex(double[] v) { + if (v.length == 3) { + setX(v[0]); + setY(v[1]); + setZ(v[2]); + } else { + log.error("Wrong amount of arguments were " + v.length + " should be 3"); + } + } + + /** * Get the name * @return The name |
From: rimestad <rim...@us...> - 2006-07-12 14:35:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4908/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: changed the drawing of constructors Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** View.java 12 Jul 2006 13:24:58 -0000 1.103 --- View.java 12 Jul 2006 14:35:11 -0000 1.104 *************** *** 15,18 **** --- 15,19 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; + import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Plane; *************** *** 922,932 **** 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); } } --- 923,945 ---- Object o = iter.next(); if (o instanceof net.sourceforge.bprocessor.model.Point) { ! drawConstructorPoint(((net.sourceforge.bprocessor.model.Point)o).getOrigin()); } else if (o instanceof Line) { ! Line l = (Line)o; ! drawConstructorPoint(l.getOrigin()); ! drawConstructorVector(l.getOrigin(), l.getDirection()); } else if (o instanceof Plane) { ! Plane p = (Plane)o; ! drawConstructorPoint(p.getOrigin()); ! drawConstructorVector(p.getOrigin(), p.getI()); ! drawConstructorVector(p.getOrigin(), p.getJ()); } else if (o instanceof CoordinateSystem) { ! CoordinateSystem cs = (CoordinateSystem)o; ! drawConstructorPoint(cs.getOrigin()); ! Vertex i = cs.getI(); ! Vertex j = cs.getJ(); ! Vertex n = cs.getN(); ! drawConstructorVector(cs.getOrigin(), i); ! drawConstructorVector(cs.getOrigin(), j); ! drawConstructorVector(cs.getOrigin(), n); } } *************** *** 939,967 **** /** ! * Draw the constructor Coordinate system ! * @param system the coordinate system ! */ ! private void drawConstructorCS(CoordinateSystem system) { ! Vertex i = system.getI(); ! Vertex j = system.getJ(); ! Vertex n = system.getN(); ! //TODO draw all three vectors ! } ! ! /** ! * Draw the plane constructor ! * @param plane the constructorplane */ ! private void drawConstructorPlane(Plane plane) { ! //TODO consider making the plane constructor as the cuttingplane } /** ! * Draw the line constructor ! * @param line the line the constructor represent */ ! private void drawConstructorLine(Line line) { ! Vertex from = line.getOrigin(); ! Vertex dir = line.getDirection(); gl.glPointSize(8); gl.glColor3fv(CONSTRUCTOR_COLOR); --- 952,972 ---- /** ! * Draw a point in the location of center ! * @param center The location for the point */ ! private void drawConstructorPoint(Vertex center) { ! gl.glPointSize(8); ! gl.glColor3fv(CONSTRUCTOR_COLOR); ! gl.glBegin(GL.GL_POINTS); ! gl.glVertex3d(center.getX(), center.getY(), center.getZ()); ! gl.glEnd(); } /** ! * Draw a point, line and cone ! * @param from the initial vertex ! * @param dir the direction vector */ ! private void drawConstructorVector(Vertex from, Vertex dir) { gl.glPointSize(8); gl.glColor3fv(CONSTRUCTOR_COLOR); *************** *** 977,999 **** gl.glPushMatrix(); gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); ! gl.glRotated(Math.toDegrees(line.degreesAboutZ()), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(line.degreesAboutY()), 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(); - } /** --- 982,991 ---- gl.glPushMatrix(); gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); ! gl.glRotated(Math.toDegrees(Geometry.degreesAboutZ(dir)), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(Geometry.degreesAboutY(dir)), 0, 1, 0); gl.glRotated(90, 0, 1, 0); glu.gluCylinder(quad, 0.15, 0, 0.5, 10, 10); gl.glPopMatrix(); } /** |
From: rimestad <rim...@us...> - 2006-07-12 14:34:24
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4366/src/net/sourceforge/bprocessor/model Modified Files: Plane.java Log Message: added tests for plane and added getI and getJ for plane Index: Plane.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Plane.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Plane.java 6 Jul 2006 10:42:08 -0000 1.21 --- Plane.java 12 Jul 2006 14:34:18 -0000 1.22 *************** *** 72,76 **** super(origin); Vertex normal = b.cross(a); ! normal.scale(1 / (normal.length())); this.a = normal.getX(); this.b = normal.getY(); --- 72,76 ---- super(origin); Vertex normal = b.cross(a); ! normal.normalize(); this.a = normal.getX(); this.b = normal.getY(); *************** *** 387,389 **** --- 387,419 ---- return "Constructor-Plane"; } + + /** + * Return one vector in the plane + * @return a vector in the plane + */ + public Vertex getI() { + Vertex res; + if (a != 0.0) { + res = new Vertex(-d / a, 0 , 0); + } else if (b != 0.0) { + res = new Vertex(0, -d / b , 0); + } else { + res = new Vertex(0, 0 , -d / c); + } + res = res.minus(getOrigin()); + res.normalize(); + return res; + } + + /** + * A vector perpindicular to the one returned in getI that is in the plane + * @return a vector in the plane perpindicular to the one returned in getI + */ + public Vertex getJ() { + Vertex v = getI(); + Vertex res = v.cross(normal()); + res.normalize(); + return res; + + } } |
From: rimestad <rim...@us...> - 2006-07-12 14:34:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4366/src/net/sourceforge/bprocessor/model/test Added Files: PlaneTest.java Log Message: added tests for plane and added getI and getJ for plane --- NEW FILE: PlaneTest.java --- //--------------------------------------------------------------------------------- // $Id: PlaneTest.java,v 1.1 2006/07/12 14:34:17 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.model.test; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Vertex; import junit.framework.TestCase; /** * A test class for Plane */ public class PlaneTest extends TestCase { /** the test plane */ private Plane p; /** * The setup routine * @throws Exception exception */ protected void setUp() throws Exception { super.setUp(); p = new Plane(new Vertex(1, 0, 0), new Vertex(0, 1, 0), new Vertex(5, 5, 5)); } /** * Test the getI method */ public void testI() { Vertex v = p.getI().add(p.getOrigin()); assertTrue(p.contains(v)); } /** * Test the getI method */ public void testJ() { assertTrue(p.contains(p.getJ().add(p.getOrigin()))); } } |
From: rimestad <rim...@us...> - 2006-07-12 14:30:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2180/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Line.java Log Message: refactored degree functions to Geometry and changed methods in Line to calls to Geometry instead Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Geometry.java 7 Jun 2006 08:22:37 -0000 1.20 --- Geometry.java 12 Jul 2006 14:30:36 -0000 1.21 *************** *** 705,707 **** --- 705,744 ---- } } + + + /** + * Calculate the rotation of a direction vector about the z-axis + * @param dir The direction vector + * @return Returns the degrees in radian about the z-axis. + */ + public static double degreesAboutZ(Vertex dir) { + Vertex tmp; + if (dir.getX() != 0.0) { + tmp = new Vertex(dir.getX(), dir.getY(), 0); + } else { + tmp = new Vertex(0, dir.getY(), dir.getZ()); + } + tmp.normalize(); + if (dir.getY() < 0) { + return -Math.acos(tmp.getX()); + } else { + return Math.acos(tmp.getX()); + } + } + + /** + * Calculate the rotation of a direction vector about the y-axis + * @param dir The direction vector + * @return Returns the degrees in radian about the y-axis. + */ + public static double degreesAboutY(Vertex dir) { + Vertex tmp; + if (dir.getX() != 0.0) { + tmp = new Vertex(dir.getX(), 0, dir.getZ()); + } else { + tmp = new Vertex(0, dir.getY(), dir.getZ()); + } + tmp.normalize(); + return Math.asin(tmp.getZ()); + } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Line.java 12 Jul 2006 13:25:02 -0000 1.7 --- Line.java 12 Jul 2006 14:30:36 -0000 1.8 *************** *** 82,117 **** /** - * @return Returns the degrees in radian about the z-axis. - */ - public double degreesAboutZ() { - Vertex tmp; - if (dir.getX() != 0.0) { - tmp = new Vertex(dir.getX(), dir.getY(), 0); - } else { - tmp = new Vertex(0, dir.getY(), dir.getZ()); - } - tmp.normalize(); - if (dir.getY() < 0) { - return -Math.acos(tmp.getX()); - } else { - return Math.acos(tmp.getX()); - } - } - - /** - * @return Returns the degrees in radian about the y-axis. - */ - public double degreesAboutY() { - Vertex tmp; - if (dir.getX() != 0.0) { - tmp = new Vertex(dir.getX(), 0, dir.getZ()); - } else { - tmp = new Vertex(0, dir.getY(), dir.getZ()); - } - tmp.normalize(); - return Math.asin(tmp.getZ()); - } - - /** * @see net.sourceforge.bprocessor.model.Parametric#setAttributes() */ --- 82,85 ---- *************** *** 146,148 **** --- 114,130 ---- return "[Line: " + getOrigin() + " direction: " + getDirection() + "]"; } + + /** + * @see @see net.sourceforge.bprocessor.model.Geometry#degreesAboutY(Vertex) + */ + public double degreesAboutY() { + return Geometry.degreesAboutY(dir); + } + + /** + * @see @see net.sourceforge.bprocessor.model.Geometry#degreesAboutZ(Vertex) + */ + public double degreesAboutZ() { + return Geometry.degreesAboutZ(dir); + } } |
From: rimestad <rim...@us...> - 2006-07-12 13:25:08
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30482/src/net/sourceforge/bprocessor/model/test Modified Files: LineTest.java Log Message: made some small fixes and made the visualizing correct Index: LineTest.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/LineTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LineTest.java 12 Jul 2006 12:19:49 -0000 1.2 --- LineTest.java 12 Jul 2006 13:25:02 -0000 1.3 *************** *** 77,80 **** --- 77,85 ---- assertEquals(Math.toRadians(-45.0), line.degreesAboutY(), 0.0001); assertEquals(Math.toRadians(90.0), line.degreesAboutZ(), 0.0001); + + line.setDirection(new Vertex(0.75, 0.25, 0)); + System.out.println(line); + assertEquals(Math.toRadians(0.0), line.degreesAboutY(), 0.0001); + assertEquals(Math.toRadians(18.4349), line.degreesAboutZ(), 0.0001); } } |
From: rimestad <rim...@us...> - 2006-07-12 13:25:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30482/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: made some small fixes and made the visualizing correct Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Line.java 12 Jul 2006 12:08:35 -0000 1.6 --- Line.java 12 Jul 2006 13:25:02 -0000 1.7 *************** *** 92,96 **** } tmp.normalize(); ! return Math.acos(tmp.getX()); } --- 92,100 ---- } tmp.normalize(); ! if (dir.getY() < 0) { ! return -Math.acos(tmp.getX()); ! } else { ! return Math.acos(tmp.getX()); ! } } |
From: rimestad <rim...@us...> - 2006-07-12 13:25:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30455/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: made some small fixes and made the visualizing correct Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** View.java 12 Jul 2006 12:09:11 -0000 1.102 --- View.java 12 Jul 2006 13:24:58 -0000 1.103 *************** *** 977,981 **** gl.glPushMatrix(); gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); ! gl.glRotated(-Math.toDegrees(line.degreesAboutZ()), 0, 0, 1); gl.glRotated(-Math.toDegrees(line.degreesAboutY()), 0, 1, 0); gl.glRotated(90, 0, 1, 0); --- 977,981 ---- gl.glPushMatrix(); gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); ! gl.glRotated(Math.toDegrees(line.degreesAboutZ()), 0, 0, 1); gl.glRotated(-Math.toDegrees(line.degreesAboutY()), 0, 1, 0); gl.glRotated(90, 0, 1, 0); |
From: rimestad <rim...@us...> - 2006-07-12 12:19:53
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27012 Modified Files: build.xml Log Message: fixed checkstyle errors and added junit to the build.xml file Index: build.xml =================================================================== RCS file: /cvsroot/bprocessor/model/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build.xml 15 May 2006 15:21:59 -0000 1.13 --- build.xml 12 Jul 2006 12:19:49 -0000 1.14 *************** *** 55,58 **** --- 55,63 ---- </copy> <copy todir="${lib.dir}"> + <fileset dir="${tools.dir}/junit"> + <include name="**/junit.jar"/> + </fileset> + </copy> + <copy todir="${lib.dir}"> <fileset dir="${tools.dir}/jaxb"> <include name="**/jaxb.jar"/> |
From: rimestad <rim...@us...> - 2006-07-12 12:19:53
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27012/src/net/sourceforge/bprocessor/model/test Modified Files: AllTests.java LineTest.java Log Message: fixed checkstyle errors and added junit to the build.xml file Index: LineTest.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/LineTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LineTest.java 12 Jul 2006 11:52:34 -0000 1.1 --- LineTest.java 12 Jul 2006 12:19:49 -0000 1.2 *************** *** 1,2 **** --- 1,8 ---- + //--------------------------------------------------------------------------------- + // $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.test; *************** *** 5,16 **** import junit.framework.TestCase; public class LineTest extends TestCase { ! Line line; protected void setUp() throws Exception { super.setUp(); ! line = new Line(new Vertex(5,5,5), new Vertex(1,0,0)); } public void testOrigin() { assertTrue(line.getOrigin().getX() == 5); --- 11,36 ---- import junit.framework.TestCase; + /** + * A testclass for Line + */ public class LineTest extends TestCase { ! /** ! * A global line for the tests ! */ ! private Line line; ! ! /** ! * Setup for the tests ! * @throws Exception the exception ! */ protected void setUp() throws Exception { super.setUp(); ! line = new Line(new Vertex(5, 5, 5), new Vertex(1, 0, 0)); } + /** + * Test the origin of line + */ public void testOrigin() { assertTrue(line.getOrigin().getX() == 5); *************** *** 19,57 **** } public void testDegrees() { ! assertEquals(0.0,line.degreesAboutY(), 0.0001); ! assertEquals(0.0,line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, 1, 0)); ! assertEquals(0.0,line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, -1, 0)); ! assertEquals(0.0,line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(-90.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, 0, 1)); ! assertEquals(Math.toRadians(90.0),line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(1, 1, 1)); ! assertEquals(Math.toRadians(45.0),line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(45.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(-1, 0, 0)); ! assertEquals(Math.toRadians(0.0),line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(180.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(-1, 1, 0)); ! assertEquals(Math.toRadians(0.0),line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(135.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(-1, 0, 1)); ! assertEquals(Math.toRadians(45.0),line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(180.0),line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, 1, -1)); ! assertEquals(Math.toRadians(-45.0),line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0),line.degreesAboutZ(), 0.0001); } } --- 39,80 ---- } + /** + * Test the degree methods of line + */ public void testDegrees() { ! assertEquals(0.0, line.degreesAboutY(), 0.0001); ! assertEquals(0.0, line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, 1, 0)); ! assertEquals(0.0, line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, -1, 0)); ! assertEquals(0.0, line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(-90.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, 0, 1)); ! assertEquals(Math.toRadians(90.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(1, 1, 1)); ! assertEquals(Math.toRadians(45.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(45.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(-1, 0, 0)); ! assertEquals(Math.toRadians(0.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(180.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(-1, 1, 0)); ! assertEquals(Math.toRadians(0.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(135.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(-1, 0, 1)); ! assertEquals(Math.toRadians(45.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(180.0), line.degreesAboutZ(), 0.0001); line.setDirection(new Vertex(0, 1, -1)); ! assertEquals(Math.toRadians(-45.0), line.degreesAboutY(), 0.0001); ! assertEquals(Math.toRadians(90.0), line.degreesAboutZ(), 0.0001); } } Index: AllTests.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test/AllTests.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AllTests.java 12 Jul 2006 11:52:33 -0000 1.1 --- AllTests.java 12 Jul 2006 12:19:49 -0000 1.2 *************** *** 1,2 **** --- 1,8 ---- + //--------------------------------------------------------------------------------- + // $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.test; *************** *** 4,9 **** --- 10,22 ---- import junit.framework.TestSuite; + /** + * The suit of all model tests + */ public class AllTests { + /** + * The method gathering all the tests + * @return The test + */ public static Test suite() { TestSuite suite = new TestSuite("Test for modelTest"); *************** *** 13,16 **** return suite; } - } --- 26,28 ---- |
From: rimestad <rim...@us...> - 2006-07-12 12:09:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21060/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: changed view to match the construction of line Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** View.java 10 Jul 2006 13:30:00 -0000 1.101 --- View.java 12 Jul 2006 12:09:11 -0000 1.102 *************** *** 977,983 **** 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); --- 977,982 ---- gl.glPushMatrix(); gl.glTranslated(dir.getX() + from.getX(), dir.getY() + from.getY(), dir.getZ() + from.getZ()); ! gl.glRotated(-Math.toDegrees(line.degreesAboutZ()), 0, 0, 1); ! gl.glRotated(-Math.toDegrees(line.degreesAboutY()), 0, 1, 0); gl.glRotated(90, 0, 1, 0); glu.gluCylinder(quad, 0.15, 0, 0.5, 10, 10); |