Exemple #1
0
        public void TestPolygonZValues()
        {
            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)
            };

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

            CartographicExtent extent = new CartographicExtent(0.0, 0.0, 10.0, 10.0);

            int[]    parts    = new[] { 0, 5 };
            double[] measures = new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };

            PolygonZShape polygonZShape = new PolygonZShape(0, m_metadata, extent, parts, positions, 1.0, 8.0, zValues, 0.0, 0.0, measures);
            Polygon       polygon       = new Polygon(polygonZShape, m_document, Color.Blue);

            polygon.Write();
            string result = m_stringWriter.ToString();

            Assert.IsTrue(Regex.IsMatch(result, m_polygonPattern));
        }
Exemple #2
0
        public void TestPolygonZShapeType()
        {
            double[]      zValues  = new double[] { 1.0, 2.0, 3.0, 4.0, 1.0 };
            double[]      measures = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0 };
            PolygonZShape polygon  = new PolygonZShape(1, m_metadata, m_extent, m_parts, m_positions, 1.0, 2.0, zValues, 0.0, 0.0, measures);

            Assert.AreEqual(ShapeType.PolygonZ, polygon.ShapeType);
        }
Exemple #3
0
        public void TestPolygonZPositions()
        {
            double[]      zValues  = new double[] { 1.0, 2.0, 3.0, 4.0, 1.0 };
            double[]      measures = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0 };
            PolygonZShape polygon  = new PolygonZShape(1, m_metadata, m_extent, m_parts, m_positions, 1.0, 2.0, zValues, 0.0, 0.0, measures);

            Assert.AreEqual(polygon[0][0], new Cartographic(0.0, 0.0, 1.0));
            Assert.AreEqual(polygon[0][1], new Cartographic(0.0, Constants.RadiansPerDegree, 2.0));
            Assert.AreEqual(polygon[0][2], new Cartographic(Constants.RadiansPerDegree, Constants.RadiansPerDegree, 3.0));
            Assert.AreEqual(polygon[0][3], new Cartographic(Constants.RadiansPerDegree, 0.0, 4.0));
            Assert.AreEqual(polygon[0][4], new Cartographic(0.0, 0.0, 1.0));
        }