public static void testEnvelope2Dintersector() { System.Collections.Generic.List <com.esri.core.geometry.Envelope2D> envelopes = new System.Collections.Generic.List <com.esri.core.geometry.Envelope2D>(0); com.esri.core.geometry.Envelope2D env0 = new com.esri.core.geometry.Envelope2D(2, 3, 4, 4); com.esri.core.geometry.Envelope2D env1 = new com.esri.core.geometry.Envelope2D(5, 13, 9, 15); com.esri.core.geometry.Envelope2D env2 = new com.esri.core.geometry.Envelope2D(6, 9, 11, 12); com.esri.core.geometry.Envelope2D env3 = new com.esri.core.geometry.Envelope2D(8, 10, 9, 17); com.esri.core.geometry.Envelope2D env4 = new com.esri.core.geometry.Envelope2D(11.001 , 12, 14, 14); com.esri.core.geometry.Envelope2D env5 = new com.esri.core.geometry.Envelope2D(1, 3, 3, 4); com.esri.core.geometry.Envelope2D env6 = new com.esri.core.geometry.Envelope2D(0, 2, 5, 10); com.esri.core.geometry.Envelope2D env7 = new com.esri.core.geometry.Envelope2D(4, 7, 5, 10); com.esri.core.geometry.Envelope2D env8 = new com.esri.core.geometry.Envelope2D(3, 15, 15, 15); com.esri.core.geometry.Envelope2D env9 = new com.esri.core.geometry.Envelope2D(0, 9, 14, 9); com.esri.core.geometry.Envelope2D env10 = new com.esri.core.geometry.Envelope2D(0 , 8.999, 14, 8.999); envelopes.add(env0); envelopes.add(env1); envelopes.add(env2); envelopes.add(env3); envelopes.add(env4); envelopes.add(env5); envelopes.add(env6); envelopes.add(env7); envelopes.add(env8); envelopes.add(env9); envelopes.add(env10); com.esri.core.geometry.Envelope2DIntersectorImpl intersector = new com.esri.core.geometry.Envelope2DIntersectorImpl (); intersector.setTolerance(0.001); intersector.startConstruction(); for (int i = 0; i < envelopes.Count; i++) { intersector.addEnvelope(i, envelopes[i]); } intersector.endConstruction(); int count = 0; while (intersector.next()) { int env_a = intersector.getHandleA(); int env_b = intersector.getHandleB(); count++; com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D(); env.setCoords(envelopes[env_a]); env.inflate(0.001, 0.001); NUnit.Framework.Assert.IsTrue(env.isIntersecting(envelopes[env_b])); } System.Diagnostics.Debug.Assert((count == 16)); com.esri.core.geometry.Envelope2DIntersectorImpl intersector2 = new com.esri.core.geometry.Envelope2DIntersectorImpl (); intersector2.setTolerance(0.0); intersector2.startConstruction(); for (int i_1 = 0; i_1 < envelopes.Count; i_1++) { intersector2.addEnvelope(i_1, envelopes[i_1]); } intersector2.endConstruction(); count = 0; while (intersector2.next()) { int env_a = intersector2.getHandleA(); int env_b = intersector2.getHandleB(); count++; com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D(); env.setCoords(envelopes[env_a]); NUnit.Framework.Assert.IsTrue(env.isIntersecting(envelopes[env_b])); } System.Diagnostics.Debug.Assert((count == 13)); env0 = new com.esri.core.geometry.Envelope2D(0, 0, 0, 10); env1 = new com.esri.core.geometry.Envelope2D(0, 10, 10, 10); env2 = new com.esri.core.geometry.Envelope2D(10, 0, 10, 10); env3 = new com.esri.core.geometry.Envelope2D(0, 0, 10, 0); envelopes.clear(); envelopes.add(env0); envelopes.add(env1); envelopes.add(env2); envelopes.add(env3); com.esri.core.geometry.Envelope2DIntersectorImpl intersector3 = new com.esri.core.geometry.Envelope2DIntersectorImpl (); intersector3.setTolerance(0.001); intersector3.startConstruction(); for (int i_2 = 0; i_2 < envelopes.Count; i_2++) { intersector3.addEnvelope(i_2, envelopes[i_2]); } intersector3.endConstruction(); count = 0; while (intersector3.next()) { int env_a = intersector3.getHandleA(); int env_b = intersector3.getHandleB(); count++; com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D(); env.setCoords(envelopes[env_a]); NUnit.Framework.Assert.IsTrue(env.isIntersecting(envelopes[env_b])); } NUnit.Framework.Assert.IsTrue(count == 4); env0 = new com.esri.core.geometry.Envelope2D(0, 0, 0, 10); envelopes.clear(); envelopes.add(env0); envelopes.add(env0); envelopes.add(env0); envelopes.add(env0); com.esri.core.geometry.Envelope2DIntersectorImpl intersector4 = new com.esri.core.geometry.Envelope2DIntersectorImpl (); intersector4.setTolerance(0.001); intersector4.startConstruction(); for (int i_3 = 0; i_3 < envelopes.Count; i_3++) { intersector4.addEnvelope(i_3, envelopes[i_3]); } intersector4.endConstruction(); count = 0; while (intersector4.next()) { int env_a = intersector4.getHandleA(); int env_b = intersector4.getHandleB(); count++; com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D(); env.setCoords(envelopes[env_a]); NUnit.Framework.Assert.IsTrue(env.isIntersecting(envelopes[env_b])); } System.Diagnostics.Debug.Assert((count == 6)); env0 = new com.esri.core.geometry.Envelope2D(0, 10, 10, 10); envelopes.clear(); envelopes.add(env0); envelopes.add(env0); envelopes.add(env0); envelopes.add(env0); com.esri.core.geometry.Envelope2DIntersectorImpl intersector5 = new com.esri.core.geometry.Envelope2DIntersectorImpl (); intersector5.setTolerance(0.001); intersector5.startConstruction(); for (int i_4 = 0; i_4 < envelopes.Count; i_4++) { intersector5.addEnvelope(i_4, envelopes[i_4]); } intersector5.endConstruction(); count = 0; while (intersector5.next()) { int env_a = intersector5.getHandleA(); int env_b = intersector5.getHandleB(); count++; com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D(); env.setCoords(envelopes[env_a]); NUnit.Framework.Assert.IsTrue(env.isIntersecting(envelopes[env_b])); } NUnit.Framework.Assert.IsTrue(count == 6); }