![]() |
Blender V2.61 - r43446
|
#include <stdlib.h>#include "MEM_guardedalloc.h"#include "BLI_boxpack2d.h"Go to the source code of this file.
Classes | |
| struct | boxVert |
Defines | |
| #define | eps 0.0000001f |
| #define | BLF 1 |
| #define | TRF 2 |
| #define | TLF 4 |
| #define | BRF 8 |
| #define | CORNERFLAGS (BLF|TRF|TLF|BRF) |
| #define | BL 0 |
| #define | TR 1 |
| #define | TL 2 |
| #define | BR 3 |
| #define | BOXLEFT(b) b->v[BL]->x |
| #define | BOXRIGHT(b) b->v[TR]->x |
| #define | BOXBOTTOM(b) b->v[BL]->y |
| #define | BOXTOP(b) b->v[TR]->y |
| #define | BOXAREA(b) (b->w * b->h) |
| #define | UPDATE_V34X(b) |
| #define | UPDATE_V34Y(b) |
| #define | UPDATE_V34(b) UPDATE_V34X(b); UPDATE_V34Y(b) |
| #define | SET_BOXLEFT(b, f) |
| #define | SET_BOXRIGHT(b, f) |
| #define | SET_BOXBOTTOM(b, f) |
| #define | SET_BOXTOP(b, f) |
| #define | BOXINTERSECT(b1, b2) |
| #define | MIN2(x, y) ( (x)<(y) ? (x) : (y) ) |
| #define | MAX2(x, y) ( (x)>(y) ? (x) : (y) ) |
Typedefs | |
| typedef struct boxVert | boxVert |
Functions | |
| static int | box_areasort (const void *p1, const void *p2) |
| static int | vertex_sort (const void *p1, const void *p2) |
| void | boxPack2D (boxPack *boxarray, const int len, float *tot_width, float *tot_height) |
Variables | |
| static float | box_width |
| static float | box_height |
| static boxVert * | vertarray |
Definition in file boxpack2d.c.
| #define BL 0 |
Definition at line 62 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BLF 1 |
Definition at line 56 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BOXAREA | ( | b | ) | (b->w * b->h) |
Definition at line 71 of file boxpack2d.c.
Referenced by box_areasort().
| #define BOXBOTTOM | ( | b | ) | b->v[BL]->y |
Definition at line 69 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BOXINTERSECT | ( | b1, | |
| b2 | |||
| ) |
| #define BOXLEFT | ( | b | ) | b->v[BL]->x |
Definition at line 67 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BOXRIGHT | ( | b | ) | b->v[TR]->x |
Definition at line 68 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BOXTOP | ( | b | ) | b->v[TR]->y |
Definition at line 70 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BR 3 |
Definition at line 65 of file boxpack2d.c.
Referenced by boxPack2D().
| #define BRF 8 |
Definition at line 59 of file boxpack2d.c.
Referenced by boxPack2D().
| #define CORNERFLAGS (BLF|TRF|TLF|BRF) |
Definition at line 60 of file boxpack2d.c.
Referenced by boxPack2D().
| #define eps 0.0000001f |
Definition at line 55 of file boxpack2d.c.
Referenced by FLUID_3D::addVorticity(), calchandleNurb(), Eigenhqr2(), Eigentql2(), KDL::Equal(), isect_seg_seg_v2_point(), nonzero(), nonzerof(), FLUID_3D::solveHeat(), FLUID_3D::solvePressurePre(), TNT::SVD(), svd_m4(), transform_uniform_scale(), btSoftBody::updateClusters(), btSoftBody::updatePose(), and vcloud_estimate_transform().
| #define MAX2 | ( | x, | |
| y | |||
| ) | ( (x)>(y) ? (x) : (y) ) |
Definition at line 98 of file boxpack2d.c.
Referenced by boxPack2D(), and vertex_sort().
| #define MIN2 | ( | x, | |
| y | |||
| ) | ( (x)<(y) ? (x) : (y) ) |
Definition at line 97 of file boxpack2d.c.
| #define SET_BOXBOTTOM | ( | b, | |
| f | |||
| ) |
b->v[TR]->y = f + b->h;\ b->v[BL]->y = f;\ UPDATE_V34Y(b)
Definition at line 85 of file boxpack2d.c.
Referenced by boxPack2D().
| #define SET_BOXLEFT | ( | b, | |
| f | |||
| ) |
b->v[TR]->x = f + b->w;\ b->v[BL]->x = f;\ UPDATE_V34X(b)
Definition at line 79 of file boxpack2d.c.
Referenced by boxPack2D().
| #define SET_BOXRIGHT | ( | b, | |
| f | |||
| ) |
b->v[BL]->x = f - b->w;\ b->v[TR]->x = f;\ UPDATE_V34X(b)
Definition at line 82 of file boxpack2d.c.
Referenced by boxPack2D().
| #define SET_BOXTOP | ( | b, | |
| f | |||
| ) |
b->v[BL]->y = f - b->h;\ b->v[TR]->y = f;\ UPDATE_V34Y(b)
Definition at line 88 of file boxpack2d.c.
Referenced by boxPack2D().
| #define TL 2 |
Definition at line 64 of file boxpack2d.c.
Referenced by boxPack2D().
| #define TLF 4 |
Definition at line 58 of file boxpack2d.c.
Referenced by boxPack2D().
| #define TR 1 |
Definition at line 63 of file boxpack2d.c.
Referenced by boxPack2D().
| #define TRF 2 |
Definition at line 57 of file boxpack2d.c.
Referenced by boxPack2D().
| #define UPDATE_V34 | ( | b | ) | UPDATE_V34X(b); UPDATE_V34Y(b) |
Definition at line 77 of file boxpack2d.c.
| #define UPDATE_V34X | ( | b | ) |
| #define UPDATE_V34Y | ( | b | ) |
| static int box_areasort | ( | const void * | p1, |
| const void * | p2 | ||
| ) | [static] |
| void boxPack2D | ( | boxPack * | boxarray, |
| const int | len, | ||
| float * | tot_width, | ||
| float * | tot_height | ||
| ) |
Definition at line 154 of file boxpack2d.c.
References BL, boxVert::blb, BLF, box_areasort(), box_height, box_width, BOXBOTTOM, BOXINTERSECT, BOXLEFT, BOXRIGHT, BOXTOP, BR, boxVert::brb, BRF, CORNERFLAGS, boxVert::free, boxPack::h, i, boxVert::index, boxVert::isect_cache, len(), MAX2, MEM_freeN(), MEM_mallocN(), NULL, SET_BOXBOTTOM, SET_BOXLEFT, SET_BOXRIGHT, SET_BOXTOP, TL, boxVert::tlb, TLF, TR, boxVert::trb, TRF, boxPack::v, vertex_sort(), boxPack::w, boxVert::x, boxPack::x, boxVert::y, and boxPack::y.
Referenced by M_Geometry_box_pack_2d(), and param_pack().
| static int vertex_sort | ( | const void * | p1, |
| const void * | p2 | ||
| ) | [static] |
Definition at line 125 of file boxpack2d.c.
References box_height, box_width, MAX2, boxVert::x, and boxVert::y.
Referenced by boxPack2D().
float box_height [static] |
Definition at line 122 of file boxpack2d.c.
Referenced by boxPack2D(), and vertex_sort().
float box_width [static] |
Definition at line 121 of file boxpack2d.c.
Referenced by boxPack2D(), and vertex_sort().
Definition at line 123 of file boxpack2d.c.