Exemplo n.º 1
0
        internal void CopyContents(DisplayPipelineAttributes other)
        {
            IntPtr ptr_this        = NonConstPointer();
            IntPtr const_ptr_other = other.ConstPointer();

            UnsafeNativeMethods.CDisplayPipelineAttributes_CopyContents(ptr_this, const_ptr_other);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Capture View contents to a bitmap using display attributes to define how
        /// drawing is performed.
        /// </summary>
        /// <param name="size">The width and height of the returned bitmap.</param>
        /// <param name="attributes">The specific display mode attributes.</param>
        /// <returns>A new bitmap.</returns>
        /// <since>5.0</since>
        public System.Drawing.Bitmap CaptureToBitmap(System.Drawing.Size size, DisplayPipelineAttributes attributes)
        {
            IntPtr const_ptr_attributes = attributes.ConstPointer();

            using (var dib = new Runtime.InteropWrappers.RhinoDib())
            {
                var dib_pointer = dib.NonConstPointer;
                if (UnsafeNativeMethods.CRhinoView_CaptureToBitmap(m_runtime_serial_number, dib_pointer, size.Width, size.Height, const_ptr_attributes))
                {
                    var bitmap = dib.ToBitmap();
                    return(bitmap);
                }
            }
            return(null);
        }
Exemplo n.º 3
0
        static void OnSetDisplayAttributesProc(Guid am_id, IntPtr pConstRhinoObject, IntPtr pDisplayPipelineAttributes)
        {
            VisualAnalysisMode mode = FindLocal(am_id);

            if (mode != null)
            {
                var rhobj = Pixel.Rhino.DocObjects.RhinoObject.CreateRhinoObjectHelper(pConstRhinoObject);
                DisplayPipelineAttributes attr = new DisplayPipelineAttributes(pDisplayPipelineAttributes);
                try
                {
                    mode.SetUpDisplayAttributes(rhobj, attr);
                    attr.m_ptr_attributes = IntPtr.Zero;
                }
                catch (Exception) { }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Captures view contents to a bitmap using display attributes to define how
 /// drawing is performed.
 /// </summary>
 /// <param name="attributes">The specific display mode attributes.</param>
 /// <returns>A new bitmap.</returns>
 /// <since>5.0</since>
 public System.Drawing.Bitmap CaptureToBitmap(DisplayPipelineAttributes attributes)
 {
     return(CaptureToBitmap(ClientRectangle.Size, attributes));
 }
Exemplo n.º 5
0
        /// <summary>
        /// Capture View contents to a bitmap using a display mode description to define
        /// how drawing is performed.
        /// </summary>
        /// <param name="size">The width and height of the returned bitmap.</param>
        /// <param name="mode">The display mode.</param>
        /// <returns>A new bitmap.</returns>
        /// <since>5.0</since>
        public System.Drawing.Bitmap CaptureToBitmap(System.Drawing.Size size, DisplayModeDescription mode)
        {
            var attr = new DisplayPipelineAttributes(mode);

            return(CaptureToBitmap(size, attr));
        }
Exemplo n.º 6
0
 /// <summary>
 /// If an analysis mode needs to modify display attributes, this is the place
 /// to do it.  In particular, Style==Texture, then this function must be
 /// overridden.
 /// </summary>
 /// <remarks>
 /// Shaded analysis modes that use texture mapping, like zebra and emap,
 /// override this function set the texture, diffuse_color, and EnableLighting
 /// parameter.
 /// </remarks>
 /// <param name="obj">The object for which to set up attributes.</param>
 /// <param name="attributes">The linked attributes.</param>
 protected virtual void SetUpDisplayAttributes(Pixel.Rhino.DocObjects.RhinoObject obj, DisplayPipelineAttributes attributes)
 {
 }
Exemplo n.º 7
0
 internal MeshDisplayAttributes(DisplayPipelineAttributes parent)
 {
     m_parent = parent;
 }