Esempio n. 1
0
 public virtual void testOffsetPoint()
 {
     try
     {
         com.esri.core.geometry.Point point = new com.esri.core.geometry.Point();
         point.setXY(0, 0);
         com.esri.core.geometry.OperatorOffset offset = (com.esri.core.geometry.OperatorOffset
                                                         )com.esri.core.geometry.OperatorFactoryLocal.getInstance().getOperator(com.esri.core.geometry.Operator.Type
                                                                                                                                .Offset);
         com.esri.core.geometry.Geometry outputGeom = offset.execute(point, null, 2, com.esri.core.geometry.OperatorOffset.JoinType
                                                                     .Round, 2, 0, null);
         NUnit.Framework.Assert.IsNull(outputGeom);
     }
     catch (System.Exception)
     {
     }
     try
     {
         com.esri.core.geometry.MultiPoint mp = new com.esri.core.geometry.MultiPoint();
         mp.add(0, 0);
         mp.add(10, 10);
         com.esri.core.geometry.OperatorOffset offset = (com.esri.core.geometry.OperatorOffset
                                                         )com.esri.core.geometry.OperatorFactoryLocal.getInstance().getOperator(com.esri.core.geometry.Operator.Type
                                                                                                                                .Offset);
         com.esri.core.geometry.Geometry outputGeom = offset.execute(mp, null, 2, com.esri.core.geometry.OperatorOffset.JoinType
                                                                     .Round, 2, 0, null);
         NUnit.Framework.Assert.IsNull(outputGeom);
     }
     catch (System.Exception)
     {
     }
 }
Esempio n. 2
0
 public virtual void OffsetPolygon_(double distance, com.esri.core.geometry.OperatorOffset.JoinType
                                    joins)
 {
     com.esri.core.geometry.Polygon polygon = new com.esri.core.geometry.Polygon();
     polygon.startPath(0, 0);
     polygon.lineTo(0, 16);
     polygon.lineTo(16, 16);
     polygon.lineTo(16, 11);
     polygon.lineTo(10, 10);
     polygon.lineTo(10, 12);
     polygon.lineTo(3, 12);
     polygon.lineTo(3, 4);
     polygon.lineTo(10, 4);
     polygon.lineTo(10, 6);
     polygon.lineTo(16, 5);
     polygon.lineTo(16, 0);
     com.esri.core.geometry.OperatorOffset offset = (com.esri.core.geometry.OperatorOffset
                                                     )com.esri.core.geometry.OperatorFactoryLocal.getInstance().getOperator(com.esri.core.geometry.Operator.Type
                                                                                                                            .Offset);
     com.esri.core.geometry.Geometry outputGeom = offset.execute(polygon, null, distance
                                                                 , joins, 2, 0, null);
     NUnit.Framework.Assert.IsNotNull(outputGeom);
     if (distance > 2)
     {
         NUnit.Framework.Assert.IsTrue(outputGeom.isEmpty());
     }
 }
Esempio n. 3
0
 public virtual void OffsetPolyline_(double distance, com.esri.core.geometry.OperatorOffset.JoinType
                                     joins)
 {
     com.esri.core.geometry.Polyline polyline = new com.esri.core.geometry.Polyline();
     polyline.startPath(0, 0);
     polyline.lineTo(6, 0);
     polyline.lineTo(6, 1);
     polyline.lineTo(4, 1);
     polyline.lineTo(4, 2);
     polyline.lineTo(10, 2);
     com.esri.core.geometry.OperatorOffset offset = (com.esri.core.geometry.OperatorOffset
                                                     )com.esri.core.geometry.OperatorFactoryLocal.getInstance().getOperator(com.esri.core.geometry.Operator.Type
                                                                                                                            .Offset);
     com.esri.core.geometry.Geometry outputGeom = offset.execute(polyline, null, distance
                                                                 , joins, 2, 0, null);
     NUnit.Framework.Assert.IsNotNull(outputGeom);
 }