Exemplo n.º 1
0
        internal override IntPtr _InternalGetConstPointer()
        {
            DocObjects.Material parent_material = m__parent as DocObjects.Material;
            if (parent_material != null)
            {
                IntPtr pRhinoMaterial = parent_material.ConstPointer();
                return(UnsafeNativeMethods.ON_Material_GetTexturePointer(pRhinoMaterial, m_index));
            }

#if RHINO_SDK
            Display.DisplayMaterial parent_display_material = m__parent as Display.DisplayMaterial;
            if (parent_display_material != null)
            {
                IntPtr pDisplayPipelineMaterial = parent_display_material.ConstPointer();
                IntPtr pMaterial = UnsafeNativeMethods.CDisplayPipelineMaterial_MaterialPointer(pDisplayPipelineMaterial,
                                                                                                m_front);
                return(UnsafeNativeMethods.ON_Material_GetTexturePointer(pMaterial, m_index));
            }

            Rhino.Render.SimulatedTexture parent_simulated_texture = m__parent as Rhino.Render.SimulatedTexture;
            if (parent_simulated_texture != null)
            {
                IntPtr pSimulatedTexture = parent_simulated_texture.ConstPointer();
                return(UnsafeNativeMethods.Rdk_SimulatedTexture_OnTexturePointer(pSimulatedTexture));
            }
#endif
            return(IntPtr.Zero);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Override this function to provide a Rhino.DocObjects.Material definition for this material
 /// to be used by other rendering engines including the display.
 /// </summary>
 /// <param name="simulation">Set the properties of the input basic material to provide the simulation for this material.</param>
 /// <param name="isForDataOnly">Called when only asking for a hash - don't write any textures to the disk - just provide the filenames they will get.</param>
 public virtual void SimulateMaterial(ref DocObjects.Material simulation, bool isForDataOnly)
 {
     if (IsNativeWrapper())
     {
         UnsafeNativeMethods.Rdk_RenderMaterial_SimulateMaterial(NonConstPointer(), simulation.ConstPointer(), isForDataOnly);
     }
     else
     {
         UnsafeNativeMethods.Rdk_RenderMaterial_CallSimulateMaterialBase(NonConstPointer(), simulation.ConstPointer(), isForDataOnly);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Constructs a new basic material from a <see cref="Rhino.DocObjects.Material">Material</see>.
        /// </summary>
        /// <param name="material">(optional)The material to create the basic material from.</param>
        /// <returns>A new basic material.</returns>
        public static RenderMaterial CreateBasicMaterial(DocObjects.Material material)
        {
            IntPtr const_ptr_source_material  = (material == null ? IntPtr.Zero : material.ConstPointer());
            IntPtr ptr_new_material           = UnsafeNativeMethods.Rdk_Globals_NewBasicMaterial(const_ptr_source_material);
            NativeRenderMaterial new_material = FromPointer(ptr_new_material) as NativeRenderMaterial;

            if (new_material != null)
            {
                new_material.AutoDelete = true;
            }
            return(new_material);
        }
Exemplo n.º 4
0
        public DisplayMaterial(DocObjects.Material material)
        {
            IntPtr pConstMaterial = material.ConstPointer();

            m_ptr = UnsafeNativeMethods.CDisplayPipelineMaterial_New4(pConstMaterial);
        }
Exemplo n.º 5
0
 /// <since>6.12</since>
 internal PhysicallyBasedMaterial()
 {
     m_material = new DocObjects.Material();
 }
Exemplo n.º 6
0
 internal PhysicallyBasedMaterial(DocObjects.Material m)
 {
     m_material = m;
 }