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


C# BoundingBox.Union方法代码示例

本文整理汇总了C#中BoundingBox.Union方法的典型用法代码示例。如果您正苦于以下问题:C# BoundingBox.Union方法的具体用法?C# BoundingBox.Union怎么用?C# BoundingBox.Union使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BoundingBox的用法示例。


在下文中一共展示了BoundingBox.Union方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateSketch


//.........这里部分代码省略.........
                        if (sectionGaugingPointsBySketch != null && sectionGaugingPointsBySketch.Count > 0)
                        {
                            gaugingPointsBySketch.AddRange(sectionGaugingPointsBySketch);
                        }
                        if (symmetricGaugingPointsBySketch != null && symmetricGaugingPointsBySketch.Count > 0)
                        {
                            gaugingPointsBySketch.AddRange(symmetricGaugingPointsBySketch);
                        }

                        pointsPerSketch.Add(index, gaugingPointsBySketch);
                        index++;

                        #region Compute gauging points in symmetric section

                        List<SteelThicknessGaugingPoint> pointsToBeDeleted = new List<SteelThicknessGaugingPoint>();

                        if (symmetricGaugingPointsBySketch != null && symmetricGaugingPointsBySketch.Count > 0)
                        {
                            #region Clone gauging points only in SB side, to PS side to be renderized in sketch

                            #region Find center plane parallel to X and Z axis

                            BoundingBox sectionBoundingBox = new BoundingBox();
                            BoundingBox symmetricBoundingBox = new BoundingBox();

                            List<Campaign> originalCampaigns = vessel.GetOriginalCampaigns();
                            foreach (Campaign campaign in originalCampaigns)
                            {
                                IList platesInCampaign = section.GetPermanentElementsInCampaign(campaign, true, "Plate");
                                if (platesInCampaign != null && platesInCampaign.Count > 0)
                                {
                                    foreach (Plate plate in platesInCampaign)
                                    {
                                        sectionBoundingBox.Union(plate.Design.Geometry.BoundingBox);
                                    }
                                }

                                platesInCampaign = symmetricSection.GetPermanentElementsInCampaign(campaign, true, "Plate");
                                if (platesInCampaign != null && platesInCampaign.Count > 0)
                                {
                                    foreach (Plate plate in platesInCampaign)
                                    {
                                        symmetricBoundingBox.Union(plate.Design.Geometry.BoundingBox);
                                    }
                                }
                            }

                            BoundingBox boundingBox = new BoundingBox(sectionBoundingBox);
                            boundingBox.Union(symmetricBoundingBox);

                            Plane plane = new Plane(new Vector3D(0, 1, 0), boundingBox.Center);

                            #endregion

                            SortedList<int, List<SteelThicknessGaugingPoint>> sectionOrganizedGaugingPoints = this.OrganizeIACSGaugingPointsByID(sectionGaugingPointsBySketch);
                            foreach (SteelThicknessGaugingPoint symmetricGaugingPoint in symmetricGaugingPointsBySketch)
                            {
                                if (sectionOrganizedGaugingPoints.ContainsKey((int)symmetricGaugingPoint.IACSReportLocationData.ID))
                                {
                                    bool haveSymmetricPoint = false;
                                    foreach (SteelThicknessGaugingPoint symmetricOrganizedGaugingPoint in sectionOrganizedGaugingPoints[(int)symmetricGaugingPoint.IACSReportLocationData.ID])
                                    {
                                        if (symmetricOrganizedGaugingPoint.IACSReportLocationData.IsForward == symmetricGaugingPoint.IACSReportLocationData.IsForward)
                                        {
                                            haveSymmetricPoint = true;
                                            break;
开发者ID:phdsoft,项目名称:Teste_de_Codigo,代码行数:67,代码来源:CampaignConverter.cs

示例2: RoomVolume

            /// <summary>
            /// If possible, calculate the volume of the room.
            /// </summary>
            /// <param name="Breps">Surfaces that make up the model.</param>
            /// <param name="Volume"></param>
            /// <param name="SurfaceArea"></param>
            /// <returns>True if successful.</returns>
            public static bool RoomVolume(List<Brep> Breps, ref double Volume, out double[] SurfaceArea)
            {
                SurfaceArea = new double[Breps.Count];
                for (int x = 0; x < Breps.Count; x++)
                {
                    AreaMassProperties ap = AreaMassProperties.Compute(Breps[x]);
                    SurfaceArea[x] = ap.Area;
                }

                Brep[] Room = Brep.JoinBreps(Breps, 0.001);
                Rhino.RhinoApp.WriteLine("Room is not closed. Using Bounding Volume.");
                BoundingBox Box = new BoundingBox();
                foreach (Brep srf in Breps)
                {
                     Box.Union(srf.GetBoundingBox(false));
                }

                ///////////////////////////////////////////////////////////////
                //Rhino.RhinoDoc.ActiveDoc.Objects.AddPoints(Box.GetCorners());
                ///////////////////////////////////////////////////////////////
                try
                {
                    Volume = VolumeMassProperties.Compute(Box.ToBrep()).Volume;
                }
                catch
                {
                    Volume = 0;
                }

                return false;
            }
开发者ID:philrob22,项目名称:PachydermAcoustic_Rhinoceros,代码行数:38,代码来源:Classes_Math.cs

示例3: GetRectangleOfRenderizedArea

        private Rectangle GetRectangleOfRenderizedArea(List<SectionElement> sectionElements)
        {
            try
            {
                int expansion = 50;
                Rectangle rectangle = new Rectangle();

                BoundingBox boundingBox = new BoundingBox();
                foreach (SectionElement sectionElement in sectionElements)
                {
                    boundingBox.Union(sectionElement.Design.Geometry.BoundingBox);
                }

                Point minPoint = this.glPanel.WorldToPixel(boundingBox.MinPoint);
                Point maxPoint = this.glPanel.WorldToPixel(boundingBox.MaxPoint);

                int minX = (minPoint.X < maxPoint.X) ? minPoint.X : maxPoint.X;
                int minY = (minPoint.Y < maxPoint.Y) ? minPoint.Y : maxPoint.Y;

                rectangle.Location = new Point(minX - expansion, minY - expansion);
                rectangle.Height = Math.Abs(minPoint.Y - maxPoint.Y) + 2 * expansion;
                rectangle.Width = Math.Abs(minPoint.X - maxPoint.X) + 2 * expansion;

                return rectangle;
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Retangle of renderized area cannot be computed!", ex);
            }
        }
开发者ID:phdsoft,项目名称:Teste_de_Codigo,代码行数:30,代码来源:CampaignConverter.cs


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