GeoCanvasShapes

GeoCanvasShapes — A group of related primitive drawing objects represented by geo coordinates.

Synopsis




            GeoCanvasShapes;
            GeoCanvasShapesClass;
            GeoCanvasShapesPrivate;
            GeoPoint;
            GeoRectangle;
            GeoVector;
GObject*    geo_canvas_shapes_add_polygon   (GeoCanvasShapes *shapes,
                                             FooCanvasPoints *lon_lat_points,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_polyline  (GeoCanvasShapes *shapes,
                                             FooCanvasPoints *lon_lat_points,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_vector    (GeoCanvasShapes *shapes,
                                             GeoVector *vector,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_line      (GeoCanvasShapes *shapes,
                                             double lon1,
                                             double lat1,
                                             double lon2,
                                             double lat2,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_rectangle (GeoCanvasShapes *shapes,
                                             GeoRectangle *rect,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_text      (GeoCanvasShapes *shapes,
                                             GeoPoint *point,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_ellipse   (GeoCanvasShapes *shapes,
                                             GeoRectangle *rect,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_pixbuf    (GeoCanvasShapes *shapes,
                                             GeoPoint *point,
                                             const gchar *first_arg_name,
                                             ...);
GObject*    geo_canvas_shapes_add_place     (GeoCanvasShapes *shapes,
                                             GType item_type,
                                             GeoPoint *point,
                                             const gchar *first_arg_name,
                                             ...);
void        geo_canvas_shapes_convert_w2g   (GeoCanvasShapes *shapes);

Object Hierarchy


  GObject
   +----GtkObject
         +----FooCanvasItem
               +----FooCanvasGroup
                     +----GeoCanvasGroup
                           +----GeoCanvasShapes

Properties


  "anchor"               GtkAnchorType         : Read / Write
  "family"               gchararray            : Read / Write
  "fill-color-rgba"      gulong                : Read / Write
  "fill-stipple"         GdkDrawable           : Read / Write
  "line-style"           GdkLineStyle          : Read / Write
  "outline-color-rgba"   gulong                : Read / Write
  "outline-stipple"      GdkDrawable           : Read / Write
  "size-points"          gdouble               : Read / Write
  "width-pixels"         guint                 : Read / Write

Description

This class implements the GeoCanvasGroup interface. It provides generalized methods for drawing and managing primitive features.

This class provides a set of commonly used properties for the various primitive canvas types. Properties for primitives that are not instantiated may be safely set without seeing warning messages. Any property that is set in the GeoCanvasShapes class may be overridden for a subset of primitives by passing that property directly into the 'add' method variable arguments list.

Details

GeoCanvasShapes

typedef struct _GeoCanvasShapes GeoCanvasShapes;


GeoCanvasShapesClass

typedef struct {
        GeoCanvasGroupClass parent_class;
} GeoCanvasShapesClass;


GeoCanvasShapesPrivate

typedef struct _GeoCanvasShapesPrivate GeoCanvasShapesPrivate;


GeoPoint

typedef struct {
        double lon, lat;
} GeoPoint;


GeoRectangle

typedef struct {
        double lon1, lat1, lon2, lat2;
} GeoRectangle;

double lon1; Westernmost point.
double lat1; Northernmost point.
double lon2; Easternmost point.
double lat2; Southernmost point.

GeoVector

typedef struct {
        double lon, lat, angle, pixels;
} GeoVector;

double lon; Begin point.
double lat; Begin point.
double angle; Degrees from True North.
double pixels; Constant length regardless of zoom scale.

geo_canvas_shapes_add_polygon ()

GObject*    geo_canvas_shapes_add_polygon   (GeoCanvasShapes *shapes,
                                             FooCanvasPoints *lon_lat_points,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasPolygon to the shapes group as specified by the input lat_lon_points. Takes over responsibility for keeping geo to world references in sync.

shapes :
lon_lat_points : Array of points in longitude, latitude order. See GnomeCanvasUtil for information on how to build this array. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasPolygon item. Use this object reference to change polygon specific properties or register callbacks.

geo_canvas_shapes_add_polyline ()

GObject*    geo_canvas_shapes_add_polyline  (GeoCanvasShapes *shapes,
                                             FooCanvasPoints *lon_lat_points,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasLine to the shapes group as specified by the input lat_lon_points. Takes over responsibility for keeping geo to world references in sync.

shapes :
lon_lat_points : Array of points in longitude, latitude order. See GnomeCanvasUtil for information on how to build this array. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasLine item. Use this object reference to change line specific properties or register callbacks.

geo_canvas_shapes_add_vector ()

GObject*    geo_canvas_shapes_add_vector    (GeoCanvasShapes *shapes,
                                             GeoVector *vector,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasLine to the shapes group such that the begin point corresponds to the GeoVector lon and lat points and the end point is always at angle degrees from North with a pixel length as specified regardless of the zoom scale.

shapes :
vector : The lat, lon, angle, and pixel values. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasLine item. Use this object reference to change line specific properties or register callbacks.

geo_canvas_shapes_add_line ()

GObject*    geo_canvas_shapes_add_line      (GeoCanvasShapes *shapes,
                                             double lon1,
                                             double lat1,
                                             double lon2,
                                             double lat2,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasLine to the shapes group as specified by the input points. Takes over responsibility for keeping geo to world references in sync. Use the "geodata" dataset key to retrieve a FooCanvasPoints reference later.

shapes :
lon1 : Longitude of the begin point.
lat1 : Latitude of the begin point.
lon2 : Longitude of the end point.
lat2 : Latitude of the end point.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasLine item. Use this object reference to change line specific properties or register callbacks.

geo_canvas_shapes_add_rectangle ()

GObject*    geo_canvas_shapes_add_rectangle (GeoCanvasShapes *shapes,
                                             GeoRectangle *rect,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasRectangle to the shapes group as specified by the input struct. Takes over responsibility for keeping geo to world references in sync.

shapes :
rect : GeoRectangle defines the upper left (lon1, lat1) and lower right (lon2, lat2) coordinate points of the rectangle. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasRectangle item. Use this object reference to change rectangle specific properties or register callbacks.

geo_canvas_shapes_add_text ()

GObject*    geo_canvas_shapes_add_text      (GeoCanvasShapes *shapes,
                                             GeoPoint *point,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasText to the shapes group as specified by the input struct. Takes over responsibility for keeping geo to world references in sync.

shapes :
point : The longitude and latitude of the anchor point for the text. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasText item. Use this object reference to change text specific properties or register callbacks.

geo_canvas_shapes_add_ellipse ()

GObject*    geo_canvas_shapes_add_ellipse   (GeoCanvasShapes *shapes,
                                             GeoRectangle *rect,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasEllipse to the shapes group as specified by the input struct. Takes over responsibility for keeping geo to world references in sync.

shapes :
rect : Defines the upper left and lower right corners of the rectangle that bounds the ellipse. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasEllipse item. Use this object reference to change ellipse specific properties or register callbacks.

geo_canvas_shapes_add_pixbuf ()

GObject*    geo_canvas_shapes_add_pixbuf    (GeoCanvasShapes *shapes,
                                             GeoPoint *point,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasPixbuf to the shapes group as specified by the input struct. Takes over responsibility for keeping geo to world references in sync.

shapes :
point : The longitude and latitude of the anchor point for the pixbuf. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasPixbuf item. Use this object reference to change pixbuf specific properties or register callbacks.

geo_canvas_shapes_add_place ()

GObject*    geo_canvas_shapes_add_place     (GeoCanvasShapes *shapes,
                                             GType item_type,
                                             GeoPoint *point,
                                             const gchar *first_arg_name,
                                             ...);

Adds a FooCanvasItem to the shapes group as specified by the input struct. The canvas item must have 'x' and 'y' coordinate properties.Takes over responsibility for keeping geo to world references in sync.

shapes :
item_type : A FooCanvasItem type id that has x,y properties.
point : The longitude and latitude of the anchor point for the place. Use the "geodata" dataset key to retrieve this later.
first_arg_name : A list of object properties name/value pairs, NULL-terminated,
... :
Returns : A pointer the newly created FooCanvasPixbuf item. Use this object reference to change pixbuf specific properties or register callbacks.

geo_canvas_shapes_convert_w2g ()

void        geo_canvas_shapes_convert_w2g   (GeoCanvasShapes *shapes);

Immediately converts the present canvas world coordinates to geographic coordinates and stores them in the "geodata" dataset for each primitive object. The geo coordinates are used henceforth to maintain a consistent geographic position on the canvas. This function should be called each time a shape is manipulated using world coordinates. An example case for manipulating a shape with world coordinates might be a pointer controlled move or resize operation.

shapes :

Properties

The "anchor" property

  "anchor"               GtkAnchorType         : Read / Write

Anchor for group (text item only).

Default value: GTK_ANCHOR_CENTER


The "family" property

  "family"               gchararray            : Read / Write

Name of the font family, e.g. Sans, Helvetica, etc.

Default value: NULL


The "fill-color-rgba" property

  "fill-color-rgba"      gulong                : Read / Write

Fill Color RGBA.


The "fill-stipple" property

  "fill-stipple"         GdkDrawable           : Read / Write

Fill Stipple.


The "line-style" property

  "line-style"           GdkLineStyle          : Read / Write

Line style.

Default value: GDK_LINE_SOLID


The "outline-color-rgba" property

  "outline-color-rgba"   gulong                : Read / Write

Outline Color RGBA.


The "outline-stipple" property

  "outline-stipple"      GdkDrawable           : Read / Write

Outline Stipple.


The "size-points" property

  "size-points"          gdouble               : Read / Write

Font size in points for group (text item only).

Allowed values: >= 0

Default value: 0


The "width-pixels" property

  "width-pixels"         guint                 : Read / Write

Line width in pixels.

Default value: 0

See Also

GeoCanvasGroup