Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_trees.h File Reference

trees module headers More...

#include "nilorea/n_common.h"
#include "nilorea/n_str.h"
#include "nilorea/n_log.h"
#include "nilorea/n_list.h"
#include "nilorea/n_hash.h"
#include "nilorea/n_3d.h"
+ Include dependency graph for n_trees.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  COORD_VALUE
 Union to store the coordinate values. More...
 
struct  NODE_DATA
 structure of a TREE node data More...
 
union  NODE_DATA_TYPES
 union of the possibles data values of a TREE node More...
 
struct  OCTREE
 structure of an OCTREE More...
 
struct  OCTREE_NODE
 structure of an OCTREE node More...
 
struct  POINT2D
 Structure for a POINT2D in the 2D space. More...
 
struct  POINT3D
 Structure for a POINT3D in the 3D space. More...
 
struct  QUADTREE
 structure of a quad tree More...
 
struct  QUADTREE_NODE
 structure of a quad tree node More...
 
struct  TREE
 structure of a TREE More...
 
struct  TREE_NODE
 structure of a n-ary TREE node More...
 

Typedefs

typedef int(* compare_func) (COORD_VALUE a, COORD_VALUE b)
 function pointer types for comparison
 
typedef void(* print_func) (COORD_VALUE val)
 function pointer types for debug print
 

Enumerations

enum  COORD_TYPE { COORD_INT , COORD_FLOAT , COORD_DOUBLE }
 Enum for coordinate types. More...
 

Functions

QUADTREE_NODEcreate_node (COORD_VALUE x, COORD_VALUE y, void *data_ptr)
 function to create a new quad tree node
 
OCTREEcreate_octree (int type)
 Create a new OCTREE with a specified coordinate type.
 
OCTREE_NODEcreate_octree_node (POINT3D point, void *data_ptr)
 create and OCTREE node
 
QUADTREEcreate_quadtree (int coord_type)
 Function to create a new quad tree.
 
void free_octree (OCTREE *OCTREE)
 free the OCTREE
 
void free_octree_node (OCTREE_NODE *node)
 recursive function to free an OCTREE node and its children
 
void free_quadtree (QUADTREE_NODE *root)
 Function to free the quad tree.
 
void insert (QUADTREE *qt, QUADTREE_NODE **root, COORD_VALUE x, COORD_VALUE y, void *data_ptr)
 Function to insert a point into the quad tree.
 
void insert_octree (OCTREE *OCTREE, POINT3D point, void *data_ptr)
 Insert a point into the OCTREE.
 
TREEnew_tree ()
 create a new TREE
 
QUADTREE_NODEsearch (QUADTREE *qt, QUADTREE_NODE *root, COORD_VALUE x, COORD_VALUE y)
 Function to search for a point in the quad tree.
 
TREE_NODEtree_create_node (NODE_DATA value, void(*destroy_func)(void *ptr))
 create a TREE node
 
int tree_delete_node (TREE *tree, TREE_NODE *node)
 delete a TREE node
 
void tree_destroy (TREE **tree)
 destroy a TREE
 
int tree_insert_child (TREE_NODE *parent, TREE_NODE *child)
 insert a child node into the parent node
 

Detailed Description

trees module headers

Author
Castagnier Mickael
Version
1.0
Date
07/08/2024

Definition in file n_trees.h.