KiCad PCB EDA Suite
CCONTAINER2D Class Reference

#include <ccontainer2d.h>

Inheritance diagram for CCONTAINER2D:
CGENERICCONTAINER2D

Public Member Functions

 CCONTAINER2D ()
 
void GetListObjectsIntersects (const CBBOX2D &aBBox, CONST_LIST_OBJECT2D &aOutList) const override
 GetListObjectsIntersects - Get a list of objects that intersects a bbox. More...
 
bool IntersectAny (const RAYSEG2D &aSegRay) const override
 IntersectAny - Intersect and check if a segment ray hits a object or is inside it. More...
 
void Add (COBJECT2D *aObject)
 
const CBBOX2DGetBBox () const
 
virtual void Clear ()
 
const LIST_OBJECT2DGetList () const
 

Protected Attributes

CBBOX2D m_bbox
 
LIST_OBJECT2D m_objects
 

Detailed Description

Definition at line 91 of file ccontainer2d.h.

Constructor & Destructor Documentation

◆ CCONTAINER2D()

CCONTAINER2D::CCONTAINER2D ( )

Definition at line 76 of file ccontainer2d.cpp.

77 {
78 
79 }
CGENERICCONTAINER2D(OBJECT2D_TYPE aObjType)

References CONTAINER.

Member Function Documentation

◆ Add()

void CGENERICCONTAINER2D::Add ( COBJECT2D aObject)
inlineinherited

◆ Clear()

void CGENERICCONTAINER2D::Clear ( )
virtualinherited

Reimplemented in CBVHCONTAINER2D.

Definition at line 48 of file ccontainer2d.cpp.

49 {
50  std::lock_guard<std::mutex> lock( m_lock );
51  m_bbox.Reset();
52 
53  for( LIST_OBJECT2D::iterator ii = m_objects.begin();
54  ii != m_objects.end();
55  ++ii )
56  {
57  delete *ii;
58  }
59 
60  m_objects.clear();
61 }
void Reset()
Function Reset reset the bounding box to zero and de-initialized it.
Definition: cbbox2d.cpp:87
LIST_OBJECT2D m_objects
Definition: ccontainer2d.h:45

References CGENERICCONTAINER2D::m_bbox, CGENERICCONTAINER2D::m_lock, CGENERICCONTAINER2D::m_objects, and CBBOX2D::Reset().

Referenced by CBVHCONTAINER2D::Clear(), C3D_RENDER_RAYTRACING::Reload(), and CGENERICCONTAINER2D::~CGENERICCONTAINER2D().

◆ GetBBox()

const CBBOX2D& CGENERICCONTAINER2D::GetBBox ( ) const
inlineinherited

Definition at line 62 of file ccontainer2d.h.

63  {
64  return m_bbox;
65  }

References CGENERICCONTAINER2D::m_bbox.

◆ GetList()

◆ GetListObjectsIntersects()

void CCONTAINER2D::GetListObjectsIntersects ( const CBBOX2D aBBox,
CONST_LIST_OBJECT2D aOutList 
) const
overridevirtual

GetListObjectsIntersects - Get a list of objects that intersects a bbox.

Parameters
aBBox- a bbox to make the query
aOutList- A list of objects that intersects the bbox

Implements CGENERICCONTAINER2D.

Definition at line 149 of file ccontainer2d.cpp.

151 {
152  // !TODO:
153 }

◆ IntersectAny()

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

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

Parameters
aSegRay- a segment to intersect with objects
Returns
true - if it hits any of the objects or is inside any object

Implements CGENERICCONTAINER2D.

Definition at line 156 of file ccontainer2d.cpp.

157 {
158  // !TODO:
159  return false;
160 }

Member Data Documentation

◆ m_bbox

◆ m_objects

LIST_OBJECT2D CGENERICCONTAINER2D::m_objects
protectedinherited

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