[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/view AbstractView.java,1.28,1.29 View.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2005-09-16 12:09:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26033 Modified Files: AbstractView.java View.java View3D.java ViewFactory.java Removed Files: ViewXY.java ViewXZ.java Log Message: the three plan views have bee removed and and Factory changed accordingly and toCanvasCoords is changed to toModelCoords and it now returns a Vertex not a double array Index: AbstractView.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/AbstractView.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractView.java 15 Sep 2005 11:11:47 -0000 1.28 --- AbstractView.java 16 Sep 2005 12:09:07 -0000 1.29 *************** *** 757,769 **** /** - * Return the distance on the canvas matching the given double - * @param dist The window coordinates - * @return The relative distance - */ - public double toCanvasDistance(double dist) { - return 2 * size * aspect * zoomFactor * (dist / height); - } - - /** * Initialize the objectTable and the name-stack * @param gl The GL --- 757,760 ---- *************** *** 906,924 **** /** ! * Return the 3D coordinates for the canvas matching the given 2D coords ! * @return The relative 3D coordinates ! * @param coords The window coordinates */ ! public abstract double[] toCanvasCoords(double[] coords); ! /** ! * Return the 3D coordinates for the canvas matching the given 2D coords ! * @param coords The coordinate to convert ! * @param plane The plane to find intersection with ! * @return The point in 3D */ ! public double[] toPlaneCoords(double[] coords, Plane plane) { ! return toCanvasCoords(coords); ! } /** --- 897,908 ---- /** ! * @see View#toModelCoords */ ! public abstract Vertex toModelCoords(double[] coords); ! /** ! * @see View#toPlaneCoords */ ! public abstract Vertex toPlaneCoords(double[] coords, Plane plane); /** --- ViewXZ.java DELETED --- Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** View.java 7 Sep 2005 11:30:34 -0000 1.11 --- View.java 16 Sep 2005 12:09:07 -0000 1.12 *************** *** 68,91 **** /** ! * Return the 3D coordinates for the canvas matching the given 2D coords ! * @param coords The window coordinates ! * @return The relative 3D coordinates */ ! public double[] toCanvasCoords(double[] coords); ! /** ! * Return the 3D coordinates for the canvas matching the given 2D coords ! * @param coords The window coordinates * @param plane The plane to find intersection with ! * @return The relative 3D coordinates ! */ ! public double[] toPlaneCoords(double[] coords, Plane plane); ! ! /** ! * Return the distance on the canvas matching the given double ! * @param dist The window coordinates ! * @return The relative distance */ ! public double toCanvasDistance(double dist); /** --- 68,84 ---- /** ! * Return the 3D coordinates in the model for the given canvas coords ! * @return The model 3D coordinate ! * @param coords The window coordinate */ ! public Vertex toModelCoords(double[] coords); ! /** ! * Return the 3D coordinates in the model for the intersection with the give plane ! * @param coords The coordinate to convert * @param plane The plane to find intersection with ! * @return The vertex in 3D */ ! public Vertex toPlaneCoords(double[] coords, Plane plane); /** --- ViewXY.java DELETED --- Index: View3D.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View3D.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** View3D.java 6 Sep 2005 08:36:22 -0000 1.15 --- View3D.java 16 Sep 2005 12:09:07 -0000 1.16 *************** *** 189,207 **** /** ! * Return the 3D coordinates for the canvas matching the given 2D coords ! * @return The relative 3D coordinates ! * @param coords The window coordinates */ ! public double[] toCanvasCoords(double[] coords) { return toPlaneCoords(coords, new Plane(0, 0, 1, 0)); } /** ! * Return the point in the space that intersects with the given plane ! * @return The intersection between the ray through the space and the given plane ! * @param coords The screen coordinate ! * @param plane The plane in the space to intersect with */ ! public double[] toPlaneCoords(double[] coords, Plane plane) { if (coords.length == 2 && plane != null) { double x = coords[0]; --- 189,202 ---- /** ! * @see AbstractView#toModelCoords */ ! public Vertex toModelCoords(double[] coords) { return toPlaneCoords(coords, new Plane(0, 0, 1, 0)); } /** ! * @see AbstractView#toPlaneCoords */ ! public Vertex toPlaneCoords(double[] coords, Plane plane) { if (coords.length == 2 && plane != null) { double x = coords[0]; *************** *** 217,225 **** if (vertex != null) { ! return new double[] {vertex.getX(), vertex.getY(), vertex.getZ()}; } } log.warn("Too many arguments"); ! return new double[] {0.0, 0.0, 0.0}; } --- 212,220 ---- if (vertex != null) { ! return vertex; } } log.warn("Too many arguments"); ! return new Vertex(""); } Index: ViewFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/ViewFactory.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ViewFactory.java 7 Sep 2005 11:30:34 -0000 1.6 --- ViewFactory.java 16 Sep 2005 12:09:07 -0000 1.7 *************** *** 28,40 **** private static View view3D; - /** The XY view */ - private static View viewXY; - - /** The XZ view */ - private static View viewXZ; - - /** The YZ view*/ - private static View viewYZ; - /** */ private static ViewFactory factory; --- 28,31 ---- *************** *** 46,52 **** private ViewFactory(GLView glv) { view3D = new View3D(glv); - viewXY = new ViewXY(glv); - viewXZ = new ViewXZ(glv); - viewYZ = new ViewYZ(glv); Toolbar tb = Toolbar.getInstance(); --- 37,40 ---- *************** *** 95,104 **** if (i == View.VIEW_3D) { return view3D; - } else if (i == View.VIEW_XZ) { - return viewXZ; - } else if (i == View.VIEW_XY) { - return viewXY; - } else if (i == View.VIEW_YZ) { - return viewYZ; } else { log.warn("[get] no such view " + i); --- 83,86 ---- |