Blender V2.61 - r43446
Classes | Defines | Typedefs | Enumerations | Functions

BLI_pbvh.h File Reference

A BVH for high poly meshes. More...

Go to the source code of this file.

Classes

struct  PBVHProxyNode
struct  PBVHVertexIter

Defines

#define PBVH_ITER_ALL   0
#define PBVH_ITER_UNIQUE   1
#define BLI_pbvh_vertex_iter_begin(bvh, node, vi, mode)
#define BLI_pbvh_vertex_iter_end

Typedefs

typedef struct PBVH PBVH
typedef struct PBVHNode PBVHNode
typedef int(* BLI_pbvh_SearchCallback )(PBVHNode *node, void *data)
typedef void(* BLI_pbvh_HitCallback )(PBVHNode *node, void *data)
typedef void(* BLI_pbvh_HitOccludedCallback )(PBVHNode *node, void *data, float *tmin)
typedef struct PBVHVertexIter PBVHVertexIter

Enumerations

enum  PBVHNodeFlags {
  PBVH_Leaf = 1, PBVH_UpdateNormals = 2, PBVH_UpdateBB = 4, PBVH_UpdateOriginalBB = 8,
  PBVH_UpdateDrawBuffers = 16, PBVH_UpdateRedraw = 32
}

Functions

PBVHBLI_pbvh_new (void)
void BLI_pbvh_build_mesh (PBVH *bvh, struct MFace *faces, struct MVert *verts, int totface, int totvert)
void BLI_pbvh_build_grids (PBVH *bvh, struct DMGridData **grids, struct DMGridAdjacency *gridadj, int totgrid, int gridsize, void **gridfaces)
void BLI_pbvh_free (PBVH *bvh)
void BLI_pbvh_search_callback (PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data, BLI_pbvh_HitCallback hcb, void *hit_data)
void BLI_pbvh_search_gather (PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data, PBVHNode ***array, int *tot)
void BLI_pbvh_raycast (PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data, float ray_start[3], float ray_normal[3], int original)
int BLI_pbvh_node_raycast (PBVH *bvh, PBVHNode *node, float(*origco)[3], float ray_start[3], float ray_normal[3], float *dist)
void BLI_pbvh_node_draw (PBVHNode *node, void *data)
int BLI_pbvh_node_planes_contain_AABB (PBVHNode *node, void *data)
void BLI_pbvh_draw (PBVH *bvh, float(*planes)[4], float(*face_nors)[3], int smooth)
void BLI_pbvh_node_mark_update (PBVHNode *node)
void BLI_pbvh_node_get_grids (PBVH *bvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, struct DMGridData ***griddata, struct DMGridAdjacency **gridadj)
void BLI_pbvh_node_num_verts (PBVH *bvh, PBVHNode *node, int *uniquevert, int *totvert)
void BLI_pbvh_node_get_verts (PBVH *bvh, PBVHNode *node, int **vert_indices, struct MVert **verts)
void BLI_pbvh_node_get_BB (PBVHNode *node, float bb_min[3], float bb_max[3])
void BLI_pbvh_node_get_original_BB (PBVHNode *node, float bb_min[3], float bb_max[3])
float BLI_pbvh_node_get_tmin (PBVHNode *node)
void BLI_pbvh_update (PBVH *bvh, int flags, float(*face_nors)[3])
void BLI_pbvh_redraw_BB (PBVH *bvh, float bb_min[3], float bb_max[3])
void BLI_pbvh_get_grid_updates (PBVH *bvh, int clear, void ***gridfaces, int *totface)
void BLI_pbvh_grids_update (PBVH *bvh, struct DMGridData **grids, struct DMGridAdjacency *gridadj, void **gridfaces)
float(* BLI_pbvh_get_vertCos (struct PBVH *pbvh))[3]
void BLI_pbvh_apply_vertCos (struct PBVH *pbvh, float(*vertCos)[3])
int BLI_pbvh_isDeformed (struct PBVH *pbvh)
void BLI_pbvh_node_get_proxies (PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count)
void BLI_pbvh_node_free_proxies (PBVHNode *node)
PBVHProxyNodeBLI_pbvh_node_add_proxy (PBVH *bvh, PBVHNode *node)
void BLI_pbvh_gather_proxies (PBVH *pbvh, PBVHNode ***nodes, int *totnode)

