bprocessor-commit Mailing List for B-processor (Page 118)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
| 2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
| 2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
| 2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
| 2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
| 2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
| 2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: rimestad <rim...@us...> - 2006-07-12 12:08:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20690/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Line.java Log Message: changed the construction of Line from degrees to a direction vertex and added normalize to vertex Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Vertex.java 6 Jul 2006 13:13:53 -0000 1.36 --- Vertex.java 12 Jul 2006 12:08:35 -0000 1.37 *************** *** 413,415 **** --- 413,424 ---- getOwner().delete(this); } + + /** + * Make the length of the vertex equal one + */ + public void normalize() { + if (getX() != 0.0 || getY() != 0.0 || getZ() != 0.0) { + this.scale(1 / this.length()); + } + } } Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Line.java 7 Jul 2006 10:46:03 -0000 1.5 --- Line.java 12 Jul 2006 12:08:35 -0000 1.6 *************** *** 16,35 **** */ 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; } --- 16,29 ---- */ public class Line extends Constructor { ! /** The direction vector */ ! private Vertex dir; /** ! * Constuctor of Line with only the origin and a standard direction of (1,0,0) * @param origin The origin */ public Line(Vertex origin) { super(origin); ! dir = new Vertex(1, 0, 0); } *************** *** 37,49 **** * 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; } --- 31,40 ---- * Constructor of the Line with orgin and three angles * @param origin The origin ! * @param dir The vector of direction */ ! public Line(Vertex origin, Vertex dir) { super(origin); ! dir.normalize(); ! this.dir = dir; } *************** *** 53,60 **** */ 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()); return dir; } --- 44,47 ---- *************** *** 86,130 **** /** ! * @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() --- 73,112 ---- /** ! * Overwrite the direction of the line ! * @param dir the vector direction */ ! public void setDirection(Vertex dir) { ! this.dir = dir; ! dir.normalize(); } ! /** ! * @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(); ! 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() *************** *** 142,148 **** 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; } --- 124,128 ---- res.add(new Attribute("Origin", getOrigin())); ! res.add(new Attribute("Direction", getDirection())); return res; } *************** *** 160,165 **** */ public String toString() { ! return "Line: " + getOrigin() + " AngleX: " + getDegreeX() + ! " Angle Y: " + getDegreeY() + " Angle Z : " + getDegreeZ(); } } --- 140,144 ---- */ public String toString() { ! return "[Line: " + getOrigin() + " direction: " + getDirection() + "]"; } } |
|
From: rimestad <rim...@us...> - 2006-07-12 12:07:39
|
Update of /cvsroot/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20122 Modified Files: .classpath Log Message: added junit to the classpath Index: .classpath =================================================================== RCS file: /cvsroot/bprocessor/model/.classpath,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** .classpath 15 May 2006 15:21:59 -0000 1.8 --- .classpath 12 Jul 2006 12:07:37 -0000 1.9 *************** *** 7,10 **** --- 7,11 ---- <classpathentry kind="lib" path="build"/> <classpathentry exported="true" kind="lib" path="/tools/antlr/antlr.jar"/> + <classpathentry kind="lib" path="/tools/junit/junit.jar"/> <classpathentry kind="output" path="bin"/> </classpath> |
|
From: rimestad <rim...@us...> - 2006-07-12 12:07:17
|
Update of /cvsroot/bprocessor/tools/junit In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19988/junit Added Files: junit.jar Log Message: junit --- NEW FILE: junit.jar --- (This appears to be a binary file; contents omitted.) |
|
From: rimestad <rim...@us...> - 2006-07-12 12:06:53
|
Update of /cvsroot/bprocessor/tools/junit In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19564/junit Log Message: Directory /cvsroot/bprocessor/tools/junit added to the repository |
|
From: rimestad <rim...@us...> - 2006-07-12 11:52:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11981/src/net/sourceforge/bprocessor/model/test Added Files: AllTests.java LineTest.java package.html Log Message: wrong package name --- NEW FILE: package.html --- <body> Defines the package that contains the test of the model </body> --- NEW FILE: AllTests.java --- package net.sourceforge.bprocessor.model.test; import junit.framework.Test; import junit.framework.TestSuite; public class AllTests { public static Test suite() { TestSuite suite = new TestSuite("Test for modelTest"); //$JUnit-BEGIN$ suite.addTestSuite(LineTest.class); //$JUnit-END$ return suite; } } --- NEW FILE: LineTest.java --- package net.sourceforge.bprocessor.model.test; import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Vertex; 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); assertTrue(line.getOrigin().getY() == 5); assertTrue(line.getOrigin().getZ() == 5); } 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); } } |
|
From: rimestad <rim...@us...> - 2006-07-12 11:52:36
|
Update of /cvsroot/bprocessor/model/src/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11981/src/test Removed Files: package.html AllTests.java LineTest.java Log Message: wrong package name --- package.html DELETED --- --- AllTests.java DELETED --- --- LineTest.java DELETED --- |
|
From: rimestad <rim...@us...> - 2006-07-12 11:52:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11953/src/net/sourceforge/bprocessor/model/test Log Message: Directory /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/test added to the repository |
|
From: rimestad <rim...@us...> - 2006-07-12 11:50:57
|
Update of /cvsroot/bprocessor/model/src/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10870/src/test Added Files: package.html AllTests.java LineTest.java Log Message: A test package for model --- NEW FILE: package.html --- <body> Defines the package that contains the test of the model </body> --- NEW FILE: AllTests.java --- package test; import junit.framework.Test; import junit.framework.TestSuite; public class AllTests { public static Test suite() { TestSuite suite = new TestSuite("Test for modelTest"); //$JUnit-BEGIN$ suite.addTestSuite(LineTest.class); //$JUnit-END$ return suite; } } --- NEW FILE: LineTest.java --- package test; import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Vertex; 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); assertTrue(line.getOrigin().getY() == 5); assertTrue(line.getOrigin().getZ() == 5); } 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); } } |
|
From: rimestad <rim...@us...> - 2006-07-12 11:50:53
|
Update of /cvsroot/bprocessor/model/src/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10834/src/test Log Message: Directory /cvsroot/bprocessor/model/src/test added to the repository |
|
From: Nordholt <nor...@us...> - 2006-07-10 15:29:27
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28763 Modified Files: AbstractPencil.java Log Message: fixed so a edge cannot be inserted if both vertices are the same Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** AbstractPencil.java 9 Jul 2006 16:22:19 -0000 1.36 --- AbstractPencil.java 10 Jul 2006 15:29:23 -0000 1.37 *************** *** 197,202 **** public Edge insertEdge(Edge edge, boolean split) { Edge actual = edge; ! edge.setFrom(insertVertex(edge.getFrom(), split)); ! edge.setTo(insertVertex(edge.getTo(), split)); { Collection edges = mesh().getEdges(); --- 197,208 ---- public Edge insertEdge(Edge edge, boolean split) { Edge actual = edge; ! Vertex from = insertVertex(edge.getFrom(), split); ! Vertex to = insertVertex(edge.getTo(), split); ! if (from == to) { ! log.error("Cannot insert edge: " + edge + " to and from vertices are the same"); ! return null; ! } ! edge.setFrom(from); ! edge.setTo(to); { Collection edges = mesh().getEdges(); *************** *** 234,238 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! actual.add(insertEdge(current, false)); } Surface surface = new Surface(actual); --- 240,249 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = insertEdge(current, false); ! if (edge != null) { ! actual.add(edge); ! } else { ! return; ! } } Surface surface = new Surface(actual); *************** *** 244,248 **** while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! actual.add(insertEdge(current, true)); } Geometry.insert(actual); --- 255,264 ---- while (iter.hasNext()) { Edge current = (Edge) iter.next(); ! Edge edge = insertEdge(current, true); ! if (edge != null) { ! actual.add(edge); ! } else { ! return; ! } } Geometry.insert(actual); |
|
From: Nordholt <nor...@us...> - 2006-07-10 15:26:54
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26758/net/sourceforge/bprocessor/gl/tool Modified Files: Tool.java ToolFactory.java Added Files: AltRectTool.java Log Message: adding a alternative rectangle tool --- NEW FILE: AltRectTool.java --- //--------------------------------------------------------------------------------- // $Id: AltRectTool.java,v 1.1 2006/07/10 15:26:38 nordholt 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 java.util.List; import java.util.LinkedList; import org.apache.log4j.Logger; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Vertex; /** * An alternative Rectangle Tool */ public class AltRectTool extends AbstractPencil { /** The logger */ private static Logger log = Logger.getLogger(AltRectTool.class); /** The edges of the rectangle */ private List rectangle; /** The edge that will be moving while making the rectangle */ private Edge movingEdge; /** The base edge of the rectangle */ private Edge baseEdge; /** The last value of currents vertex where the rectangle was moved */ private Vertex lastCurrent; /** Dragging flag */ private boolean dragging; /** * Constructor * @param glv GLView * @param cursor Cursor */ public AltRectTool(GLView glv, Cursor cursor) { super(glv, cursor); rectangle = new LinkedList(); movingEdge = null; baseEdge = null; lastCurrent = null; dragging = false; } /** * Update feedback */ public void updateFeedback() { if (start != null) { if (baseEdge == null) { Edge edge = new Edge(start.vertex(), current.vertex()); List edges = new LinkedList(); edges.add(edge); feedback(edges); } else { Vertex delta = lastCurrent.minus(current.vertex()); Vertex baseProjection = baseEdge.getDirection(); baseProjection.scale(1 / baseProjection.length()); baseProjection.scale(delta.dot(baseProjection)); Vertex movement = baseProjection.minus(delta); movingEdge.move(movement.getX(), movement.getY(), movement.getZ()); lastCurrent = current.vertex(); } } } /** * On vertex - to make "apply" work */ public void onVertex() { if (start != null) { if (baseEdge == null) { setUpRectangle(); } else { double length = start.vertex().minus(current.vertex()).length(); Vertex direction = movingEdge.getFrom().minus(baseEdge.getTo()); direction.scale((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); insertEdges(rectangle); cleanUp(); feedback(rectangle); } updateFeedback(); updateConstructors(); } } /** * Creates the base edge of the rectangle and sets up the * rectangle. */ private void setUpRectangle() { rectangle = new LinkedList(); baseEdge = new Edge(start.vertex(), current.vertex()); movingEdge = new Edge(current.vertex().copy(), start.vertex().copy()); rectangle.add(baseEdge); rectangle.add(new Edge(current.vertex(), movingEdge.getFrom())); rectangle.add(movingEdge); rectangle.add(new Edge(movingEdge.getTo(), start.vertex())); feedback(rectangle); } /** * Update the length field */ protected void updateLength() { if (baseEdge == null) { super.updateLength(); } else { glv.setLength(baseEdge.getFrom().minus(movingEdge.getTo()).length()); } } /** * @param e MouseEvent */ protected void moved(MouseEvent e) { current = findIntersection(e); if (current != null) { updateFeedback(); updateConstructors(); } } /** * @param e MouseEvent */ protected void pressed(MouseEvent e) { if (start == null) { start = current; lastCurrent = start.vertex(); } else if (baseEdge == null) { setUpRectangle(); } else { insertEdges(rectangle); cleanUp(); feedback(rectangle); } updateFeedback(); updateConstructors(); } /** * @param e MouseEvent */ protected void dragged(MouseEvent e) { moved(e); if (!dragging) { dragging = true; } } /** * @param e MouseEvent */ protected void released(MouseEvent e) { if (dragging) { pressed(e); dragging = false; } } /** * do clean up */ public void cleanUp() { baseEdge = null; movingEdge = null; start = null; rectangle = new LinkedList(); dragging = false; super.cleanUp(); } } Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ToolFactory.java 9 Jul 2006 16:20:57 -0000 1.52 --- ToolFactory.java 10 Jul 2006 15:26:38 -0000 1.53 *************** *** 119,122 **** --- 119,125 ---- /** The Offset tool */ private OffsetTool offset; + + /** The Alternative Rect tool */ + private AltRectTool altRect; /** The selection button */ *************** *** 159,162 **** --- 162,168 ---- private JToggleButton offBut; + /** The alternative rect tool button */ + private JToggleButton altRectBut; + /** * Constructor *************** *** 208,211 **** --- 214,218 ---- constructor = new ConstructorTool(glv, pencilcursor); offset = new OffsetTool(glv, pencilcursor); + altRect = new AltRectTool(glv, pencilcursor); Toolbar tb = Toolbar.getInstance(); *************** *** 215,218 **** --- 222,226 ---- eraserBut = this.registerTool(Tool.ERASER_TOOL, eraser, "Biconeraser.gif", "Eraser"); this.registerTool(Tool.RECT_TOOL, rect, "Brect.gif", "Rectangle"); + this.registerTool(Tool.ALT_RECT_TOOL, altRect, "Biconaltrect.gif", "Alt. Rectangle"); this.registerTool(Tool.ARC_TOOL, arc, "Barc.gif", "Arc"); Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Tool.java 9 Jul 2006 16:20:57 -0000 1.24 --- Tool.java 10 Jul 2006 15:26:38 -0000 1.25 *************** *** 54,57 **** --- 54,59 ---- /** The Offset tool */ public static final int OFFSET_TOOL = 16; + /** The Alternative Rect tool */ + public static final int ALT_RECT_TOOL = 17; /** |
|
From: Nordholt <nor...@us...> - 2006-07-10 15:26:47
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26758/gfx Added Files: Biconaltrect.gif Log Message: adding a alternative rectangle tool --- NEW FILE: Biconaltrect.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Michael L. <he...@us...> - 2006-07-10 13:30:03
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11320/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Fixed hit-detection problem with hitting edges, not part of surface Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** View.java 7 Jul 2006 14:03:23 -0000 1.100 --- View.java 10 Jul 2006 13:30:00 -0000 1.101 *************** *** 1450,1454 **** } if (selectMode == EDGES || selectMode == ALL) { - if (space != null) { Set es = new HashSet(); --- 1450,1453 ---- *************** *** 1461,1470 **** } } ! Collection surfs = space.getSurfaces(); ! Iterator surfsIt = surfs.iterator(); ! while (surfsIt.hasNext()) { ! Surface current = (Surface) surfsIt.next(); ! es.addAll(current.getEdges()); ! } Iterator it = es.iterator(); gl.glColor3fv(lineColor); --- 1460,1473 ---- } } ! ! // Collection surfs = space.getSurfaces(); ! // Iterator surfsIt = surfs.iterator(); ! // while (surfsIt.hasNext()) { ! // Surface current = (Surface) surfsIt.next(); ! // es.addAll(current.getEdges()); ! // } ! ! es.addAll(space.getEdges()); ! Iterator it = es.iterator(); gl.glColor3fv(lineColor); *************** *** 1820,1824 **** Object current = getName(id); - if (!unWantedEntities.contains(current)) { if (current instanceof Surface) { --- 1823,1826 ---- |
|
From: Michael L. <he...@us...> - 2006-07-10 13:30:00
|
Update of /cvsroot/bprocessor/tools/checkstyle In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11311/checkstyle Modified Files: checkstyle.xml Log Message: Fixed hit-detection problem with hitting edges, not part of surface Index: checkstyle.xml =================================================================== RCS file: /cvsroot/bprocessor/tools/checkstyle/checkstyle.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** checkstyle.xml 12 Dec 2005 10:11:38 -0000 1.2 --- checkstyle.xml 10 Jul 2006 13:29:56 -0000 1.3 *************** *** 109,113 **** <module name="MethodLength"> <property name="tokens" value="METHOD_DEF"/> ! <property name="max" value="250"/> </module> <module name="MethodLength"> --- 109,113 ---- <module name="MethodLength"> <property name="tokens" value="METHOD_DEF"/> ! <property name="max" value="300"/> </module> <module name="MethodLength"> |
|
From: Nordholt <nor...@us...> - 2006-07-10 12:19:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12424 Modified Files: OffsetTool.java Log Message: Changed the way the offset tool is used. Changed the constructor contour to a full surface. Lengthfield should also work in the new offset tool. Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OffsetTool.java 9 Jul 2006 16:19:55 -0000 1.1 --- OffsetTool.java 10 Jul 2006 12:19:28 -0000 1.2 *************** *** 19,23 **** import net.sourceforge.bprocessor.gl.GLView; - import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Surface; --- 19,22 ---- *************** *** 35,40 **** private Map directionMap; ! /** The intersection before the current */ ! private Intersection lastIntersection; /** Dragging flag */ --- 34,47 ---- private Map directionMap; ! /** The last point the offset was moved to */ ! private Vertex lastOffsetPoint; ! ! /** Tells if a surface is found to do the offset from */ ! private boolean surfaceFound; ! ! /** A vector perpendicular to both the edge clicked to start the offset, ! and the normal of the surface that is being offset. ! This vector should point away from the surface */ ! private Vertex outNormal; /** Dragging flag */ *************** *** 50,54 **** --- 57,63 ---- contour = new LinkedList(); directionMap = new HashMap(); + surfaceFound = false; dragging = false; + outNormal = null; } *************** *** 58,75 **** */ public void updateFeedback() { ! if (start != null) { ! double lastRadius = start.vertex().minus(lastIntersection.vertex()).length(); ! double newRadius = start.vertex().minus(current.vertex()).length(); ! double delta = newRadius - lastRadius; ! Iterator it = collect(contour).iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! Vertex dir = ((Vertex)directionMap.get(v)).copy(); ! dir.scale(delta); ! v.move(dir.getX(), dir.getY(), dir.getZ()); } } makeTarget(current); } /** --- 67,117 ---- */ public void updateFeedback() { ! if (start != null && lastOffsetPoint != null) { ! if (!surfaceFound) { ! Edge startEdge = (Edge)start.object(); ! if (current != null && ! current.object() instanceof Surface && ! ((Surface)current.object()).contains(startEdge)) { ! surfaceFound = true; ! Surface surface = (Surface)current.object(); ! contour = copyContour(surface); ! directionMap = findDirections(contour, surface.normal()); ! feedback(contour); ! outNormal = startEdge.getDirection().cross(surface.normal()); ! if (current.vertex().minus(start.vertex()).dot(outNormal) > 0) { ! outNormal.scale(1 / outNormal.length()); ! } else { ! outNormal.scale(-1 / outNormal.length()); ! } ! } ! } else { ! Vertex projection = outNormal.copy(); ! projection.scale((lastOffsetPoint.minus(current.vertex())).dot(projection)); ! double length; ! if (projection.dot(outNormal) > 0) { ! length = projection.length(); ! } else { ! length = (-1 * projection.length()); ! } ! moveContour(length); ! lastOffsetPoint = current.vertex().copy(); } } makeTarget(current); } + + /** + * Moves the offset contour by the sepcified length + * @param length the length to move the offset + */ + private void moveContour(double length) { + Iterator it = collect(contour).iterator(); + while (it.hasNext()) { + Vertex v = (Vertex)it.next(); + Vertex dir = ((Vertex)directionMap.get(v)).copy(); + dir.scale(length); + v.move(dir.getX(), dir.getY(), dir.getZ()); + } + } /** *************** *** 78,83 **** */ protected void moved(MouseEvent e) { ! lastIntersection = current; ! current = findIntersection(e); if (current != null) { updateFeedback(); --- 120,124 ---- */ protected void moved(MouseEvent e) { ! current = findIntersection(e); if (current != null) { updateFeedback(); *************** *** 92,105 **** protected void pressed(MouseEvent e) { if (start == null) { ! if (current != null && current.object() instanceof Surface) { start = current; ! Surface surface = (Surface)current.object(); ! contour = copyContour(surface); ! directionMap = findDirections(contour, surface.normal()); ! feedback(contour); ! } } else { endOffset(); ! } } /** --- 133,143 ---- protected void pressed(MouseEvent e) { if (start == null) { ! if (current != null && current.object() instanceof Edge) { start = current; ! lastOffsetPoint = start.vertex().copy(); ! } } else { endOffset(); ! } } /** *************** *** 108,113 **** */ public void onVertex() { ! if (start != null) { ! updateFeedback(); endOffset(); } --- 146,160 ---- */ public void onVertex() { ! if (start != null && current != null && lastOffsetPoint != null) { ! Vertex lengthVector = start.vertex().minus(current.vertex()); ! Vertex projection = outNormal.copy(); ! projection.scale(start.vertex().minus(lastOffsetPoint).dot(projection)); ! double projectionLength = projection.length(); ! double length = lengthVector.length(); ! if (projection.dot(outNormal) < 0) { ! moveContour(projectionLength - length); ! } else { ! moveContour(length - projectionLength); ! } endOffset(); } *************** *** 118,130 **** */ private void endOffset() { ! Iterator it = contour.iterator(); ! while (it.hasNext()) { ! Edge edge = (Edge)it.next(); ! insertEdge(edge, false); ! } directionMap = new HashMap(); contour = new LinkedList(); - feedback(contour); start = null; } --- 165,176 ---- */ private void endOffset() { ! insertEdges(contour); directionMap = new HashMap(); contour = new LinkedList(); start = null; + lastOffsetPoint = null; + surfaceFound = false; + outNormal = null; + feedback(contour); } *************** *** 197,206 **** to = ((Vertex)it.next()).copy(); Edge offsetEdge = new Edge(from, to); - offsetEdge.setConstructor(true); edges.add(offsetEdge); from = to; } Edge offsetEdge = new Edge(from, first); - offsetEdge.setConstructor(true); edges.add(offsetEdge); return edges; --- 243,250 ---- *************** *** 228,230 **** --- 272,287 ---- } } + + /** + * Update the length field + */ + protected void updateLength() { + if (start != null && lastOffsetPoint != null && outNormal != null) { + Vertex projection = outNormal.copy(); + projection.scale((lastOffsetPoint.minus(start.vertex())).dot(projection)); + glv.setLength(projection.length()); + } else { + super.updateLength(); + } + } } |
|
From: Nordholt <nor...@us...> - 2006-07-09 16:24:42
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25949 Modified Files: Surface.java Log Message: removed incorrect documentation Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** Surface.java 26 Jun 2006 11:36:26 -0000 1.101 --- Surface.java 9 Jul 2006 16:24:39 -0000 1.102 *************** *** 132,137 **** /** * Return an ordered list of vertices around this Surface. - * The first and last point is the same point if the Surface - * is closed * @return An ordered list of vertices around this Surface */ --- 132,135 ---- |
|
From: Nordholt <nor...@us...> - 2006-07-09 16:22:26
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25157 Modified Files: AbstractPencil.java AbstractTool.java Log Message: removed some printout and commentet code Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** AbstractPencil.java 3 Jul 2006 14:25:02 -0000 1.35 --- AbstractPencil.java 9 Jul 2006 16:22:19 -0000 1.36 *************** *** 107,111 **** */ protected Intersection findIntersection(MouseEvent e) { - //plane = bestAlignedPlane(); if (start != null) { Vertex planeNormal = plane.normal(); --- 107,110 ---- Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** AbstractTool.java 5 Jul 2006 13:39:06 -0000 1.84 --- AbstractTool.java 9 Jul 2006 16:22:19 -0000 1.85 *************** *** 384,387 **** --- 384,388 ---- */ public void mousePressed(MouseEvent e) { + if (!e.isPopupTrigger()) { if (e.getButton() == 1) { *************** *** 417,423 **** */ public void mouseReleased(MouseEvent e) { - if (e.isPopupTrigger()) { - log.info("up popup-trigger"); - } if (e.getButton() == MouseEvent.BUTTON2) { --- 418,421 ---- |
|
From: Nordholt <nor...@us...> - 2006-07-09 16:21:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24427 Modified Files: Tool.java ToolFactory.java Log Message: adding the offset tool Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** ToolFactory.java 6 Jul 2006 13:13:50 -0000 1.51 --- ToolFactory.java 9 Jul 2006 16:20:57 -0000 1.52 *************** *** 114,119 **** private Tool previousTool; ! /** The curretn tool */ private Tool currentTool; /** The selection button */ --- 114,122 ---- private Tool previousTool; ! /** The current tool */ private Tool currentTool; + + /** The Offset tool */ + private OffsetTool offset; /** The selection button */ *************** *** 153,156 **** --- 156,162 ---- private JToggleButton walkBut; + /** The offset tool button */ + private JToggleButton offBut; + /** * Constructor *************** *** 201,204 **** --- 207,211 ---- walk = new CameraWalkTool(glv, walkCursor); constructor = new ConstructorTool(glv, pencilcursor); + offset = new OffsetTool(glv, pencilcursor); Toolbar tb = Toolbar.getInstance(); *************** *** 227,230 **** --- 234,238 ---- this.registerTool(Tool.CONSTRUCTOR_TOOL, constructor, "Biconconstructor.gif", "Constructor"); + offBut = this.registerTool(Tool.OFFSET_TOOL, offset, "Biconoffset.gif", "Offset"); tb.addSeparator(3); Index: Tool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/Tool.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Tool.java 6 Jul 2006 13:13:50 -0000 1.23 --- Tool.java 9 Jul 2006 16:20:57 -0000 1.24 *************** *** 52,55 **** --- 52,57 ---- /** The controlled extrude tool */ public static final int MULTI_EXTRUDE_TOOL = 15; + /** The Offset tool */ + public static final int OFFSET_TOOL = 16; /** |
|
From: Nordholt <nor...@us...> - 2006-07-09 16:19:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23994 Added Files: OffsetTool.java Log Message: an offset tool --- NEW FILE: OffsetTool.java --- //--------------------------------------------------------------------------------- // $Id: OffsetTool.java,v 1.1 2006/07/09 16:19:55 nordholt 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 java.util.Iterator; import java.util.List; import java.util.LinkedList; import java.util.Map; import java.util.HashMap; import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.gl.model.Intersection; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * OffsetTool */ public class OffsetTool extends AbstractPencil { /** The current contour */ private List contour; /** A map of wich direction each vertex should be moved */ private Map directionMap; /** The intersection before the current */ private Intersection lastIntersection; /** Dragging flag */ private boolean dragging; /** * Constructor fo OffsetTool * @param glv The GLView * @param cursor The Cursor */ public OffsetTool(GLView glv, Cursor cursor) { super(glv, cursor); contour = new LinkedList(); directionMap = new HashMap(); dragging = false; } /** * * Update feedback */ public void updateFeedback() { if (start != null) { double lastRadius = start.vertex().minus(lastIntersection.vertex()).length(); double newRadius = start.vertex().minus(current.vertex()).length(); double delta = newRadius - lastRadius; Iterator it = collect(contour).iterator(); while (it.hasNext()) { Vertex v = (Vertex)it.next(); Vertex dir = ((Vertex)directionMap.get(v)).copy(); dir.scale(delta); v.move(dir.getX(), dir.getY(), dir.getZ()); } } makeTarget(current); } /** * Invoked when the mouse cursor has been moved * @param e The MouseEvent object */ protected void moved(MouseEvent e) { lastIntersection = current; current = findIntersection(e); if (current != null) { updateFeedback(); } updateConstructors(); } /** * Invoked when a mouse button has been pressed. * @param e The MouseEvent object */ protected void pressed(MouseEvent e) { if (start == null) { if (current != null && current.object() instanceof Surface) { start = current; Surface surface = (Surface)current.object(); contour = copyContour(surface); directionMap = findDirections(contour, surface.normal()); feedback(contour); } } else { endOffset(); } } /** * onVertex - necessary only to make the general "apply" method work * when using the length field. */ public void onVertex() { if (start != null) { updateFeedback(); endOffset(); } } /** * Ends this offset. */ private void endOffset() { Iterator it = contour.iterator(); while (it.hasNext()) { Edge edge = (Edge)it.next(); insertEdge(edge, false); } directionMap = new HashMap(); contour = new LinkedList(); feedback(contour); start = null; } /** * Finds the directions each vertex must move inorder for * the contour to be expanded correctly. These are put in * the direction map. * @param edges the contour, the list must be ordered * @param surfaceNormal the normal of the surface we are offsetting * @return the directionmap */ private Map findDirections(List edges, Vertex surfaceNormal) { //The direction of a vertex should be the sum of the normals of each //of its edges, and scaled propably so it does not twist the contour out of shape Map directions = new HashMap(); Edge firstEdge = null; Edge e1 = null; Edge e2 = null; Iterator it = edges.iterator(); if (it.hasNext()) { firstEdge = (Edge)it.next(); e1 = firstEdge; } while (it.hasNext()) { e2 = (Edge)it.next(); Vertex dir1 = e1.getDirection().cross(surfaceNormal); Vertex dir2 = e2.getDirection().cross(surfaceNormal); dir1.scale(1 / dir1.length()); dir2.scale(1 / dir2.length()); Vertex mainDir = dir1.add(dir2); mainDir.scale(1 / mainDir.dot(dir1)); if (e2.contains(e1.getTo())) { directions.put(e1.getTo(), mainDir); } else { directions.put(e1.getFrom(), mainDir); } e1 = e2; } //Here I make sure the first vertex gets a direction Vertex dir1 = e1.getDirection().cross(surfaceNormal); Vertex dir2 = firstEdge.getDirection().cross(surfaceNormal); dir1.scale(1 / dir1.length()); dir2.scale(1 / dir2.length()); Vertex mainDir = dir1.add(dir2); mainDir.scale(1 / mainDir.dot(dir1)); if (firstEdge.contains(e1.getTo())) { directions.put(e1.getTo(), mainDir); } else { directions.put(e1.getFrom(), mainDir); } return directions; } /** * Copies the edges of a surface maintaining the connectivity. * @param surface the surface * @return a list of the edges */ private List copyContour(Surface surface) { List edges = new LinkedList(); Vertex from = null; Vertex to = null; Vertex first = null; Iterator it = surface.getVertices().iterator(); if (it.hasNext()) { first = ((Vertex)it.next()).copy(); from = first; } while (it.hasNext()) { to = ((Vertex)it.next()).copy(); Edge offsetEdge = new Edge(from, to); offsetEdge.setConstructor(true); edges.add(offsetEdge); from = to; } Edge offsetEdge = new Edge(from, first); offsetEdge.setConstructor(true); edges.add(offsetEdge); return edges; } /** * Invoked when a mouse is dragged with button down. * @param e The MouseEvent object */ protected void dragged(MouseEvent e) { moved(e); if (!dragging) { dragging = true; } } /** * Invoked when the mouse button is released. * @param e Event */ protected void released(MouseEvent e) { if (dragging) { pressed(e); dragging = false; } } } |
|
From: Nordholt <nor...@us...> - 2006-07-09 16:19:00
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23598 Added Files: Biconoffset.gif Log Message: an icon for the offset tool --- NEW FILE: Biconoffset.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Nordholt <nor...@us...> - 2006-07-07 14:09:40
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15896/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: implemented new way of correcting the minimal bounding sphere in viewEntireModel. Now works well at most angles Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Camera.java 16 Jun 2006 09:45:17 -0000 1.17 --- Camera.java 7 Jul 2006 14:09:35 -0000 1.18 *************** *** 401,405 **** Set allVertices = Project.getInstance().world().collect(); if (!allVertices.isEmpty()) { ! //Computing center and radius of the minimal covering sphere Set notTested = new HashSet(allVertices); double radius = 0; --- 401,405 ---- Set allVertices = Project.getInstance().world().collect(); if (!allVertices.isEmpty()) { ! //Computing center and radius of the minimal bounding sphere Set notTested = new HashSet(allVertices); double radius = 0; *************** *** 424,440 **** modelCenter.scale(1.0 / 2.0); modelCenter = modelCenter.add(p2); ! ! //Setting up camera ! double halfFocal; ! if (aspect < 1.0) { ! halfFocal = (this.getFocalwidth() * aspect) / 2.0; ! log.info("doing"); ! } else { ! halfFocal = (this.getFocalwidth() / 2.0); ! } double halfFocalVerTan = Math.tan(Math.toRadians(halfFocal)); ! double halfFocalHorTan = halfFocalVerTan / aspect; ! double width = Math.min(halfFocalHorTan, halfFocalVerTan); double cameraDistance = radius / width; --- 424,445 ---- modelCenter.scale(1.0 / 2.0); modelCenter = modelCenter.add(p2); ! //expand sphere if needs ! it = allVertices.iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! Vertex dV = v.minus(modelCenter); ! double dist = dV.length(); ! //if v is outside the sphere expand it to contain v. ! if (dist > radius) { ! radius = (dist + radius) / 2.0; ! dV.scale((dist - radius) / dist); ! modelCenter = modelCenter.add(dV); ! } ! } + //Setting up camera + double halfFocal = this.getFocalwidth() / 2.0; double halfFocalVerTan = Math.tan(Math.toRadians(halfFocal)); ! double halfFocalHorTan = halfFocalVerTan * aspect; double width = Math.min(halfFocalHorTan, halfFocalVerTan); double cameraDistance = radius / width; |
|
From: Nordholt <nor...@us...> - 2006-07-07 14:07:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15040/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: removed come initial constructors Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Project.java 6 Jul 2006 12:57:11 -0000 1.60 --- Project.java 7 Jul 2006 14:07:33 -0000 1.61 *************** *** 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(); --- 102,105 ---- |
|
From: Nordholt <nor...@us...> - 2006-07-07 14:03:32
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13346 Modified Files: View.java Log Message: making the aspekt consistent Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** View.java 7 Jul 2006 10:52:29 -0000 1.99 --- View.java 7 Jul 2006 14:03:23 -0000 1.100 *************** *** 595,599 **** } ! double aspect = width / height; /** fetch the current camera */ Camera camera = Project.getInstance().getCurrentCamera(); --- 595,599 ---- } ! View.aspect = width / height; /** fetch the current camera */ Camera camera = Project.getInstance().getCurrentCamera(); |
|
From: rimestad <rim...@us...> - 2006-07-07 10:52:33
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28312/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: removed printout and changed a little on the drawing og a line Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** View.java 6 Jul 2006 15:10:26 -0000 1.98 --- View.java 7 Jul 2006 10:52:29 -0000 1.99 *************** *** 943,948 **** */ private void drawConstructorCS(CoordinateSystem system) { ! // TODO Auto-generated method stub ! } --- 943,950 ---- */ private void drawConstructorCS(CoordinateSystem system) { ! Vertex i = system.getI(); ! Vertex j = system.getJ(); ! Vertex n = system.getN(); ! //TODO draw all three vectors } *************** *** 952,957 **** */ private void drawConstructorPlane(Plane plane) { ! // TODO Auto-generated method stub ! } --- 954,958 ---- */ private void drawConstructorPlane(Plane plane) { ! //TODO consider making the plane constructor as the cuttingplane } *************** *** 963,968 **** 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()); --- 964,973 ---- Vertex from = line.getOrigin(); Vertex dir = line.getDirection(); ! 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()); *************** *** 979,983 **** gl.glPopMatrix(); } ! /** * Draw a constructor point --- 984,988 ---- gl.glPopMatrix(); } ! /** * Draw a constructor point |
|
From: rimestad <rim...@us...> - 2006-07-07 10:46:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25726/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: removed printout Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Line.java 6 Jul 2006 15:10:21 -0000 1.4 --- Line.java 7 Jul 2006 10:46:03 -0000 1.5 *************** *** 57,61 **** Math.sin(Math.toRadians(degreeZ))); dir.scale(1 / dir.length()); - System.out.println("Direction: " + dir); return dir; } --- 57,60 ---- |