KiCad PCB EDA Suite
COBJECT2D Class Referenceabstract

#include <cobject2d.h>

Inheritance diagram for COBJECT2D:
CDUMMYBLOCK2D CFILLEDCIRCLE2D CITEMLAYERCSG2D CPOLYGON4PTS2D CPOLYGONBLOCK2D CRING2D CROUNDSEGMENT2D CTRIANGLE2D

Public Member Functions

 COBJECT2D (OBJECT2D_TYPE aObjType, const BOARD_ITEM &aBoardItem)
 
virtual ~COBJECT2D ()
 
const BOARD_ITEMGetBoardItem () const
 
virtual bool Overlaps (const CBBOX2D &aBBox) const =0
 Function Overlaps. More...
 
virtual bool Intersects (const CBBOX2D &aBBox) const =0
 Function Intersects. More...
 
virtual bool Intersect (const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const =0
 Function Intersect. More...
 
virtual INTERSECTION_RESULT IsBBoxInside (const CBBOX2D &aBBox) const =0
 Function IsBBoxInside. More...
 
virtual bool IsPointInside (const SFVEC2F &aPoint) const =0
 
const CBBOX2DGetBBox () const
 
const SFVEC2FGetCentroid () const
 
OBJECT2D_TYPE GetObjectType () const
 

Protected Attributes

CBBOX2D m_bbox
 
SFVEC2F m_centroid
 
OBJECT2D_TYPE m_obj_type
 
const BOARD_ITEMm_boardItem
 

Detailed Description

Definition at line 62 of file cobject2d.h.

Constructor & Destructor Documentation

COBJECT2D::COBJECT2D ( OBJECT2D_TYPE  aObjType,
const BOARD_ITEM aBoardItem 
)

Definition at line 37 of file cobject2d.cpp.

References COBJECT2D_STATS::AddOne(), COBJECT2D_STATS::Instance(), and m_obj_type.

38  : m_boardItem(aBoardItem)
39 {
40  m_obj_type = aObjType;
41  COBJECT2D_STATS::Instance().AddOne( aObjType );
42 }
const BOARD_ITEM & m_boardItem
Definition: cobject2d.h:69
void AddOne(OBJECT2D_TYPE aObjType)
Definition: cobject2d.h:142
static COBJECT2D_STATS & Instance()
Definition: cobject2d.h:146
OBJECT2D_TYPE m_obj_type
Definition: cobject2d.h:67
virtual COBJECT2D::~COBJECT2D ( )
inlinevirtual

Definition at line 73 of file cobject2d.h.

73 {}

Member Function Documentation

const BOARD_ITEM& COBJECT2D::GetBoardItem ( ) const
inline

Definition at line 75 of file cobject2d.h.

References m_boardItem.

Referenced by C3D_RENDER_RAYTRACING::reload().

75 { return m_boardItem; }
const BOARD_ITEM & m_boardItem
Definition: cobject2d.h:69
const SFVEC2F& COBJECT2D::GetCentroid ( ) const
inline

Definition at line 123 of file cobject2d.h.

References m_centroid.

Referenced by CLAYERITEM::CLAYERITEM(), C3D_RENDER_RAYTRACING::reload(), sortByCentroid_X(), sortByCentroid_Y(), and sortByCentroid_Z().

123 { return m_centroid; }
SFVEC2F m_centroid
Definition: cobject2d.h:66
virtual bool COBJECT2D::Intersect ( const RAYSEG2D aSegRay,
float *  aOutT,
SFVEC2F aNormalOut 
) const
pure virtual

Function Intersect.

Intersect

Parameters
aSegRay
aOutTa value between 0.0 and 1.0 in relation to the time of the hit of the segment
aNormalOut
Returns

Implemented in CDUMMYBLOCK2D, CPOLYGONBLOCK2D, CITEMLAYERCSG2D, CROUNDSEGMENT2D, CPOLYGON4PTS2D, CTRIANGLE2D, CRING2D, and CFILLEDCIRCLE2D.

Referenced by CLAYERITEM::Intersect(), CITEMLAYERCSG2D::Intersect(), and CLAYERITEM::IntersectP().

virtual bool COBJECT2D::Intersects ( const CBBOX2D aBBox) const
pure virtual

Function Intersects.

Intersects - a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅) It intersects if the result intersection is not null

Parameters
aBBox
Returns

Implemented in CDUMMYBLOCK2D, CPOLYGONBLOCK2D, CITEMLAYERCSG2D, CROUNDSEGMENT2D, CPOLYGON4PTS2D, CTRIANGLE2D, CRING2D, and CFILLEDCIRCLE2D.

Referenced by C3D_RENDER_RAYTRACING::insert3DPadHole(), CLAYERITEM::Intersects(), CBVHCONTAINER2D::recursiveGetListObjectsIntersects(), and C3D_RENDER_RAYTRACING::reload().

virtual INTERSECTION_RESULT COBJECT2D::IsBBoxInside ( const CBBOX2D aBBox) const
pure virtual

Function IsBBoxInside.

Tests if the bouding is out, intersects or is complety inside

Parameters
aBBox- The bounding box to test
Returns
INTERSECTION_RESULT

Implemented in CDUMMYBLOCK2D, CPOLYGONBLOCK2D, CITEMLAYERCSG2D, CROUNDSEGMENT2D, CPOLYGON4PTS2D, CTRIANGLE2D, CRING2D, and CFILLEDCIRCLE2D.

virtual bool COBJECT2D::Overlaps ( const CBBOX2D aBBox) const
pure virtual

Function Overlaps.

Test if the box overlaps the object Conformance The function overlaps implements function Overlaps from the OGC Simple Feature Specification. http://www.opengeospatial.org/standards/sfa a.Overlaps(b) ⇔ ( dim(I(a)) = dim(I(b)) = dim(I(a)I(b))) ∧ (a ∩ b ≠ a) ∧ (a ∩ b ≠ b) It means that the result dimension of an overlap is the same dimentions of the bounding box (so the overlap cannot be a point or a line) and one of the boxes cannot full contain the other box.

Parameters
aBBox- The bounding box to test
Returns
true if the BBox intersects the object or is inside it

Implemented in CDUMMYBLOCK2D, CPOLYGONBLOCK2D, CITEMLAYERCSG2D, CROUNDSEGMENT2D, CPOLYGON4PTS2D, CTRIANGLE2D, CRING2D, and CFILLEDCIRCLE2D.

Member Data Documentation

const BOARD_ITEM& COBJECT2D::m_boardItem
protected

Definition at line 69 of file cobject2d.h.

Referenced by GetBoardItem().

OBJECT2D_TYPE COBJECT2D::m_obj_type
protected

Definition at line 67 of file cobject2d.h.

Referenced by COBJECT2D(), and GetObjectType().


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