navit  0.5.3-trunk
vehicle.h File Reference

Go to the source code of this file.

Data Structures

struct  vehicle_methods
 

Functions

struct vehiclevehicle_new (struct attr *parent, struct attr **attrs)
 Creates a new vehicle. More...
 
void vehicle_destroy (struct vehicle *this_)
 Destroys a vehicle. More...
 
struct attr_itervehicle_attr_iter_new (void *unused)
 
void vehicle_attr_iter_destroy (struct attr_iter *iter)
 
int vehicle_get_attr (struct vehicle *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 
int vehicle_set_attr (struct vehicle *this_, struct attr *attr)
 
int vehicle_add_attr (struct vehicle *this_, struct attr *attr)
 
int vehicle_remove_attr (struct vehicle *this_, struct attr *attr)
 Generic remove function. More...
 
void vehicle_set_cursor (struct vehicle *this_, struct cursor *cursor, int overwrite)
 
void vehicle_draw (struct vehicle *this_, struct graphics *gra, struct point *pnt, int angle, int speed)
 
int vehicle_get_cursor_data (struct vehicle *this_, struct point *pnt, int *angle, int *speed)
 
void vehicle_log_gpx_add_tag (char *tag, char **logstr)
 
struct vehiclevehicle_ref (struct vehicle *this_)
 
void vehicle_unref (struct vehicle *this_)
 

Function Documentation

◆ vehicle_add_attr()

int vehicle_add_attr ( struct vehicle this_,
struct attr attr 
)

Generic add function

Parameters
this_A vehicle
attrThe attribute to add
Returns
true if the attribute was added, false if not.

References attr_generic_add_attr(), attr::callback, callback_list_add(), vehicle::cbl, attr::cursor, vehicle::cursor_fixed, attr::log, attr::type, attr::u, vehicle_add_log(), and vehicle_set_cursor().

Referenced by navit_add_vehicle(), and pedestrian_navit_init().

◆ vehicle_attr_iter_destroy()

void vehicle_attr_iter_destroy ( struct attr_iter iter)

Destroys a vehicle attribute iterator

Parameters
itera vehicle attr_iter

References attr_iter::iter.

Referenced by NGQProxyVehicle::dropIterFunc(), and save_vehicle_xml().

◆ vehicle_attr_iter_new()

struct attr_iter* vehicle_attr_iter_new ( void *  unused)

Creates an attribute iterator to be used with vehicles

Referenced by NGQProxyVehicle::getIterFunc(), and save_vehicle_xml().

◆ vehicle_destroy()

◆ vehicle_draw()

void vehicle_draw ( struct vehicle this_,
struct graphics gra,
struct point pnt,
int  angle,
int  speed 
)

Draws a vehicle on top of a graphics.

Parameters
this_The vehicle
graThe graphics
pntScreen coordinates of the vehicle.
angleThe angle relative to the map.
speedThe speed of the vehicle.

References vehicle::angle, vehicle::bg, c, vehicle::cursor, vehicle::cursor_pnt, dbg, vehicle::gra, graphics_background_gc(), graphics_gc_new(), graphics_gc_set_foreground(), graphics_init(), graphics_overlay_new(), graphics_overlay_resize(), cursor::h, lvl_debug, navit_sqrt, vehicle::need_resize, vehicle::real_h, vehicle::real_w, vehicle::speed, vehicle::trans, transform_set_screen_center(), vehicle_draw_do(), cursor::w, point::x, and point::y.

Referenced by navit_vehicle_draw().

◆ vehicle_get_attr()

int vehicle_get_attr ( struct vehicle this_,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

◆ vehicle_get_cursor_data()

int vehicle_get_cursor_data ( struct vehicle this_,
struct point pnt,
int *  angle,
int *  speed 
)

◆ vehicle_log_gpx_add_tag()

void vehicle_log_gpx_add_tag ( char *  tag,
char **  logstr 
)

Add a tag to the extensions section of a GPX trackpoint.

Parameters
tagThe tag to add
logstrPointer to a pointer to a string to be inserted into the log. When calling this function,
*logstr
must point to the substring into which the new tag is to be inserted. If
*logstr
is NULL, a new string will be created for the extensions section. Upon returning,
*logstr
will point to the new string with the additional tag inserted.

References attr::str.

Referenced by pedestrian_log().

◆ vehicle_new()

struct vehicle* vehicle_new ( struct attr parent,
struct attr **  attrs 
)

Creates a new vehicle.

Parameters
parent
attrsPoints to a null-terminated array of pointers to the attributes for the new vehicle type.
Returns
The newly created vehicle object

References attr_list_dup(), attr_search(), attr::attrs, callback_list_destroy(), callback_list_new(), cbl, vehicle::cbl, center, dbg, vehicle::log_to_cb, lvl_debug, lvl_error, vehicle::meth, navit_object_ref(), vehicle::priv, projection_screen, attr::str, vehicle::trans, transform_new(), type, attr::u, vehicle_func, and vehicle_set_default_name().

◆ vehicle_ref()

struct vehicle* vehicle_ref ( struct vehicle this_)

◆ vehicle_remove_attr()

int vehicle_remove_attr ( struct vehicle this_,
struct attr attr 
)

Generic remove function.

Used to remove a callback from the vehicle.

Parameters
this_A vehicle
attr

References attr_generic_remove_attr(), attr::callback, callback_list_remove(), vehicle::cbl, attr::log, vehicle::log_to_cb, attr::type, and attr::u.

◆ vehicle_set_attr()

int vehicle_set_attr ( struct vehicle this_,
struct attr attr 
)

◆ vehicle_set_cursor()

void vehicle_set_cursor ( struct vehicle this_,
struct cursor cursor,
int  overwrite 
)

◆ vehicle_unref()

void vehicle_unref ( struct vehicle this_)