svn - r34225 - branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry

1 message Options
Embed this post
Permalink
svn_geotools

svn - r34225 - branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry

Reply Threaded More More options
Print post
Permalink
Author: jive
Date: 2009-10-24 23:45:08 -0400 (Sat, 24 Oct 2009)
New Revision: 34225

Modified:
   branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java
   branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java
Log:
fix up points constructors based on initial feedback

Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java
===================================================================
--- branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java 2009-10-25 03:25:35 UTC (rev 34224)
+++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryBuilder.java 2009-10-25 03:45:08 UTC (rev 34225)
@@ -14,12 +14,24 @@
 import org.osgeo.geometry.primitive.Curve;
 import org.osgeo.geometry.primitive.LineString;
 import org.osgeo.geometry.primitive.LinearRing;
+import org.osgeo.geometry.primitive.OrientableCurve;
+import org.osgeo.geometry.primitive.OrientableSurface;
 import org.osgeo.geometry.primitive.Point;
 import org.osgeo.geometry.primitive.Polygon;
+import org.osgeo.geometry.primitive.PolyhedralSurface;
 import org.osgeo.geometry.primitive.Ring;
+import org.osgeo.geometry.primitive.Solid;
 import org.osgeo.geometry.primitive.Surface;
+import org.osgeo.geometry.primitive.Tin;
+import org.osgeo.geometry.primitive.TriangulatedSurface;
+import org.osgeo.geometry.primitive.patches.Cone;
+import org.osgeo.geometry.primitive.patches.Cylinder;
 import org.osgeo.geometry.primitive.patches.PolygonPatch;
+import org.osgeo.geometry.primitive.patches.Rectangle;
+import org.osgeo.geometry.primitive.patches.Sphere;
 import org.osgeo.geometry.primitive.patches.SurfacePatch;
+import org.osgeo.geometry.primitive.patches.Triangle;
+import org.osgeo.geometry.primitive.segments.AffinePlacement;
 import org.osgeo.geometry.primitive.segments.Arc;
 import org.osgeo.geometry.primitive.segments.ArcByBulge;
 import org.osgeo.geometry.primitive.segments.ArcByCenterPoint;
@@ -29,6 +41,8 @@
 import org.osgeo.geometry.primitive.segments.Bezier;
 import org.osgeo.geometry.primitive.segments.Circle;
 import org.osgeo.geometry.primitive.segments.CircleByCenterPoint;
+import org.osgeo.geometry.primitive.segments.Clothoid;
+import org.osgeo.geometry.primitive.segments.CubicSpline;
 import org.osgeo.geometry.primitive.segments.CurveSegment;
 import org.osgeo.geometry.primitive.segments.Geodesic;
 import org.osgeo.geometry.primitive.segments.GeodesicString;
