コード例 #1
0
        public void TestMultipatchConversionWithMultipleRings()
        {
            Rectangular[] positions = new[]
                                          {
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(5.0, 10.0),
                                              new Rectangular(10.0, 5.0),
                                              new Rectangular(5.0, 0.0),
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(2.0, 5.0),
                                              new Rectangular(5.0, 2.0),
                                              new Rectangular(8.0, 5.0),
                                              new Rectangular(5.0, 8.0),
                                              new Rectangular(2.0, 5.0)
                                          };

            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 10.0, 10.0);
            int[] parts = new[] { 0, 5 };
            MultiPatchPartType[] partTypes = new[] { MultiPatchPartType.Ring, MultiPatchPartType.Ring };

            double[] zValues = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
            double[] measures = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

            MultiPatchShape multipatch = new MultiPatchShape(0, m_metadata, extent, parts, partTypes, positions, 0.0, 0.0, zValues, 0.0, 0.0, measures);
            MultiPatch patch = new MultiPatch(multipatch, m_document, Color.Blue);
            patch.Write();
            string result = m_stringWriter.ToString();
            Regex polygonPattern = new Regex(m_polygonPattern);
            Assert.AreEqual(2, polygonPattern.Matches(result).Count);
        }
コード例 #2
0
        public void TestMultipatchConversionWithTriangleStrip()
        {
            Rectangular[] positions = new[]
                                          {
                                              new Rectangular(0.0, 0.0),
                                              new Rectangular(0.0, 1.0),
                                              new Rectangular(1.0, 0.0),
                                              new Rectangular(1.0, 1.0),
                                              new Rectangular(2.0, 0.0),
                                              new Rectangular(2.0, 1.0),
                                              new Rectangular(3.0, 0.0)
                                          };

            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 3.0, 1.0);
            int[] parts = new[] { 0 };
            MultiPatchPartType[] partTypes = new[] { MultiPatchPartType.TriangleStrip };

            double[] zValues = new[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 };
            double[] measures = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

            MultiPatchShape multipatch = new MultiPatchShape(0, m_metadata, extent, parts, partTypes, positions, 0.0, 0.0, zValues, 0.0, 0.0, measures);
            MultiPatch patch = new MultiPatch(multipatch, m_document, Color.Blue);
            patch.Write();
            string result = m_stringWriter.ToString();
            Regex trianglePattern = new Regex(m_trianglePattern);
            Assert.AreEqual(5, trianglePattern.Matches(result).Count);
        }
コード例 #3
0
        public void TestMultipatchConversionWithInnerAndOuterRings()
        {
            Rectangular[] positions = new[]
                                          {
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(5.0, 10.0),
                                              new Rectangular(10.0, 5.0),
                                              new Rectangular(5.0, 0.0),
                                              new Rectangular(0.0, 5.0),
                                              new Rectangular(2.0, 5.0),
                                              new Rectangular(5.0, 2.0),
                                              new Rectangular(8.0, 5.0),
                                              new Rectangular(5.0, 8.0),
                                              new Rectangular(2.0, 5.0)
                                          };

            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 10.0, 10.0);
            int[] parts = new[] { 0, 5 };
            MultiPatchPartType[] partTypes = new[] { MultiPatchPartType.OuterRing, MultiPatchPartType.InnerRing };

            double[] zValues = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
            double[] measures = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

            MultiPatchShape multipatch = new MultiPatchShape(0, m_metadata, extent, parts, partTypes, positions, 0.0, 0.0, zValues, 0.0, 0.0, measures);
            MultiPatch patch = new MultiPatch(multipatch, m_document, Color.Blue);
            patch.Write();
            string result = m_stringWriter.ToString();
            Assert.IsTrue(Regex.IsMatch(result, m_polygonPattern));
        }