Smrender
 All Data Structures Files Functions Variables Macros
Macros | Typedefs | Enumerations | Functions
smcore.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ERULE_OUTOFBBOX   1
 The node is outside of the area to render.
 
#define ERULE_WAYOPEN   2
 The rule applies only to closed ways.
 
#define ERULE_WAYCLOSED   3
 The rule applies only to open ways.
 
#define ERULE_NOMATCH   4
 The tags of the rule do not match the object.
 
#define ERULE_INVISIBLE   5
 The object is invisible.
 
#define RULES_TAG   "smrender:rules"
 

Typedefs

typedef int(* tree_func_t )(osm_obj_t *, void *)
 

Enumerations

enum  { IDX_NODE, IDX_WAY, IDX_REL }
 

Functions

int traverse (const bx_node_t *, int, int, tree_func_t, void *)
 
int execute_rules (bx_node_t *, int)
 
int rev_index_way_nodes (osm_way_t *, bx_node_t **)
 
int rev_index_rel_nodes (osm_rel_t *, bx_node_t **)
 
int get_rev_index (osm_obj_t **, const osm_obj_t *)
 
void sm_wait_threads (void)
 
int traverse_queue (const bx_node_t *, int, tree_func_t, void *)
 
int sm_is_threaded (const smrule_t *)
 

Detailed Description

This file contains the prototypes for the core routines of the execution engine.

Author
Bernhard R. Fischer

Function Documentation

int get_rev_index ( osm_obj_t **  optr,
const osm_obj_t o 
)

Find OSM object in object list and return index.

Parameters
optrPointer to NULL-terminated object list.
oPointer to object.
Returns
Index greater or equal 0 of object within list. If the list has no such object the index of the last element (which is a NULL pointer) is returned. If optr itself is a NULL pointer -1 is returned.
int traverse ( const bx_node_t nt,
int  d,
int  idx,
tree_func_t  dhandler,
void *  p 
)

Recursively traverse tree and call function dhandler for all leaf nodes which are not NULL.

Parameters
ntPointer to tree root.
dDepth of traversal. This should be 0 if called at the root of the tree.
idxThe tree actually allows to be an overlapped tree of several trees. idx is the index of the tree which should be traversed.
dhandlerThis is the function called at the leaf node.
pThis is a generic argument which is passed to dhandler upon call.
Returns
On success 0 is returned. If dhandler() returns a value != 0 traverse() will break the recursion and return the return value of dhandler().