コード例 #1
0
        public static Tristrip PolygonToTristrip(Polygon polygon)
        {
            gpc_tristrip gpc_strip = new gpc_tristrip();
            gpc_polygon  gpc_pol   = GpcWrapper.PolygonTo_gpc_polygon(polygon);

            NativeMethods.gpc_polygon_to_tristrip(ref gpc_pol, ref gpc_strip);
            Tristrip tristrip = GpcWrapper.Gpc_strip_ToTristrip(gpc_strip);

            GpcWrapper.Free_gpc_polygon(gpc_pol);
            GpcWrapper.NativeMethods.gpc_free_tristrip(ref gpc_strip);

            return(tristrip);
        }
コード例 #2
0
        public static Tristrip ClipToTristrip(GpcOperation operation, Polygon subject_polygon, Polygon clip_polygon)
        {
            gpc_tristrip gpc_strip           = new gpc_tristrip();
            gpc_polygon  gpc_subject_polygon = GpcWrapper.PolygonTo_gpc_polygon(subject_polygon);
            gpc_polygon  gpc_clip_polygon    = GpcWrapper.PolygonTo_gpc_polygon(clip_polygon);

            NativeMethods.gpc_tristrip_clip(operation, ref gpc_subject_polygon, ref gpc_clip_polygon, ref gpc_strip);
            Tristrip tristrip = GpcWrapper.Gpc_strip_ToTristrip(gpc_strip);

            GpcWrapper.Free_gpc_polygon(gpc_subject_polygon);
            GpcWrapper.Free_gpc_polygon(gpc_clip_polygon);
            GpcWrapper.NativeMethods.gpc_free_tristrip(ref gpc_strip);

            return(tristrip);
        }