示例#1
0
        public static void SavePolygon(string filename, bool writeHoleFlags, GpcPolygon polygon)
        {
            gpc_polygon gpc_polygon = GpcWrapper.PolygonTo_gpc_polygon(polygon);

            IntPtr fp = fopen(filename, "wb");

            gpc_write_polygon(fp, writeHoleFlags?((int)1):((int)0), ref gpc_polygon);
            fclose(fp);

            GpcWrapper.Free_gpc_polygon(gpc_polygon);
        }
示例#2
0
        public static Tristrip PolygonToTristrip(GpcPolygon polygon)
        {
            gpc_tristrip gpc_strip = new gpc_tristrip();
            gpc_polygon  gpc_pol   = GpcWrapper.PolygonTo_gpc_polygon(polygon);

            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.gpc_free_tristrip(ref gpc_strip);

            return(tristrip);
        }
示例#3
0
        public static GpcPolygon Clip(GpcOperation operation, GpcPolygon subject_polygon, GpcPolygon clip_polygon)
        {
            gpc_polygon gpc_polygon         = new gpc_polygon();
            gpc_polygon gpc_subject_polygon = GpcWrapper.PolygonTo_gpc_polygon(subject_polygon);
            gpc_polygon gpc_clip_polygon    = GpcWrapper.PolygonTo_gpc_polygon(clip_polygon);

            gpc_polygon_clip(operation, ref gpc_subject_polygon, ref gpc_clip_polygon, ref gpc_polygon);
            GpcPolygon polygon = GpcWrapper.gpc_polygon_ToPolygon(gpc_polygon);

            GpcWrapper.Free_gpc_polygon(gpc_subject_polygon);
            GpcWrapper.Free_gpc_polygon(gpc_clip_polygon);
            GpcWrapper.gpc_free_polygon(ref gpc_polygon);

            return(polygon);
        }
示例#4
0
        public static Tristrip ClipToTristrip(GpcOperation operation, GpcPolygon subject_polygon, GpcPolygon 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);

            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.gpc_free_tristrip(ref gpc_strip);

            return(tristrip);
        }
示例#5
0
 public void Save(string filename, bool writeHoleFlags)
 {
     GpcWrapper.SavePolygon(filename, writeHoleFlags, this);
 }
示例#6
0
 public Tristrip ToTristrip()
 {
     return(GpcWrapper.PolygonToTristrip(this));
 }
示例#7
0
 public GpcPolygon Clip(GpcOperation operation, GpcPolygon polygon)
 {
     return(GpcWrapper.Clip(operation, this, polygon));
 }
示例#8
0
 public Tristrip ClipToTristrip(GpcOperation operation, GpcPolygon polygon)
 {
     return(GpcWrapper.ClipToTristrip(operation, this, polygon));
 }
示例#9
0
 public static GpcPolygon FromFile(string filename, bool readHoleFlags)
 {
     return(GpcWrapper.ReadPolygon(filename, readHoleFlags));
 }