Example #1
0
        internal override IntPtr _InternalGetConstPointer()
        {
            MaterialHolder mh = m__parent as MaterialHolder;

            if (mh != null)
            {
                return(mh.ConstMaterialPointer());
            }
#if RHINO_SDK
            if (m_is_default)
            {
                return(UnsafeNativeMethods.CRhinoMaterial_DefaultMaterial());
            }
            if (m_doc != null)
            {
                return(UnsafeNativeMethods.CRhinoMaterialTable_GetMaterialPointer(m_doc.m_docId, m_id));
            }
#endif
            FileIO.File3dm parent_file = m__parent as FileIO.File3dm;
            if (parent_file != null)
            {
                IntPtr ptr_model = parent_file.ConstPointer();
                return(UnsafeNativeMethods.ONX_Model_GetMaterialPointer(ptr_model, m_id));
            }
            return(IntPtr.Zero);
        }
Example #2
0
 internal Material(MaterialHolder holder)
 {
     ConstructConstObject(holder, -1);
 }