Examples of Limb


Examples of net.lucidviews.geoalgo.limb.data.Limb

    final double expectedScreenY = 100.2;
    final double x = this.defaultViewEnvelope.getMinX() + (2 * expectedScreenX);
    final double y = this.defaultViewEnvelope.getMinY() + (2 * expectedScreenY);
    Point point = this.geometryFactory.createPoint( new Coordinate( x, y ) );
   
    Limb limb = new Limb();
    limb.setIntersection( point );
   
    Options options = new Options();
    options.setScreenSize( this.halfScreenSize );
   
    PositionAssignmentLimbRefiner testObj = new PositionAssignmentLimbRefiner();
    testObj.refine( limb, this.defaultView, options );
   
    assertNotNull( limb.getPosition() );
    Geometry position = limb.getPosition();
    assertTrue( position instanceof Point );
    assertEquals( expectedScreenX, ((Point)position).getCoordinate().x, DOUBLE_TOLERANCE );
    assertEquals( expectedScreenY, ((Point)position).getCoordinate().y, DOUBLE_TOLERANCE );
  }
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    final double expectedScreenY = 1400.2;
    final double x = this.defaultViewEnvelope.getMinX() + (expectedScreenX / 3);
    final double y = this.defaultViewEnvelope.getMinY() + (expectedScreenY/ 3);
    Point point = this.geometryFactory.createPoint( new Coordinate( x, y ) );
   
    Limb limb = new Limb();
    limb.setIntersection( point );
   
    Options options = new Options();
    options.setScreenSize( this.trebleScreenSize );
   
    PositionAssignmentLimbRefiner testObj = new PositionAssignmentLimbRefiner();
    testObj.refine( limb, this.defaultView, options );
   
    assertNotNull( limb.getPosition() );
    Geometry position = limb.getPosition();
    assertTrue( position instanceof Point );
    assertEquals( expectedScreenX, ((Point)position).getCoordinate().x, DOUBLE_TOLERANCE );
    assertEquals( expectedScreenY, ((Point)position).getCoordinate().y, DOUBLE_TOLERANCE );
  }
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    // We're then able to verify that the cloning process takes a deep copy of the geometry collection.
    // A shallow copy will result in the transform being applied several times to the same line object.
    // (Interestingly, outerCollection.clone() takes a deep copy
    //  but GeometryFactory::createGeometry( outerCollection ) takes a shallow copy.)
   
    Limb limb = new Limb();
    limb.setIntersection( outerCollection );
   
    Options options = new Options();
    options.setScreenSize( this.halfScreenSize );
   
    PositionAssignmentLimbRefiner testObj = new PositionAssignmentLimbRefiner();
    testObj.refine( limb, this.defaultView, options );
   
    assertTrue( limb.getPosition() instanceof GeometryCollection );
    GeometryCollection position = (GeometryCollection)limb.getPosition();
    assertTrue( position.getGeometryN( 0 ) instanceof MultiLineString );
    MultiLineString position1 = (MultiLineString)position.getGeometryN( 0 );
    assertTrue( position1.getGeometryN( 0 ) instanceof LineString );
    LineString multiLine1 = (LineString)position1.getGeometryN( 0 );
    assertEquals( expectedScreenX1, multiLine1.getCoordinateN( 0 ).x, DOUBLE_TOLERANCE );
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    LineString featureGeometry = this.geometryFactory.createLineString( LimbGeneratorTest.Utils.createCoords( "0 0, 100 0" ) );
    this.feature.setDefaultGeometry( featureGeometry );
   
    Point intersectionPoint = this.geometryFactory.createPoint( new Coordinate( 50, 50 ) );
   
    Limb limb = new Limb();
    limb.setFeature( this.feature );
    limb.setIntersection( intersectionPoint );
   
    DistanceCalculationLimbRefiner testObj = new DistanceCalculationLimbRefiner();
    testObj.refine( limb, null, null );
   
    assertEquals( 50, limb.getDistance(), DOUBLE_TOLERANCE );
  }
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    LineString featureGeometry = this.geometryFactory.createLineString( LimbGeneratorTest.Utils.createCoords( "50 50, 100 100" ) );
    this.feature.setDefaultGeometry( featureGeometry );
   
    LineString intersectionPoint = this.geometryFactory.createLineString( LimbGeneratorTest.Utils.createCoords( "0 0, 100 0" ) );
   
    Limb limb = new Limb();
    limb.setFeature( this.feature );
    limb.setIntersection( intersectionPoint );
   
    DistanceCalculationLimbRefiner testObj = new DistanceCalculationLimbRefiner();
    testObj.refine( limb, null, null );
   
    assertEquals( 50, limb.getDistance(), DOUBLE_TOLERANCE );
  }
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    this.geometryFactory = new GeometryFactory( new PrecisionModel( PrecisionModel.FLOATING ), 27700 );
   
    SimpleFeatureType featureType = new SimpleFeatureTypeImpl( new NameImpl( "test" ), null, null, false, null, null, null );
    Feature feature = new SimpleFeatureImpl( new ArrayList<Object>(), featureType, new FeatureIdImpl( "test" ) );
   
    this.limb = new Limb();
    this.limb.setEdges( new HashSet<Edge>() );
    this.limb.setFeature( feature );
    this.limb.setIntersection( this.geometryFactory.createPoint( new Coordinate( 0, 0 ) ) );
    this.limb.setLabel( "dummy label" );
    this.limb.setPosition( this.geometryFactory.createPoint( new Coordinate( 0, 0 ) ) );
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

          }
         
          // Ignore intersections that have been voided by the processor.
          if (intersection != null)
          {
            Limb limb = generateLimb( feature, intersection, options );
           
            // Run the limb through the processors.
            for (ILimbRefiner limbRefiner : this.limbRefiners)
            {
              limbRefiner.refine( limb, view, options );
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

   * @param options processing options, or <code>null</code> for no options
   * @return the limb object
   */
  protected Limb generateLimb( Feature feature, Geometry intersection, Options options )
  {
    Limb limb = new Limb();
   
    limb.setFeature( feature );
    limb.setIntersection( intersection );
   
    return limb;
  }
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    LineString featureGeometry = this.geometryFactory.createLineString( LimbGeneratorTest.Utils.createCoords( "0 0, 0 40" ) );
    this.feature.setDefaultGeometry( featureGeometry );
   
    Point intersectionPoint = this.geometryFactory.createPoint( new Coordinate( 0, 20 ) );
   
    Limb limb = new Limb();
    limb.setFeature( this.feature );
    limb.setIntersection( intersectionPoint );
   
    AngleCalculationLimbRefiner testObj = new AngleCalculationLimbRefiner();
    testObj.refine( limb, null, null );
   
    assertEquals( 90, limb.getAngle(), DOUBLE_TOLERANCE );
  }
View Full Code Here

Examples of net.lucidviews.geoalgo.limb.data.Limb

    LineString featureGeometry = this.geometryFactory.createLineString( LimbGeneratorTest.Utils.createCoords( "0 40, 0 0" ) );
    this.feature.setDefaultGeometry( featureGeometry );
   
    Point intersectionPoint = this.geometryFactory.createPoint( new Coordinate( 0, 20 ) );
   
    Limb limb = new Limb();
    limb.setFeature( this.feature );
    limb.setIntersection( intersectionPoint );
   
    AngleCalculationLimbRefiner testObj = new AngleCalculationLimbRefiner();
    testObj.refine( limb, null, null );
   
    assertEquals( -90, limb.getAngle(), DOUBLE_TOLERANCE );
  }
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.