예제 #1
0
        internal bool PerformGeometryMorph(Geometry.GeometryBase geometry)
        {
            // dont' copy a const geometry if we don't have to
            if (null == geometry || !IsMorphable(geometry))
            {
                return(false);
            }

            IntPtr pGeometry = geometry.NonConstPointer();
            NativeSpaceMorphWrapper native_wrapper = this as NativeSpaceMorphWrapper;

            if (native_wrapper != null)
            {
                return(UnsafeNativeMethods.ON_SpaceMorph_MorphGeometry2(pGeometry, native_wrapper.m_pSpaceMorph));
            }

            SpaceMorph oldActive = m_active_morph;

            m_active_morph = this;
            MorphPointCallback cb = OnMorphPoint;
            bool rc = UnsafeNativeMethods.ON_SpaceMorph_MorphGeometry(pGeometry, m_tolerance, m_bQuickPreview, m_bPreserveStructure, cb);

            m_active_morph = oldActive;
            return(rc);
        }
예제 #2
0
        /// <summary>Applies the space morph to geometry.</summary>
        /// <param name="geometry">The geometry to be morphed.</param>
        /// <returns>true on success, false on failure.</returns>
        public bool Morph(GeometryBase geometry)
        {
            // dont' copy a const geometry if we don't have to
            if (null == geometry || !SpaceMorph.IsMorphable(geometry))
            {
                return(false);
            }

            IntPtr pConstThis = ConstPointer();
            IntPtr pGeometry  = geometry.NonConstPointer();

            return(UnsafeNativeMethods.ON_MorphControl_MorphGeometry(pConstThis, pGeometry));
        }
예제 #3
0
        public override IGH_GeometricGoo Morph(Rhino.Geometry.SpaceMorph xmorph)
        {
            if (m_value != null)
            {
                var m = new PlanktonMesh(m_value);

                foreach (var v in m.Vertices)
                {
                    Point3d p = new Point3d(v.X, v.Y, v.Z);
                    p = xmorph.MorphPoint(p);

                    v.X = (float)p.X;
                    v.Y = (float)p.Y;
                    v.Z = (float)p.Z;
                }

                return(new GH_PlanktonMesh(m));
            }
            else
            {
                return(new GH_PlanktonMesh(null));
            }
        }
예제 #4
0
 public override Grasshopper.Kernel.Types.IGH_GeometricGoo Morph(Rhino.Geometry.SpaceMorph xmorph)
 {
     throw new NotImplementedException();
 }