Blender V5.3
boxpack_2d.cc File Reference
#include <cmath>
#include <cstdlib>
#include "MEM_guardedalloc.h"
#include "BLI_boxpack_2d.hh"
#include "BLI_listbase.hh"
#include "BLI_math_base_c.hh"
#include "BLI_utildefines.hh"
#include "BLI_sort.hh"
#include "BLI_strict_flags.hh"

Go to the source code of this file.

Classes

struct  blender::BoxVert
struct  blender::VertSortContext

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define qsort_r   BLI_qsort_r
#define USE_MERGE
#define USE_FREE_STRIP
#define USE_PACK_BIAS
#define EPSILON   0.0000001f
#define EPSILON_MERGE   0.00001f
#define EPSILON_BIAS   0.000001f
#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 A   (vert->trb->v[TL])
#define B   (vert->tlb->v[TR])
#define MASK   (BLF | BRF)
#define A   (vert->blb->v[BR])
#define B   (vert->brb->v[BL])
#define MASK   (TRF | TLF)
#define A   (vert->blb->v[TL])
#define B   (vert->tlb->v[BL])
#define MASK   (TRF | BRF)
#define A   (vert->brb->v[TR])
#define B   (vert->trb->v[BR])
#define MASK   (TLF | BLF)

Functions

BLI_INLINE int blender::quad_flag (uint q)
static void blender::vert_bias_update (BoxVert *v)
void blender::BLI_box_pack_2d (BoxPack *boxarray, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y)
void blender::BLI_box_pack_2d_fixedarea (ListBaseT< FixedSizeBoxPack > *boxes, int width, int height, ListBaseT< FixedSizeBoxPack > *packed)
Box Accessor Functions
static float blender::box_xmin_get (const BoxPack *box)
static float blender::box_xmax_get (const BoxPack *box)
static float blender::box_ymin_get (const BoxPack *box)
static float blender::box_ymax_get (const BoxPack *box)
Box Placement
BLI_INLINE void blender::box_v34x_update (BoxPack *box)
BLI_INLINE void blender::box_v34y_update (BoxPack *box)
static void blender::box_xmin_set (BoxPack *box, const float f)
static void blender::box_xmax_set (BoxPack *box, const float f)
static void blender::box_ymin_set (BoxPack *box, const float f)
static void blender::box_ymax_set (BoxPack *box, const float f)
Box Utils
static float blender::box_area (const BoxPack *box)
static bool blender::box_isect (const BoxPack *box_a, const BoxPack *box_b)
Box/Vert Sorting
static int blender::box_areasort (const void *p1, const void *p2)
static int blender::vertex_sort (const void *p1, const void *p2, void *vs_ctx_p)

Macro Definition Documentation

◆ A [1/4]

#define A   (vert->brb->v[TR])

◆ A [2/4]

#define A   (vert->blb->v[TL])

◆ A [3/4]

#define A   (vert->blb->v[BR])

◆ A [4/4]

#define A   (vert->trb->v[TL])

