KiCad PCB EDA Suite
ccontainer2d.cpp File Reference
#include "ccontainer2d.h"
#include <vector>
#include <boost/range/algorithm/partition.hpp>
#include <boost/range/algorithm/nth_element.hpp>
#include <wx/debug.h>

Go to the source code of this file.

Macros

#define BVH_CONTAINER2D_MAX_OBJ_PER_LEAF   4
 

Functions

static bool sortByCentroid_X (const COBJECT2D *a, const COBJECT2D *b)
 
static bool sortByCentroid_Y (const COBJECT2D *a, const COBJECT2D *b)
 
static bool sortByCentroid_Z (const COBJECT2D *a, const COBJECT2D *b)
 

Macro Definition Documentation

#define BVH_CONTAINER2D_MAX_OBJ_PER_LEAF   4

Definition at line 263 of file ccontainer2d.cpp.

Referenced by CBVHCONTAINER2D::recursiveBuild_MIDDLE_SPLIT().

Function Documentation

static bool sortByCentroid_X ( const COBJECT2D a,
const COBJECT2D b 
)
static

Definition at line 301 of file ccontainer2d.cpp.

References COBJECT2D::GetCentroid().

Referenced by CBVHCONTAINER2D::recursiveBuild_MIDDLE_SPLIT().

302 {
303  return a->GetCentroid()[0] < b->GetCentroid()[0];
304 }
const SFVEC2F & GetCentroid() const
Definition: cobject2d.h:123
static bool sortByCentroid_Y ( const COBJECT2D a,
const COBJECT2D b 
)
static

Definition at line 306 of file ccontainer2d.cpp.

References COBJECT2D::GetCentroid().

Referenced by CBVHCONTAINER2D::recursiveBuild_MIDDLE_SPLIT().

307 {
308  return a->GetCentroid()[0] < b->GetCentroid()[0];
309 }
const SFVEC2F & GetCentroid() const
Definition: cobject2d.h:123
static bool sortByCentroid_Z ( const COBJECT2D a,
const COBJECT2D b 
)
static

Definition at line 311 of file ccontainer2d.cpp.

References COBJECT2D::GetCentroid().

Referenced by CBVHCONTAINER2D::recursiveBuild_MIDDLE_SPLIT().

312 {
313  return a->GetCentroid()[0] < b->GetCentroid()[0];
314 }
const SFVEC2F & GetCentroid() const
Definition: cobject2d.h:123