geoc-clip

geoc-clip — A polygon clipping routine that may be useful for speeding up painting.

Synopsis

#define             GEOC_TYPE_CLIP
#define             GEOC_TYPE_PIPELINE
                    GeocPipeline;
                    GeocClip;
GeocClip*           geoc_clip_new                       (gboolean open,
                                                         double x1,
                                                         double y1,
                                                         double x2,
                                                         double y2);
void                geoc_clip_add_point                 (GeocClip *clip,
                                                         double x,
                                                         double y);
void                geoc_clip_finish                    (GeocClip *clip);
void                geoc_clip_free                      (GeocClip *clip);
GType               geoc_clip_get_type                  (void);
GType               geoc_pipeline_get_type              (void);

Description

Details

GEOC_TYPE_CLIP

#define GEOC_TYPE_CLIP (geoc_clip_get_type())


GEOC_TYPE_PIPELINE

#define GEOC_TYPE_PIPELINE (geoc_pipeline_get_type())


GeocPipeline

typedef struct {
        double value, px, py, fx, fy;
        int edge, stage;
} GeocPipeline;


GeocClip

typedef struct {
        GeocPipeline left, top, right, bot;
        gboolean open;
        CrPoints *points;
} GeocClip;


geoc_clip_new ()

GeocClip*           geoc_clip_new                       (gboolean open,
                                                         double x1,
                                                         double y1,
                                                         double x2,
                                                         double y2);

Initializes a structure to be used for pipeline clipping of a polyline or polygon to a rectangle.

open :

If this is an open or closed shape.

x1 :

The leftmost coordinate of the clipping rectangle.

y1 :

The topmost coordinate of the clipping rectangle.

x2 :

The rightmost coordinate of the clipping rectangle.

y2 :

The bottommost coordinate of the clipping rectangle.

Returns :

A new GeocClip structure to be used for point clipping.

geoc_clip_add_point ()

void                geoc_clip_add_point                 (GeocClip *clip,
                                                         double x,
                                                         double y);

Add an additional point to the shape to be clipped. Call this routine until all points are added.

clip :

x :

The x-coordinate of the next point in the shape.

y :

The y-coordinate of the next point in the shape.

geoc_clip_finish ()

void                geoc_clip_finish                    (GeocClip *clip);

Tells the clipping algorithm that we are at the end of the pipeline. That is, all points have been added.

clip :


geoc_clip_free ()

void                geoc_clip_free                      (GeocClip *clip);

Use this to free the filled GeocClip structure.

clip :


geoc_clip_get_type ()

GType               geoc_clip_get_type                  (void);

Returns :


geoc_pipeline_get_type ()

GType               geoc_pipeline_get_type              (void);

Returns :