Esempio n. 1
0
        /// <summary> Add a RhinoObject to this list </summary>
        /// <param name="rhinoObject"></param>
        /// <since>5.10</since>
        public void Add(DocObjects.RhinoObject rhinoObject)
        {
            IntPtr const_ptr_rhinoobject = rhinoObject.ConstPointer();
            IntPtr ptr_this = NonConstPointer();

            UnsafeNativeMethods.CRhinoXformObjectList_AddObject2(ptr_this, const_ptr_rhinoobject);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns the underlying const CRhinoObject* for a RhinoCommon class. You should only
        /// be interested in using this function if you are writing C++ code.
        /// </summary>
        /// <param name="rhinoObject">A Rhino object.</param>
        /// <returns>A pointer to the Rhino const object.</returns>
        /// <since>5.0</since>
        public static IntPtr RhinoObjectConstPointer(DocObjects.RhinoObject rhinoObject)
        {
            IntPtr rc = IntPtr.Zero;

            if (rhinoObject != null)
            {
                rc = rhinoObject.ConstPointer();
            }
            return(rc);
        }
Esempio n. 3
0
        /// <summary>
        /// Checks geometry to see if it passes the basic GeometryAttributeFilter.
        /// </summary>
        /// <param name="rhObject">parent object being considered.</param>
        /// <param name="geometry">geometry being considered.</param>
        /// <param name="componentIndex">if >= 0, geometry is a proper sub-part of object->Geometry() with componentIndex.</param>
        /// <returns>
        /// true if the geometry passes the filter returned by GeometryAttributeFilter().
        /// </returns>
        public bool PassesGeometryAttributeFilter(DocObjects.RhinoObject rhObject, GeometryBase geometry, ComponentIndex componentIndex)
        {
            IntPtr pRhinoObject = IntPtr.Zero;

            if (rhObject != null)
            {
                pRhinoObject = rhObject.ConstPointer();
            }
            IntPtr pGeometry = IntPtr.Zero;

            if (geometry != null)
            {
                pGeometry = geometry.ConstPointer();
            }
            IntPtr ptr = NonConstPointer();

            return(UnsafeNativeMethods.CRhinoGetObject_PassesGeometryAttributeFilter(ptr, pRhinoObject, pGeometry, componentIndex));
        }
Esempio n. 4
0
        public GeometryBase[] Explode()
        {
            using (Runtime.InteropWrappers.SimpleArrayGeometryPointer geometry = new Runtime.InteropWrappers.SimpleArrayGeometryPointer())
            {
                IntPtr ptr_parent_rhinoobject = IntPtr.Zero;

                if (IsDocumentControlled)
                {
                    DocObjects.RhinoObject rhobj = ParentRhinoObject();
                    if (rhobj != null)
                    {
                        ptr_parent_rhinoobject = rhobj.ConstPointer();
                    }
                }
                IntPtr ptr_geometry_array = geometry.NonConstPointer();
                IntPtr const_ptr_this     = ConstPointer();

                UnsafeNativeMethods.ON_Hatch_Explode(const_ptr_this, ptr_parent_rhinoobject, ptr_geometry_array);
                GeometryBase[] rc = geometry.ToNonConstArray();
                return(rc);
            }
        }