ChamplainPolygon

ChamplainPolygon — A polygon to be drawn on the map

Synopsis

                    ChamplainPolygon;
ChamplainPolygon *  champlain_polygon_new               (void);
ChamplainPoint *    champlain_polygon_insert_point      (ChamplainPolygon *polygon,
                                                         gdouble lat,
                                                         gdouble lon,
                                                         gint pos);
ChamplainPoint *    champlain_polygon_append_point      (ChamplainPolygon *polygon,
                                                         gdouble lat,
                                                         gdouble lon);
void                champlain_polygon_remove_point      (ChamplainPolygon *polygon,
                                                         ChamplainPoint *point);
void                champlain_polygon_clear_points      (ChamplainPolygon *polygon);
gboolean            champlain_polygon_get_fill          (ChamplainPolygon *polygon);
ClutterColor *      champlain_polygon_get_fill_color    (ChamplainPolygon *polygon);
gboolean            champlain_polygon_get_mark_points   (ChamplainPolygon *polygon);
GList *             champlain_polygon_get_points        (ChamplainPolygon *polygon);
gboolean            champlain_polygon_get_stroke        (ChamplainPolygon *polygon);
ClutterColor *      champlain_polygon_get_stroke_color  (ChamplainPolygon *polygon);
gdouble             champlain_polygon_get_stroke_width  (ChamplainPolygon *polygon);
void                champlain_polygon_set_fill          (ChamplainPolygon *polygon,
                                                         gboolean value);
void                champlain_polygon_set_fill_color    (ChamplainPolygon *polygon,
                                                         const ClutterColor *color);
void                champlain_polygon_set_mark_points   (ChamplainPolygon *polygon,
                                                         gboolean value);
void                champlain_polygon_set_stroke        (ChamplainPolygon *polygon,
                                                         gboolean value);
void                champlain_polygon_set_stroke_color  (ChamplainPolygon *polygon,
                                                         const ClutterColor *color);
void                champlain_polygon_set_stroke_width  (ChamplainPolygon *polygon,
                                                         gdouble value);
void                champlain_polygon_show              (ChamplainPolygon *polygon);
void                champlain_polygon_hide              (ChamplainPolygon *polygon);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----ClutterGroup
                     +----ChamplainPolygon

Implemented Interfaces

ChamplainPolygon implements ClutterScriptable and ClutterContainer.

Properties

  "closed-path"              gboolean              : Read / Write
  "fill"                     gboolean              : Read / Write
  "fill-color"               ClutterColor*         : Read / Write
  "mark-points"              gboolean              : Read / Write
  "stroke"                   gboolean              : Read / Write
  "stroke-color"             ClutterColor*         : Read / Write
  "stroke-width"             gdouble               : Read / Write
  "visible"                  gboolean              : Read / Write

Description

A ChamplainPolygon is a set of point forming a shape on the map. This API is based on Cairo's.

Details

ChamplainPolygon

typedef struct _ChamplainPolygon ChamplainPolygon;


champlain_polygon_new ()

ChamplainPolygon *  champlain_polygon_new               (void);

Create an instance of ChamplainPolygon.

Returns :

a new empty ChamplainPolygon

Since 0.4


champlain_polygon_insert_point ()

ChamplainPoint *    champlain_polygon_insert_point      (ChamplainPolygon *polygon,
                                                         gdouble lat,
                                                         gdouble lon,
                                                         gint pos);

Adds point at the given position in the list of points in the polygon

polygon :

The polygon

lat :

the latitude

lon :

the longitude

pos :

where to insert the point

Returns :

the added point, should not be freed.

Since 0.4


champlain_polygon_append_point ()

ChamplainPoint *    champlain_polygon_append_point      (ChamplainPolygon *polygon,
                                                         gdouble lat,
                                                         gdouble lon);

Adds point at the end of the list of points in the polygon

polygon :

The polygon

lat :

the latitude

lon :

the longitude

Returns :

the added point, should not be freed.

Since 0.4


champlain_polygon_remove_point ()

void                champlain_polygon_remove_point      (ChamplainPolygon *polygon,
                                                         ChamplainPoint *point);

Removes the point from the polygon.

polygon :

a ChamplainPolygon

point :

the ChamplainPoint to remove

Since 0.4


champlain_polygon_clear_points ()

void                champlain_polygon_clear_points      (ChamplainPolygon *polygon);

Remove all points from the polygon

polygon :

The polygon

Since 0.4


champlain_polygon_get_fill ()

gboolean            champlain_polygon_get_fill          (ChamplainPolygon *polygon);

Checks whether the polygon is filled.

polygon :

The polygon

Returns :

TRUE if the polygon is filled, FALSE otherwise.

Since 0.4


champlain_polygon_get_fill_color ()