Detailed Description

A BVH for high poly meshes.

Definition in file BLI_pbvh.h.


Define Documentation

#define BLI_pbvh_vertex_iter_begin (   bvh,
  node,
  vi,
  mode 
)
#define BLI_pbvh_vertex_iter_end
#define PBVH_ITER_ALL   0

Definition at line 137 of file BLI_pbvh.h.

Referenced by sculpt_undo_push_node(), and update_node_vb().

#define PBVH_ITER_UNIQUE   1

Typedef Documentation

typedef void(* BLI_pbvh_HitCallback)(PBVHNode *node, void *data)

Definition at line 49 of file BLI_pbvh.h.

typedef void(* BLI_pbvh_HitOccludedCallback)(PBVHNode *node, void *data, float *tmin)

Definition at line 50 of file BLI_pbvh.h.

typedef int(* BLI_pbvh_SearchCallback)(PBVHNode *node, void *data)

Definition at line 47 of file BLI_pbvh.h.

typedef struct PBVH PBVH

Definition at line 37 of file BLI_pbvh.h.

typedef struct PBVHNode PBVHNode

Definition at line 38 of file BLI_pbvh.h.


Enumeration Type Documentation

Enumerator:
PBVH_Leaf 
PBVH_UpdateNormals 
PBVH_UpdateBB 
PBVH_UpdateOriginalBB 
PBVH_UpdateDrawBuffers 
PBVH_UpdateRedraw 

Definition at line 92 of file BLI_pbvh.h.


Function Documentation

void BLI_pbvh_apply_vertCos ( struct PBVH pbvh,
float(*)  vertCos[3] 
)
void BLI_pbvh_build_grids ( PBVH bvh,
struct DMGridData **  grids,
struct DMGridAdjacency gridadj,
int  totgrid,
int  gridsize,
void **  gridfaces 
)
void BLI_pbvh_build_mesh ( PBVH bvh,
struct MFace faces,
struct MVert verts,
int  totface,
int  totvert 
)
void BLI_pbvh_draw ( PBVH bvh,
float(*)  planes[4],
float(*)  face_nors[3],
int  smooth 
)
void BLI_pbvh_free ( PBVH bvh)
void BLI_pbvh_gather_proxies ( PBVH pbvh,
PBVHNode ***  nodes,
int *  totnode 
)

Definition at line 1650 of file pbvh.c.

References MEM_callocN(), MEM_freeN(), PBVH::nodes, NULL, and PBVH::totnode.

Referenced by sculpt_combine_proxies().

void BLI_pbvh_get_grid_updates ( PBVH bvh,
int  clear,
void ***  gridfaces,
int *  totface 
)
float(* BLI_pbvh_get_vertCos ( struct PBVH pbvh) )[3]

Definition at line 1542 of file pbvh.c.

References co, copy_v3_v3(), MEM_callocN(), and NULL.

Referenced by sculpt_update_keyblock().

void BLI_pbvh_grids_update ( PBVH bvh,
struct DMGridData **  grids,
struct DMGridAdjacency gridadj,
void **  gridfaces 
)

Definition at line 1535 of file pbvh.c.

References PBVH::gridadj, PBVH::gridfaces, and PBVH::grids.

Referenced by ccgDM_getPBVH().

int BLI_pbvh_isDeformed ( struct PBVH pbvh)

Definition at line 1599 of file pbvh.c.

References PBVH::deformed.

Referenced by sculpt_update_mesh_elements().

PBVH* BLI_pbvh_new ( void  )

Definition at line 629 of file pbvh.c.

