KiCad PCB EDA Suite
Loading...
Searching...
No Matches
RING_2D Class Reference

#include <ring_2d.h>

Inheritance diagram for RING_2D:
OBJECT_2D

Public Member Functions

 RING_2D (const SFVEC2F &aCenter, float aInnerRadius, float aOuterRadius, const BOARD_ITEM &aBoardItem)
 
bool Overlaps (const BBOX_2D &aBBox) const override
 Test if the box overlaps the object.
 
bool Intersects (const BBOX_2D &aBBox) const override
 a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
 
bool Intersect (const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
 
INTERSECTION_RESULT IsBBoxInside (const BBOX_2D &aBBox) const override
 Test this object if it's completely outside, intersects, or is completely inside aBBox.
 
bool IsPointInside (const SFVEC2F &aPoint) const override
 
const SFVEC2FGetCenter () const
 
float GetInnerRadius () const
 
float GetOuterRadius () const
 
float GetInnerRadiusSquared () const
 
float GetOuterRadiusSquared () const
 
const BOARD_ITEMGetBoardItem () const
 
const BBOX_2DGetBBox () const
 
const SFVEC2FGetCentroid () const
 
OBJECT_2D_TYPE GetObjectType () const
 

Protected Attributes

BBOX_2D m_bbox
 
SFVEC2F m_centroid
 
OBJECT_2D_TYPE m_obj_type
 
const BOARD_ITEMm_boardItem
 

Private Attributes

SFVEC2F m_center
 
float m_inner_radius
 
float m_outer_radius
 
float m_inner_radius_squared
 
float m_outer_radius_squared
 

Detailed Description

Definition at line 34 of file ring_2d.h.

Constructor & Destructor Documentation

◆ RING_2D()

RING_2D::RING_2D ( const SFVEC2F aCenter,
float  aInnerRadius,
float  aOuterRadius,
const BOARD_ITEM aBoardItem 
)

Member Function Documentation

◆ GetBBox()

◆ GetBoardItem()

const BOARD_ITEM & OBJECT_2D::GetBoardItem ( ) const
inlineinherited

Definition at line 66 of file object_2d.h.

References OBJECT_2D::m_boardItem.

Referenced by RENDER_3D_RAYTRACE_BASE::createItemsFromContainer().

◆ GetCenter()

const SFVEC2F & RING_2D::GetCenter ( ) const
inline

Definition at line 46 of file ring_2d.h.

References m_center.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetCentroid()

const SFVEC2F & OBJECT_2D::GetCentroid ( ) const
inlineinherited

◆ GetInnerRadius()

float RING_2D::GetInnerRadius ( ) const
inline

Definition at line 47 of file ring_2d.h.

References m_inner_radius.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetInnerRadiusSquared()

float RING_2D::GetInnerRadiusSquared ( ) const
inline

Definition at line 50 of file ring_2d.h.

References m_inner_radius_squared.

◆ GetObjectType()

◆ GetOuterRadius()

float RING_2D::GetOuterRadius ( ) const
inline

Definition at line 48 of file ring_2d.h.

References m_outer_radius.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetOuterRadiusSquared()

float RING_2D::GetOuterRadiusSquared ( ) const
inline

Definition at line 51 of file ring_2d.h.

References m_outer_radius_squared.

◆ Intersect()

bool RING_2D::Intersect ( const RAYSEG2D aSegRay,
float *  aOutT,
SFVEC2F aNormalOut 
) const
overridevirtual
Parameters
aOutTa value between 0.0 and 1.0 in relation to the time of the hit of the segment.

Implements OBJECT_2D.

Definition at line 72 of file ring_2d.cpp.

References RAYSEG2D::at(), m_center, RAYSEG2D::m_Dir, m_inner_radius, m_inner_radius_squared, RAYSEG2D::m_Length, m_outer_radius, m_outer_radius_squared, and RAYSEG2D::m_Start.

◆ Intersects()

bool RING_2D::Intersects ( const BBOX_2D aBBox) const
overridevirtual

a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)

Implements OBJECT_2D.

Definition at line 65 of file ring_2d.cpp.

References BBOX_2D::Intersects(), m_center, and m_outer_radius_squared.

◆ IsBBoxInside()

INTERSECTION_RESULT RING_2D::IsBBoxInside ( const BBOX_2D aBBox) const
overridevirtual

Test this object if it's completely outside, intersects, or is completely inside aBBox.

Returns
INTERSECTION_RESULT

Implements OBJECT_2D.

Definition at line 148 of file ring_2d.cpp.

◆ IsPointInside()

bool RING_2D::IsPointInside ( const SFVEC2F aPoint) const
overridevirtual

Implements OBJECT_2D.

Definition at line 154 of file ring_2d.cpp.

References m_center, m_inner_radius_squared, and m_outer_radius_squared.

◆ Overlaps()

bool RING_2D::Overlaps ( const BBOX_2D aBBox) const
overridevirtual

Test if the box overlaps the object.

Conformance Implements the Overlaps function from the OGC Simple Feature Specification at 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 dimensions 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
aBBoxis the bounding box to test.
Returns
true if the BBox intersects the object or is inside it.

Implements OBJECT_2D.

Definition at line 58 of file ring_2d.cpp.

Member Data Documentation

◆ m_bbox

◆ m_boardItem

const BOARD_ITEM& OBJECT_2D::m_boardItem
protectedinherited

Definition at line 114 of file object_2d.h.

Referenced by OBJECT_2D::GetBoardItem().

◆ m_center

SFVEC2F RING_2D::m_center
private

Definition at line 54 of file ring_2d.h.

Referenced by GetCenter(), Intersect(), Intersects(), IsPointInside(), and RING_2D().

◆ m_centroid

◆ m_inner_radius

float RING_2D::m_inner_radius
private

Definition at line 55 of file ring_2d.h.

Referenced by GetInnerRadius(), Intersect(), and RING_2D().

◆ m_inner_radius_squared

float RING_2D::m_inner_radius_squared
private

Definition at line 57 of file ring_2d.h.

Referenced by GetInnerRadiusSquared(), Intersect(), IsPointInside(), and RING_2D().

◆ m_obj_type

OBJECT_2D_TYPE OBJECT_2D::m_obj_type
protectedinherited

Definition at line 112 of file object_2d.h.

Referenced by OBJECT_2D::GetObjectType(), and OBJECT_2D::OBJECT_2D().

◆ m_outer_radius

float RING_2D::m_outer_radius
private

Definition at line 56 of file ring_2d.h.

Referenced by GetOuterRadius(), Intersect(), and RING_2D().

◆ m_outer_radius_squared

float RING_2D::m_outer_radius_squared
private

Definition at line 58 of file ring_2d.h.

Referenced by GetOuterRadiusSquared(), Intersect(), Intersects(), IsPointInside(), and RING_2D().


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