本文整理汇总了C#中CoordinateSystem类的典型用法代码示例。如果您正苦于以下问题:C# CoordinateSystem类的具体用法?C# CoordinateSystem怎么用?C# CoordinateSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoordinateSystem类属于命名空间,在下文中一共展示了CoordinateSystem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReadMultiLineString
/// <summary>
/// Reads a <see cref="IMultiLineString"/> geometry.
/// </summary>
/// <param name="reader">The reader</param>
/// <param name="cs">The coordinate system</param>
///<param name="srid">The spatial reference id for the geometry.</param>
///<returns>A <see cref="IMultiLineString"/> geometry</returns>
protected IGeometry ReadMultiLineString(BinaryReader reader, CoordinateSystem cs, int srid)
{
IGeometryFactory factory = _geometryServices.CreateGeometryFactory(_precisionModel, srid, _sequenceFactory);
int numGeometries = reader.ReadInt32();
ILineString[] strings = new ILineString[numGeometries];
for (int i = 0; i < numGeometries; i++)
{
ReadByteOrder(reader);
CoordinateSystem cs2;
int srid2;
WKBGeometryTypes geometryType = ReadGeometryType(reader, out cs2, out srid2);//(WKBGeometryTypes) reader.ReadInt32();
if (geometryType != WKBGeometryTypes.WKBLineString)
throw new ArgumentException("ILineString feature expected");
strings[i] = ReadLineString(reader, cs2, srid2) as ILineString;
}
return factory.CreateMultiLineString(strings);
}
开发者ID:leoliusg,项目名称:NetTopologySuite,代码行数:24,代码来源:WKBReader.cs
示例2: CalculateCalloutLocation
public override bool CalculateCalloutLocation(out PointF location, out CoordinateSystem coordinateSystem)
{
// if the user has manually positioned the callout, we won't override it
if (_manuallyPositionedCallout)
{
location = PointF.Empty;
coordinateSystem = CoordinateSystem.Destination;
return false;
}
Callout.CoordinateSystem = CoordinateSystem.Destination;
AnnotationSubject.CoordinateSystem = CoordinateSystem.Destination;
try
{
var roiBoundingBox = AnnotationSubject.BoundingBox;
var clientRectangle = AnnotationSubject.ParentPresentationImage.ClientRectangle;
var textSize = Callout.TextBoundingBox.Size;
if (textSize.IsEmpty)
textSize = new SizeF(100, 50);
coordinateSystem = CoordinateSystem.Destination;
location = new PointF(ComputeCalloutLocationX(textSize, clientRectangle, roiBoundingBox), ComputeCalloutLocationY(textSize, clientRectangle, roiBoundingBox));
}
finally
{
Callout.ResetCoordinateSystem();
AnnotationSubject.ResetCoordinateSystem();
}
return true;
}
开发者ID:nhannd,项目名称:Xian,代码行数:31,代码来源:DefaultRoiCalloutLocationStrategy.cs
示例3: InvalidOperationException
AnnotationGraphic IDrawProtractor.Draw(CoordinateSystem coordinateSystem, string name, PointF point1, PointF vertex, PointF point2)
{
var image = Context.Viewer.SelectedPresentationImage;
if (!CanStart(image))
throw new InvalidOperationException("Can't draw a protractor at this time.");
var imageGraphic = ((IImageGraphicProvider) image).ImageGraphic;
if (coordinateSystem == CoordinateSystem.Destination)
{
point1 = imageGraphic.SpatialTransform.ConvertToSource(point1);
vertex = imageGraphic.SpatialTransform.ConvertToSource(vertex);
point2 = imageGraphic.SpatialTransform.ConvertToSource(point2);
}
var overlayProvider = (IOverlayGraphicsProvider) image;
var roiGraphic = CreateRoiGraphic(false);
roiGraphic.Name = name;
AddRoiGraphic(image, roiGraphic, overlayProvider);
var subject = (IPointsGraphic) roiGraphic.Subject;
subject.Points.Add(point1);
subject.Points.Add(vertex);
subject.Points.Add(point2);
roiGraphic.Callout.Update();
roiGraphic.State = roiGraphic.CreateSelectedState();
return roiGraphic;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:28,代码来源:ProtractorTool.cs
示例4: Geometry
/// <summary>Initializes a new instance of the <see cref="T:Microsoft.Spatial.Geometry" /> class.</summary>
/// <param name="coordinateSystem">The coordinate system of this instance.</param>
/// <param name="creator">The implementation that created this instance.</param>
protected Geometry(CoordinateSystem coordinateSystem, SpatialImplementation creator)
{
Util.CheckArgumentNull(coordinateSystem, "coordinateSystem");
Util.CheckArgumentNull(creator, "creator");
this.coordinateSystem = coordinateSystem;
this.creator = creator;
}
开发者ID:larsenjo,项目名称:odata.net,代码行数:10,代码来源:Geometry.cs
示例5: YuvPlanar
protected YuvPlanar(Buffer.Sized buffer, Geometry2D.Integer.Size size, CoordinateSystem coordinateSystem, Geometry2D.Integer.Shell crop) :
base(buffer, size, coordinateSystem, crop)
{
this.Y = this.CreateY();
this.U = this.CreateU();
this.V = this.CreateV();
}
开发者ID:imintsystems,项目名称:Kean,代码行数:7,代码来源:YuvPlanar.cs
示例6: Image
protected Image(Geometry2D.Integer.Size size, CoordinateSystem coordinateSystem, Geometry2D.Integer.Shell crop) :
base(size, coordinateSystem, crop)
{
this.LeftTop = new Geometry2D.Single.Point(0, 0);
this.RightTop = new Geometry2D.Single.Point(1, 0);
this.LeftBottom = new Geometry2D.Single.Point(0, 1);
this.RightBottom = new Geometry2D.Single.Point(1, 1);
}
开发者ID:imintsystems,项目名称:Kean,代码行数:8,代码来源:Image.cs
示例7: Linear
public Linear(CoordinateSystem entity, Vector2 direction)
{
PathAwareEntity = entity as PathAware;
Position = entity.Position;
if (direction.X != 0 || direction.Y != 0)
{
direction.Normalize();
}
Direction = direction;
}
开发者ID:jallarzie,项目名称:spectrum,代码行数:10,代码来源:Linear.cs
示例8: AreEqual
public static void AreEqual(CoordinateSystem expected, CoordinateSystem actual, double tolerance = 1e-6, string message = "")
{
if (string.IsNullOrEmpty(message))
message = string.Format("Expected {0} but was {1}", expected, actual);
if (expected.Values.Length != actual.Values.Length)
Assert.Fail();
for (int i = 0; i < expected.Values.Length; i++)
{
Assert.AreEqual(expected.Values[i], actual.Values[i], tolerance);
}
}
开发者ID:EMostafaAli,项目名称:mathnet-spatial,代码行数:11,代码来源:AssertGeometry.cs
示例9: ReadPolygonTest
private void ReadPolygonTest(string input, CoordinateSystem expectedReference, params PositionData[][] expected)
{
var p = this.d4Formatter.Read<Geography>(new StringReader(input));
Assert.NotNull(p);
p.VerifyAsPolygon(expected);
if (expectedReference != null)
{
Assert.Equal(p.CoordinateSystem, expectedReference);
}
}
开发者ID:AlineGuan,项目名称:odata.net,代码行数:11,代码来源:WellKnownTextSqlFormatterTests.cs
示例10: ReadPointTest
private static void ReadPointTest(SpatialFormatter<TextReader, TextWriter> formatter, TextReader input, PositionData expected, CoordinateSystem expectedCoordinateSystem = null)
{
var p = formatter.Read<Geography>(input);
Assert.NotNull(p);
p.VerifyAsPoint(expected);
if (expectedCoordinateSystem != null)
{
Assert.Equal(p.CoordinateSystem, expectedCoordinateSystem);
}
}
开发者ID:AlineGuan,项目名称:odata.net,代码行数:11,代码来源:WellKnownTextSqlFormatterTests.cs
示例11: Create
public static GeographyPoint Create(CoordinateSystem coordinateSystem, double latitude, double longitude, double? z, double? m)
{
var builder = SpatialBuilder.Create();
var pipeline = builder.GeographyPipeline;
pipeline.SetCoordinateSystem(coordinateSystem);
pipeline.BeginGeography(SpatialType.Point);
pipeline.BeginFigure(new GeographyPosition(latitude, longitude, z, m));
pipeline.EndFigure();
pipeline.EndGeography();
return (GeographyPoint)builder.ConstructedGeography;
}
开发者ID:larsenjo,项目名称:odata.net,代码行数:11,代码来源:GeographyPoint.cs
示例12: Create
public static GeometryPoint Create(CoordinateSystem coordinateSystem, double x, double y, double? z, double? m)
{
var builder = SpatialBuilder.Create();
var pipeline = builder.GeometryPipeline;
pipeline.SetCoordinateSystem(coordinateSystem);
pipeline.BeginGeometry(SpatialType.Point);
pipeline.BeginFigure(new GeometryPosition(x, y, z, m));
pipeline.EndFigure();
pipeline.EndGeometry();
return (GeometryPoint)builder.ConstructedGeometry;
}
开发者ID:larsenjo,项目名称:odata.net,代码行数:11,代码来源:GeometryPoint.cs
示例13: CalculateCalloutEndPoint
public override void CalculateCalloutEndPoint(out PointF endPoint, out CoordinateSystem coordinateSystem)
{
if (_userMovedCallout)
{
base.CalculateCalloutEndPoint(out endPoint, out coordinateSystem);
}
else
{
coordinateSystem = AnnotationSubject.CoordinateSystem;
if (this.Roi.Points.Count < 3)
endPoint = this.Roi.Points[0];
else
endPoint = this.Roi.Points[1];
}
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:16,代码来源:ProtractorRoiCalloutLocationStrategy.cs
示例14: ShouldConvertPointsFromWgs84ToLambert93
public void ShouldConvertPointsFromWgs84ToLambert93()
{
var wgs84=new CoordinateSystem(new DotGeo.World().WGS1984);
var lam93=new CoordinateSystem(new DotPrj.NationalGrids().RGF1993Lambert93);
var ct=new CoordinatesTransformer(wgs84, lam93);
foreach (var coordinates in new double[][][] { _Paris, _NewYorkCity })
{
var input=coordinates[0];
var expected=coordinates[1];
var result=ct.Convert(input);
Assert.Equal(expected, result, new CoordinateComparer(2));
}
}
开发者ID:mcartoixa,项目名称:GeoSIK,代码行数:16,代码来源:CoordinatesTransformer.cs
示例15: CalculateCalloutLocation
public override bool CalculateCalloutLocation(out PointF location, out CoordinateSystem coordinateSystem)
{
if (this.Roi.Points.Count < 3 || string.IsNullOrEmpty(this.Callout.Text))
base.Callout.Visible = false;
else
base.Callout.Visible = true;
if (!base.Callout.Visible || _userMovedCallout)
return base.CalculateCalloutLocation(out location, out coordinateSystem);
SizeF calloutOffsetDestination = GetCalloutOffsetDestination();
coordinateSystem = CoordinateSystem.Destination;
base.AnnotationGraphic.CoordinateSystem = coordinateSystem;
// first, move the callout by the same amount the vertex moved (if it moved at all).
location = base.Callout.TextLocation + calloutOffsetDestination;
PointF start = this.Roi.Points[0];
PointF vertex = this.Roi.Points[1];
PointF end = this.Roi.Points[2];
base.AnnotationGraphic.ResetCoordinateSystem();
double vectorAngle = -Vector.SubtendedAngle(start, vertex, end) / 2 + 180;
PointF[] points = new PointF[] { start, end };
using (Matrix rotation = new Matrix())
{
rotation.Rotate((float) vectorAngle);
rotation.Translate(-vertex.X, -vertex.Y);
rotation.TransformPoints(points);
}
float calloutMagnitude = new Vector3D(location.X - vertex.X, location.Y - vertex.Y, 0).Magnitude;
Vector3D startVector = new Vector3D(points[0].X, points[0].Y, 0);
if (FloatComparer.AreEqual(startVector.Magnitude, 0F, 0.01F))
startVector = new Vector3D(-1, 0, 0);
startVector = startVector / startVector.Magnitude * calloutMagnitude;
location = new PointF(startVector.X + vertex.X, startVector.Y + vertex.Y);
return true;
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:47,代码来源:ProtractorRoiCalloutLocationStrategy.cs
示例16: CreateNewCoordinateSystem
private void CreateNewCoordinateSystem(int id)
{
if((31 - m_coordinateSystems.Count) < 15)
{
throw new OverflowException("Too many coordinate systems in use.");
}
var coordSystem = new CoordinateSystem();
coordSystem.objects = new List<GameObject>();
coordSystem.layerNumber = (31 - m_coordinateSystems.Count);
coordSystem.cullingMask = 1 << coordSystem.layerNumber;
coordSystem.camera = Instantiate(m_cameraPrefab);
// Add new camera under "Cameras"-entity.
coordSystem.camera.transform.parent = transform.parent.FindChild("Cameras");
coordSystem.camera.GetComponent<Camera>().cullingMask = coordSystem.cullingMask;
m_coordinateSystems[id] = coordSystem;
}
开发者ID:ndob,项目名称:yarrar,代码行数:18,代码来源:PipelineManager.cs
示例17: Entity2D
public Entity2D(Texture2D texture, CoordinateSystem parent)
{
SourceRectangle = null;
Dirty = false;
Texture = texture;
Parent = parent;
BoundingArea = new Sphere(new Vector2(0, 0), 1);
Position = new Vector2(0, 0);
Rotation = 0f;
Scale = 1f;
Tint = Color.White;
Origin = new Vector2(0, 0);
Layer = 0f;
Opacity = 1f;
Flip = SpriteEffects.None;
}
开发者ID:jallarzie,项目名称:spectrum,代码行数:19,代码来源:Entity2D.cs
示例18: CalculateCalloutLocation
public override bool CalculateCalloutLocation(out PointF location, out CoordinateSystem coordinateSystem)
{
// if the user has manually positioned the callout, we won't override it
if (_manuallyPositionedCallout || Roi.Points.Count == 0)
{
location = PointF.Empty;
coordinateSystem = CoordinateSystem.Destination;
return false;
}
Callout.CoordinateSystem = CoordinateSystem.Destination;
Roi.CoordinateSystem = CoordinateSystem.Destination;
try
{
var roiPoint1 = Roi.Points[0];
var roiPoint2 = Roi.Points[Roi.Points.Count - 1];
var clientRectangle = Roi.ParentPresentationImage.ClientRectangle;
var textSize = Callout.TextBoundingBox.Size;
if (textSize.IsEmpty)
textSize = new SizeF(100, 50);
var calloutLocation = new PointF();
calloutLocation.Y = ComputeCalloutLocationY(textSize, clientRectangle, roiPoint1, roiPoint2);
calloutLocation.X = ComputeCalloutLocationX(textSize, clientRectangle, roiPoint1, roiPoint2, calloutLocation.Y);
coordinateSystem = CoordinateSystem.Destination;
location = calloutLocation;
}
finally
{
Callout.ResetCoordinateSystem();
Roi.ResetCoordinateSystem();
}
return true;
}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:36,代码来源:RulerCalloutLocationStrategy.cs
示例19: Yuv444
public Yuv444(Buffer.Sized buffer, Geometry2D.Integer.Size size, CoordinateSystem coordinateSystem, Geometry2D.Integer.Shell crop) :
base(buffer, size, coordinateSystem, crop)
{ }
开发者ID:imintsystems,项目名称:Kean,代码行数:3,代码来源:Yuv444.cs
示例20: ConvertSweepAngle
internal static float ConvertSweepAngle(float sweepAngle, float startAngle, SpatialTransform transform, CoordinateSystem targetSystem)
{
PointF x = new PointF(100, 0);
PointF[] startVector = new PointF[] { x };
Matrix rotation = new Matrix();
rotation.Rotate(startAngle);
rotation.TransformVectors(startVector);
PointF[] sweepVector = (PointF[])startVector.Clone();
rotation.Reset();
rotation.Rotate(sweepAngle);
rotation.TransformVectors(sweepVector);
rotation.Dispose();
SizeF startVectorTransformed, sweepVectorTransformed;
if (targetSystem == Graphics.CoordinateSystem.Destination)
{
startVectorTransformed = transform.ConvertToDestination(new SizeF(startVector[0]));
sweepVectorTransformed = transform.ConvertToDestination(new SizeF(sweepVector[0]));
}
else
{
startVectorTransformed = transform.ConvertToSource(new SizeF(startVector[0]));
sweepVectorTransformed = transform.ConvertToSource(new SizeF(sweepVector[0]));
}
// simply return the angle between the start and sweep angle, in the target system.
return (int)Math.Round(Vector.SubtendedAngle(sweepVectorTransformed.ToPointF(), PointF.Empty, startVectorTransformed.ToPointF()));
}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:30,代码来源:ArcPrimitive.cs
注:本文中的CoordinateSystem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论