References MEM_callocN().

Referenced by ccgDM_getPBVH(), and cdDM_getPBVH().

PBVHProxyNode* BLI_pbvh_node_add_proxy ( PBVH bvh,
PBVHNode node 
)
void BLI_pbvh_node_draw ( PBVHNode node,
void *  data 
)

Referenced by BLI_pbvh_draw().

void BLI_pbvh_node_free_proxies ( PBVHNode node)

Definition at line 1632 of file pbvh.c.

References PBVHProxyNode::co, MEM_freeN(), p, PBVHNode::proxies, and PBVHNode::proxy_count.

Referenced by sculpt_combine_proxies().

void BLI_pbvh_node_get_BB ( PBVHNode node,
float  bb_min[3],
float  bb_max[3] 
)
void BLI_pbvh_node_get_grids ( PBVH bvh,
PBVHNode node,
int **  grid_indices,
int *  totgrid,
int *  maxgrid,
int *  gridsize,
struct DMGridData ***  griddata,
struct DMGridAdjacency **  gridadj 
)
void BLI_pbvh_node_get_original_BB ( PBVHNode node,
float  bb_min[3],
float  bb_max[3] 
)

Definition at line 1277 of file pbvh.c.

References BB::bmax, BB::bmin, copy_v3_v3(), and PBVHNode::orig_vb.

Referenced by ray_aabb_intersect(), and sculpt_search_sphere_cb().

void BLI_pbvh_node_get_proxies ( PBVHNode node,
PBVHProxyNode **  proxies,
int *  proxy_count 
)

Definition at line 1283 of file pbvh.c.

References PBVHNode::proxies, and PBVHNode::proxy_count.

Referenced by sculpt_combine_proxies().

float BLI_pbvh_node_get_tmin ( PBVHNode node)

Definition at line 892 of file pbvh.c.

References PBVHNode::tmin.

Referenced by sculpt_raycast_cb().

void BLI_pbvh_node_get_verts ( PBVH bvh,
PBVHNode node,
int **  vert_indices,
struct MVert **  verts 
)

Definition at line 1232 of file pbvh.c.

References PBVHNode::vert_indices, and PBVH::verts.

void BLI_pbvh_node_mark_update ( PBVHNode node)
void BLI_pbvh_node_num_verts ( PBVH bvh,
PBVHNode node,
int *  uniquevert,
int *  totvert 
)
int BLI_pbvh_node_planes_contain_AABB ( PBVHNode node,
void *  data 
)

Definition at line 1486 of file pbvh.c.

References BLI_pbvh_node_get_BB(), data, dot_v3v3(), and i.

Referenced by BLI_pbvh_draw().

int BLI_pbvh_node_raycast ( PBVH bvh,
PBVHNode node,
float(*)  origco[3],
float  ray_start[3],
float  ray_normal[3],
float *  dist 
)
void BLI_pbvh_raycast ( PBVH bvh,
BLI_pbvh_HitOccludedCallback  cb,
void *  data,
float  ray_start[3],
float  ray_normal[3],
int  original 
)
void BLI_pbvh_redraw_BB ( PBVH bvh,
float  bb_min[3],
float  bb_max[3] 
)
void BLI_pbvh_search_callback ( PBVH bvh,
BLI_pbvh_SearchCallback  scb,
void *  search_data,
BLI_pbvh_HitCallback  hcb,
void *  hit_data 
)

Definition at line 825 of file pbvh.c.

References PBVHNode::flag, pbvh_iter_begin(), pbvh_iter_end(), pbvh_iter_next(), and PBVH_Leaf.

Referenced by BLI_pbvh_draw(), and sculpt_undo_restore().

void BLI_pbvh_search_gather ( PBVH bvh,
BLI_pbvh_SearchCallback  scb,
void *  search_data,
PBVHNode ***  array,
int *  tot 
)
void BLI_pbvh_update ( PBVH bvh,
int  flags,
float(*)  face_nors[3] 
)