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


C# Geometry.BoundingBox类代码示例

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


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

示例1: CreateThroughBox

 /// <summary>
 /// Extends a plane into a plane surface so that the latter goes through a bounding box.
 /// </summary>
 /// <param name="plane">An original plane value.</param>
 /// <param name="box">A box to use for extension boundary.</param>
 /// <returns>A new plane surface on success, or null on error.</returns>
 /// <example>
 /// <code source='examples\vbnet\ex_splitbrepwithplane.vb' lang='vbnet'/>
 /// <code source='examples\cs\ex_splitbrepwithplane.cs' lang='cs'/>
 /// <code source='examples\py\ex_splitbrepwithplane.py' lang='py'/>
 /// </example>
 public static PlaneSurface CreateThroughBox(Plane plane, BoundingBox box)
 {
   IntPtr ptr = UnsafeNativeMethods.RHC_RhinoPlaneThroughBox2(ref plane, ref box);
   if (IntPtr.Zero == ptr)
     return null;
   return new PlaneSurface(ptr, null);
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:18,代码来源:opennurbs_planesurface.cs

示例2: Box

 /// <summary>
 /// Initializes a new Box that mimics a BoundingBox struct. 
 /// <para>The orientation plane of the Box is coincident with the 
 /// World XY plane.</para>
 /// </summary>
 /// <param name="bbox">BoundingBox to mimic.</param>
 public Box(BoundingBox bbox)
 {
   m_plane = Plane.WorldXY;
   m_dx = new Interval(bbox.m_min.m_x, bbox.m_max.m_x);
   m_dy = new Interval(bbox.m_min.m_y, bbox.m_max.m_y);
   m_dz = new Interval(bbox.m_min.m_z, bbox.m_max.m_z);
 }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:13,代码来源:opennurbs_box.cs

示例3: DisplayElementSectionsComponent

 public DisplayElementSectionsComponent()
     : base("DisplayElementSectionsComponent", "DES", "Displays the element sections", "CIFem", "Results")
 {
     _bb = new BoundingBox();
     _secCrvs = new List<Curve>();
     _breps = new List<Brep>();
 }
开发者ID:IsakNaslund,项目名称:MasterThesis,代码行数:7,代码来源:DisplayElementSectionsComponent.cs

示例4: SelectionScreen

        static SelectionScreen()
        {
            _transformMouseDown = Transform.Translation(Vector3d.ZAxis * -1);
            _transformMouseOver = Transform.Translation(Vector3d.ZAxis * 1);

            var menuTitle = new SelectableObject(ElementType.Drawable);
            menuTitle.AddGeoemtry(Serialized.Meshes.Menu.TitleBigBackground, Settings.MaterialOrange);
            menuTitle.AddGeoemtry(Serialized.Meshes.Menu.TitleBigBorder, Settings.MaterialRed);
            menuTitle.AddGeoemtry(Serialized.Meshes.Menu.TitleBigLetters, Settings.MaterialYellow);

            var menuOptions = new SelectableObject(ElementType.MenuOptions);
            menuOptions.AddGeoemtry(Serialized.Meshes.Menu.OptionsBackground, Settings.MaterialOrange);
            menuOptions.AddGeoemtry(Serialized.Meshes.Menu.OptionsBorder, Settings.MaterialRed);
            menuOptions.AddGeoemtry(Serialized.Meshes.Menu.OptionsLetters, Settings.MaterialYellow);

            var menuStart = new SelectableObject(ElementType.MenuStart);
            menuStart.AddGeoemtry(Serialized.Meshes.Menu.StartBacbground, Settings.MaterialOrange);
            menuStart.AddGeoemtry(Serialized.Meshes.Menu.StartBorder, Settings.MaterialRed);
            menuStart.AddGeoemtry(Serialized.Meshes.Menu.StartLetters, Settings.MaterialYellow);

            var menuExit = new SelectableObject(ElementType.MenuExit);
            menuExit.AddGeoemtry(Serialized.Meshes.Menu.ExitBacground, Settings.MaterialOrange);
            menuExit.AddGeoemtry(Serialized.Meshes.Menu.ExitBorder, Settings.MaterialRed);
            menuExit.AddGeoemtry(Serialized.Meshes.Menu.ExitLetters, Settings.MaterialYellow);

            _menuObjects = new[] { menuTitle, menuOptions, menuStart, menuExit };

            _mouseController = new MouseController(new[] { menuOptions, menuStart, menuExit });
            _mouseController.OnChange += _mouseController_OnChange;
            _mouseController.OnMouseClick += _mouseController_OnMouseClick;
            _mouseController.OnMouseRelease += _mouseController_OnMouseRelease;

            _box = new BoundingBox(-400, -400, -100, 400, 400, 100);
        }
开发者ID:henrydm,项目名称:PacMan,代码行数:34,代码来源:SelectionScreen.cs

示例5: DisplayThickVectors

 public DisplayThickVectors()
     : base("VectorDisplay", "VDisp", "Displays a vector with set thickness", "CIFem", "Utilities")
 {
     //_vectors = new List<Vector3d>();
     _vectors = new List<DisplayVector>();
     _bounds = BoundingBox.Unset;
 }
开发者ID:IsakNaslund,项目名称:MasterThesis,代码行数:7,代码来源:DisplayThickVectors.cs

示例6: CheckBoxInOther

 private static bool CheckBoxInOther(BoundingBox box1, BoundingBox box2)
 {
     return
         CheckIntervals(box1.Min.X, box2.Min.X, box2.Max.X) ||
         CheckIntervals(box1.Max.X, box2.Min.X, box2.Max.X) ||
         CheckIntervals(box1.Min.Y, box2.Min.Y, box2.Max.Y) ||
         CheckIntervals(box1.Max.Y, box2.Min.Y, box2.Max.Y);
 }
开发者ID:henrydm,项目名称:PacMan,代码行数:8,代码来源:GameObject.cs

示例7: DrawBlueMeshConduit

 public DrawBlueMeshConduit(Mesh mesh)
 {
   // set up as much data as possible so we do the minimum amount of work possible inside
   // the actual display code
   m_mesh = mesh;
   m_color = System.Drawing.Color.Blue;
   m_material = new DisplayMaterial();
   m_material.Diffuse = m_color;
   if (m_mesh != null && m_mesh.IsValid)
     m_bbox = m_mesh.GetBoundingBox(true);
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:11,代码来源:ex_meshdrawing.cs

示例8: DisplayResultElementsComponent

 public DisplayResultElementsComponent()
     : base("DisplayElementResults", "ER", "Displays the element results", "CIFem", "Results")
 {
     _bb = new BoundingBox();
     _bbPts = new List<Point3d>();
     _dispCrvN = new List<Curve>();
     _dispCrvVy = new List<Curve>();
     _dispCrvVz = new List<Curve>();
     _dispCrvT = new List<Curve>();
     _dispCrvMyy = new List<Curve>();
     _dispCrvMzz = new List<Curve>();
 }
开发者ID:IsakNaslund,项目名称:MasterThesis,代码行数:12,代码来源:DisplayResultElementsComponent.cs

示例9: DisplayPipeline_CalculateBoundingBox

 void DisplayPipeline_CalculateBoundingBox(object sender, Rhino.Display.CalculateBoundingBoxEventArgs e)
 {
   if (m_draw_single_sprite)
   {
     BoundingBox bbox = new BoundingBox(new Point3d(20, 0, 0), new Point3d(20, 0, 0));
     e.IncludeBoundingBox(bbox);
   }
   else
   {
     var items = GetItems();
     e.IncludeBoundingBox(items.BoundingBox);
   }
 }
开发者ID:jackieyin2015,项目名称:rhinocommon,代码行数:13,代码来源:ex_spritedrawing.cs

示例10: AddBrepBox

 public static Rhino.Commands.Result AddBrepBox(Rhino.RhinoDoc doc)
 {
   Rhino.Geometry.Point3d pt0 = new Rhino.Geometry.Point3d(0, 0, 0);
   Rhino.Geometry.Point3d pt1 = new Rhino.Geometry.Point3d(10, 10, 10);
   Rhino.Geometry.BoundingBox box = new Rhino.Geometry.BoundingBox(pt0, pt1);
   Rhino.Geometry.Brep brep = box.ToBrep();
   Rhino.Commands.Result rc = Rhino.Commands.Result.Failure;
   if( doc.Objects.AddBrep(brep) != System.Guid.Empty )
   {
     rc = Rhino.Commands.Result.Success;
     doc.Views.Redraw();
   }
   return rc;
 }
开发者ID:austinlaw,项目名称:rhinocommon,代码行数:14,代码来源:ex_addbrepbox.cs

示例11: GetCameraExtents

 public BoundingBox GetCameraExtents(System.Collections.Generic.IEnumerable<Point3d> points)
 {
   Rhino.Collections.Point3dList _points = new Collections.Point3dList(points);
   IntPtr pConstThis = ConstPointer();
   IntPtr pConstViewport = UnsafeNativeMethods.CRhinoViewport_VP(pConstThis);
   BoundingBox bbox = new BoundingBox();
   UnsafeNativeMethods.ON_Viewport_GetCameraExtents(pConstViewport, _points.Count, _points.m_items, ref bbox);
   return bbox;
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:9,代码来源:rhinosdkviewport.cs

示例12: ZoomBoundingBox

 /// <summary>
 /// Zooms the viewport to the given bounding box.
 /// </summary>
 /// <param name="box">The bouding box to zoom.</param>
 /// <returns>true if operation succeeded; otherwise false.</returns>
 public bool ZoomBoundingBox(BoundingBox box)
 {
   IntPtr pThis = NonConstPointer();
   return UnsafeNativeMethods.RHC_RhZoomExtentsHelper(pThis, box.m_min, box.m_max);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:10,代码来源:rhinosdkviewport.cs

示例13: IsVisible

 /// <summary>
 /// Returns true if some portion of a world coordinate bounding box is
 /// potentially visible in the viewing frustum.
 /// </summary>
 /// <param name="bbox">A bounding box that is tested for visibility.</param>
 /// <returns>true if the box is potentially visible; otherwise false.</returns>
 public bool IsVisible(BoundingBox bbox)
 {
   IntPtr ptr = NonConstPointer();
   return UnsafeNativeMethods.CRhinoViewport_IsVisible(ptr, bbox.Min, bbox.Max, true);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:11,代码来源:rhinosdkviewport.cs

示例14: SetClippingPlanes

 /// <summary>
 /// Sets optimal clipping planes to view objects in a world coordinate 3d bounding box.
 /// </summary>
 /// <param name="box">The bounding box </param>
 public void SetClippingPlanes(BoundingBox box)
 {
   IntPtr pThis = NonConstPointer();
   UnsafeNativeMethods.CRhinoViewport_SetClippingPlanes(pThis, box.Min, box.Max);
 }
开发者ID:gwinsky,项目名称:rhinocommon,代码行数:9,代码来源:rhinosdkviewport.cs

示例15: bboxAll

        public BoundingBox bboxAll(List<Brep> things)
        {
            //Find the bounding box of a list of objects
            BoundingBox bbox;
            Point3d maxPt = new Point3d(0, 0, 0);
            Point3d minPt = new Point3d(0, 0, 0);

            foreach (Brep thing in things)
            {
                BoundingBox b_box = thing.GetBoundingBox(Plane.WorldXY);

                if (b_box.Max.X > maxPt.X && b_box.Max.Y > maxPt.Y && b_box.Max.Z > maxPt.Z)
                {
                    maxPt = b_box.Max;
                }
                if (b_box.Min.X < minPt.X && b_box.Min.Y < minPt.Y && b_box.Min.Z < minPt.Z)
                {
                    minPt = b_box.Min;
                }

            }

            bbox = new BoundingBox(minPt, maxPt);
            return bbox;
        }
开发者ID:samuto,项目名称:Silkworm,代码行数:25,代码来源:SilkwormSkein.cs


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