ClutterColor *      champlain_polygon_get_fill_color    (ChamplainPolygon *polygon);

Gets the polygon's fill color.

polygon :

The polygon

Returns :

the polygon's fill color.

Since 0.4


champlain_polygon_get_mark_points ()

gboolean            champlain_polygon_get_mark_points   (ChamplainPolygon *polygon);

Checks whether the polygon points are marked.

polygon :

The polygon

Returns :

wether points in polygon gets marked for extra visibility.

Since 0.4.3


champlain_polygon_get_points ()

GList *             champlain_polygon_get_points        (ChamplainPolygon *polygon);

Gets a list of polygon points.

polygon :

The polygon

Returns :

a list of all points from the polygon, it shouldn't be freed.

Since 0.4


champlain_polygon_get_stroke ()

gboolean            champlain_polygon_get_stroke        (ChamplainPolygon *polygon);

Checks whether the polygon has a stroke.

polygon :

The polygon

Returns :

TRUE if the polygon has a stroke, FALSE otherwise.

Since 0.4


champlain_polygon_get_stroke_color ()

ClutterColor *      champlain_polygon_get_stroke_color  (ChamplainPolygon *polygon);

Gets the polygon's stroke color.

polygon :

The polygon

Returns :

the polygon's stroke color.

Since 0.4


champlain_polygon_get_stroke_width ()

gdouble             champlain_polygon_get_stroke_width  (ChamplainPolygon *polygon);

Gets the width of the stroke.

polygon :

The polygon

Returns :

the width of the stroke

Since 0.4


champlain_polygon_set_fill ()

void                champlain_polygon_set_fill          (ChamplainPolygon *polygon,
                                                         gboolean value);

Sets the polygon to have be filled

polygon :

The polygon

value :

if the polygon is filled

Since 0.4


champlain_polygon_set_fill_color ()

void                champlain_polygon_set_fill_color    (ChamplainPolygon *polygon,
                                                         const ClutterColor *color);

Set the polygon's fill color.

polygon :

The polygon

color :

The polygon's fill color or NULL to reset to the default color. The color parameter is copied.

Since 0.4


champlain_polygon_set_mark_points ()

void                champlain_polygon_set_mark_points   (ChamplainPolygon *polygon,
                                                         gboolean value);

Sets the property determining if the points in the polygon should get marked for extra visibility when drawing the polygon.

polygon :

The polygon

value :

mark points when drawing the polygon.

Since 0.4.3


champlain_polygon_set_stroke ()

void                champlain_polygon_set_stroke        (ChamplainPolygon *polygon,
                                                         gboolean value);

Sets the polygon to have a stroke

polygon :

The polygon

value :

if the polygon is stroked

Since 0.4


champlain_polygon_set_stroke_color ()

void                champlain_polygon_set_stroke_color  (ChamplainPolygon *polygon,
                                                         const ClutterColor *color);

Set the polygon's stroke color.

polygon :

The polygon

color :

The polygon's stroke color or NULL to reset to the default color. The color parameter is copied.

Since 0.4


champlain_polygon_set_stroke_width ()

void                champlain_polygon_set_stroke_width  (ChamplainPolygon *polygon,
                                                         gdouble value);

Sets the width of the stroke

polygon :

The polygon

value :

the width of the stroke (in pixels)

Since 0.4


champlain_polygon_show ()

void                champlain_polygon_show              (ChamplainPolygon *polygon);

Makes the polygon visible

polygon :

The polygon

Since 0.4


champlain_polygon_hide ()

void                champlain_polygon_hide              (ChamplainPolygon *polygon);

Hides the polygon

polygon :

The polygon

Since 0.4

Property Details

The "closed-path" property

  "closed-path"              gboolean              : Read / Write

The Path is Closed.

Default value: FALSE


The "fill" property

  "fill"                     gboolean              : Read / Write

The shape should be filled

Default value: FALSE

Since 0.4


The "fill-color" property

  "fill-color"               ClutterColor*         : Read / Write

The polygon's fill color.


The "mark-points" property

  "mark-points"              gboolean              : Read / Write

Wether the polygons points should be marked for extra visibility.

Default value: FALSE

Since 0.4.3


The "stroke" property

  "stroke"                   gboolean              : Read / Write

The shape should be stroked

Default value: TRUE

Since 0.4


The "stroke-color" property

  "stroke-color"             ClutterColor*         : Read / Write

The polygon's stroke color

Since 0.4


The "stroke-width" property

  "stroke-width"             gdouble               : Read / Write

The polygon's stroke width (in pixels)

Allowed values: [0,100]

Default value: 2

Since 0.4


The "visible" property

  "visible"                  gboolean              : Read / Write

Wether the polygon is visible

Default value: TRUE

Since 0.4