Blender
V3.3
|
#include "testing/testing.h"
#include "MEM_guardedalloc.h"
#include "BLI_array_utils.h"
#include "BLI_edgehash.h"
#include "BLI_math.h"
#include "BLI_polyfill_2d.h"
#include "BLI_utildefines.h"
#include "BLI_heap.h"
#include "BLI_memarena.h"
#include "BLI_polyfill_2d_beautify.h"
Go to the source code of this file.
Macros | |
#define | USE_COMBINATIONS_ALL |
#define | USE_BEAUTIFY |
#define | TRI_ERROR_VALUE (unsigned int)-1 |
#define | TEST_POLYFILL_TEMPLATE_STATIC(poly, is_degenerate) |
#define | POLY_TRI_COUNT(len) ((len)-2) |
Functions | |
static void | polyfill_to_obj (const char *id, const float poly[][2], const unsigned int poly_num, const unsigned int tris[][3], const unsigned int tris_num) |
static void | test_valid_polyfill_prepare (unsigned int tris[][3], unsigned int tris_num) |
static void | test_polyfill_simple (const float[][2], const unsigned int poly_num, const unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_topology (const float[][2], const unsigned int poly_num, const unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_winding (const float poly[][2], const unsigned int, const unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_area (const float poly[][2], const unsigned int poly_num, const unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_template_check (const char *id, bool is_degenerate, const float poly[][2], const unsigned int poly_num, const unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_template (const char *id, bool is_degenerate, const float poly[][2], const unsigned int poly_num, unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_template_flip_sign (const char *id, bool is_degenerate, const float poly[][2], const unsigned int poly_num, unsigned int tris[][3], const unsigned int tris_num) |
static void | test_polyfill_template_main (const char *id, bool is_degenerate, const float poly[][2], const unsigned int poly_num, unsigned int tris[][3], const unsigned int tris_num) |
TEST (polyfill2d, TriangleCCW) | |
TEST (polyfill2d, SquareCCW) | |
TEST (polyfill2d, SquareCW) | |
TEST (polyfill2d, Starfleet) | |
TEST (polyfill2d, StarfleetDegenerate) | |
TEST (polyfill2d, 3Colinear) | |
TEST (polyfill2d, 4Colinear) | |
TEST (polyfill2d, UnorderedColinear) | |
TEST (polyfill2d, PlusShape) | |
TEST (polyfill2d, StarShape) | |
TEST (polyfill2d, UShape) | |
TEST (polyfill2d, Spiral) | |
TEST (polyfill2d, TestFlipCode) | |
TEST (polyfill2d, SelfIntersect) | |
TEST (polyfill2d, SelfTouch) | |
TEST (polyfill2d, SelfOverlap) | |
TEST (polyfill2d, TestDavData) | |
TEST (polyfill2d, Issue815) | |
TEST (polyfill2d, Issue207_1) | |
TEST (polyfill2d, Issue207_11) | |
TEST (polyfill2d, Issue1407) | |
TEST (polyfill2d, Issue1407_pt) | |
TEST (polyfill2d, IssueT40777_colinear) | |
TEST (polyfill2d, IssueT41986_axis_align) | |
TEST (polyfill2d, IssueT52834_axis_align_co_linear) | |
TEST (polyfill2d, IssueT67109_axis_align_co_linear_a) | |
TEST (polyfill2d, IssueT67109_axis_align_co_linear_b) | |
TEST (polyfill2d, IssueT67109_axis_align_co_linear_c) | |
Script to generate the data below:
Definition at line 377 of file BLI_polyfill_2d_test.cc.
#define TEST_POLYFILL_TEMPLATE_STATIC | ( | poly, | |
is_degenerate | |||
) |
Definition at line 282 of file BLI_polyfill_2d_test.cc.
#define TRI_ERROR_VALUE (unsigned int)-1 |
Definition at line 39 of file BLI_polyfill_2d_test.cc.
#define USE_BEAUTIFY |
Definition at line 10 of file BLI_polyfill_2d_test.cc.
#define USE_COMBINATIONS_ALL |
Definition at line 9 of file BLI_polyfill_2d_test.cc.
|
static |
Definition at line 325 of file BLI_polyfill_2d_test.cc.
References void.
Referenced by test_polyfill_template_check().
TEST | ( | polyfill2d | , |
3Colinear | |||
) |
Definition at line 415 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
4Colinear | |||
) |
Definition at line 422 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Issue1407 | |||
) |
Definition at line 632 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Issue1407_pt | |||
) |
Definition at line 645 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Issue207_1 | |||
) |
Definition at line 593 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Issue207_11 | |||
) |
Definition at line 613 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Issue815 | |||
) |
Definition at line 577 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
IssueT40777_colinear | |||
) |
Definition at line 658 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
IssueT41986_axis_align | |||
) |
Definition at line 669 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
IssueT52834_axis_align_co_linear | |||
) |
Definition at line 684 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
IssueT67109_axis_align_co_linear_a | |||
) |
Definition at line 700 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
IssueT67109_axis_align_co_linear_b | |||
) |
Definition at line 718 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
IssueT67109_axis_align_co_linear_c | |||
) |
Definition at line 736 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
PlusShape | |||
) |
Definition at line 436 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
SelfIntersect | |||
) |
Definition at line 518 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
SelfOverlap | |||
) |
Definition at line 545 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
SelfTouch | |||
) |
Definition at line 525 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Spiral | |||
) |
Definition at line 471 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
SquareCCW | |||
) |
Definition at line 387 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
SquareCW | |||
) |
Definition at line 394 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
Starfleet | |||
) |
Definition at line 401 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
StarfleetDegenerate | |||
) |
Definition at line 408 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
StarShape | |||
) |
Definition at line 456 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
TestDavData | |||
) |
Definition at line 565 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
TestFlipCode | |||
) |
Definition at line 495 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
TriangleCCW | |||
) |
Definition at line 380 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
UnorderedColinear | |||
) |
Definition at line 429 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
TEST | ( | polyfill2d | , |
UShape | |||
) |
Definition at line 463 of file BLI_polyfill_2d_test.cc.
References TEST_POLYFILL_TEMPLATE_STATIC.
|
static |
Check the accumulated triangle area is close to the original area.
Definition at line 146 of file BLI_polyfill_2d_test.cc.
References area_poly_v2(), area_tri_v2(), and eps.
Referenced by test_polyfill_template_check().
|
static |
Basic check for face index values:
Definition at line 59 of file BLI_polyfill_2d_test.cc.
References MEM_callocN, MEM_freeN, and TRI_ERROR_VALUE.
Referenced by test_polyfill_template_check().
|
static |
Definition at line 184 of file BLI_polyfill_2d_test.cc.
References BLI_heap_free(), BLI_heap_new_ex(), BLI_memarena_free(), BLI_memarena_new(), BLI_POLYFILL_ALLOC_NGON_RESERVE, BLI_POLYFILL_ARENA_SIZE, BLI_polyfill_beautify(), BLI_polyfill_calc(), test_polyfill_template_check(), and test_valid_polyfill_prepare().
Referenced by test_polyfill_template_flip_sign().
|
static |
Main template for polyfill testing.
Definition at line 167 of file BLI_polyfill_2d_test.cc.
References polyfill_to_obj(), test_polyfill_area(), test_polyfill_simple(), test_polyfill_topology(), and test_polyfill_winding().
Referenced by test_polyfill_template().
|
static |
Definition at line 213 of file BLI_polyfill_2d_test.cc.
References float(), id, MEM_freeN, MEM_mallocN, and test_polyfill_template().
Referenced by test_polyfill_template_main().
|
static |
Definition at line 236 of file BLI_polyfill_2d_test.cc.
References BLI_array_reverse, copy_v2_v2(), float(), id, MEM_freeN, MEM_mallocN, and test_polyfill_template_flip_sign().
|
static |
Definition at line 82 of file BLI_polyfill_2d_test.cc.
References BLI_edgehash_free(), BLI_edgehash_insert(), BLI_edgehash_len(), BLI_edgehash_lookup_p(), BLI_edgehash_new(), BLI_edgehashIterator_free(), BLI_edgehashIterator_getValue_p(), BLI_edgehashIterator_isDone(), BLI_edgehashIterator_new(), BLI_edgehashIterator_step(), ELEM, EXPECT_EQ(), v1, and v2.
Referenced by test_polyfill_template_check().
|
static |
Check all faces are flipped the same way
Definition at line 127 of file BLI_polyfill_2d_test.cc.
References count, cross_tri_v2(), ELEM, and fabsf.
Referenced by test_polyfill_template_check().
|
static |
Definition at line 41 of file BLI_polyfill_2d_test.cc.
References TRI_ERROR_VALUE.
Referenced by test_polyfill_template().