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 ; // when treated as an area, lines cannot contain // areas. if ( env_b . getHeight ( ) <= tolerance && env_b . getWidth ( ) <= tolerance ) { // Treat // as // point Point2D pt_b = envelope_b . getCenterXY ( ) ; return linearPathContainsPoint_ ( polyline_a , pt_b , tolerance ) ; } // Treat as polyline 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 .