Blender V2.61 - r43446
Functions

bmesh_private.h File Reference

#include "BKE_bmesh.h"

Go to the source code of this file.

Functions

struct BME_VertBME_addvertlist (struct BME_Mesh *bm, struct BME_Vert *example)
struct BME_EdgeBME_addedgelist (struct BME_Mesh *bm, struct BME_Vert *v1, struct BME_Vert *v2, struct BME_Edge *example)
struct BME_PolyBME_addpolylist (struct BME_Mesh *bm, struct BME_Poly *example)
struct BME_LoopBME_create_loop (struct BME_Mesh *bm, struct BME_Vert *v, struct BME_Edge *e, struct BME_Poly *f, struct BME_Loop *example)
void BME_free_vert (struct BME_Mesh *bm, struct BME_Vert *v)
void BME_free_edge (struct BME_Mesh *bm, struct BME_Edge *e)
void BME_free_poly (struct BME_Mesh *bm, struct BME_Poly *f)
void BME_free_loop (struct BME_Mesh *bm, struct BME_Loop *l)
void BME_cycle_append (void *h, void *nt)
int BME_cycle_remove (void *h, void *remn)
int BME_cycle_validate (int len, void *h)
int BME_disk_append_edge (struct BME_Edge *e, struct BME_Vert *v)
void BME_disk_remove_edge (struct BME_Edge *e, struct BME_Vert *v)
void BME_radial_append (struct BME_Edge *e, struct BME_Loop *l)
void BME_radial_remove_loop (struct BME_Loop *l, struct BME_Edge *e)
int BME_edge_swapverts (struct BME_Edge *e, struct BME_Vert *orig, struct BME_Vert *new)
int BME_disk_hasedge (struct BME_Vert *v, struct BME_Edge *e)
void BME_error (void)

Detailed Description

Definition in file bmesh_private.h.


Function Documentation

struct BME_Edge* BME_addedgelist ( struct BME_Mesh bm,
struct BME_Vert v1,
struct BME_Vert v2,
struct BME_Edge example 
) [read]
struct BME_Poly* BME_addpolylist ( struct BME_Mesh bm,
struct BME_Poly example 
) [read]
struct BME_Vert* BME_addvertlist ( BME_Mesh bm,
BME_Vert example 
) [read]
struct BME_Loop* BME_create_loop ( struct BME_Mesh bm,
struct BME_Vert v,
struct BME_Edge e,
struct BME_Poly f,
struct BME_Loop example 
) [read]
void BME_cycle_append ( void *  h,
void *  nt 
)

BMESH CYCLES

Cycles are circular doubly linked lists that form the basis of adjacency information in the BME modeller. Full adjacency relations can be derived from examining these cycles very quickly. Although each cycle is a double circular linked list, each one is considered to have a 'base' or 'head', and care must be taken by Euler code when modifying the contents of a cycle.

The contents of this file are split into two parts. First there are the BME_cycle family of functions which are generic circular double linked list procedures. The second part contains higher level procedures for supporting modification of specific cycle types.

The three cycles explicitly stored in the BMesh data structure are as follows:

1: The Disk Cycle - A circle of edges around a vertex Base: vertex->edge pointer.

This cycle is the most complicated in terms of its structure. Each BME_Edge contains two BME_CycleNode structures to keep track of that edge's membership in the disk cycle of each of its vertices. However for any given vertex it may be the first in some edges in its disk cycle and the second for others. The BME_disk_XXX family of functions contain some nice utilities for navigating disk cycles in a way that hides this detail from the tool writer.

Note that the disk cycle is completley independant from face data. One advantage of this is that wire edges are fully integrated into the topology database. Another is that the the disk cycle has no problems dealing with non-manifold conditions involving faces.

Functions relating to this cycle:

BME_disk_append_edge BME_disk_remove_edge BME_disk_nextedge BME_disk_getpointer

2: The Radial Cycle - A circle of face edges (BME_Loop) around an edge Base: edge->loop->radial structure.

