本文整理汇总了C#中com.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# com.GetType方法的具体用法?C# com.GetType怎么用?C# com.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com
的用法示例。
在下文中一共展示了com.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WiggleGeometry
//.........这里部分代码省略.........
// WiggleGeometry(env1, 0.00000001, 1982);
// WiggleGeometry(env2, 0.00000001, 511);
// NUnit.Framework.Assert.IsTrue(!equals.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!contains.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(contains.Execute(env2, env1, sr, null));
// NUnit.Framework.Assert.IsTrue(!disjoint.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!touches.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!touches.Execute(env2, env1, sr, null));
// NUnit.Framework.Assert.IsTrue(!overlaps.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!overlaps.Execute(env2, env1, sr, null));
// NUnit.Framework.Assert.IsTrue(!crosses.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!crosses.Execute(env2, env1, sr, null));
// }
// {
// com.esri.core.geometry.Envelope env1 = (com.esri.core.geometry.Envelope)(com.esri.core.geometry.TestCommonMethods.FromJson("{\"xmin\":5,\"ymin\":0,\"xmax\":5,\"ymax\":0}").GetGeometry());
// com.esri.core.geometry.Envelope env2 = (com.esri.core.geometry.Envelope)(com.esri.core.geometry.TestCommonMethods.FromJson("{\"xmin\":5,\"ymin\":0,\"xmax\":5,\"ymax\":0}").GetGeometry());
// WiggleGeometry(env1, 0.00000001, 1982);
// WiggleGeometry(env2, 0.00000001, 511);
// NUnit.Framework.Assert.IsTrue(equals.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(contains.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(contains.Execute(env2, env1, sr, null));
// NUnit.Framework.Assert.IsTrue(!disjoint.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!touches.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!touches.Execute(env2, env1, sr, null));
// NUnit.Framework.Assert.IsTrue(!overlaps.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!overlaps.Execute(env2, env1, sr, null));
// NUnit.Framework.Assert.IsTrue(!crosses.Execute(env1, env2, sr, null));
// NUnit.Framework.Assert.IsTrue(!crosses.Execute(env2, env1, sr, null));
// }
// }
internal static void WiggleGeometry(com.esri.core.geometry.Geometry geometry, double tolerance, int rand)
{
int type = geometry.GetType().Value();
if (type == com.esri.core.geometry.Geometry.GeometryType.Polygon || type == com.esri.core.geometry.Geometry.GeometryType.Polyline || type == com.esri.core.geometry.Geometry.GeometryType.MultiPoint)
{
com.esri.core.geometry.MultiVertexGeometry mvGeom = (com.esri.core.geometry.MultiVertexGeometry)geometry;
for (int i = 0; i < mvGeom.GetPointCount(); i++)
{
com.esri.core.geometry.Point2D pt = mvGeom.GetXY(i);
// create random vector and normalize it to 0.49 * tolerance
com.esri.core.geometry.Point2D randomV = new com.esri.core.geometry.Point2D();
rand = com.esri.core.geometry.NumberUtils.NextRand(rand);
randomV.x = 1.0 * rand / com.esri.core.geometry.NumberUtils.IntMax() - 0.5;
rand = com.esri.core.geometry.NumberUtils.NextRand(rand);
randomV.y = 1.0 * rand / com.esri.core.geometry.NumberUtils.IntMax() - 0.5;
randomV.Normalize();
randomV.Scale(0.45 * tolerance);
pt.Add(randomV);
mvGeom.SetXY(i, pt);
}
}
else
{
if (type == com.esri.core.geometry.Geometry.GeometryType.Point)
{
com.esri.core.geometry.Point ptGeom = (com.esri.core.geometry.Point)(geometry);
com.esri.core.geometry.Point2D pt = ptGeom.GetXY();
// create random vector and normalize it to 0.49 * tolerance
com.esri.core.geometry.Point2D randomV = new com.esri.core.geometry.Point2D();
rand = com.esri.core.geometry.NumberUtils.NextRand(rand);
randomV.x = 1.0 * rand / com.esri.core.geometry.NumberUtils.IntMax() - 0.5;
rand = com.esri.core.geometry.NumberUtils.NextRand(rand);
randomV.y = 1.0 * rand / com.esri.core.geometry.NumberUtils.IntMax() - 0.5;
randomV.Normalize();
randomV.Scale(0.45 * tolerance);
示例2: RgHelper
internal virtual bool RgHelper(com.esri.core.geometry.RasterizedGeometry2D rg, com.esri.core.geometry.MultiPath mp)
{
com.esri.core.geometry.SegmentIterator iter = mp.QuerySegmentIterator();
while (iter.NextPath())
{
while (iter.HasNextSegment())
{
com.esri.core.geometry.Segment seg = iter.NextSegment();
int count = 20;
for (int i = 0; i < count; i++)
{
double t = (1.0 * i / count);
com.esri.core.geometry.Point2D pt = seg.GetCoord2D(t);
com.esri.core.geometry.RasterizedGeometry2D.HitType hit = rg.QueryPointInGeometry(pt.x, pt.y);
if (hit != com.esri.core.geometry.RasterizedGeometry2D.HitType.Border)
{
return false;
}
}
}
}
if (mp.GetType() != com.esri.core.geometry.Geometry.Type.Polygon)
{
return true;
}
com.esri.core.geometry.Polygon poly = (com.esri.core.geometry.Polygon)mp;
com.esri.core.geometry.Envelope2D env = new com.esri.core.geometry.Envelope2D();
poly.QueryEnvelope2D(env);
int count_1 = 100;
for (int iy = 0; iy < count_1; iy++)
{
double ty = 1.0 * iy / count_1;
double y = env.ymin * (1.0 - ty) + ty * env.ymax;
for (int ix = 0; ix < count_1; ix++)
{
double tx = 1.0 * ix / count_1;
double x = env.xmin * (1.0 - tx) + tx * env.xmax;
com.esri.core.geometry.RasterizedGeometry2D.HitType hit = rg.QueryPointInGeometry(x, y);
com.esri.core.geometry.PolygonUtils.PiPResult res = com.esri.core.geometry.PolygonUtils.IsPointInPolygon2D(poly, new com.esri.core.geometry.Point2D(x, y), 0);
if (res == com.esri.core.geometry.PolygonUtils.PiPResult.PiPInside)
{
bool bgood = (hit == com.esri.core.geometry.RasterizedGeometry2D.HitType.Border || hit == com.esri.core.geometry.RasterizedGeometry2D.HitType.Inside);
if (!bgood)
{
return false;
}
}
else
{
if (res == com.esri.core.geometry.PolygonUtils.PiPResult.PiPOutside)
{
bool bgood = (hit == com.esri.core.geometry.RasterizedGeometry2D.HitType.Border || hit == com.esri.core.geometry.RasterizedGeometry2D.HitType.Outside);
if (!bgood)
{
return false;
}
}
else
{
bool bgood = (hit == com.esri.core.geometry.RasterizedGeometry2D.HitType.Border);
if (!bgood)
{
return false;
}
}
}
}
}
return true;
}