@@ -537,7 +551,7 @@
      * @return created {@link OrientableCurve}
      */
     public OrientableCurve createOrientableCurve( String id, CRS crs, Curve baseCurve, boolean isReversed ) {
-        return new DefaultOrientableCurve( id, crs, baseCurve, isReversed );
+        return factory.orientableCurve(id, crs, baseCurve, isReversed);
     }
 
     /**
@@ -548,7 +562,7 @@
      * @return created {@link Triangle}
      */
     public Triangle createTriangle( LinearRing exterior ) {
-        return new DefaultTriangle( exterior );
+        return factory.triangle(exterior);
     }
 
     /**
@@ -559,7 +573,7 @@
      * @return created {@link Rectangle}
      */
     public Rectangle createRectangle( LinearRing exterior ) {
-        return new DefaultRectangle( exterior );
+        return factory.rectangle(exterior);
     }
 
     /**
@@ -576,7 +590,7 @@
      * @return created {@link OrientableCurve}
      */
     public OrientableSurface createOrientableSurface( String id, CRS crs, Surface baseSurface, boolean isReversed ) {
-        return new DefaultOrientableSurface( id, crs, baseSurface, isReversed );
+        return factory.orientableSurface(id, crs, baseSurface, isReversed);
     }
 
     /**
@@ -591,7 +605,7 @@
      * @return created {@link PolyhedralSurface}
      */
     public PolyhedralSurface createPolyhedralSurface( String id, CRS crs, List<PolygonPatch> memberPatches ) {
-        return new DefaultPolyhedralSurface( id, crs, pm, memberPatches );
+        return factory.polyhedralSurface(id, crs, memberPatches);
     }
 
     /**
@@ -606,7 +620,7 @@
      * @return created {@link TriangulatedSurface}
      */
     public TriangulatedSurface createTriangulatedSurface( String id, CRS crs, List<Triangle> memberPatches ) {
-        return new DefaultTriangulatedSurface( id, crs, pm, memberPatches );
+        return factory.triangulatedSurface(id, crs, memberPatches);
     }
 
     /**
@@ -626,7 +640,7 @@
     public Tin createTin( String id, CRS crs, List<List<LineStringSegment>> stopLines,
                           List<List<LineStringSegment>> breakLines, Length maxLength, Points controlPoints,
                           List<Triangle> patches ) {
-        return new DefaultTin( id, crs, pm, stopLines, breakLines, maxLength, controlPoints, patches );
+        return factory.tin(id, crs, stopLines, breakLines, maxLength, controlPoints, patches);
     }
 
     /**
@@ -645,7 +659,7 @@
      */
     public Clothoid createClothoid( AffinePlacement referenceLocation, double scaleFactor, double startParameter,
                                     double endParameter ) {
-        return new DefaultClothoid( referenceLocation, scaleFactor, startParameter, endParameter );
+        return factory.clothoid(referenceLocation, scaleFactor, startParameter, endParameter);
     }
 
     /**
@@ -656,7 +670,7 @@
      * @return created {@link Cone}
      */
     public Cone createCone( List<Points> grid ) {
-        return new DefaultCone( grid );
+        return factory.cone(grid);
     }
 
     /**
@@ -667,7 +681,7 @@
      * @return created {@link Cylinder}
      */
     public Cylinder createCylinder( List<Points> grid ) {
-        return new DefaultCylinder( grid );
+        return factory.cylinder(grid);
     }
 
     /**
@@ -678,7 +692,7 @@
      * @return created {@link Sphere}
      */
     public Sphere createSphere( List<Points> grid ) {
-        return new DefaultSphere( grid );
+        return factory.sphere(grid);
     }
 
     /**
@@ -693,7 +707,7 @@
      * @return created {@link Clothoid}
      */
     public CubicSpline createCubicSpline( Points points, Point vectorAtStart, Point vectorAtEnd ) {
-        return new DefaultCubicSpline( points, vectorAtStart, vectorAtEnd );
+        return factory.cubicSpline(points, vectorAtStart, vectorAtEnd);
     }    
     
     /**
@@ -710,7 +724,7 @@
      * @return created {@link Solid}
      */
     public Solid createSolid( String id, CRS crs, Surface exteriorSurface, List<Surface> interiorSurfaces ) {
-        return new DefaultSolid( id, crs, pm, exteriorSurface, interiorSurfaces );
+        return factory.solid(id, crs, exteriorSurface, interiorSurfaces);
     }
 
     /**
@@ -725,7 +739,7 @@
      * @return created {@link MultiCurve}
      */
     public MultiCurve createMultiCurve( String id, CRS crs, List<Curve> members ) {
-        return new DefaultMultiCurve( id, crs, pm, members );
+        return factory.multiCurve(id, crs, members);
     }
 
     /**

Modified: branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java
===================================================================
--- branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java 2009-10-25 03:25:35 UTC (rev 34224)
+++ branches/geometry/spike/geometry/src/main/java/org/osgeo/geometry/GeometryFactory.java 2009-10-25 03:45:08 UTC (rev 34225)
@@ -84,31 +84,40 @@
  */
 public interface GeometryFactory {
     /**
-     * Points represent the fundamental building block
-     * of the geometry data structure. Represented as
-     * a Iterable of Points; all sharing the same CRS.
-     * @param coordinates array of double matching the axis order of the crs
-     * @param crs Coordinate Reference System
+     * Points represent the fundamental building block of the geometry data structure. Represented
+     * as a Iterable of Points; all sharing the same CRS.
+     *
+     * @param coordinates
+     *            array of double matching the axis order of the crs
+     * @param dimension
+     *            number of "ordinates" contained by each point; including both spatial ordinates in
+     *            the order supplied by the CRS and the measures associated with each point
+     * @param crs
+     *            Coordinate Reference System
      * @return Points
      */
-    Points points( double[] coordinates, CRS crs);
-    
+    Points points(double[] coordinates, int dimension, CRS crs);
+
     /**
-     * Points represent the fundamental building block
-     * of the geometry data structure. Represented as
-     * a Iterable of Points; all sharing the same CRS.
-     * @param coordinates Separate double arrays for each axis
-     * @param crs Coordinate Reference System
+     * Points represent the fundamental building block of the geometry data structure. Represented
+     * as a Iterable of Points; all sharing the same CRS.
+     *
+     * @param coordinates
+     *            Separate double arrays for each axis
+     * @param crs
+     *            Coordinate Reference System
      * @return Points
      */
-    Points points( double[][] coordinates, CRS crs);
-    
-    // Simple    
+    Points points(List<Point> list, CRS crs);
+
+    // Simple
     /**
      * Creates a {@link Point} with provided coordinates and CRS.
-     * <p>The order of the coordiantes are described by the CRS; so both the
-     * order and number of the coordinates should match the CRS axis order.
+     * <p>
+     * The order of the coordiantes are described by the CRS; so both the order and number of the
+     * coordinates should match the CRS axis order.
      * </p>
+     *
      * @param id
      *            identifier, may be null
      * @param coordinates
@@ -117,7 +126,7 @@
      *            coordinate reference system, may be null
      * @return created {@link Point}
      */
-    public Point point( String id, double[] coordinates, CRS crs );
+    public Point point(String id, double[] coordinates, CRS crs);
 
     /**
      * Creates a {@link Polygon} surface.
@@ -127,12 +136,13 @@
      * @param crs
      *            coordinate reference system, may be null
      * @param exteriorRing
-     *            ring that defines the outer boundary, this may be null (see section 9.2.2.5 of GML spec)
+     *            ring that defines the outer boundary, this may be null (see section 9.2.2.5 of GML
+     *            spec)
      * @param interiorRings
      *            list of rings that define the inner boundaries, may be empty or null
      * @return created {@link Polygon}
      */
-    public Polygon polygon( String id, CRS crs, Ring exteriorRing, List<Ring> interiorRings );
+    public Polygon polygon(String id, CRS crs, Ring exteriorRing, List<Ring> interiorRings);
 
     /**
      * Creates a {@link LineString} geometry.
@@ -145,20 +155,20 @@
      *            control points
      * @return created {@link LineString}
      */
-    public LineString lineString( String id, CRS crs, Points points );
+    public LineString lineString(String id, CRS crs, Points points);
 
-
     /**
      * Creates an {@link Envelope} based on lowerCorner and upperCorner.
      *
-     * @param points Points capturing the lower and upper bounds.
+     * @param points
+     *            Points capturing the lower and upper bounds.
      * @param max
      *            maximum corner coordinates
      * @param crs
      *            coordinate reference system, may be null
      * @return created {@link Envelope}
      */
-    public Envelope envelope( Point lowerCorner,  Point upperCorner, CRS crs);
+    public Envelope envelope(Point lowerCorner, Point upperCorner, CRS crs);
 
     /**
      * Creates an untyped multi geometry from a list of {@link Geometry}s.
@@ -170,7 +180,7 @@
      * @param members
      * @return created {@link MultiGeometry}
      */
-    public MultiGeometry<Geometry> multiGeometry( String id, CRS crs, List<Geometry> members );
+    public MultiGeometry<Geometry> multiGeometry(String id, CRS crs, List<Geometry> members);
 
     /**
      * Creates a {@link MultiPoint} from a list of passed {@link Point}s.
@@ -183,7 +193,7 @@
      *            points that constitute the collection
      * @return created {@link MultiPoint}
      */
-    public MultiPoint multiPoint( String id, CRS crs, List<Point> members );
+    public MultiPoint multiPoint(String id, CRS crs, List<Point> members);
 
     /**
      * Creates a {@link MultiCurve} from a list of passed {@link LineString}s.
@@ -196,7 +206,7 @@
      *            curves that constitute the collection
      * @return created {@link MultiLineString}
      */
-    public MultiLineString multiLineString( String id, CRS crs, List<LineString> members );
+    public MultiLineString multiLineString(String id, CRS crs, List<LineString> members);
 
     /**
      * Creates a {@link MultiPolygon} from a list of passed {@link Polygon}s.
@@ -209,9 +219,8 @@
      *            polygons that constitute the collection
      * @return created {@link MultiPolygon}
      */
-    public MultiPolygon multiPolygon( String id, CRS crs, List<Polygon> members );
-    
-  
+    public MultiPolygon multiPolygon(String id, CRS crs, List<Polygon> members);
+
     /**
      * Creates a segmented {@link Curve} from one or more {@link CurveSegment}s. The last
      * {@link Point} of segment <code>i</code> must equal the first {@link Point} of segment


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits