KiCad PCB EDA Suite
|
#include <container_2d.h>
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_2D & | GetBBox () const |
const LIST_OBJECT2D & | GetList () 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_2D * | m_tree |
std::mutex | m_lock |
Definition at line 116 of file container_2d.h.
BVH_CONTAINER_2D::BVH_CONTAINER_2D | ( | ) |
Definition at line 82 of file container_2d.cpp.
References CONTAINER_2D_BASE::m_bbox, m_elementsToDelete, m_isInitialized, m_tree, and BBOX_2D::Reset().
BVH_CONTAINER_2D::~BVH_CONTAINER_2D | ( | ) |
Definition at line 113 of file container_2d.cpp.
References destroy().
|
inlineinherited |
Definition at line 49 of file container_2d.h.
References OBJECT_2D::GetBBox(), CONTAINER_2D_BASE::m_bbox, CONTAINER_2D_BASE::m_lock, CONTAINER_2D_BASE::m_objects, and BBOX_2D::Union().
Referenced by addFILLED_CIRCLE_2D(), addRING_2D(), addROUND_SEGMENT_2D(), BOARD_ADAPTER::addText(), ConvertPolygonToBlocks(), ConvertPolygonToTriangles(), RENDER_3D_RAYTRACE_BASE::createItemsFromContainer(), BOARD_ADAPTER::createLayers(), RENDER_3D_RAYTRACE_BASE::insertHole(), and RENDER_3D_RAYTRACE_BASE::Reload().
void BVH_CONTAINER_2D::BuildBVH | ( | ) |
Definition at line 122 of file container_2d.cpp.
References destroy(), CONTAINER_2D_BASE::m_bbox, BVH_CONTAINER_NODE_2D::m_BBox, m_elementsToDelete, m_isInitialized, BVH_CONTAINER_NODE_2D::m_LeafList, CONTAINER_2D_BASE::m_objects, m_tree, and recursiveBuild_MIDDLE_SPLIT().
Referenced by RENDER_3D_RAYTRACE_BASE::Reload().
|
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().
|
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().
|
inlineinherited |
Definition at line 59 of file container_2d.h.
References CONTAINER_2D_BASE::m_bbox.
|
overridevirtual |
Get a list of objects that intersects a bounding box.
aBBox | The bounding box to test. |
aOutList | The 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().
|
inlineinherited |
Definition at line 66 of file container_2d.h.
References CONTAINER_2D_BASE::m_objects.
Referenced by RENDER_3D_OPENGL::createBoard(), RENDER_3D_RAYTRACE_BASE::createItemsFromContainer(), RENDER_3D_OPENGL::generateLayerList(), RENDER_3D_OPENGL::generateViasAndPads(), RENDER_3D_RAYTRACE_BASE::insertHole(), RENDER_3D_OPENGL::reload(), and RENDER_3D_RAYTRACE_BASE::Reload().
|
overridevirtual |
Intersect and check if a segment ray hits a object or is inside it.
aSegRay | The segment to intersect with objects. |
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().
|
private |
Definition at line 173 of file container_2d.cpp.
References BVH_CONTAINER2D_MAX_OBJ_PER_LEAF, OBJECT_2D::GetBBox(), BBOX_2D::IsInitialized(), BVH_CONTAINER_NODE_2D::m_BBox, BVH_CONTAINER_NODE_2D::m_Children, m_elementsToDelete, BVH_CONTAINER_NODE_2D::m_LeafList, BBOX_2D::MaxDimension(), recursiveBuild_MIDDLE_SPLIT(), BBOX_2D::Reset(), sortByCentroidX(), sortByCentroidY(), sortByCentroidZ(), and BBOX_2D::Union().
Referenced by BuildBVH(), and recursiveBuild_MIDDLE_SPLIT().
|
private |
Definition at line 315 of file container_2d.cpp.
References BBOX_2D::Intersects(), OBJECT_2D::Intersects(), BBOX_2D::IsInitialized(), BVH_CONTAINER_NODE_2D::m_BBox, BVH_CONTAINER_NODE_2D::m_Children, BVH_CONTAINER_NODE_2D::m_LeafList, and recursiveGetListObjectsIntersects().
Referenced by GetIntersectingObjects(), and recursiveGetListObjectsIntersects().
|
private |
Definition at line 262 of file container_2d.cpp.
References BBOX_2D::Inside(), BBOX_2D::Intersect(), OBJECT_2D::Intersect(), OBJECT_2D::IsPointInside(), BVH_CONTAINER_NODE_2D::m_BBox, BVH_CONTAINER_NODE_2D::m_Children, RAYSEG2D::m_End, BVH_CONTAINER_NODE_2D::m_LeafList, RAYSEG2D::m_Start, and recursiveIntersectAny().
Referenced by IntersectAny(), and recursiveIntersectAny().
|
protectedinherited |
Definition at line 86 of file container_2d.h.
Referenced by CONTAINER_2D_BASE::Add(), BuildBVH(), BVH_CONTAINER_2D(), CONTAINER_2D_BASE::Clear(), CONTAINER_2D_BASE::CONTAINER_2D_BASE(), and CONTAINER_2D_BASE::GetBBox().
|
private |
Definition at line 141 of file container_2d.h.
Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), and recursiveBuild_MIDDLE_SPLIT().
|
private |
Definition at line 140 of file container_2d.h.
Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), GetIntersectingObjects(), and IntersectAny().
|
privateinherited |
Definition at line 90 of file container_2d.h.
Referenced by CONTAINER_2D_BASE::Add(), and CONTAINER_2D_BASE::Clear().
|
protectedinherited |
Definition at line 87 of file container_2d.h.
Referenced by CONTAINER_2D_BASE::Add(), BuildBVH(), CONTAINER_2D_BASE::Clear(), and CONTAINER_2D_BASE::GetList().
|
private |
Definition at line 142 of file container_2d.h.
Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), GetIntersectingObjects(), and IntersectAny().