当前位置: 首页>>代码示例>>C#>>正文


C# Geometry类代码示例

本文整理汇总了C#中Geometry的典型用法代码示例。如果您正苦于以下问题:C# Geometry类的具体用法?C# Geometry怎么用?C# Geometry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Geometry类属于命名空间,在下文中一共展示了Geometry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的Geometry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。