Referenced by blender::add_m3_m3m3(), blender::add_m4_m4m4(), blender::bake_differentials(), blender::BKE_ocean_is_valid(), blender::BLI_box_pack_2d(), blender::BLI_ewa_filter(), blender::BLI_ewa_imp2radangle(), blender::BLI_ghashutil_paircmp(), bsdf_glass_ior(), bsdf_hair_huang_albedo(), bsdf_hair_huang_eval_trrt(), bssrdf_burley_fitting(), bssrdf_burley_setup(), btDoSimplex2(), btDoSimplex3(), btDoSimplex4(), btFactorLDLT(), btLCP::btLCP(), btLDLTRemove(), btRemoveRowCol(), btSolveDantzigLCP(), btSwapProblem(), btSwapRowsAndCols(), slim::build_linear_system(), slim::buildA(), Freestyle::ViewEdgeXBuilder::BuildSmoothFEdge(), blender::eevee::burley_setup(), builtin::polyline::Resources::clip_line_point_homogeneous_space(), Freestyle::GridHelpers::closestPointToSegment(), GivensRotation::columnRotation(), GivensRotation::columnRotation(), Freestyle::ViewMapBuilder::computeCusps(), Freestyle::ViewMapBuilder::ComputeRayCastingVisibility(), libmv::ComputeTrackingEquation(), blender::Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _Filter, _Preconditioner >::ConstrainedConjugateGradient(), Freestyle::crossesProscenium(), cullPoints2(), CurvePoint_fedge_get(), CurvePoint_first_svertex_get(), dBoxBox2(), Freestyle::GeomUtils::distPointSegment(), btDeformableNeoHookeanForce::DotProduct(), libmv::EightPointSolver(), libmv::euclidean_resection::EuclideanResectionPPnP(), libmv::ExtractColumns(), extractRotation(), F_eta(), FEdge_first_svertex_get(), GivensRotation::fill(), GivensRotation::fill(), film_adaptive_sampling_convergence_check(), btLemkeAlgorithm::findLexicographicMinimum(), Freestyle::ViewMapBuilder::FindOccludee(), Freestyle::ViewMapBuilder::FindOccludee(), Freestyle::findOccludee(), Freestyle::findOccludee(), blender::ed::object::followpath_path_animate_exec(), fresnel_dielectric_cos(), fresnel_dielectric_cos(), libmv::FrobeniusDistance(), libmv::FrobeniusNorm(), libmv::FundamentalFrom7CorrespondencesLinear(), btLemkeAlgorithm::GaussJordanEliminationStep(), Freestyle::GenerateBezier(), blender::ed::greasepencil::get_reordered_indices(), Freestyle::ViewMap::getClosestFEdge(), Freestyle::ViewMap::getClosestViewEdge(), libmv::euclidean_resection::IJToIndex(), Freestyle::GeomUtils::include2dSeg2dArea(), Freestyle::GeomUtils::includePointTriangle(), blender::interp_m3_m3m3(), blender::interp_m4_m4m4(), blender::math::interpolate(), blender::math::interpolate(), Freestyle::GeomUtils::intersect2dSeg2dArea(), jacobi_svd_3x3(), blender::madd_m3_m3m3fl(), blender::madd_m4_m4m4fl(), matrix_svd(), libmv::MatrixColumn(), libmv::MatrixColumn(), libmv::MatrixColumn(), libmv::euclidean_resection::MatrixToConstraint(), blender::md5_process_block(), libmv::MeanAndVarianceAlongRows(), libmv::Dogleg< Function, Jacobian, Solver >::minimize(), libmv::LevenbergMarquardt< Function, Jacobian, Solver >::minimize(), mnee_solve_matrix_h_to_x(), blender::mul_m3_m3_pre(), blender::mul_m3_m3m3(), blender::mul_m3_m3m4(), blender::mul_m3_m4m3(), blender::mul_m3_m4m4(), blender::mul_m4_m3m4(), blender::mul_m4_m4_pre(), blender::mul_m4_m4m3(), blender::mul_m4_m4m4(), blender::mul_m4_m4m4_aligned_scale(), blender::mul_m4_m4m4_split_channels(), blender::mul_m4db_m4db_m4fl(), blender::newPerlin(), libmv::Nullspace(), libmv::Nullspace2(), operator!=(), Freestyle::Functions0D::Curvature2DAngleF0D::operator()(), Freestyle::Functions0D::VertexOrientation2DF0D::operator()(), Freestyle::Functions0D::VertexOrientation3DF0D::operator()(), Freestyle::less_SVertex2D::operator()(), GivensRotation::operator*(), GivensRotation::operator*=(), operator<(), operator==(), operator==(), Freestyle::ImagePyramid::pixel(), slim::polar_svd(), polarDecomposition(), polarDecomposition(), blender::ed::greasepencil::primitive_calculate_curve_positions(), blender::pseudoinverse_m4_m4(), eevee::lightprobe::sphere::quad_solid_angle(), blender::radangle2imp(), GivensRotation::rowRotation(), GivensRotation::rowRotation(), libmv::SelectKeyframesBasedOnGRICAndVariance(), blender::SIM_hair_volume_solve_divergence(), singularValueDecomposition(), singularValueDecomposition(), singularValueDecomposition(), btConjugateGradient< MatrixX >::solve(), btConjugateResidual< MatrixX >::solve(), btKrylovSolver< MatrixX >::solve(), btLemkeAlgorithm::solve(), iTaSC::Solver::solve(), iTaSC::WDLSSolver::solve(), iTaSC::WSDLSSolver::solve(), eevee::ltc::detail::solve_cubic(), solve_least_squares(), libmv::SolveCubicPolynomial(), btDantzigSolver::solveMLCP(), btLemkeSolver::solveMLCP(), btMLCPSolverInterface::solveMLCP(), btSolveProjectedGaussSeidel::solveMLCP(), SolveP3(), Freestyle::SShape::SplitEdge(), blender::sub_m3_m3m3(), KDL::svd_eigen_HH(), blender::svd_m4(), swapCol(), Freestyle::StrokeTesselator::Tesselate(), transform_equal_threshold(), libmv::TransposeInPlace(), triangle_light_pdf(), triangle_light_sample(), eevee::lightprobe::sphere::triangle_solid_angle(), libmv::Dogleg< Function, Jacobian, Solver >::Update(), libmv::LevenbergMarquardt< Function, Jacobian, Solver >::Update(), and IK_QElbowSegment::UpdateAngleApply().

◆ B [1/4]

#define B   (vert->trb->v[BR])

◆ B [2/4]

#define B   (vert->tlb->v[BL])

◆ B [3/4]

#define B   (vert->brb->v[BL])

◆ B [4/4]

#define B   (vert->tlb->v[TR])

◆ BL

◆ BLF

#define BLF   1

Definition at line 64 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ BR

◆ BRF

#define BRF   8

Definition at line 67 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ CORNERFLAGS

#define CORNERFLAGS   (BLF | TRF | TLF | BRF)

Definition at line 68 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ EPSILON

#define EPSILON   0.0000001f

◆ EPSILON_BIAS

#define EPSILON_BIAS   0.000001f

Definition at line 62 of file boxpack_2d.cc.

Referenced by blender::vert_bias_update().

◆ EPSILON_MERGE

#define EPSILON_MERGE   0.00001f

Definition at line 60 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ MASK [1/4]

#define MASK   (TLF | BLF)

◆ MASK [2/4]

#define MASK   (TRF | BRF)

◆ MASK [3/4]

#define MASK   (TRF | TLF)

◆ MASK [4/4]

◆ qsort_r

#define qsort_r   BLI_qsort_r

Definition at line 20 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ TL

#define TL   2

◆ TLF

#define TLF   4

Definition at line 66 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ TR

◆ TRF

#define TRF   2

Definition at line 65 of file boxpack_2d.cc.

Referenced by blender::BLI_box_pack_2d().

◆ USE_FREE_STRIP

#define USE_FREE_STRIP

Definition at line 29 of file boxpack_2d.cc.

◆ USE_MERGE

#define USE_MERGE

Definition at line 27 of file boxpack_2d.cc.

◆ USE_PACK_BIAS

#define USE_PACK_BIAS

Definition at line 31 of file boxpack_2d.cc.