Blender V2.61 - r43446
|
#include <limits.h>
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BKE_bmesh.h"
Go to the source code of this file.
Definition in file BME_structure.c.
BME_Edge* BME_addedgelist | ( | BME_Mesh * | bm, |
BME_Vert * | v1, | ||
BME_Vert * | v2, | ||
BME_Edge * | example | ||
) | [read] |
Definition at line 111 of file BME_structure.c.
References BLI_addtail(), BLI_mempool_alloc(), BME_Edge::bweight, BME_Edge::crease, CustomData_bmesh_copy_data(), CustomData_bmesh_set_default(), BME_Edge::d2, BME_Edge::data, BME_CycleNode::data, credits_svn_gen::e, BME_Mesh::edges, BME_Edge::eflag1, BME_Edge::eflag2, BME_Edge::EID, BME_Mesh::epool, BME_Edge::flag, BME_Edge::h, BME_Edge::loop, BME_CycleNode::next, BME_Edge::next, BME_Mesh::nexte, NULL, BME_Edge::prev, BME_CycleNode::prev, BME_Edge::tflag1, BME_Edge::tflag2, BME_Mesh::totedge, BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_ME(), BME_SEMV(), and BME_SFME().
Definition at line 162 of file BME_structure.c.
References BLI_addtail(), BLI_mempool_alloc(), CustomData_bmesh_copy_data(), CustomData_bmesh_set_default(), BME_Poly::data, BME_Poly::eflag1, BME_Poly::eflag2, BME_Poly::EID, BME_Poly::flag, BME_Poly::h, BME_Poly::len, BME_Poly::loopbase, BME_Poly::mat_nr, BME_Poly::next, BME_Mesh::nextp, NULL, BME_Mesh::polys, BME_Mesh::ppool, BME_Poly::prev, BME_Poly::tflag1, BME_Poly::tflag2, and BME_Mesh::totpoly.
Referenced by BME_MF(), and BME_SFME().
ALLOCATION/DEALLOCATION FUNCTIONS
Definition at line 86 of file BME_structure.c.
References BLI_addtail(), BLI_mempool_alloc(), BME_Vert::bweight, BME_Vert::co, CustomData_bmesh_copy_data(), CustomData_bmesh_set_default(), BME_Vert::data, BME_Vert::edge, BME_Vert::eflag1, BME_Vert::eflag2, BME_Vert::EID, BME_Vert::flag, BME_Vert::h, BME_Vert::next, BME_Mesh::nextv, BME_Vert::no, NULL, BME_Vert::prev, BME_Vert::tflag1, BME_Vert::tflag2, BME_Mesh::totvert, VECCOPY, BME_Mesh::verts, and BME_Mesh::vpool.
Referenced by BME_MV(), and BME_SEMV().
BME_Loop* BME_create_loop | ( | BME_Mesh * | bm, |
BME_Vert * | v, | ||
BME_Edge * | e, | ||
BME_Poly * | f, | ||
BME_Loop * | example | ||
) | [read] |
Definition at line 138 of file BME_structure.c.
References BLI_mempool_alloc(), CustomData_bmesh_copy_data(), CustomData_bmesh_set_default(), BME_CycleNode::data, BME_Loop::data, BME_Loop::e, credits_svn_gen::e, BME_Loop::eflag1, BME_Loop::eflag2, BME_Loop::EID, BME_Loop::f, BME_Loop::flag, BME_Loop::h, BME_Mesh::ldata, BME_Mesh::lpool, BME_Loop::next, BME_CycleNode::next, BME_Mesh::nextl, NULL, BME_Loop::prev, BME_CycleNode::prev, BME_Loop::radial, BME_Loop::tflag1, BME_Loop::tflag2, BME_Mesh::totloop, and BME_Loop::v.
Referenced by BME_MF(), BME_SEMV(), and BME_SFME().
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_length | ( | void * | h | ) |
BME_cycle_length
Count the nodes in a cycle.
Returns - Integer
Definition at line 313 of file BME_structure.c.
References len(), and BME_CycleNode::next.
Referenced by BME_bevel_initialize(), BME_bevel_mesh(), BME_bmesh_to_derivedmesh(), BME_bmesh_to_editmesh(), BME_cycle_remove(), BME_disk_count_edgeflag(), BME_disk_hasedge(), BME_disk_remove_edge(), BME_is_nonmanifold_vert(), BME_JEKV(), BME_JFKE(), BME_KF(), BME_loop_find_loop(), BME_loop_reverse(), BME_ME(), BME_MF(), BME_radial_find_face(), BME_radial_remove_loop(), BME_SEMV(), BME_SFME(), BME_validate_mesh(), and bmesh_dissolve_disk().
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().
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_count_edgeflag | ( | BME_Vert * | v, |
int | eflag, | ||
int | tflag | ||
) |
BME_disk_count_edgeflag
Counts number of edges in this verts disk cycle which have either eflag or tflag (but not both!)
Returns - Integer.
Definition at line 540 of file BME_structure.c.
References BME_cycle_length(), BME_disk_getpointer(), BME_disk_nextedge(), BME_Vert::edge, BME_Edge::eflag1, i, len(), and BME_Edge::tflag1.
Referenced by BME_MF().
BME_CycleNode* BME_disk_getpointer | ( | BME_Edge * | e, |
BME_Vert * | v | ||
) | [read] |
BME_disk_getpointer
Given an edge and one of its vertices, find the apporpriate CycleNode
Returns - Pointer to BME_CycleNode.
Definition at line 426 of file BME_structure.c.
References BME_Edge::d2, NULL, BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_bevel_initialize(), BME_bevel_mesh(), BME_disk_append_edge(), BME_disk_count_edgeflag(), BME_disk_hasedge(), BME_disk_remove_edge(), BME_JEKV(), BME_ME(), BME_SEMV(), and BME_validate_mesh().
Definition at line 563 of file BME_structure.c.
References BME_cycle_length(), BME_disk_getpointer(), BME_disk_nextedge(), BME_Vert::edge, i, and len().
Referenced by BME_KE(), BME_ME(), and BME_validate_mesh().
BME_disk_next_edgeflag
Searches the disk cycle of v, starting with e, for the next edge that has either eflag or tflag.
BME_Edge pointer.
Definition at line 504 of file BME_structure.c.
References BME_disk_nextedge(), BME_vert_in_edge(), BME_Edge::eflag1, NULL, and BME_Edge::tflag1.
Referenced by BME_bevel_mesh(), and BME_MF().
BME_disk_nextedge
Find the next edge in a disk cycle
Returns - Pointer to the next edge in the disk cycle for the vertex v.
Definition at line 409 of file BME_structure.c.
References BME_vert_in_edge(), BME_Edge::d2, BME_Edge::data, BME_CycleNode::data, BME_CycleNode::next, BME_Edge::next, NULL, BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_bevel_mesh(), BME_bevel_split_edge(), BME_bevel_wire(), BME_disk_count_edgeflag(), BME_disk_hasedge(), BME_disk_next_edgeflag(), BME_is_nonmanifold_vert(), BME_JEKV(), BME_validate_mesh(), and bmesh_dissolve_disk().
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().
Definition at line 60 of file BME_structure.c.
References NULL, BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_bevel_split_edge(), BME_bevel_wire(), BME_collapse_vert(), BME_JEKV(), BME_MF(), BME_SEMV(), and BME_split_edge().
Definition at line 66 of file BME_structure.c.
References BME_Edge::d2, BME_CycleNode::next, BME_Edge::next, NULL, BME_Edge::prev, BME_CycleNode::prev, BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_JEKV(), and BME_SEMV().
Definition at line 193 of file BME_structure.c.
References BLI_mempool_free(), CustomData_bmesh_free_block(), BME_Edge::data, BME_Mesh::epool, and BME_Mesh::totedge.
Referenced by BME_JEKV(), BME_JFKE(), and BME_KE().
Definition at line 203 of file BME_structure.c.
References BLI_mempool_free(), CustomData_bmesh_free_block(), BME_Loop::data, BME_Mesh::ldata, BME_Mesh::lpool, and BME_Mesh::totloop.
Referenced by BME_JEKV(), BME_JFKE(), and BME_KF().
Definition at line 198 of file BME_structure.c.
References BLI_mempool_free(), CustomData_bmesh_free_block(), BME_Poly::data, BME_Mesh::ppool, and BME_Mesh::totpoly.
Referenced by BME_JFKE(), and BME_KF().
Definition at line 188 of file BME_structure.c.
References BLI_mempool_free(), CustomData_bmesh_free_block(), BME_Vert::data, BME_Mesh::totvert, and BME_Mesh::vpool.
Referenced by BME_JEKV(), and BME_KV().
Definition at line 619 of file BME_structure.c.
References BME_cycle_length(), i, len(), BME_Poly::loopbase, next, NULL, and BME_Loop::v.
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().
Definition at line 606 of file BME_structure.c.
References BME_cycle_length(), BME_Loop::data, BME_Loop::f, i, len(), BME_Edge::loop, BME_Loop::next, and BME_Loop::radial.
Referenced by BME_face_sharededges(), and BME_JFKE().
Definition at line 581 of file BME_structure.c.
References BME_CycleNode::data, BME_CycleNode::next, and BME_Loop::radial.
Referenced by BME_JEKV().
Definition at line 590 of file BME_structure.c.
References BME_cycle_length(), BME_cycle_remove(), BME_CycleNode::data, len(), BME_Edge::loop, BME_CycleNode::next, NULL, and BME_Loop::radial.
Referenced by BME_KF(), BME_loop_reverse(), and BME_SEMV().
MISC utility functions.
Definition at line 50 of file BME_structure.c.
References BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_disk_append_edge(), BME_disk_next_edgeflag(), BME_disk_nextedge(), BME_JEKV(), BME_SEMV(), and BME_validate_mesh().
Definition at line 54 of file BME_structure.c.
References BME_Edge::v1, and BME_Edge::v2.
Referenced by BME_JEKV(), BME_loop_reverse(), BME_MF(), BME_SEMV(), and BME_validate_mesh().