KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BVH_CONTAINER_2D Class Reference

#include <container_2d.h>

Inheritance diagram for BVH_CONTAINER_2D:
CONTAINER_2D_BASE

Public Member Functions

 BVH_CONTAINER_2D ()
 
 ~BVH_CONTAINER_2D ()
 
void BuildBVH ()
 
void Clear () override
 
void GetIntersectingObjects (const BBOX_2D &aBBox, CONST_LIST_OBJECT2D &aOutList) const override
 Get a list of objects that intersects a bounding box.
 
bool IntersectAny (const RAYSEG2D &aSegRay) const override
 Intersect and check if a segment ray hits a object or is inside it.
 
void Add (OBJECT_2D *aObject)
 
const BBOX_2DGetBBox () const
 
const LIST_OBJECT2DGetList () const
 

Protected Attributes

BBOX_2D m_bbox
 
LIST_OBJECT2D m_objects
 

Private Member Functions

void destroy ()
 
void recursiveBuild_MIDDLE_SPLIT (BVH_CONTAINER_NODE_2D *aNodeParent)
 
void recursiveGetListObjectsIntersects (const BVH_CONTAINER_NODE_2D *aNode, const BBOX_2D &aBBox, CONST_LIST_OBJECT2D &aOutList) const
 
bool recursiveIntersectAny (const BVH_CONTAINER_NODE_2D *aNode, const RAYSEG2D &aSegRay) const
 

Private Attributes

bool m_isInitialized
 
std::list< BVH_CONTAINER_NODE_2D * > m_elementsToDelete
 
BVH_CONTAINER_NODE_2Dm_tree
 
std::mutex m_lock
 

Detailed Description

Definition at line 116 of file container_2d.h.

Constructor & Destructor Documentation

◆ BVH_CONTAINER_2D()

BVH_CONTAINER_2D::BVH_CONTAINER_2D ( )

◆ ~BVH_CONTAINER_2D()

BVH_CONTAINER_2D::~BVH_CONTAINER_2D ( )

Definition at line 113 of file container_2d.cpp.

References destroy().

Member Function Documentation

◆ Add()

◆ BuildBVH()

◆ Clear()

void BVH_CONTAINER_2D::Clear ( )
overridevirtual

Reimplemented from CONTAINER_2D_BASE.

Definition at line 91 of file container_2d.cpp.

References CONTAINER_2D_BASE::Clear(), and destroy().

Referenced by BOARD_ADAPTER::BOARD_ADAPTER(), and BOARD_ADAPTER::destroyLayers().

◆ destroy()

void BVH_CONTAINER_2D::destroy ( )
private

Definition at line 98 of file container_2d.cpp.

References m_elementsToDelete, m_isInitialized, and m_tree.

Referenced by BuildBVH(), Clear(), and ~BVH_CONTAINER_2D().

◆ GetBBox()

const BBOX_2D & CONTAINER_2D_BASE::GetBBox ( ) const
inlineinherited

Definition at line 59 of file container_2d.h.

References CONTAINER_2D_BASE::m_bbox.

◆ GetIntersectingObjects()

void BVH_CONTAINER_2D::GetIntersectingObjects ( const BBOX_2D aBBox,
CONST_LIST_OBJECT2D aOutList 
) const
overridevirtual

Get a list of objects that intersects a bounding box.

Parameters
aBBoxThe bounding box to test.
aOutListThe list of objects that intersects the bounding box.

Implements CONTAINER_2D_BASE.

Definition at line 302 of file container_2d.cpp.

References BBOX_2D::IsInitialized(), m_isInitialized, m_tree, and recursiveGetListObjectsIntersects().

Referenced by RENDER_3D_RAYTRACE_BASE::createItemsFromContainer(), RENDER_3D_RAYTRACE_BASE::insertHole(), and RENDER_3D_RAYTRACE_BASE::Reload().

◆ GetList()

◆ IntersectAny()

bool BVH_CONTAINER_2D::IntersectAny ( const RAYSEG2D aSegRay) const
overridevirtual

Intersect and check if a segment ray hits a object or is inside it.

Parameters
aSegRayThe segment to intersect with objects.
Returns
true if it hits any of the objects or is inside any object.

Implements CONTAINER_2D_BASE.

Definition at line 251 of file container_2d.cpp.

References m_isInitialized, m_tree, and recursiveIntersectAny().

Referenced by TRIANGLE_DISPLAY_LIST::AddToMiddleContourns().

◆ recursiveBuild_MIDDLE_SPLIT()

◆ recursiveGetListObjectsIntersects()

◆ recursiveIntersectAny()

Member Data Documentation

◆ m_bbox

◆ m_elementsToDelete

std::list<BVH_CONTAINER_NODE_2D*> BVH_CONTAINER_2D::m_elementsToDelete
private

Definition at line 141 of file container_2d.h.

Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), and recursiveBuild_MIDDLE_SPLIT().

◆ m_isInitialized

bool BVH_CONTAINER_2D::m_isInitialized
private

◆ m_lock

std::mutex CONTAINER_2D_BASE::m_lock
privateinherited

Definition at line 90 of file container_2d.h.

Referenced by CONTAINER_2D_BASE::Add(), and CONTAINER_2D_BASE::Clear().

◆ m_objects

LIST_OBJECT2D CONTAINER_2D_BASE::m_objects
protectedinherited

◆ m_tree

BVH_CONTAINER_NODE_2D* BVH_CONTAINER_2D::m_tree
private

The documentation for this class was generated from the following files: