Пример #1
0
        internal override IntPtr _InternalGetConstPointer()
        {
#if RHINO_SDK
            //constructed in table callback
            DocObjects.Tables.InstanceDefinitionTableEventArgs ide = m__parent as DocObjects.Tables.InstanceDefinitionTableEventArgs;
            if (ide != null)
            {
                return(ide.ConstLightPointer());
            }

            //derived from doc
            RhinoDoc parent_doc = m__parent as RhinoDoc;
            if (parent_doc != null)
            {
                IntPtr idf_ptr = UnsafeNativeMethods.CRhinoInstanceDefinition_PtrFromId(
                    parent_doc.RuntimeSerialNumber, m_id);
            }
#endif
            FileIO.File3dm parent_file = m__parent as FileIO.File3dm;
            if (parent_file != null)
            {
                IntPtr ptr_model = parent_file.NonConstPointer();
                return(UnsafeNativeMethods.ONX_Model_GetInstanceDefinitionPointer(ptr_model, m_id));
            }
            return(IntPtr.Zero);
        }
        internal override IntPtr _InternalGetConstPointer()
        {
#if RHINO_SDK
            DocObjects.Tables.InstanceDefinitionTableEventArgs ide = m__parent as DocObjects.Tables.InstanceDefinitionTableEventArgs;
            if (ide != null)
            {
                return(ide.ConstLightPointer());
            }
#endif
            FileIO.File3dm parent_file = m__parent as FileIO.File3dm;
            if (parent_file != null)
            {
                IntPtr ptr_model = parent_file.NonConstPointer();
                return(UnsafeNativeMethods.ONX_Model_GetInstanceDefinitionPointer(ptr_model, m_file3dm_id));
            }
            return(base._InternalGetConstPointer());
        }