Examples of AffineTransformation


Examples of com.vividsolutions.jts.geom.util.AffineTransformation

  }
 
  protected Geometry rotate(Geometry geom)
  {
    if (rotationAngle != 0.0) {
      AffineTransformation trans = AffineTransformation.rotationInstance(rotationAngle,
          dim.getCentre().x, dim.getCentre().y);
      geom.apply(trans);
    }
    return geom;
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

   * @param intersection the geometry to be converted
   * @return the screen position
   */
  protected Geometry buildScreenPosition( Dimension2D screenSize, Geometry view, Geometry intersection )
  {
    AffineTransformation transformer = createWorldToScreenTransform( view.getEnvelopeInternal(), screenSize );
   
    Geometry position = (Geometry)intersection.clone();
    position.apply( transformer );
    position.geometryChanged();
   
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

    double xOffset = - view.getMinX() * xScale;
     
    double yScale = screenSize.getHeight() / view.getHeight();
    double yOffset = - view.getMinY() * yScale;
   
    return new AffineTransformation( xScale, 0.0, xOffset, 0.0, yScale, yOffset );
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

  }
 
  protected Geometry rotate(Geometry geom)
  {
    if (rotationAngle != 0.0) {
      AffineTransformation trans = AffineTransformation.rotationInstance(rotationAngle,
          dim.getCentre().x, dim.getCentre().y);
      geom.apply(trans);
    }
    return geom;
  }
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

        Geometry shell = obj.getAreaSet().getShell();
        Envelope bounds = shell.getEnvelopeInternal(); // bounds for hatch lines
        // using bounds of outer shell to ascertain that hatch lines on
        // different layers align
       
        AffineTransformation t = obj.getTranslate();
       
        // currently not used --> always 0
        if(lp.outline_offset != 0)
            shell = shell.buffer(-lp.outline_offset);
       
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

    private Point2d[] optimizePacking(AreaSet as, int lines, BSProperties bsp){
        double lineHeight = (bsp.bed_size[1] - 2*(bsp.extrusion_width + bsp.skirt_distance) - (lines-1)*bsp.gap)/lines;
        Geometry shell0 = (Geometry)as.getShell().clone();
        Envelope env0 = shell0.getEnvelopeInternal();
       
        AffineTransformation t;
        t = AffineTransformation.translationInstance(-env0.getMinX(), -env0.getMinY());
        shell0 = t.transform(shell0);
        env0 = shell0.getEnvelopeInternal();
       
        Geometry shell1 = (Geometry)shell0.clone();
        t = AffineTransformation.translationInstance(env0.getWidth(), lineHeight - env0.getHeight());
        shell1 = t.transform(shell1);
       
        double dist = shell0.distance(shell1);
        double error = dist-2.5;
        while(Math.abs(error) > 0.5){
            t = AffineTransformation.translationInstance(-error/2, 0);
            shell1 = t.transform(shell1);
            dist = shell0.distance(shell1);
            System.out.println("shell 1 distance: " + dist);
            error = dist-2.5;
        }
        Envelope env1 = shell1.getEnvelopeInternal();
       
        Geometry shell2 = (Geometry)shell1.clone();
        t = AffineTransformation.translationInstance(env1.getWidth(), -env1.getMinY());
        shell2 = t.transform(shell2);
       
        dist = shell1.distance(shell2);
        error = dist-2.5;
        while(Math.abs(error) > 0.5){
            t = AffineTransformation.translationInstance(-error/3, 0);
            shell2 = t.transform(shell2);
            dist = shell1.distance(shell2);
            System.out.println("shell 2 distance: " + dist);
            error = dist-2.5;
        }
        Envelope env2 = shell2.getEnvelopeInternal();
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

        BufferedImage image = new BufferedImage(tileRequest.width, tileRequest.height,
                renderer.getColorModel());
        context.graphics = image.createGraphics();
        Envelope2D trbb = tileRequest.bbox;
        context.bbox = new Envelope(trbb.x, trbb.x + trbb.width, trbb.y, trbb.y + trbb.height);
        context.transform = new AffineTransformation();
        double xScale = tileRequest.width / trbb.width;
        double yScale = tileRequest.height / trbb.height;

        context.transform.translate(-trbb.x, -trbb.y - trbb.height);
        context.transform.scale(xScale, -yScale);
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

                //System.out.println(simplifiedGeometry.getEnvelopeInternal());
               
                // compensate for the jaitools range lookup poking the corner of the cells instead
                // of their center, this makes for odd results if the polygon is just slightly
                // misaligned with the coverage
                AffineTransformation at = new AffineTransformation();
               
                at.setToTranslation(-0.5, -0.5);
                simplifiedGeometry.apply(at);
               
                // build a shape using a fast point in polygon wrapper
                ROI roi = new ROIGeometry(simplifiedGeometry, false);
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

        // wrap as a feature collection and return
        final SimpleFeatureType featureType = CoverageUtilities.createFeatureType(coverage, Polygon.class);
        final SimpleFeatureBuilder builder = new SimpleFeatureBuilder(featureType);
        int i = 0;
        final ListFeatureCollection featureCollection = new ListFeatureCollection(featureType);
        final AffineTransformation jtsTransformation = new AffineTransformation(
                mt2D.getScaleX(),
                mt2D.getShearX(),
                mt2D.getTranslateX(),
                mt2D.getShearY(),
                mt2D.getScaleY(),
View Full Code Here

Examples of com.vividsolutions.jts.geom.util.AffineTransformation

        final SimpleFeatureType schema = CoverageUtilities
                .createFeatureType(gc2d, LineString.class);
        final SimpleFeatureBuilder builder = new SimpleFeatureBuilder(schema);
        int i = 0;
        final ListFeatureCollection featureCollection = new ListFeatureCollection(schema);
        final AffineTransformation jtsTransformation = new AffineTransformation(mt2D.getScaleX(),
                mt2D.getShearX(), mt2D.getTranslateX(), mt2D.getShearY(), mt2D.getScaleY(),
                mt2D.getTranslateY());
        for (LineString line : prop) {

            // get value
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.