本文整理汇总了C#中Geometry类的典型用法代码示例。如果您正苦于以下问题:C# Geometry类的具体用法?C# Geometry怎么用?C# Geometry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Geometry类属于命名空间,在下文中一共展示了Geometry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Create
public virtual void Create(int x, int y, Geometry geometry, Tile[] sides)
{
geometry.CreateFace(x, 0, y, Geometry.Direction.east);
geometry.CreateFace(x, 0, y, Geometry.Direction.west);
geometry.CreateFace(x, 0, y, Geometry.Direction.up);
geometry.CreateFace(x, 0, y, Geometry.Direction.down);
}
开发者ID:Munkkeli,项目名称:Unity-Room-Editor-Source,代码行数:7,代码来源:Tile.cs
示例2: Model
/// <summary>
/// Initializes a new instance of the <see cref="nginz.Model"/> class.
/// </summary>
/// <param name="geometry">Geometry.</param>
public Model(Geometry geometry)
{
Geometry = geometry;
Position = Vector3.Zero;
Scale = Vector3.One;
Rotation = Vector3.Zero;
}
开发者ID:splitandthechro,项目名称:nginz,代码行数:11,代码来源:Model.cs
示例3: GeographyContains
public GeographyContains(Geometry ContainingObject, Geometry ContainedObject)
{
this.ContainingObject = ContainingObject;
this.ContainingObjectType = ValueObjectType.Value;
this.ContainedObject = ContainedObject;
this.ContainedObjectType = ValueObjectType.Value;
}
开发者ID:ycaihua,项目名称:dg.Sql,代码行数:7,代码来源:GeographyContains.cs
示例4: SymDifference
public static Geometry SymDifference(Geometry g1, Geometry g2)
{
SqlGeometry sg1 = SqlGeometryConverter.ToSqlGeometry(g1);
SqlGeometry sg2 = SqlGeometryConverter.ToSqlGeometry(g2);
SqlGeometry sgSymDifference = sg1.STSymDifference(sg2);
return SqlGeometryConverter.ToSharpMapGeometry(sgSymDifference);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:7,代码来源:SpatialOperationsEx.cs
示例5: Intersection
public static Geometry Intersection(Geometry g1, Geometry g2)
{
SqlGeometry sg1 = SqlGeometryConverter.ToSqlGeometry(g1);
SqlGeometry sg2 = SqlGeometryConverter.ToSqlGeometry(g2);
SqlGeometry sgIntersection = sg1.STIntersection(sg2);
return SqlGeometryConverter.ToSharpMapGeometry(sgIntersection);
}
开发者ID:lishxi,项目名称:_SharpMap,代码行数:7,代码来源:SpatialOperationsEx.cs
示例6: GeographyContains
public GeographyContains(Geometry outerValue, Geometry innerValue)
{
this.OuterValue = outerValue;
this.OuterValueType = ValueObjectType.Value;
this.InnerValue = innerValue;
this.InnerValueType = ValueObjectType.Value;
}
开发者ID:danielgindi,项目名称:dg.Sql,代码行数:7,代码来源:GeographyContains.cs
示例7: ParseGeometryLibrary_GeometryMesh
public void ParseGeometryLibrary_GeometryMesh(XmlNode MeshNode, Geometry CurrentGeometry)
{
Console.WriteLine("Entered MeshNode");
Mesh CurrentMesh = new Mesh();
for (int i = 0; i < MeshNode.ChildNodes.Count; i++)
{
if (MeshNode.ChildNodes[i].Name.Equals("source"))
{
ParseGeometryLibrary_GeometryMeshSource(MeshNode.ChildNodes[i], CurrentMesh);
}
if (MeshNode.ChildNodes[i].Name.Equals("vertices"))
{
ParseGeometryLibrary_GeometryMeshVertices(MeshNode.ChildNodes[i], CurrentMesh);
}
if (MeshNode.ChildNodes[i].Name.Equals("triangles"))
{
ParseGeometryLibrary_GeometryMeshTriangles(MeshNode.ChildNodes[i], CurrentMesh);
}
}
CurrentGeometry.mMeshes.Add(CurrentMesh);
}
开发者ID:DerRM,项目名称:Collada-Exporter,代码行数:26,代码来源:ColladaParser.cs
示例8: RemoveVertex
public void RemoveVertex(Geometry.Point vertex)
{
int indexToRemove;
for (indexToRemove = 0; indexToRemove < _vertices.Count; ++indexToRemove)
{
if(_vertices[indexToRemove].Equals(vertex))
break;
}
if (indexToRemove == _vertices.Count)
return;
++_holeCount;
if (_vertices.Count == 1)
{
_vertices.RemoveAt(indexToRemove);
return;
}
if (_vertices.Count <= 2)
{
HandleVertexRemovalTwoPoint(indexToRemove);
return;
}
//TODO: Find new vertices that will emerge from removing the vertex
//TODO: preserve the cyclical ordering of the vertices to aid in area calculation.
}
开发者ID:Cooker1977,项目名称:Solutions,代码行数:27,代码来源:ShrinkingBoard.cs
示例9: Get
/// <summary>
/// Perform the 'get' operation.
/// </summary>
/// <param name="line"></param>
/// <returns></returns>
public Commands.Result Get(out Geometry.Line line)
{
IntPtr ptr_this = NonConstPointer();
line = Geometry.Line.Unset;
int rc = UnsafeNativeMethods.RHC_RhinoGetLine2(ptr_this, ref line, IntPtr.Zero);
return (Commands.Result)rc;
}
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:12,代码来源:rhinosdkgetline.cs
示例10: SlicePolygon
/// <summary>
/// Slices a polygon by a circle with some thickness.
/// Input circle may be a line.
/// </summary>
/// <remarks>The input polygon might get reversed</remarks>
public static void SlicePolygon( Polygon p, CircleNE c, Geometry g, double thickness, out List<Polygon> output )
{
output = new List<Polygon>();
// Setup the two slicing circles.
CircleNE c1 = c.Clone(), c2 = c.Clone();
Mobius m = new Mobius();
Vector3D pointOnCircle = c.IsLine ? c.P1 : c.Center + new Vector3D( c.Radius, 0 );
m.Hyperbolic2( g, c1.CenterNE, pointOnCircle, thickness / 2 );
c1.Transform( m );
m.Hyperbolic2( g, c2.CenterNE, pointOnCircle, -thickness / 2 );
c2.Transform( m );
// ZZZ - alter Clip method to work on Polygons and use that.
// Slice it up.
List<Polygon> sliced1, sliced2;
Slicer.SlicePolygon( p, c1, out sliced1 );
Slicer.SlicePolygon( p, c2, out sliced2 );
// Keep the ones we want.
foreach( Polygon newPoly in sliced1 )
{
bool outside = !c1.IsPointInsideNE( newPoly.CentroidApprox );
if( outside )
output.Add( newPoly );
}
foreach( Polygon newPoly in sliced2 )
{
bool inside = c2.IsPointInsideNE( newPoly.CentroidApprox );
if( inside )
output.Add( newPoly );
}
}
开发者ID:roice3,项目名称:Honeycombs,代码行数:40,代码来源:Slicer.cs
示例11: WallCollision
private static bool WallCollision(Geometry.Circle2D c, double objectZ, double objectHeight, Wall wall)
{
if (Geometry.Intersections.CirclePolygonIntersection(c,
wall.Area))
return true;
return false;
}
开发者ID:longjoel,项目名称:master,代码行数:7,代码来源:Collisions.cs
示例12: DoGeodesicLength
private async Task DoGeodesicLength()
{
ResetButton.IsEnabled = false;
try
{
if (mapView1.Editor.IsActive)
mapView1.Editor.Cancel.Execute(null);
//Get the input polygon geometry from the user
inputGeom = await mapView1.Editor.RequestShapeAsync(DrawShape.Polyline);
if (inputGeom != null)
{
//Add the polygon drawn by the user
var g = new Graphic
{
Geometry = inputGeom,
};
myGraphicsLayer.Graphics.Add(g);
//Get the label point for the input geometry
var length = GeometryEngine.GeodesicLength(inputGeom);
LineLengthTextBlock.Text = length.ToString("N2") + " m";
LineLengthTextBlock.Visibility = Windows.UI.Xaml.Visibility.Visible;
}
}
catch (Exception)
{
}
ResetButton.IsEnabled = true;
}
开发者ID:KrisFoster44,项目名称:arcgis-runtime-samples-dotnet,代码行数:35,代码来源:LineLength.xaml.cs
示例13: NativeGeometryNonConstPointer
/// <summary>
/// Returns the underlying non-const ON_Geometry* for a RhinoCommon class. You should
/// only be interested in using this function if you are writing C++ code.
/// </summary>
/// <param name="geometry">A geometry object. This can be null and in such a case <see cref="IntPtr.Zero"/> is returned.</param>
/// <returns>A pointer to the non-const geometry.</returns>
public static IntPtr NativeGeometryNonConstPointer(Geometry.GeometryBase geometry)
{
IntPtr rc = IntPtr.Zero;
if (geometry != null)
rc = geometry.NonConstPointer();
return rc;
}
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:13,代码来源:interop.cs
示例14: Model
/// <summary>
/// Creates a new empty model.
/// </summary>
public Model(Matrix transform)
{
Enabled = true;
this.transform = transform;
inverseTranspose = Matrix.InverseTranspose(transform);
geometry = new Geometry(SceneFlags.Static | SceneFlags.HighQuality, TraversalFlags.Single | TraversalFlags.Packet4);
}
开发者ID:TomCrypto,项目名称:Embree.NET,代码行数:10,代码来源:Program.cs
示例15: Geometry
/// <summary>
/// 拷贝构造函数。
/// </summary>
/// <param name="geometry">几何对象。</param>
/// <exception cref="ArgumentNullException">几何对象为 null 时抛出异常。</exception>
public Geometry(Geometry geometry)
{
if (geometry == null) throw new ArgumentNullException();
this.Id = geometry.Id;
if (geometry.Parts != null)
{
int length = geometry.Parts.Length;
this.Parts = new int[length];
for (int i = 0; i < length; i++)
{
this.Parts[i] = geometry.Parts[i];
}
}
if (geometry.Points != null)
{
int length = geometry.Points.Length;
this.Points = new Point2D[length];
for (int i = 0; i < length; i++)
{
this.Points[i] = new Point2D(geometry.Points[i]);
}
}
if (Style != null)
{
this.Style = new Style(geometry.Style);
}
this.Type = geometry.Type;
}
开发者ID:SuperMap,项目名称:iClient-for-DotNet,代码行数:33,代码来源:Geometry.cs
示例16: CoordinatesConvertor
public static string CoordinatesConvertor(double InputX,double InputY, int InputWKID, int OutputWKID)
{
Geometry_GeometryServer geometryService = new Geometry_GeometryServer();
SpatialReference inputSpatialReference = new GeographicCoordinateSystem();
inputSpatialReference.WKID = InputWKID;
inputSpatialReference.WKIDSpecified = true;
SpatialReference outputSpatialReference = new ProjectedCoordinateSystem();
outputSpatialReference.WKID = OutputWKID;
outputSpatialReference.WKIDSpecified = true;
PointN pt = new PointN();
pt.X = InputX;
pt.Y = InputY;
Geometry[] inGeo = new Geometry[] { pt };
Geometry[] geo = geometryService.Project(inputSpatialReference, outputSpatialReference, false, null, null, inGeo);
PointN nPt = (PointN)geo[0];
return (nPt.X.ToString() + ',' + nPt.Y.ToString());
}
开发者ID:hzhiguang,项目名称:AbuseAnalysis,代码行数:27,代码来源:CoordinatesConverter.cs
示例17: OrderPresenter
Geometry.Figures.Point target; //точка цели
#endregion Fields
#region Constructors
/// <summary>
/// Конструктор текущего действия (движения)
/// </summary>
/// <param name="a">Действие</param>
/// <param name="curPoint">Текущее положение отряда</param>
public OrderPresenter(AbstractGameEngine.Action a, Geometry.Figures.Point curPoint)
{
double ratio = Transformer.Ratio;
this.origin = curPoint;
this.target = (a as GameEngine.Characters.MoveAction).Destination;
OrderOrigin = new Point(curPoint.X * ratio, curPoint.Y * ratio);
OrderTarget = new Point(target.X * ratio, target.Y * ratio);
this.OrderType = 0;
VisibleWayAim = Visibility.Visible;
this.TurnsToComplete = (a as GameEngine.Characters.MoveAction).TurnsToComplete;
double dX=0;//смещение значка цели перемещения относительно положения отряда по оси X
double dY=0;//смещение значка цели перемещения относительно положения отряда по оси Y
if ((target.X - origin.X) < 0) dX = 2 * (target.X - origin.X) * ratio;//если отряд двигается влево
else dX = (target.X - origin.X) * ratio - 12.5;//если отряд двигается вправо
if ((origin.Y - target.Y) < 0) dY = 2 * (origin.Y - target.Y) * ratio;//если отряд двигается вверх
else dY = (origin.Y - target.Y) * ratio - 12.5;//если отряд двигается вниз
this.Margin = new Thickness(dX, dY, 0, 0);
DeltaHorisontal = (target.X - origin.X) * ratio;
DeltaVertical = (origin.Y - target.Y) * ratio;
this.WayLine = new System.Windows.Media.PointCollection();
Point aimPos = new Point(dX, dY);//получение точки цели перемещения отряда
this.WayLine.Add(new Point(0, 0));//точка нахождения отряда относительно отряда
this.WayLine.Add(new Point((target.X - origin.X) * ratio, (origin.Y - target.Y) * ratio));
}
开发者ID:anhlehoang410,项目名称:Game-5,代码行数:40,代码来源:OrderPresenter.cs
示例18: Initialized
internal static BiosParameterBlock Initialized(Geometry diskGeometry, int clusterSize, uint partitionStartLba, long partitionSizeLba, int mftRecordSize, int indexBufferSize)
{
BiosParameterBlock bpb = new BiosParameterBlock();
bpb.OemId = "NTFS ";
bpb.BytesPerSector = Sizes.Sector;
bpb.SectorsPerCluster = (byte)(clusterSize / bpb.BytesPerSector);
bpb.ReservedSectors = 0;
bpb.NumFats = 0;
bpb.FatRootEntriesCount = 0;
bpb.TotalSectors16 = 0;
bpb.Media = 0xF8;
bpb.FatSize16 = 0;
bpb.SectorsPerTrack = (ushort)diskGeometry.SectorsPerTrack;
bpb.NumHeads = (ushort)diskGeometry.HeadsPerCylinder;
bpb.HiddenSectors = partitionStartLba;
bpb.TotalSectors32 = 0;
bpb.BiosDriveNumber = 0x80;
bpb.ChkDskFlags = 0;
bpb.SignatureByte = 0x80;
bpb.PaddingByte = 0;
bpb.TotalSectors64 = partitionSizeLba - 1;
bpb.RawMftRecordSize = bpb.CodeRecordSize(mftRecordSize);
bpb.RawIndexBufferSize = bpb.CodeRecordSize(indexBufferSize);
bpb.VolumeSerialNumber = GenSerialNumber();
return bpb;
}
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:27,代码来源:BiosParameterBlock.cs
示例19: Tile
public Tile( Polygon boundary, Polygon drawn, Geometry geometry )
: this()
{
Boundary = boundary;
Drawn = drawn;
Geometry = geometry;
// Make the vertex circle.
VertexCircle = boundary.CircumCircle;
// ZZZ - we shouldn't do this here (I did it for the slicing study page).
//VertexCircle.Radius = 1.0;
//
// Below are experimentations with different vertex circle sizes.
//
//VertexCircle.Radius *= (1+1.0/9);
// cuts adjacent cells at midpoint
// Math.Sqrt(63)/6 for {3,6}
// (1 + 1.0/5) for {3,7}
// (1 + 1.0/9) for {3,8}
// (1 + 1.0/20) for {3,9}
// cuts at 1/3rd
// 2/Math.Sqrt(3) for {3,6}
}
开发者ID:roice3,项目名称:Honeycombs,代码行数:28,代码来源:Tile.cs
示例20: RunQuery
private async Task RunQuery(Geometry geometry)
{
var l = mapView1.Map.Layers["GraphicsWellsLayer"] as GraphicsLayer;
l.Graphics.Clear();
QueryTask queryTask =
new QueryTask(new Uri("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer/0"));
Query query = new Query("1=1")
{
Geometry = geometry,
ReturnGeometry = true,
//OutSpatialReference = mapView1.SpatialReference,
OutFields = OutFields.All
};
try
{
var result = await queryTask.ExecuteAsync(query);
if (result.FeatureSet.Features != null && result.FeatureSet.Features.Count > 0)
{
ResultsGrid.ItemsSource = result.FeatureSet.Features;
l.Graphics.AddRange(from g in result.FeatureSet.Features select g);
}
}
catch (Exception)
{
}
}
开发者ID:KrisFoster44,项目名称:arcgis-runtime-samples-dotnet,代码行数:27,代码来源:QueryRelatedRecords.xaml.cs
注:本文中的Geometry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论