idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
26,300 | private static boolean polygonDisjointPolygon_ ( Polygon polygon_a , Polygon polygon_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polygon_b , tolerance , true ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains || relation == Relation . within || relation == Relation . intersects ) return false ; return polygonDisjointMultiPath_ ( polygon_a , polygon_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a is disjoint from polygon_b . |
26,301 | private static boolean polygonTouchesPolygon_ ( Polygon polygon_a , Polygon polygon_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polygon_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains || relation == Relation . within ) return false ; return polygonTouchesPolygonImpl_ ( polygon_a , polygon_b , tolerance , null ) ; } | Returns true if polygon_a touches polygon_b . |
26,302 | private static boolean polygonOverlapsPolygon_ ( Polygon polygon_a , Polygon polygon_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polygon_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains || relation == Relation . within ) return false ; return polygonOverlapsPolygonImpl_ ( polygon_a , polygon_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a overlaps polygon_b . |
26,303 | private static boolean polygonContainsPolygon_ ( Polygon polygon_a , Polygon polygon_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; polygon_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polygon_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . within ) return false ; if ( relation == Relation . contains ) return true ; return polygonContainsPolygonImpl_ ( polygon_a , polygon_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a contains polygon_b . |
26,304 | private static boolean polygonDisjointPolyline_ ( Polygon polygon_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polyline_b , tolerance , true ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains || relation == Relation . intersects ) return false ; return polygonDisjointMultiPath_ ( polygon_a , polyline_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a is disjoint from polyline_b . |
26,305 | private static boolean polygonTouchesPolyline_ ( Polygon polygon_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polyline_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains ) return false ; return polygonTouchesPolylineImpl_ ( polygon_a , polyline_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a touches polyline_b . |
26,306 | private static boolean polygonCrossesPolyline_ ( Polygon polygon_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polyline_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains ) return false ; return polygonCrossesPolylineImpl_ ( polygon_a , polyline_b , tolerance , null ) ; } | Returns true if polygon_a crosses polyline_b . |
26,307 | private static boolean polygonContainsPolyline_ ( Polygon polygon_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; polyline_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , polyline_b , tolerance , false ) ; if ( relation == Relation . disjoint ) return false ; if ( relation == Relation . contains ) return true ; return polygonContainsPolylineImpl_ ( polygon_a , polyline_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a contains polyline_b . |
26,308 | private static boolean polygonDisjointPoint_ ( Polygon polygon_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { PolygonUtils . PiPResult result = PolygonUtils . isPointInPolygon2D ( polygon_a , point_b , tolerance ) ; if ( result == PolygonUtils . PiPResult . PiPOutside ) return true ; return false ; } | Returns true if polygon_a is disjoint from point_b . |
26,309 | private static boolean polygonTouchesPoint_ ( Polygon polygon_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { Point2D pt_b = point_b . getXY ( ) ; return polygonTouchesPointImpl_ ( polygon_a , pt_b , tolerance , null ) ; } | Returns true of polygon_a touches point_b . |
26,310 | private static boolean polygonContainsPoint_ ( Polygon polygon_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { Point2D pt_b = point_b . getXY ( ) ; return polygonContainsPointImpl_ ( polygon_a , pt_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a contains point_b . |
26,311 | private static boolean polygonDisjointMultiPoint_ ( Polygon polygon_a , MultiPoint multipoint_b , double tolerance , boolean bIncludeBoundaryA , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , multipoint_b , tolerance , false ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains ) return false ; Envelope2D env_a_inflated = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a_inflated ) ; env_a_inflated . inflate ( tolerance , tolerance ) ; Point2D ptB = new Point2D ( ) ; for ( int i = 0 ; i < multipoint_b . getPointCount ( ) ; i ++ ) { multipoint_b . getXY ( i , ptB ) ; if ( ! env_a_inflated . contains ( ptB ) ) continue ; PolygonUtils . PiPResult result = PolygonUtils . isPointInPolygon2D ( polygon_a , ptB , tolerance ) ; if ( result == PolygonUtils . PiPResult . PiPInside || ( bIncludeBoundaryA && result == PolygonUtils . PiPResult . PiPBoundary ) ) return false ; } return true ; } | Returns true if polygon_a is disjoint from multipoint_b . |
26,312 | private static boolean polygonTouchesMultiPoint_ ( Polygon polygon_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , multipoint_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains ) return false ; Envelope2D env_a_inflated = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a_inflated ) ; env_a_inflated . inflate ( tolerance , tolerance ) ; Point2D ptB ; boolean b_boundary = false ; MultiPathImpl polygon_a_impl = ( MultiPathImpl ) polygon_a . _getImpl ( ) ; Polygon pa = null ; Polygon p_polygon_a = polygon_a ; boolean b_checked_polygon_a_quad_tree = false ; for ( int i = 0 ; i < multipoint_b . getPointCount ( ) ; i ++ ) { ptB = multipoint_b . getXY ( i ) ; if ( env_a_inflated . contains ( ptB ) ) { PolygonUtils . PiPResult result = PolygonUtils . isPointInPolygon2D ( p_polygon_a , ptB , tolerance ) ; if ( result == PolygonUtils . PiPResult . PiPBoundary ) b_boundary = true ; else if ( result == PolygonUtils . PiPResult . PiPInside ) return false ; } if ( ! b_checked_polygon_a_quad_tree ) { if ( PointInPolygonHelper . quadTreeWillHelp ( polygon_a , multipoint_b . getPointCount ( ) - 1 ) && ( polygon_a_impl . _getAccelerators ( ) == null || polygon_a_impl . _getAccelerators ( ) . getQuadTree ( ) == null ) ) { pa = new Polygon ( ) ; polygon_a . copyTo ( pa ) ; ( ( MultiPathImpl ) pa . _getImpl ( ) ) . _buildQuadTreeAccelerator ( Geometry . GeometryAccelerationDegree . enumMedium ) ; p_polygon_a = pa ; } else { p_polygon_a = polygon_a ; } b_checked_polygon_a_quad_tree = true ; } } if ( b_boundary ) return true ; return false ; } | Returns true if polygon_a touches multipoint_b . |
26,313 | private static boolean polygonContainsMultiPoint_ ( Polygon polygon_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; multipoint_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , multipoint_b , tolerance , false ) ; if ( relation == Relation . disjoint ) return false ; if ( relation == Relation . contains ) return true ; boolean b_interior = false ; Point2D ptB ; MultiPathImpl polygon_a_impl = ( MultiPathImpl ) polygon_a . _getImpl ( ) ; Polygon pa = null ; Polygon p_polygon_a = polygon_a ; boolean b_checked_polygon_a_quad_tree = false ; for ( int i = 0 ; i < multipoint_b . getPointCount ( ) ; i ++ ) { ptB = multipoint_b . getXY ( i ) ; if ( ! env_a . contains ( ptB ) ) return false ; PolygonUtils . PiPResult result = PolygonUtils . isPointInPolygon2D ( p_polygon_a , ptB , tolerance ) ; if ( result == PolygonUtils . PiPResult . PiPInside ) b_interior = true ; else if ( result == PolygonUtils . PiPResult . PiPOutside ) return false ; if ( ! b_checked_polygon_a_quad_tree ) { if ( PointInPolygonHelper . quadTreeWillHelp ( polygon_a , multipoint_b . getPointCount ( ) - 1 ) && ( polygon_a_impl . _getAccelerators ( ) == null || polygon_a_impl . _getAccelerators ( ) . getQuadTree ( ) == null ) ) { pa = new Polygon ( ) ; polygon_a . copyTo ( pa ) ; ( ( MultiPathImpl ) pa . _getImpl ( ) ) . _buildQuadTreeAccelerator ( Geometry . GeometryAccelerationDegree . enumMedium ) ; p_polygon_a = pa ; } else { p_polygon_a = polygon_a ; } b_checked_polygon_a_quad_tree = true ; } } return b_interior ; } | Returns true if polygon_a contains multipoint_b . |
26,314 | private static boolean polygonEqualsEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ) return false ; Polygon polygon_b = new Polygon ( ) ; polygon_b . addEnvelope ( envelope_b , false ) ; return linearPathEqualsLinearPath_ ( polygon_a , polygon_b , tolerance , true ) ; } | Returns true if polygon_a equals envelope_b . |
26,315 | private static boolean polygonDisjointEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , envelope_b , tolerance , false ) ; if ( relation == Relation . disjoint ) return true ; if ( relation == Relation . contains || relation == Relation . within ) return false ; Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; PolygonUtils . PiPResult pipres ; Point2D pt_b = new Point2D ( ) ; env_b . queryLowerLeft ( pt_b ) ; pipres = PolygonUtils . isPointInPolygon2D ( polygon_a , pt_b , tolerance ) ; if ( pipres != PolygonUtils . PiPResult . PiPOutside ) return false ; env_b . queryLowerRight ( pt_b ) ; pipres = PolygonUtils . isPointInPolygon2D ( polygon_a , pt_b , tolerance ) ; if ( pipres != PolygonUtils . PiPResult . PiPOutside ) return false ; env_b . queryUpperRight ( pt_b ) ; pipres = PolygonUtils . isPointInPolygon2D ( polygon_a , pt_b , tolerance ) ; if ( pipres != PolygonUtils . PiPResult . PiPOutside ) return false ; env_b . queryUpperLeft ( pt_b ) ; pipres = PolygonUtils . isPointInPolygon2D ( polygon_a , pt_b , tolerance ) ; if ( pipres != PolygonUtils . PiPResult . PiPOutside ) return false ; MultiPathImpl mimpl_a = ( MultiPathImpl ) polygon_a . _getImpl ( ) ; AttributeStreamOfDbl pos = ( AttributeStreamOfDbl ) ( mimpl_a . getAttributeStreamRef ( VertexDescription . Semantics . POSITION ) ) ; Envelope2D env_b_inflated = new Envelope2D ( ) ; env_b_inflated . setCoords ( env_b ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; for ( int ptIndex = 0 , n = mimpl_a . getPointCount ( ) ; ptIndex < n ; ptIndex ++ ) { double x = pos . read ( 2 * ptIndex ) ; double y = pos . read ( 2 * ptIndex + 1 ) ; if ( env_b_inflated . contains ( x , y ) ) return false ; } return ! linearPathIntersectsEnvelope_ ( polygon_a , env_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a is disjoint from envelope_b . |
26,316 | private static boolean polygonTouchesEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , envelope_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains || relation == Relation . within ) return false ; Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getWidth ( ) <= tolerance && env_b . getHeight ( ) <= tolerance ) { Point2D pt_b = envelope_b . getCenterXY ( ) ; return polygonTouchesPointImpl_ ( polygon_a , pt_b , tolerance , progress_tracker ) ; } if ( env_b . getWidth ( ) <= tolerance || env_b . getHeight ( ) <= tolerance ) { Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return polygonTouchesPolylineImpl_ ( polygon_a , polyline_b , tolerance , progress_tracker ) ; } Polygon polygon_b = new Polygon ( ) ; polygon_b . addEnvelope ( envelope_b , false ) ; return polygonTouchesPolygonImpl_ ( polygon_a , polygon_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a touches envelope_b . |
26,317 | private static boolean polygonOverlapsEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , envelope_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . contains || relation == Relation . within ) return false ; Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getWidth ( ) <= tolerance || env_b . getHeight ( ) <= tolerance ) return false ; Polygon polygon_b = new Polygon ( ) ; polygon_b . addEnvelope ( envelope_b , false ) ; return polygonOverlapsPolygonImpl_ ( polygon_a , polygon_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a overlaps envelope_b . |
26,318 | private static boolean polygonWithinEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; return envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ; } | Returns true if polygon_a is within envelope_b |
26,319 | private static boolean polygonContainsEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; int relation = tryRasterizedContainsOrDisjoint_ ( polygon_a , envelope_b , tolerance , false ) ; if ( relation == Relation . disjoint || relation == Relation . within ) return false ; if ( relation == Relation . contains ) return true ; if ( env_b . getWidth ( ) <= tolerance && env_b . getHeight ( ) <= tolerance ) { Point2D pt_b = envelope_b . getCenterXY ( ) ; return polygonContainsPointImpl_ ( polygon_a , pt_b , tolerance , progress_tracker ) ; } if ( env_b . getWidth ( ) <= tolerance || env_b . getHeight ( ) <= tolerance ) { Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return polygonContainsPolylineImpl_ ( polygon_a , polyline_b , tolerance , null ) ; } Polygon polygon_b = new Polygon ( ) ; polygon_b . addEnvelope ( envelope_b , false ) ; return polygonContainsPolygonImpl_ ( polygon_a , polygon_b , tolerance , null ) ; } | Returns true if polygon_a contains envelope_b . |
26,320 | private static boolean polygonCrossesEnvelope_ ( Polygon polygon_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polygon_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getHeight ( ) > tolerance && env_b . getWidth ( ) > tolerance ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return false ; Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return polygonCrossesPolylineImpl_ ( polygon_a , polyline_b , tolerance , progress_tracker ) ; } | Returns true if polygon_a crosses envelope_b . |
26,321 | private static boolean polylineEqualsPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; polyline_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ) return false ; if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return false ; if ( multiPathExactlyEqualsMultiPath_ ( polyline_a , polyline_b , tolerance , progress_tracker ) ) return true ; return linearPathEqualsLinearPath_ ( polyline_a , polyline_b , tolerance , false ) ; } | Returns true if polyline_a equals polyline_b . |
26,322 | private static boolean polylineDisjointPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return true ; MultiPathImpl multi_path_impl_a = ( MultiPathImpl ) polyline_a . _getImpl ( ) ; MultiPathImpl multi_path_impl_b = ( MultiPathImpl ) polyline_b . _getImpl ( ) ; PairwiseIntersectorImpl intersector_paths = new PairwiseIntersectorImpl ( multi_path_impl_a , multi_path_impl_b , tolerance , true ) ; if ( ! intersector_paths . next ( ) ) return false ; return ! linearPathIntersectsLinearPath_ ( polyline_a , polyline_b , tolerance ) ; } | Returns true if polyline_a is disjoint from polyline_b . |
26,323 | private static boolean polylineTouchesPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return false ; AttributeStreamOfDbl intersections = new AttributeStreamOfDbl ( 0 ) ; int dim = linearPathIntersectsLinearPathMaxDim_ ( polyline_a , polyline_b , tolerance , intersections ) ; if ( dim != 0 ) return false ; MultiPoint intersection = new MultiPoint ( ) ; for ( int i = 0 ; i < intersections . size ( ) ; i += 2 ) { double x = intersections . read ( i ) ; double y = intersections . read ( i + 1 ) ; intersection . add ( x , y ) ; } MultiPoint boundary_a_b = ( MultiPoint ) ( polyline_a . getBoundary ( ) ) ; MultiPoint boundary_b = ( MultiPoint ) ( polyline_b . getBoundary ( ) ) ; boundary_a_b . add ( boundary_b , 0 , boundary_b . getPointCount ( ) ) ; return multiPointContainsMultiPointBrute_ ( boundary_a_b , intersection , tolerance ) ; } | Returns true if polyline_a touches polyline_b . |
26,324 | private static boolean polylineOverlapsPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return false ; return linearPathOverlapsLinearPath_ ( polyline_a , polyline_b , tolerance ) ; } | Returns true if polyline_a overlaps polyline_b . |
26,325 | private static boolean polylineContainsPolyline_ ( Polyline polyline_a , Polyline polyline_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; polyline_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , polyline_b , tolerance , false ) == Relation . disjoint ) return false ; return linearPathWithinLinearPath_ ( polyline_b , polyline_a , tolerance , false ) ; } | Returns true if polyline_a contains polyline_b . |
26,326 | private static boolean polylineDisjointPoint_ ( Polyline polyline_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , point_b , tolerance , false ) == Relation . disjoint ) return true ; Point2D pt_b = point_b . getXY ( ) ; return ! linearPathIntersectsPoint_ ( polyline_a , pt_b , tolerance ) ; } | Returns true if polyline_a is disjoint from point_b . |
26,327 | private static boolean polylineTouchesPoint_ ( Polyline polyline_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , point_b , tolerance , false ) == Relation . disjoint ) return false ; Point2D pt_b = point_b . getXY ( ) ; return linearPathTouchesPointImpl_ ( polyline_a , pt_b , tolerance ) ; } | Returns true if polyline_a touches point_b . |
26,328 | private static boolean polylineContainsPoint_ ( Polyline polyline_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , point_b , tolerance , false ) == Relation . disjoint ) return false ; Point2D pt_b = point_b . getXY ( ) ; return linearPathContainsPoint_ ( polyline_a , pt_b , tolerance ) ; } | Returns true of polyline_a contains point_b . |
26,329 | private static boolean polylineDisjointMultiPoint_ ( Polyline polyline_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , multipoint_b , tolerance , false ) == Relation . disjoint ) return true ; return ! linearPathIntersectsMultiPoint_ ( polyline_a , multipoint_b , tolerance , false ) ; } | Returns true if polyline_a is disjoint from multipoint_b . |
26,330 | private static boolean polylineContainsMultiPoint_ ( Polyline polyline_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; multipoint_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; if ( tryRasterizedContainsOrDisjoint_ ( polyline_a , multipoint_b , tolerance , false ) == Relation . disjoint ) return false ; if ( ! linearPathIntersectsMultiPoint_ ( polyline_a , multipoint_b , tolerance , true ) ) return false ; MultiPoint boundary_a = ( MultiPoint ) ( polyline_a . getBoundary ( ) ) ; return ! multiPointIntersectsMultiPoint_ ( boundary_a , multipoint_b , tolerance , progress_tracker ) ; } | Returns true if polyline_a contains multipoint_b . |
26,331 | private static boolean polylineEqualsEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( env_b . getHeight ( ) > tolerance && env_b . getWidth ( ) > tolerance ) return false ; return envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ; } | Returns true if polyline_a equals envelope_b . |
26,332 | private static boolean polylineDisjointEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; return ! linearPathIntersectsEnvelope_ ( polyline_a , env_b , tolerance , progress_tracker ) ; } | Returns true if polyline_a is disjoint from envelope_b . |
26,333 | private static boolean polylineTouchesEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) { Point2D pt_b = envelope_b . getCenterXY ( ) ; return linearPathTouchesPointImpl_ ( polyline_a , pt_b , tolerance ) ; } if ( env_b . getHeight ( ) <= tolerance || env_b . getWidth ( ) <= tolerance ) { Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return polylineTouchesPolyline_ ( polyline_a , polyline_b , tolerance , progress_tracker ) ; } SegmentIterator seg_iter_a = polyline_a . querySegmentIterator ( ) ; Envelope2D env_b_deflated = new Envelope2D ( ) , env_b_inflated = new Envelope2D ( ) ; env_b_deflated . setCoords ( env_b ) ; env_b_inflated . setCoords ( env_b ) ; env_b_deflated . inflate ( - tolerance , - tolerance ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; boolean b_boundary = false ; Envelope2D env_segment_a = new Envelope2D ( ) ; Envelope2D env_inter = new Envelope2D ( ) ; while ( seg_iter_a . nextPath ( ) ) { while ( seg_iter_a . hasNextSegment ( ) ) { Segment segment_a = seg_iter_a . nextSegment ( ) ; segment_a . queryEnvelope2D ( env_segment_a ) ; env_inter . setCoords ( env_b_deflated ) ; env_inter . intersect ( env_segment_a ) ; if ( ! env_inter . isEmpty ( ) && ( env_inter . getHeight ( ) > tolerance || env_inter . getWidth ( ) > tolerance ) ) return false ; env_inter . setCoords ( env_b_inflated ) ; env_inter . intersect ( env_segment_a ) ; if ( ! env_inter . isEmpty ( ) ) b_boundary = true ; } } return b_boundary ; } | Returns true if polyline_a touches envelope_b . |
26,334 | private static boolean polylineOverlapsEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) || envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getHeight ( ) > tolerance && env_b . getWidth ( ) > tolerance ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return false ; Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return linearPathOverlapsLinearPath_ ( polyline_a , polyline_b , tolerance ) ; } | Returns true if polyline_a overlaps envelope_b . |
26,335 | private static boolean polylineWithinEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return false ; if ( env_b . getHeight ( ) <= tolerance || env_b . getWidth ( ) <= tolerance ) return envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ; SegmentIterator seg_iter_a = polyline_a . querySegmentIterator ( ) ; Envelope2D env_b_deflated = new Envelope2D ( ) ; env_b_deflated . setCoords ( env_b ) ; env_b_deflated . inflate ( - tolerance , - tolerance ) ; boolean b_interior = false ; Envelope2D env_segment_a = new Envelope2D ( ) ; Envelope2D env_inter = new Envelope2D ( ) ; while ( seg_iter_a . nextPath ( ) ) { while ( seg_iter_a . hasNextSegment ( ) ) { Segment segment_a = seg_iter_a . nextSegment ( ) ; segment_a . queryEnvelope2D ( env_segment_a ) ; if ( env_b_deflated . containsExclusive ( env_segment_a ) ) { b_interior = true ; continue ; } env_inter . setCoords ( env_b_deflated ) ; env_inter . intersect ( env_segment_a ) ; if ( ! env_inter . isEmpty ( ) && ( env_inter . getHeight ( ) > tolerance || env_inter . getWidth ( ) > tolerance ) ) b_interior = true ; } } return b_interior ; } | Returns true if polyline_a is within envelope_b . |
26,336 | private static boolean polylineContainsEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; envelope_b . queryEnvelope2D ( env_b ) ; polyline_a . queryEnvelope2D ( env_a ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; if ( env_b . getHeight ( ) > tolerance && env_b . getWidth ( ) > tolerance ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) { Point2D pt_b = envelope_b . getCenterXY ( ) ; return linearPathContainsPoint_ ( polyline_a , pt_b , tolerance ) ; } Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return linearPathWithinLinearPath_ ( polyline_b , polyline_a , tolerance , false ) ; } | Returns true if polyline_a contains envelope_b . |
26,337 | private static boolean polylineCrossesEnvelope_ ( Polyline polyline_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; polyline_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return false ; if ( env_b . getHeight ( ) <= tolerance || env_b . getWidth ( ) <= tolerance ) { Polyline polyline_b = new Polyline ( ) ; Point p = new Point ( ) ; envelope_b . queryCornerByVal ( 0 , p ) ; polyline_b . startPath ( p ) ; envelope_b . queryCornerByVal ( 2 , p ) ; polyline_b . lineTo ( p ) ; return polylineCrossesPolyline_ ( polyline_a , polyline_b , tolerance , progress_tracker ) ; } SegmentIterator seg_iter_a = polyline_a . querySegmentIterator ( ) ; Envelope2D env_b_inflated = new Envelope2D ( ) , env_b_deflated = new Envelope2D ( ) ; env_b_deflated . setCoords ( env_b ) ; env_b_inflated . setCoords ( env_b ) ; env_b_deflated . inflate ( - tolerance , - tolerance ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; boolean b_interior = false , b_exterior = false ; Envelope2D env_segment_a = new Envelope2D ( ) ; Envelope2D env_inter = new Envelope2D ( ) ; while ( seg_iter_a . nextPath ( ) ) { while ( seg_iter_a . hasNextSegment ( ) ) { Segment segment_a = seg_iter_a . nextSegment ( ) ; segment_a . queryEnvelope2D ( env_segment_a ) ; if ( ! b_exterior ) { if ( ! env_b_inflated . contains ( env_segment_a ) ) b_exterior = true ; } if ( ! b_interior ) { env_inter . setCoords ( env_b_deflated ) ; env_inter . intersect ( env_segment_a ) ; if ( ! env_inter . isEmpty ( ) && ( env_inter . getHeight ( ) > tolerance || env_inter . getWidth ( ) > tolerance ) ) b_interior = true ; } if ( b_interior && b_exterior ) return true ; } } return false ; } | Returns true if polyline_a crosses envelope_b . |
26,338 | private static boolean multiPointEqualsMultiPoint_ ( MultiPoint multipoint_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; multipoint_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ) return false ; if ( multiPointExactlyEqualsMultiPoint_ ( multipoint_a , multipoint_b , tolerance , progress_tracker ) ) return true ; return multiPointCoverageMultiPoint_ ( multipoint_a , multipoint_b , tolerance , false , true , false , progress_tracker ) ; } | Returns true if multipoint_a equals multipoint_b . |
26,339 | private static boolean multiPointDisjointMultiPoint_ ( MultiPoint multipoint_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { return ! multiPointIntersectsMultiPoint_ ( multipoint_a , multipoint_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a is disjoint from multipoint_b . |
26,340 | private static boolean multiPointOverlapsMultiPoint_ ( MultiPoint multipoint_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { return multiPointCoverageMultiPoint_ ( multipoint_a , multipoint_b , tolerance , false , false , true , progress_tracker ) ; } | Returns true if multipoint_a overlaps multipoint_b . |
26,341 | private static boolean multiPointContainsMultiPoint_ ( MultiPoint multipoint_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; multipoint_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; return multiPointCoverageMultiPoint_ ( multipoint_b , multipoint_a , tolerance , true , false , false , progress_tracker ) ; } | Returns true if multipoint_a contains multipoint_b . |
26,342 | static boolean multiPointEqualsPoint_ ( MultiPoint multipoint_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; point_b . queryEnvelope2D ( env_b ) ; return envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a equals point_b . |
26,343 | private static boolean multiPointDisjointPoint_ ( MultiPoint multipoint_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { Point2D pt_b = point_b . getXY ( ) ; return multiPointDisjointPointImpl_ ( multipoint_a , pt_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a is disjoint from point_b . |
26,344 | private static boolean multiPointWithinPoint_ ( MultiPoint multipoint_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { return multiPointEqualsPoint_ ( multipoint_a , point_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a is within point_b . |
26,345 | private static boolean multiPointContainsPoint_ ( MultiPoint multipoint_a , Point point_b , double tolerance , ProgressTracker progress_tracker ) { return ! multiPointDisjointPoint_ ( multipoint_a , point_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a contains point_b . |
26,346 | private static boolean multiPointEqualsEnvelope_ ( MultiPoint multipoint_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( env_b . getHeight ( ) > tolerance || env_b . getWidth ( ) > tolerance ) return false ; return envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a equals envelope_b . |
26,347 | private static boolean multiPointDisjointEnvelope_ ( MultiPoint multipoint_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; Envelope2D env_b_inflated = new Envelope2D ( ) ; env_b_inflated . setCoords ( env_b ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; Point2D pt_a = new Point2D ( ) ; for ( int i = 0 ; i < multipoint_a . getPointCount ( ) ; i ++ ) { multipoint_a . getXY ( i , pt_a ) ; if ( ! env_b_inflated . contains ( pt_a ) ) continue ; return false ; } return true ; } | Returns true if multipoint_a is disjoint from envelope_b . |
26,348 | private static boolean multiPointWithinEnvelope_ ( MultiPoint multipoint_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ; if ( env_b . getHeight ( ) <= tolerance || env_b . getWidth ( ) <= tolerance ) { boolean b_interior = false ; Envelope2D env_b_deflated = new Envelope2D ( ) , env_b_inflated = new Envelope2D ( ) ; env_b_deflated . setCoords ( env_b ) ; env_b_inflated . setCoords ( env_b ) ; if ( env_b . getHeight ( ) > tolerance ) env_b_deflated . inflate ( 0 , - tolerance ) ; else env_b_deflated . inflate ( - tolerance , 0 ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; Point2D pt_a = new Point2D ( ) ; for ( int i = 0 ; i < multipoint_a . getPointCount ( ) ; i ++ ) { multipoint_a . getXY ( i , pt_a ) ; if ( ! env_b_inflated . contains ( pt_a ) ) return false ; if ( env_b . getHeight ( ) > tolerance ) { if ( pt_a . y > env_b_deflated . ymin && pt_a . y < env_b_deflated . ymax ) b_interior = true ; } else { if ( pt_a . x > env_b_deflated . xmin && pt_a . x < env_b_deflated . xmax ) b_interior = true ; } } return b_interior ; } boolean b_interior = false ; Envelope2D env_b_deflated = new Envelope2D ( ) , env_b_inflated = new Envelope2D ( ) ; env_b_deflated . setCoords ( env_b ) ; env_b_inflated . setCoords ( env_b ) ; env_b_deflated . inflate ( - tolerance , - tolerance ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; Point2D pt_a = new Point2D ( ) ; for ( int i = 0 ; i < multipoint_a . getPointCount ( ) ; i ++ ) { multipoint_a . getXY ( i , pt_a ) ; if ( ! env_b_inflated . contains ( pt_a ) ) return false ; if ( env_b_deflated . containsExclusive ( pt_a ) ) b_interior = true ; } return b_interior ; } | Returns true if multipoint_a is within envelope_b . |
26,349 | private static boolean multiPointContainsEnvelope_ ( MultiPoint multipoint_a , Envelope envelope_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) , env_b = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; envelope_b . queryEnvelope2D ( env_b ) ; if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; if ( env_b . getHeight ( ) > tolerance || env_b . getWidth ( ) > tolerance ) return false ; Point2D pt_b = envelope_b . getCenterXY ( ) ; return ! multiPointDisjointPointImpl_ ( multipoint_a , pt_b , tolerance , progress_tracker ) ; } | Returns true if multipoint_a contains envelope_b . |
26,350 | private static boolean pointEqualsPoint_ ( Point2D pt_a , Point2D pt_b , double tolerance , ProgressTracker progress_tracker ) { if ( Point2D . sqrDistance ( pt_a , pt_b ) <= tolerance * tolerance ) return true ; return false ; } | Returns true if pt_a equals pt_b . |
26,351 | private static boolean pointContainsPoint_ ( Point2D pt_a , Point2D pt_b , double tolerance , ProgressTracker progress_tracker ) { return pointEqualsPoint_ ( pt_a , pt_b , tolerance , progress_tracker ) ; } | Returns true if pt_a contains pt_b . |
26,352 | private static boolean pointEqualsEnvelope_ ( Point2D pt_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_a = new Envelope2D ( ) ; env_a . setCoords ( pt_a ) ; return envelopeEqualsEnvelope_ ( env_a , env_b , tolerance , progress_tracker ) ; } | Returns true if pt_a equals enve_b . |
26,353 | static boolean pointDisjointEnvelope_ ( Point2D pt_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_b_inflated = new Envelope2D ( ) ; env_b_inflated . setCoords ( env_b ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; return ! env_b_inflated . contains ( pt_a ) ; } | Returns true if pt_a is disjoint from env_b . |
26,354 | private static boolean pointTouchesEnvelope_ ( Point2D pt_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return false ; Envelope2D env_b_inflated = new Envelope2D ( ) , env_b_deflated = new Envelope2D ( ) ; env_b_inflated . setCoords ( env_b ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; if ( ! env_b_inflated . contains ( pt_a ) ) return false ; if ( env_b . getHeight ( ) <= tolerance || env_b . getWidth ( ) <= tolerance ) { env_b_deflated . setCoords ( env_b ) ; if ( env_b . getHeight ( ) > tolerance ) env_b_deflated . inflate ( 0 , - tolerance ) ; else env_b_deflated . inflate ( - tolerance , 0 ) ; if ( env_b . getHeight ( ) > tolerance ) { if ( pt_a . y > env_b_deflated . ymin && pt_a . y < env_b_deflated . ymax ) return false ; } else { if ( pt_a . x > env_b_deflated . xmin && pt_a . x < env_b_deflated . xmax ) return false ; } return true ; } env_b_deflated . setCoords ( env_b ) ; env_b_deflated . inflate ( - tolerance , - tolerance ) ; if ( env_b_deflated . containsExclusive ( pt_a ) ) return false ; return true ; } | Returns true if pt_a touches env_b . |
26,355 | private static boolean pointContainsEnvelope_ ( Point2D pt_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { return pointEqualsEnvelope_ ( pt_a , env_b , tolerance , progress_tracker ) ; } | Returns true if pt_a contains env_b . |
26,356 | private static boolean envelopeEqualsEnvelope_ ( Envelope2D env_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { return envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) && envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ; } | Returns true if env_a equals env_b . |
26,357 | static boolean envelopeDisjointEnvelope_ ( Envelope2D env_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { Envelope2D env_b_inflated = new Envelope2D ( ) ; env_b_inflated . setCoords ( env_b ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; return ! env_a . isIntersecting ( env_b_inflated ) ; } | Returns true if env_a is disjoint from env_b . |
26,358 | private static boolean envelopeContainsEnvelope_ ( Envelope2D env_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { if ( ! envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ) return false ; if ( env_a . getHeight ( ) <= tolerance && env_a . getWidth ( ) <= tolerance ) { Point2D pt_a = env_a . getCenter ( ) ; return pointWithinEnvelope_ ( pt_a , env_b , tolerance , progress_tracker ) ; } if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) { Point2D pt_b = env_b . getCenter ( ) ; return pointWithinEnvelope_ ( pt_b , env_a , tolerance , progress_tracker ) ; } if ( env_a . getHeight ( ) <= tolerance || env_a . getWidth ( ) <= tolerance ) return envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ; if ( env_b . getHeight ( ) <= tolerance || env_b . getWidth ( ) <= tolerance ) { Envelope2D env_a_deflated = new Envelope2D ( ) ; env_a_deflated . setCoords ( env_a ) ; env_a_deflated . inflate ( - tolerance , - tolerance ) ; if ( env_a_deflated . containsExclusive ( env_b ) ) return true ; Envelope2D env_inter = new Envelope2D ( ) ; env_inter . setCoords ( env_a_deflated ) ; env_inter . intersect ( env_b ) ; if ( env_inter . isEmpty ( ) || ( env_inter . getHeight ( ) <= tolerance && env_inter . getWidth ( ) <= tolerance ) ) return false ; return true ; } return envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) ; } | Returns true if env_a contains env_b . |
26,359 | private static boolean envelopeCrossesEnvelope_ ( Envelope2D env_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { if ( envelopeInfContainsEnvelope_ ( env_a , env_b , tolerance ) || envelopeInfContainsEnvelope_ ( env_b , env_a , tolerance ) ) return false ; if ( env_a . getHeight ( ) <= tolerance && env_a . getWidth ( ) <= tolerance ) return false ; if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) return false ; if ( env_b . getHeight ( ) > tolerance && env_b . getWidth ( ) > tolerance ) { if ( env_a . getHeight ( ) > tolerance && env_a . getWidth ( ) > tolerance ) return false ; } Envelope2D _env_a ; Envelope2D _env_b ; if ( env_a . getHeight ( ) > tolerance && env_a . getWidth ( ) > tolerance ) { _env_a = env_b ; _env_b = env_a ; } else { _env_a = env_a ; _env_b = env_b ; } if ( _env_b . getHeight ( ) > tolerance && _env_b . getWidth ( ) > tolerance ) { Envelope2D env_inter = new Envelope2D ( ) , env_b_deflated = new Envelope2D ( ) ; env_b_deflated . setCoords ( _env_b ) ; env_b_deflated . inflate ( - tolerance , - tolerance ) ; env_inter . setCoords ( env_b_deflated ) ; env_inter . intersect ( _env_a ) ; if ( env_inter . isEmpty ( ) ) return false ; if ( env_inter . getHeight ( ) <= tolerance && env_inter . getWidth ( ) <= tolerance ) return false ; assert ( ! envelopeInfContainsEnvelope_ ( env_inter , _env_a , tolerance ) ) ; return true ; } Line line_a = new Line ( ) , line_b = new Line ( ) ; double [ ] scalars_a = new double [ 2 ] ; double [ ] scalars_b = new double [ 2 ] ; Point2D pt = new Point2D ( ) ; _env_a . queryLowerLeft ( pt ) ; line_a . setStartXY ( pt ) ; _env_a . queryUpperRight ( pt ) ; line_a . setEndXY ( pt ) ; _env_b . queryLowerLeft ( pt ) ; line_b . setStartXY ( pt ) ; _env_b . queryUpperRight ( pt ) ; line_b . setEndXY ( pt ) ; line_a . intersect ( line_b , null , scalars_a , scalars_b , tolerance ) ; int count = line_a . intersect ( line_b , null , null , null , tolerance ) ; if ( count != 1 ) return false ; return scalars_a [ 0 ] > 0.0 && scalars_a [ 1 ] < 1.0 && scalars_b [ 0 ] > 0.0 && scalars_b [ 1 ] < 1.0 ; } | Returns true if env_a crosses env_b . |
26,360 | private static boolean envelopeInfContainsEnvelope_ ( Envelope2D env_a , Envelope2D env_b , double tolerance ) { Envelope2D env_a_inflated = new Envelope2D ( ) ; env_a_inflated . setCoords ( env_a ) ; env_a_inflated . inflate ( tolerance , tolerance ) ; return env_a_inflated . contains ( env_b ) ; } | Returns true if env_a inflated contains env_b . |
26,361 | private static boolean interiorEnvExteriorEnv_ ( Envelope2D env_a , Envelope2D env_b , double tolerance ) { Envelope2D envBInflated = new Envelope2D ( ) ; envBInflated . setCoords ( env_b ) ; envBInflated . inflate ( tolerance , tolerance ) ; Point2D pt = new Point2D ( ) ; env_a . queryLowerLeft ( pt ) ; if ( ! envBInflated . contains ( pt ) ) return true ; env_a . queryLowerRight ( pt ) ; if ( ! envBInflated . contains ( pt ) ) return true ; env_a . queryUpperLeft ( pt ) ; if ( ! envBInflated . contains ( pt ) ) return true ; env_a . queryUpperRight ( pt ) ; if ( ! envBInflated . contains ( pt ) ) return true ; assert ( envBInflated . contains ( env_a ) ) ; return false ; } | Returns true if a coordinate of envelope A is outside of envelope B . |
26,362 | private static boolean multiPathExactlyEqualsMultiPath_ ( MultiPath multipathA , MultiPath multipathB , double tolerance , ProgressTracker progress_tracker ) { if ( multipathA . getPathCount ( ) != multipathB . getPathCount ( ) || multipathA . getPointCount ( ) != multipathB . getPointCount ( ) ) return false ; Point2D ptA = new Point2D ( ) , ptB = new Point2D ( ) ; boolean bAllPointsEqual = true ; double tolerance_sq = tolerance * tolerance ; for ( int ipath = 0 ; ipath < multipathA . getPathCount ( ) ; ipath ++ ) { if ( multipathA . getPathEnd ( ipath ) != multipathB . getPathEnd ( ipath ) ) { bAllPointsEqual = false ; break ; } for ( int i = multipathA . getPathStart ( ipath ) ; i < multipathB . getPathEnd ( ipath ) ; i ++ ) { multipathA . getXY ( i , ptA ) ; multipathB . getXY ( i , ptB ) ; if ( Point2D . sqrDistance ( ptA , ptB ) > tolerance_sq ) { bAllPointsEqual = false ; break ; } } if ( ! bAllPointsEqual ) break ; } if ( ! bAllPointsEqual ) return false ; return true ; } | those in multipathB within a tolerance and in the same order . |
26,363 | private static boolean multiPointExactlyEqualsMultiPoint_ ( MultiPoint multipoint_a , MultiPoint multipoint_b , double tolerance , ProgressTracker progress_tracker ) { if ( multipoint_a . getPointCount ( ) != multipoint_b . getPointCount ( ) ) return false ; Point2D ptA = new Point2D ( ) , ptB = new Point2D ( ) ; boolean bAllPointsEqual = true ; double tolerance_sq = tolerance * tolerance ; for ( int i = 0 ; i < multipoint_a . getPointCount ( ) ; i ++ ) { multipoint_a . getXY ( i , ptA ) ; multipoint_b . getXY ( i , ptB ) ; if ( Point2D . sqrDistance ( ptA , ptB ) > tolerance_sq ) { bAllPointsEqual = false ; break ; } } if ( ! bAllPointsEqual ) return false ; return true ; } | multipoint_b within a tolerance and in the same order . |
26,364 | private static boolean multiPointIntersectsMultiPoint_ ( MultiPoint _multipointA , MultiPoint _multipointB , double tolerance , ProgressTracker progress_tracker ) { MultiPoint multipoint_a ; MultiPoint multipoint_b ; if ( _multipointA . getPointCount ( ) > _multipointB . getPointCount ( ) ) { multipoint_a = _multipointB ; multipoint_b = _multipointA ; } else { multipoint_a = _multipointA ; multipoint_b = _multipointB ; } Envelope2D env_a = new Envelope2D ( ) ; Envelope2D env_b = new Envelope2D ( ) ; Envelope2D envInter = new Envelope2D ( ) ; multipoint_a . queryEnvelope2D ( env_a ) ; multipoint_b . queryEnvelope2D ( env_b ) ; env_a . inflate ( tolerance , tolerance ) ; env_b . inflate ( tolerance , tolerance ) ; envInter . setCoords ( env_a ) ; envInter . intersect ( env_b ) ; Point2D ptA = new Point2D ( ) ; Point2D ptB = new Point2D ( ) ; double tolerance_sq = tolerance * tolerance ; QuadTreeImpl quadTreeB = InternalUtils . buildQuadTree ( ( MultiPointImpl ) ( multipoint_b . _getImpl ( ) ) , envInter ) ; QuadTreeImpl . QuadTreeIteratorImpl qtIterB = quadTreeB . getIterator ( ) ; for ( int vertex_a = 0 ; vertex_a < multipoint_a . getPointCount ( ) ; vertex_a ++ ) { multipoint_a . getXY ( vertex_a , ptA ) ; if ( ! envInter . contains ( ptA ) ) continue ; env_a . setCoords ( ptA . x , ptA . y , ptA . x , ptA . y ) ; qtIterB . resetIterator ( env_a , tolerance ) ; for ( int elementHandleB = qtIterB . next ( ) ; elementHandleB != - 1 ; elementHandleB = qtIterB . next ( ) ) { int vertex_b = quadTreeB . getElement ( elementHandleB ) ; multipoint_b . getXY ( vertex_b , ptB ) ; if ( Point2D . sqrDistance ( ptA , ptB ) <= tolerance_sq ) return true ; } } return false ; } | Returns true if multipoint_a intersects multipoint_b . |
26,365 | private static boolean linearPathEqualsLinearPath_ ( MultiPath multipathA , MultiPath multipathB , double tolerance , boolean bEnforceOrientation ) { return linearPathWithinLinearPath_ ( multipathA , multipathB , tolerance , bEnforceOrientation ) && linearPathWithinLinearPath_ ( multipathB , multipathA , tolerance , bEnforceOrientation ) ; } | Returns true if multipathA equals multipathB . |
26,366 | private static boolean linearPathIntersectsLinearPath_ ( MultiPath multipathA , MultiPath multipathB , double tolerance ) { MultiPathImpl multi_path_impl_a = ( MultiPathImpl ) multipathA . _getImpl ( ) ; MultiPathImpl multi_path_impl_b = ( MultiPathImpl ) multipathB . _getImpl ( ) ; SegmentIteratorImpl segIterA = multi_path_impl_a . querySegmentIterator ( ) ; SegmentIteratorImpl segIterB = multi_path_impl_b . querySegmentIterator ( ) ; PairwiseIntersectorImpl intersector = new PairwiseIntersectorImpl ( multi_path_impl_a , multi_path_impl_b , tolerance , false ) ; while ( intersector . next ( ) ) { int vertex_a = intersector . getRedElement ( ) ; int vertex_b = intersector . getBlueElement ( ) ; segIterA . resetToVertex ( vertex_a ) ; segIterB . resetToVertex ( vertex_b ) ; Segment segmentA = segIterA . nextSegment ( ) ; Segment segmentB = segIterB . nextSegment ( ) ; int result = segmentB . intersect ( segmentA , null , null , null , tolerance ) ; if ( result > 0 ) { return true ; } } return false ; } | segments of _multipathB . |
26,367 | static boolean linearPathIntersectsPoint_ ( MultiPath multipathA , Point2D ptB , double tolerance ) { Point2D closest = new Point2D ( ) ; double toleranceSq = tolerance * tolerance ; SegmentIteratorImpl segIterA = ( ( MultiPathImpl ) multipathA . _getImpl ( ) ) . querySegmentIterator ( ) ; GeometryAccelerators accel = ( ( MultiPathImpl ) multipathA . _getImpl ( ) ) . _getAccelerators ( ) ; if ( accel != null ) { QuadTreeImpl quadTreeA = accel . getQuadTree ( ) ; if ( quadTreeA != null ) { Envelope2D env_b = new Envelope2D ( ) ; env_b . setCoords ( ptB ) ; QuadTreeImpl . QuadTreeIteratorImpl qt_iter = quadTreeA . getIterator ( env_b , tolerance ) ; for ( int e = qt_iter . next ( ) ; e != - 1 ; e = qt_iter . next ( ) ) { segIterA . resetToVertex ( quadTreeA . getElement ( e ) ) ; if ( segIterA . hasNextSegment ( ) ) { Segment segmentA = segIterA . nextSegment ( ) ; double t = segmentA . getClosestCoordinate ( ptB , false ) ; segmentA . getCoord2D ( t , closest ) ; if ( Point2D . sqrDistance ( ptB , closest ) <= toleranceSq ) { return true ; } } } return false ; } } Envelope2D env_a = new Envelope2D ( ) ; while ( segIterA . nextPath ( ) ) { while ( segIterA . hasNextSegment ( ) ) { Segment segmentA = segIterA . nextSegment ( ) ; segmentA . queryEnvelope2D ( env_a ) ; env_a . inflate ( tolerance , tolerance ) ; if ( ! env_a . contains ( ptB ) ) { continue ; } double t = segmentA . getClosestCoordinate ( ptB , false ) ; segmentA . getCoord2D ( t , closest ) ; if ( Point2D . sqrDistance ( ptB , closest ) <= toleranceSq ) { return true ; } } } return false ; } | Returns true if a segment of multipathA intersects point_b . |
26,368 | private static boolean linearPathIntersectsEnvelope_ ( MultiPath multipath_a , Envelope2D env_b , double tolerance , ProgressTracker progress_tracker ) { if ( ! multipath_a . hasNonLinearSegments ( ) ) { Envelope2D env_b_inflated = new Envelope2D ( ) ; env_b_inflated . setCoords ( env_b ) ; env_b_inflated . inflate ( tolerance , tolerance ) ; MultiPathImpl mimpl_a = ( MultiPathImpl ) multipath_a . _getImpl ( ) ; AttributeStreamOfDbl xy = ( AttributeStreamOfDbl ) ( mimpl_a . getAttributeStreamRef ( VertexDescription . Semantics . POSITION ) ) ; Point2D pt = new Point2D ( ) ; Point2D pt_prev = new Point2D ( ) ; Point2D pt_1 = new Point2D ( ) ; Point2D pt_2 = new Point2D ( ) ; for ( int ipath = 0 , npath = mimpl_a . getPathCount ( ) ; ipath < npath ; ipath ++ ) { boolean b_first = true ; for ( int i = mimpl_a . getPathStart ( ipath ) , n = mimpl_a . getPathEnd ( ipath ) ; i < n ; i ++ ) { if ( b_first ) { xy . read ( 2 * i , pt_prev ) ; b_first = false ; continue ; } xy . read ( 2 * i , pt ) ; pt_1 . setCoords ( pt_prev ) ; pt_2 . setCoords ( pt ) ; if ( env_b_inflated . clipLine ( pt_1 , pt_2 ) != 0 ) return true ; pt_prev . setCoords ( pt ) ; } } } else { Line line_1 = new Line ( env_b . xmin , env_b . ymin , env_b . xmin , env_b . ymax ) ; Line line_2 = new Line ( env_b . xmin , env_b . ymax , env_b . xmax , env_b . ymax ) ; Line line3 = new Line ( env_b . xmax , env_b . ymax , env_b . xmax , env_b . ymin ) ; Line line4 = new Line ( env_b . xmax , env_b . ymin , env_b . xmin , env_b . ymin ) ; SegmentIterator iter = multipath_a . querySegmentIterator ( ) ; while ( iter . nextPath ( ) ) { while ( iter . hasNextSegment ( ) ) { Segment polySeg = iter . nextSegment ( ) ; if ( polySeg . isIntersecting ( line_1 , tolerance ) ) return true ; if ( polySeg . isIntersecting ( line_2 , tolerance ) ) return true ; if ( polySeg . isIntersecting ( line3 , tolerance ) ) return true ; if ( polySeg . isIntersecting ( line4 , tolerance ) ) return true ; } } } return false ; } | Returns true if the segments of multipathA intersects env_b |
26,369 | private static boolean checkVerticesForIntersection_ ( MultiVertexGeometryImpl geom , RasterizedGeometry2D rgeom ) { int pointCount = geom . getPointCount ( ) ; Point2D pt = new Point2D ( ) ; for ( int ipoint = 0 ; ipoint < pointCount ; ipoint ++ ) { geom . getXY ( ipoint , pt ) ; RasterizedGeometry2D . HitType hit = rgeom . queryPointInGeometry ( pt . x , pt . y ) ; if ( hit == RasterizedGeometry2D . HitType . Inside ) { return true ; } } return false ; } | Returns true if intersects and false if nothing can be determined . |
26,370 | private boolean reset ( int bucket_count , double min_value , double max_value , int capacity ) { if ( bucket_count < 2 || max_value == min_value ) return false ; int bc = Math . min ( MAXBUCKETS , bucket_count ) ; m_buckets . reserve ( bc ) ; m_buckets . resize ( bc ) ; m_buckets . setRange ( 0 , 0 , m_buckets . size ( ) ) ; m_min_value = min_value ; m_max_value = max_value ; m_bucketed_indices . resize ( capacity ) ; m_dy = ( max_value - min_value ) / ( bc - 1 ) ; return true ; } | Clears and resets Bucket_sort to the new state preparing for the accumulation of new data . |
26,371 | private int getBucket ( double value ) { assert ( value >= m_min_value && value <= m_max_value ) ; int bucket = ( int ) ( ( value - m_min_value ) / m_dy ) ; return bucket ; } | Adds new element to the bucket builder . The value must be between min_value and max_value . |
26,372 | int getField ( int element , int field ) { assert ( m_buffer [ element >> m_blockPower ] [ ( element & m_blockMask ) + 1 ] != - 0x7eadbeed ) ; return m_buffer [ element >> m_blockPower ] [ ( element & m_blockMask ) + field ] ; } | Returns the given field of the element . |
26,373 | void setField ( int element , int field , int value ) { assert ( m_buffer [ element >> m_blockPower ] [ ( element & m_blockMask ) + 1 ] != - 0x7eadbeed ) ; m_buffer [ element >> m_blockPower ] [ ( element & m_blockMask ) + field ] = value ; } | Sets the given field of the element . |
26,374 | int newElement ( ) { int element = m_firstFree ; if ( element == - 1 ) { if ( m_last == m_capacity ) { long newcap = m_capacity != 0 ? ( ( ( long ) m_capacity + 1 ) * 3 / 2 ) : ( long ) 1 ; if ( newcap > Integer . MAX_VALUE ) newcap = Integer . MAX_VALUE ; if ( newcap == m_capacity ) throw new IndexOutOfBoundsException ( ) ; grow_ ( newcap ) ; } element = ( ( m_last / m_blockSize ) << m_blockPower ) + ( m_last % m_blockSize ) * m_realStride ; m_last ++ ; } else { m_firstFree = m_buffer [ element >> m_blockPower ] [ element & m_blockMask ] ; } m_size ++ ; int ar [ ] = m_buffer [ element >> m_blockPower ] ; int ind = element & m_blockMask ; for ( int i = 0 ; i < m_stride ; i ++ ) { ar [ ind + i ] = - 1 ; } return element ; } | All fields are initialized to - 1 . |
26,375 | void swapField ( int element1 , int element2 , int field ) { int ar1 [ ] = m_buffer [ element1 >> m_blockPower ] ; int ar2 [ ] = m_buffer [ element2 >> m_blockPower ] ; int ind1 = ( element1 & m_blockMask ) + field ; int ind2 = ( element2 & m_blockMask ) + field ; int tmp = ar1 [ ind1 ] ; ar1 [ ind1 ] = ar2 [ ind2 ] ; ar2 [ ind2 ] = tmp ; } | Swaps content of two fields |
26,376 | public void add ( MultiVertexGeometry src , int srcFrom , int srcTo ) { m_impl . add ( ( MultiVertexGeometryImpl ) src . _getImpl ( ) , srcFrom , srcTo ) ; } | Appends points from another multipoint at the end of this multipoint . |
26,377 | public void transform ( Point [ ] pointsIn , int count , Point [ ] pointsOut ) { Point2D res = new Point2D ( ) ; for ( int i = 0 ; i < count ; i ++ ) { Point2D p = pointsIn [ i ] . getXY ( ) ; res . x = xx * p . x + xy * p . y + xd ; res . y = yx * p . x + yy * p . y + yd ; pointsOut [ i ] = new Point ( res . x , res . y ) ; } } | Transforms an array of points . |
26,378 | public void transform ( double [ ] pointsXYInterleaved , int start , int count ) { int n = Math . min ( pointsXYInterleaved . length , ( start + count ) * 2 ) / 2 ; for ( int i = count ; i < n ; i ++ ) { double px = pointsXYInterleaved [ 2 * i ] ; double py = pointsXYInterleaved [ 2 * i + 1 ] ; pointsXYInterleaved [ 2 * i ] = xx * px + xy * py + xd ; pointsXYInterleaved [ 2 * i + 1 ] = yx * px + yy * py + yd ; } } | Transforms an array of points stored in an array of doubles as interleaved XY coordinates . |
26,379 | public Transformation2D copy ( ) { Transformation2D result = new Transformation2D ( ) ; result . xx = xx ; result . xy = xy ; result . xd = xd ; result . yx = yx ; result . yy = yy ; result . yd = yd ; return result ; } | Returns a copy of the Transformation2D object . |
26,380 | public void getCoefficients ( double [ ] coefs ) { if ( coefs . length < 6 ) throw new GeometryException ( "Buffer is too small. coefs needs 6 members" ) ; coefs [ 0 ] = xx ; coefs [ 1 ] = xy ; coefs [ 2 ] = xd ; coefs [ 3 ] = yx ; coefs [ 4 ] = yy ; coefs [ 5 ] = yd ; } | Writes the matrix coefficients in the order XX XY XD YX YY YD into the given array . |
26,381 | void initializeFromRect ( Envelope2D src , Envelope2D dest ) { if ( src . isEmpty ( ) || dest . isEmpty ( ) || 0 == src . getWidth ( ) || 0 == src . getHeight ( ) ) setZero ( ) ; else { xy = yx = 0 ; xx = dest . getWidth ( ) / src . getWidth ( ) ; yy = dest . getHeight ( ) / src . getHeight ( ) ; xd = dest . xmin - src . xmin * xx ; yd = dest . ymin - src . ymin * yy ; } } | Initialize transformation from two rectangles . |
26,382 | void initializeFromRectIsotropic ( Envelope2D src , Envelope2D dest ) { if ( src . isEmpty ( ) || dest . isEmpty ( ) || 0 == src . getWidth ( ) || 0 == src . getHeight ( ) ) setZero ( ) ; else { yx = 0 ; xy = 0 ; xx = dest . getWidth ( ) / src . getWidth ( ) ; yy = dest . getHeight ( ) / src . getHeight ( ) ; if ( xx > yy ) xx = yy ; else yy = xx ; Point2D destCenter = dest . getCenter ( ) ; Point2D srcCenter = src . getCenter ( ) ; xd = destCenter . x - srcCenter . x * xx ; yd = destCenter . y - srcCenter . y * yy ; } } | Initializes an orhtonormal transformation from the Src and Dest rectangles . |
26,383 | Point2D transformSize ( Point2D SizeSrc ) { Point2D pt = new Point2D ( ) ; pt . x = Math . sqrt ( xx * xx + yx * yx ) * SizeSrc . x ; pt . y = Math . sqrt ( xy * xy + yy * yy ) * SizeSrc . y ; return pt ; } | Transforms size . |
26,384 | public double transform ( double tolerance ) { Point2D pt1 = new Point2D ( ) ; Point2D pt2 = new Point2D ( ) ; pt1 . setCoords ( xx , yx ) ; pt2 . setCoords ( xy , yy ) ; pt1 . sub ( pt1 ) ; double d1 = pt1 . sqrLength ( ) * 0.5 ; pt1 . setCoords ( xx , yx ) ; pt2 . setCoords ( xy , yy ) ; pt1 . add ( pt2 ) ; double d2 = pt1 . sqrLength ( ) * 0.5 ; return tolerance * ( ( d1 > d2 ) ? Math . sqrt ( d1 ) : Math . sqrt ( d2 ) ) ; } | Transforms a tolerance value . |
26,385 | void transformWithoutShift ( Point2D [ ] pointsIn , int from , int count , Point2D [ ] pointsOut ) { for ( int i = from , n = from + count ; i < n ; i ++ ) { Point2D p = pointsIn [ i ] ; double new_x = xx * p . x + xy * p . y ; double new_y = yx * p . x + yy * p . y ; pointsOut [ i ] . setCoords ( new_x , new_y ) ; } } | be zeroed . |
26,386 | public boolean isIdentity ( double tol ) { Point2D pt = Point2D . construct ( 0. , 1. ) ; transform ( pt , pt ) ; pt . sub ( Point2D . construct ( 0. , 1. ) ) ; if ( pt . sqrLength ( ) > tol * tol ) return false ; pt . setCoords ( 0 , 0 ) ; transform ( pt , pt ) ; if ( pt . sqrLength ( ) > tol * tol ) return false ; pt . setCoords ( 1.0 , 0.0 ) ; transform ( pt , pt ) ; pt . sub ( Point2D . construct ( 1.0 , 0.0 ) ) ; return pt . sqrLength ( ) <= tol * tol ; } | Returns TRUE if this matrix is an identity matrix within the given tolerance . |
26,387 | public boolean isUniform ( double eps ) { double v1 = xx * xx + yx * yx ; double v2 = xy * xy + yy * yy ; double e = ( v1 + v2 ) * eps ; return Math . abs ( v1 - v2 ) <= e && Math . abs ( xx * xy + yx * yy ) <= e ; } | Returns TRUE if this transformation is a uniform transformation . |
26,388 | public boolean isShift ( double tol ) { Point2D pt = transformWithoutShift ( Point2D . construct ( 0.0 , 1.0 ) ) ; pt . y -= 1.0 ; if ( pt . sqrLength ( ) > tol * tol ) return false ; pt = transformWithoutShift ( Point2D . construct ( 1.0 , 0.0 ) ) ; pt . x -= 1.0 ; return pt . sqrLength ( ) <= tol * tol ; } | Returns TRUE if this transformation is a shift transformation within the given tolerance . |
26,389 | public boolean isScaleAndShift ( double tol ) { return xy * xy + yx * yx < ( xx * xx + yy * yy ) * tol ; } | Returns TRUE if this transformation does not have rotation and shear within the given tolerance . |
26,390 | public void setShift ( double x , double y ) { xx = 1 ; xy = 0 ; xd = x ; yx = 0 ; yy = 1 ; yd = y ; } | Set this transformation to be a shift . |
26,391 | public void setFlipX ( double x0 , double x1 ) { xx = - 1 ; xy = 0 ; xd = x0 + x1 ; yx = 0 ; yy = 1 ; yd = 0 ; } | Sets the transformation to be a flip around the X axis . Flips the X coordinates so that the x0 becomes x1 and vice verse . |
26,392 | public void setFlipY ( double y0 , double y1 ) { xx = 1 ; xy = 0 ; xd = 0 ; yx = 0 ; yy = - 1 ; yd = y0 + y1 ; } | Sets the transformation to be a flip around the Y axis . Flips the Y coordinates so that the y0 becomes y1 and vice verse . |
26,393 | public void setShear ( double proportionX , double proportionY ) { xx = 1 ; xy = proportionX ; xd = 0 ; yx = proportionY ; yy = 1 ; yd = 0 ; } | Set transformation to a shear . |
26,394 | public void setRotate ( double cosA , double sinA ) { xx = cosA ; xy = - sinA ; xd = 0 ; yx = sinA ; yy = cosA ; yd = 0 ; } | Sets rotation for this transformation . |
26,395 | public void scale ( double x , double y ) { xx *= x ; xy *= x ; xd *= x ; yx *= y ; yy *= y ; yd *= y ; } | Scales the transformation . |
26,396 | public void flipX ( double x0 , double x1 ) { xx = - xx ; xy = - xy ; xd = x0 + x1 - xd ; } | Flips the transformation around the X axis . |
26,397 | public void flipY ( double y0 , double y1 ) { yx = - yx ; yy = - yy ; yd = y0 + y1 - yd ; } | Flips the transformation around the Y axis . |
26,398 | public void shear ( double proportionX , double proportionY ) { Transformation2D temp = new Transformation2D ( ) ; temp . setShear ( proportionX , proportionY ) ; multiply ( temp ) ; } | Shears the transformation . |
26,399 | public void rotate ( double cos , double sin , Point2D rotationCenter ) { Transformation2D temp = new Transformation2D ( ) ; temp . setRotate ( cos , sin , rotationCenter ) ; multiply ( temp ) ; } | Rotates the transformation aroung a center point . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.