• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DbGeometry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



DbGeometry类属于命名空间,在下文中一共展示了DbGeometry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AsBinary

        public override byte[] AsBinary(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var providerValue = new MySqlGeometry();
              MySqlGeometry.TryParse(geometryValue.ProviderValue.ToString(), out providerValue);

              return providerValue.Value;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:10,代码来源:MySqlSpatialServices.cs


示例2: EvaluateAndSaveGeometry

        /// <summary>
        ///     Parsing the THREEJS Geometry of an Object ... (including the color ...)
        /// </summary>
        /// <param name="geo"></param>
        /// <param name="model"></param>
        /// <param name="color"></param>
        public static void EvaluateAndSaveGeometry(DbGeometry geo, DtObject model, Color color)
        {
            // Create 3DPoints
            var splitpointlist = geo.Vertices
                .Select((x, i) => new { Index = i, Value = x })
                .GroupBy(x => x.Index / 3)
                .Select(x => x.Select(v => v.Value).ToList())
                .ToList();

            var points = splitpointlist.Select(item => new Point3D(item[0], item[1], item[2])).ToList();

            // Add the information as AttributeGroup
            model.AttributeGroups["geometry"].AddProperty("threejspoints", points);
            model.AttributeGroups["geometry"].AddProperty("geometryindices", geo.Faces);
            model.AttributeGroups["geometry"].AddProperty("color", color);
        }
开发者ID:corneliuspreidel,项目名称:TUM.CMS.VPLControl,代码行数:22,代码来源:GeometryWriter.cs


示例3: GetSpatialTypeName

        public override string GetSpatialTypeName(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.SpatialTypeName;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例4: GetMeasure

        public override double? GetMeasure(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.Measure;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例5: WorkerOnDoWork

        private void WorkerOnDoWork(object sender, DoWorkEventArgs doWorkEventArgs)
        {
            // Shoe ProgressBar
            Dispatcher.BeginInvoke((Action)delegate () {
                _control.LoadingGrid.Visibility = Visibility.Visible;
                _control.statusLabel.Content = "Status: Loading ...";
            });

            if (InputPorts[0] == null || ControlElements[0] == null || InputPorts[0].Data == null) return;

            if (InputPorts[0].Data.GetType() == typeof(DtoShortProject))
            {
                
                var project = InputPorts[0].Data as DtoShortProject;

                if (project != null)
                {
                    projectId = project.Id;
                    var topo = _controller.IntBase.APICore.Projects.GetTopology(project.Id);
                    if (topo == null)
                        return;
                    var model = _controller.IntBase.APICore.DtObjects.GetObjectGeometryAsThreeJs(topo.Id);
                    // var model = _controller.IntBase.APICore.DtObjects.GetObjectGeometry(topo.Id);

                    if (model.Objects == null)
                        return;

                    foreach (var elem in model.Objects)
                    {
                        var geom = new DbGeometry();
                        var jObject = elem.AttributeGroups["geometry"]["threejs"] as JObject;
                        if (jObject != null)
                        {
                            geom.Vertices = jObject.SelectToken("vertices").ToList().Select(value => value.Value<double>()).ToList();
                            geom.Faces = jObject.SelectToken("faces").ToList().Select(value => value.Value<uint>()).ToList();

                            var colorid = (int)jObject.SelectToken("metadata")["colorid"];
                            var colorInteger = model.Colors[colorid];
                            var color = Color.FromArgb((int)colorInteger);

                            GeometryWriter.EvaluateAndSaveGeometry(geom, elem, color);
                        }
                    }
                    
                    // model.Colors
                    // Color c = Color.FromArgb(someInt);

                    // var model = _controller.IntBase.APICore.DtObjects.GetObjectGeometry(topo.Id);
                    _elements = (List<DtObject>) model.Objects;
                }
                // _elements = _controller.IntBase.APICore.GetElementsFromTopologyId(project.Id);
                // OutputPorts[0].Data = _elements;
            }

            if (InputPorts[0].Data.GetType() == typeof(DtoDivision))
            {
                var dtoDivision = InputPorts[0].Data as DtoDivision;
                if (dtoDivision?.TopologyDivisionId != null)
                {
                    var model = _controller.IntBase.APICore.DtObjects.GetObjectGeometryAsThreeJs((Guid)dtoDivision.TopologyDivisionId);
                    projectId = dtoDivision.ProjectId;

                    foreach (var elem in model.Objects)
                    {
                        var geom = new DbGeometry();
                        var jObject = elem.AttributeGroups["geometry"]["threejs"] as JObject;
                        if (jObject != null)
                        {
                            geom.Vertices = jObject.SelectToken("vertices").ToList().Select(value => value.Value<double>()).ToList();
                            geom.Faces = jObject.SelectToken("faces").ToList().Select(value => value.Value<uint>()).ToList();

                            var colorid = (int)jObject.SelectToken("metadata")["colorid"];
                            var colorInteger = model.Colors[colorid];
                            var color = Color.FromArgb((int)colorInteger);

                            GeometryWriter.EvaluateAndSaveGeometry(geom, elem, color);
                        }
                    }
                    _elements = (List<DtObject>)model.Objects;
                }
            }

            doWorkEventArgs.Result = _elements;
        }
开发者ID:corneliuspreidel,项目名称:TUM.CMS.VPLControl,代码行数:84,代码来源:ElementContainerNode.cs


示例6: SymmetricDifference

        public override DbGeometry SymmetricDifference(DbGeometry geometryValue, DbGeometry otherGeometry)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              if (otherGeometry == null)
            throw new ArgumentNullException("otherGeometry");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              var mysqlOtherValue = GeometryFromProviderValue(otherGeometry);

              return mysqlValue.SymmetricDifference(mysqlOtherValue);
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:14,代码来源:MySqlSpatialServices.cs


示例7: PointAt

 public override DbGeometry PointAt(DbGeometry geometryValue, int index)
 {
     throw new System.NotImplementedException();
 }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:4,代码来源:MySqlSpatialServices.cs


示例8: InteriorRingAt

        public override DbGeometry InteriorRingAt(DbGeometry geometryValue, int index)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.InteriorRingAt(index);
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例9: GetCoordinateSystemId

        public override int GetCoordinateSystemId(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.CoordinateSystemId;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例10: GetConvexHull

        public override DbGeometry GetConvexHull(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.ConvexHull;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例11: Distance

        public override double Distance(DbGeometry geometryValue, DbGeometry otherGeometry)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              if (otherGeometry == null)
            throw new ArgumentNullException("otherGeometry");

              DbGeometry mysqlValue = DbGeometry.FromText(geometryValue.ProviderValue.ToString());

              Double? result = mysqlValue.Distance(otherGeometry);
              if (result != null)
            return result.Value;
              return 0;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:15,代码来源:MySqlSpatialServices.cs


示例12: Disjoint

 public override bool Disjoint(DbGeometry geometryValue, DbGeometry otherGeometry)
 {
     throw new System.NotImplementedException();
 }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:4,代码来源:MySqlSpatialServices.cs


示例13: CreateWellKnownValue

        public override DbGeometryWellKnownValue CreateWellKnownValue(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.WellKnownValue;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例14: Contains

        public override bool Contains(DbGeometry geometryValue, DbGeometry otherGeometry)
        {
            if (geometryValue == null)
             throw new ArgumentNullException("geometryValue");

               if (otherGeometry == null)
             throw new ArgumentNullException("otherGeometry");

               DbGeometry mysqlValue = DbGeometry.FromText(geometryValue.ProviderValue.ToString());
               return mysqlValue.Contains(otherGeometry);
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:11,代码来源:MySqlSpatialServices.cs


示例15: Buffer

        public override DbGeometry Buffer(DbGeometry geometryValue, double distance)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              DbGeometry mysqlValue = DbGeometry.FromText(geometryValue.ProviderValue.ToString());
              return mysqlValue.Buffer(distance);
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:8,代码来源:MySqlSpatialServices.cs


示例16: GetStartPoint

        public override DbGeometry GetStartPoint(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.StartPoint;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例17: GetYCoordinate

        public override double? GetYCoordinate(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var providerValue = new MySqlGeometry();
              MySqlGeometry.TryParse(geometryValue.ProviderValue.ToString(), out providerValue);
              return providerValue.YCoordinate;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例18: GetDimension

        public override int GetDimension(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.Dimension;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs


示例19: AsGml

 public override string AsGml(DbGeometry geometryValue)
 {
     throw new NotImplementedException();
 }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:4,代码来源:MySqlSpatialServices.cs


示例20: GetExteriorRing

        public override DbGeometry GetExteriorRing(DbGeometry geometryValue)
        {
            if (geometryValue == null)
            throw new ArgumentNullException("geometryValue");

              var mysqlValue = GeometryFromProviderValue(geometryValue);

              return mysqlValue.ExteriorRing;
        }
开发者ID:schivei,项目名称:mysql-connector-net,代码行数:9,代码来源:MySqlSpatialServices.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DbHelper类代码示例发布时间:2022-05-24
下一篇:
C# DbFunctionExpression类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap