KiCad PCB EDA Suite
|
#include <container_2d.h>
Public Member Functions | |
BVH_CONTAINER_2D () | |
~BVH_CONTAINER_2D () | |
BVH_CONTAINER_2D (const BVH_CONTAINER_2D &)=delete | |
BVH_CONTAINER_2D & | operator= (const BVH_CONTAINER_2D &)=delete |
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 109 of file container_2d.h.
BVH_CONTAINER_2D::BVH_CONTAINER_2D | ( | ) |
Definition at line 82 of file container_2d.cpp.
References BVHCONTAINER, CONTAINER_2D_BASE::CONTAINER_2D_BASE(), CONTAINER_2D_BASE::m_bbox, m_elementsToDelete, m_isInitialized, and m_tree.
Referenced by BVH_CONTAINER_2D(), and operator=().
BVH_CONTAINER_2D::~BVH_CONTAINER_2D | ( | ) |
Definition at line 113 of file container_2d.cpp.
References destroy().
|
delete |
References BVH_CONTAINER_2D().
|
inlineinherited |
Definition at line 44 of file container_2d.h.
References OBJECT_2D::GetBBox(), m_bbox, m_lock, and m_objects.
Referenced by addFILLED_CIRCLE_2D(), addRING_2D(), addROUND_SEGMENT_2D(), BOARD_ADAPTER::addText(), ConvertPolygonToBlocks(), ConvertPolygonToTriangles(), and BOARD_ADAPTER::createLayers().
void BVH_CONTAINER_2D::BuildBVH | ( | ) |
Definition at line 122 of file container_2d.cpp.
References destroy(), CONTAINER_2D_BASE::m_bbox, m_elementsToDelete, m_isInitialized, CONTAINER_2D_BASE::m_objects, m_tree, and recursiveBuild_MIDDLE_SPLIT().
|
overridevirtual |
Reimplemented from CONTAINER_2D_BASE.
Definition at line 91 of file container_2d.cpp.
References CONTAINER_2D_BASE::Clear(), and 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().
|
inlineinherited |
Definition at line 54 of file container_2d.h.
References 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(), and RENDER_3D_RAYTRACE_BASE::Reload().
|
inlineinherited |
Definition at line 61 of file container_2d.h.
References m_objects.
Referenced by RENDER_3D_OPENGL::createBoard(), RENDER_3D_RAYTRACE_BASE::createItemsFromContainer(), RENDER_3D_OPENGL::generateLayerList(), RENDER_3D_OPENGL::generateViasAndPads(), 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().
|
delete |
References BVH_CONTAINER_2D().
|
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 80 of file container_2d.h.
Referenced by Add(), BVH_CONTAINER_2D::BuildBVH(), BVH_CONTAINER_2D::BVH_CONTAINER_2D(), Clear(), CONTAINER_2D_BASE(), and GetBBox().
|
private |
Definition at line 137 of file container_2d.h.
Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), and recursiveBuild_MIDDLE_SPLIT().
|
private |
Definition at line 136 of file container_2d.h.
Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), GetIntersectingObjects(), and IntersectAny().
|
privateinherited |
Definition at line 84 of file container_2d.h.
|
protectedinherited |
Definition at line 81 of file container_2d.h.
Referenced by Add(), BVH_CONTAINER_2D::BuildBVH(), Clear(), and GetList().
|
private |
Definition at line 138 of file container_2d.h.
Referenced by BuildBVH(), BVH_CONTAINER_2D(), destroy(), GetIntersectingObjects(), and IntersectAny().