Exemplo n.º 1
0
        /// <summary>
        /// Returns a bounding box for the custom render meshes for the given object.
        /// </summary>
        /// <param name="vp">The viewport being rendered.</param>
        /// <param name="obj">The Rhino object of interest.</param>
        /// <param name="requestingPlugIn">UUID of the RDK plug-in requesting the meshes.</param>
        /// <param name="preview">Type of mesh to build.</param>
        /// <returns>A bounding box value.</returns>
        public virtual BoundingBox BoundingBox(ViewportInfo vp, RhinoObject obj, Guid requestingPlugIn, bool preview)
        {
            var min = new Point3d();
            var max = new Point3d();

            if (UnsafeNativeMethods.Rdk_RMPBoundingBoxImpl(m_runtime_serial_number, vp.ConstPointer(), obj.ConstPointer(), requestingPlugIn, preview ? 1 : 0, ref min, ref max))
            {
                return(new BoundingBox(min, max));
            }

            return(new BoundingBox());
        }