KiCad PCB EDA Suite
CONTAINER_2D Class Reference

#include <container_2d.h>

Inheritance diagram for CONTAINER_2D:
CONTAINER_2D_BASE

Public Member Functions

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

Protected Attributes

BBOX_2D m_bbox
 
LIST_OBJECT2D m_objects
 

Detailed Description

Definition at line 94 of file container_2d.h.

Constructor & Destructor Documentation

◆ CONTAINER_2D()

CONTAINER_2D::CONTAINER_2D ( )

Definition at line 62 of file container_2d.cpp.

63 {
64 
65 }
CONTAINER_2D_BASE(OBJECT_2D_TYPE aObjType)

References CONTAINER.

Member Function Documentation

◆ Add()

◆ Clear()

void CONTAINER_2D_BASE::Clear ( )
virtualinherited

Reimplemented in BVH_CONTAINER_2D.

Definition at line 42 of file container_2d.cpp.

43 {
44  std::lock_guard<std::mutex> lock( m_lock );
45  m_bbox.Reset();
46 
47  for( LIST_OBJECT2D::iterator ii = m_objects.begin(); ii != m_objects.end(); ++ii )
48  {
49  delete *ii;
50  }
51 
52  m_objects.clear();
53 }
LIST_OBJECT2D m_objects
Definition: container_2d.h:87
void Reset()
Reset the bounding box to zero and uninitialize it.
Definition: bbox_2d.cpp:86
std::mutex m_lock
Definition: container_2d.h:90

References CONTAINER_2D_BASE::m_bbox, CONTAINER_2D_BASE::m_lock, CONTAINER_2D_BASE::m_objects, and BBOX_2D::Reset().

Referenced by BVH_CONTAINER_2D::Clear(), RENDER_3D_RAYTRACE::Reload(), and CONTAINER_2D_BASE::~CONTAINER_2D_BASE().

◆ GetBBox()

const BBOX_2D& CONTAINER_2D_BASE::GetBBox ( ) const
inlineinherited

Definition at line 59 of file container_2d.h.

60  {
61  return m_bbox;
62  }

References CONTAINER_2D_BASE::m_bbox.

◆ GetList()

◆ GetListObjectsIntersects()

void CONTAINER_2D::GetListObjectsIntersects ( 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.
Todo:
Determine what to do with this code.

Implements CONTAINER_2D_BASE.

Definition at line 68 of file container_2d.cpp.

70 {
72 }

◆ IntersectAny()

bool 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.
Todo:
Determine what what needs done because someone wrote TODO here.

Implements CONTAINER_2D_BASE.

Definition at line 75 of file container_2d.cpp.

76 {
78  return false;
79 }

Member Data Documentation

◆ m_bbox

◆ m_objects

LIST_OBJECT2D CONTAINER_2D_BASE::m_objects
protectedinherited

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