The radial cycle is similar to the radial cycle in the radial edge data structure.* Unlike the radial edge however, the radial cycle does not require a large amount of memory to store non-manifold conditions since BMesh does not keep track of region/shell information.

Functions relating to this cycle:

BME_radial_append BME_radial_remove_loop BME_radial_nextloop BME_radial_find_face

3: The Loop Cycle - A circle of face edges around a polygon. Base: polygon->loopbase.

The loop cycle keeps track of a faces vertices and edges. It should be noted that the direction of a loop cycle is either CW or CCW depending on the face normal, and is not oriented to the faces editedges.

Functions relating to this cycle:

BME_cycle_XXX family of functions.

Note that the order of elements in all cycles except the loop cycle is undefined. This leads to slightly increased seek time for deriving some adjacency relations, however the advantage is that no intrinsic properties of the data structures are dependant upon the cycle order and all non-manifold conditions are represented trivially.

Definition at line 281 of file BME_structure.c.

References BME_CycleNode::next, NULL, and BME_CycleNode::prev.

Referenced by BME_disk_append_edge(), BME_MF(), BME_radial_append(), and BME_SEMV().

int BME_cycle_remove ( void *  h,
void *  remn 
)

BME_cycle_remove

Removes a node from a cycle.

Returns - 1 for success, 0 for failure.

Definition at line 341 of file BME_structure.c.

References BME_cycle_length(), i, len(), BME_CycleNode::next, NULL, and BME_CycleNode::prev.

Referenced by BME_disk_remove_edge(), BME_KF(), and BME_radial_remove_loop().

int BME_cycle_validate ( int  len,
void *  h 
)

BME_cycle_validate

Validates a cycle. Takes as an argument the expected length of the cycle and a pointer to the cycle head or base.

Returns - 1 for success, 0 for failure.

Definition at line 382 of file BME_structure.c.

References i, len(), and BME_CycleNode::next.

Referenced by BME_JEKV(), BME_JFKE(), BME_loop_reverse(), BME_ME(), BME_MF(), BME_SEMV(), and BME_validate_mesh().

int BME_disk_append_edge ( BME_Edge e,
BME_Vert v 
)

BME_disk_append_edge

Appends edge to the end of a vertex disk cycle.

Returns - 1 for success, 0 for failure

Definition at line 442 of file BME_structure.c.

References BME_cycle_append(), BME_disk_getpointer(), BME_vert_in_edge(), credits_svn_gen::e, BME_Vert::edge, and NULL.

Referenced by BME_JEKV(), BME_ME(), BME_SEMV(), and BME_SFME().

int BME_disk_hasedge ( struct BME_Vert v,
struct BME_Edge e 
)
void BME_disk_remove_edge ( BME_Edge e,
BME_Vert v 
)

BME_disk_remove_edge

Removes an edge from a disk cycle. If the edge to be removed is at the base of the cycle, the next edge becomes the new base.

Returns - Nothing

Definition at line 475 of file BME_structure.c.

References BME_cycle_length(), BME_cycle_remove(), BME_disk_getpointer(), data, BME_Vert::edge, len(), BME_CycleNode::next, and NULL.

Referenced by BME_JEKV(), BME_JFKE(), BME_KE(), and BME_SEMV().

int BME_edge_swapverts ( struct BME_Edge e,
struct BME_Vert orig,
struct BME_Vert new 
)
void BME_error ( void  )
void BME_free_edge ( struct BME_Mesh bm,
struct BME_Edge e 
)
void BME_free_loop ( struct BME_Mesh bm,
struct BME_Loop l 
)
void BME_free_poly ( struct BME_Mesh bm,
struct BME_Poly f 
)
void BME_free_vert ( struct BME_Mesh bm,
struct BME_Vert v 
)
void BME_radial_append ( struct BME_Edge e,
struct BME_Loop l 
)

Definition at line 585 of file BME_structure.c.

References BME_cycle_append(), BME_Edge::loop, NULL, and BME_Loop::radial.

Referenced by BME_loop_reverse(), BME_MF(), and BME_SFME().

void BME_radial_remove_loop ( struct BME_Loop l,
struct BME_Edge e 
)