/// <summary> /// Returns the underlying non-const ON_Geometry* for a RhinoCommon class. You should /// only be interested in using this function if you are writing C++ code. /// </summary> /// <param name="geometry">A geometry object. This can be null and in such a case <see cref="IntPtr.Zero"/> is returned.</param> /// <returns>A pointer to the non-const geometry.</returns> public static IntPtr NativeGeometryNonConstPointer(Geometry.GeometryBase geometry) { IntPtr rc = IntPtr.Zero; if (geometry != null) rc = geometry.NonConstPointer(); return rc; }
/// <summary> /// Adds a brep to the list. /// </summary> /// <param name="brep">A brep to add.</param> /// <param name="asConst">Whether this brep should be treated as non-modifiable.</param> public void Add(Geometry.Brep brep, bool asConst) { if (null != brep) { IntPtr pBrep = brep.ConstPointer(); if (!asConst) pBrep = brep.NonConstPointer(); IntPtr ptr = NonConstPointer(); UnsafeNativeMethods.ON_BrepArray_Append(ptr, pBrep); } }
/// <summary> /// Adds a mesh to the list. /// </summary> /// <param name="mesh">A mesh to add.</param> /// <param name="asConst">Whether this mesh should be treated as non-modifiable.</param> public void Add(Geometry.Mesh mesh, bool asConst) { if (null != mesh) { IntPtr pMesh = mesh.ConstPointer(); if (!asConst) pMesh = mesh.NonConstPointer(); IntPtr ptr = NonConstPointer(); UnsafeNativeMethods.ON_MeshArray_Append(ptr, pMesh); } }