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

#include <round_segment_2d.h>

Inheritance diagram for ROUND_SEGMENT_2D:
OBJECT_2D

Public Member Functions

 ROUND_SEGMENT_2D (const SFVEC2F &aStart, const SFVEC2F &aEnd, float aWidth, const BOARD_ITEM &aBoardItem)
 
float GetRadius () const
 
float GetRadiusSquared () const
 
float GetWidth () const
 
float GetLength () const
 
const SFVEC2FGetStart () const
 
const SFVEC2FGetEnd () const
 
const SFVEC2FGetEnd_minus_Start () const
 
const SFVEC2FGetLeftStar () const
 
const SFVEC2FGetLeftEnd () const
 
const SFVEC2FGetLeftEnd_minus_Start () const
 
const SFVEC2FGetLeftDir () const
 
const SFVEC2FGetRightStar () const
 
const SFVEC2FGetRightEnd () const
 
const SFVEC2FGetRightEnd_minus_Start () const
 
const SFVEC2FGetRightDir () const
 
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 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

RAYSEG2D m_segment
 
SFVEC2F m_leftStart
 
SFVEC2F m_leftEnd
 
SFVEC2F m_leftEndMinusStart
 
SFVEC2F m_leftDir
 
SFVEC2F m_rightStart
 
SFVEC2F m_rightEnd
 
SFVEC2F m_rightEndMinusStart
 
SFVEC2F m_rightDir
 
float m_radius
 
float m_radius_squared
 
float m_width
 

Friends

class ROUND_SEGMENT
 

Detailed Description

Definition at line 39 of file round_segment_2d.h.

Constructor & Destructor Documentation

◆ ROUND_SEGMENT_2D()

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().

◆ GetCentroid()

const SFVEC2F & OBJECT_2D::GetCentroid ( ) const
inlineinherited

◆ GetEnd()

const SFVEC2F & ROUND_SEGMENT_2D::GetEnd ( ) const
inline

Definition at line 51 of file round_segment_2d.h.

References RAYSEG2D::m_End, and m_segment.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetEnd_minus_Start()

const SFVEC2F & ROUND_SEGMENT_2D::GetEnd_minus_Start ( ) const
inline

Definition at line 52 of file round_segment_2d.h.

References RAYSEG2D::m_End_minus_start, and m_segment.

Referenced by DrawSegment().

◆ GetLeftDir()

const SFVEC2F & ROUND_SEGMENT_2D::GetLeftDir ( ) const
inline

Definition at line 57 of file round_segment_2d.h.

References m_leftDir.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetLeftEnd()

const SFVEC2F & ROUND_SEGMENT_2D::GetLeftEnd ( ) const
inline

Definition at line 55 of file round_segment_2d.h.

References m_leftEnd.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetLeftEnd_minus_Start()

const SFVEC2F & ROUND_SEGMENT_2D::GetLeftEnd_minus_Start ( ) const
inline

Definition at line 56 of file round_segment_2d.h.

References m_leftEndMinusStart.

◆ GetLeftStar()

const SFVEC2F & ROUND_SEGMENT_2D::GetLeftStar ( ) const
inline

Definition at line 54 of file round_segment_2d.h.

References m_leftStart.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetLength()

float ROUND_SEGMENT_2D::GetLength ( ) const
inline

Definition at line 48 of file round_segment_2d.h.

References RAYSEG2D::m_Length, and m_segment.

Referenced by DrawSegment().

◆ GetObjectType()

◆ GetRadius()

float ROUND_SEGMENT_2D::GetRadius ( ) const
inline

◆ GetRadiusSquared()

float ROUND_SEGMENT_2D::GetRadiusSquared ( ) const
inline

Definition at line 46 of file round_segment_2d.h.

References m_radius_squared.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetRightDir()

const SFVEC2F & ROUND_SEGMENT_2D::GetRightDir ( ) const
inline

Definition at line 62 of file round_segment_2d.h.

References m_rightDir.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetRightEnd()

const SFVEC2F & ROUND_SEGMENT_2D::GetRightEnd ( ) const
inline

Definition at line 60 of file round_segment_2d.h.

References m_rightEnd.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetRightEnd_minus_Start()

const SFVEC2F & ROUND_SEGMENT_2D::GetRightEnd_minus_Start ( ) const
inline

Definition at line 61 of file round_segment_2d.h.

References m_rightEndMinusStart.

◆ GetRightStar()

const SFVEC2F & ROUND_SEGMENT_2D::GetRightStar ( ) const
inline

Definition at line 59 of file round_segment_2d.h.

References m_rightStart.

Referenced by RENDER_3D_OPENGL::addObjectTriangles().

◆ GetStart()

const SFVEC2F & ROUND_SEGMENT_2D::GetStart ( ) const
inline

Definition at line 50 of file round_segment_2d.h.

References m_segment, and RAYSEG2D::m_Start.

Referenced by RENDER_3D_OPENGL::addObjectTriangles(), and DrawSegment().

◆ GetWidth()

float ROUND_SEGMENT_2D::GetWidth ( ) const
inline

Definition at line 47 of file round_segment_2d.h.

References m_width.

Referenced by DrawSegment().

◆ Intersect()

bool ROUND_SEGMENT_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 127 of file round_segment_2d.cpp.

References RAYSEG2D::IntersectCircle(), RAYSEG2D::IntersectSegment(), IsPointInside(), RAYSEG2D::m_End, m_leftDir, m_leftEndMinusStart, m_leftStart, m_radius, m_rightDir, m_rightEndMinusStart, m_rightStart, m_segment, and RAYSEG2D::m_Start.

◆ Intersects()

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

◆ IsBBoxInside()

INTERSECTION_RESULT ROUND_SEGMENT_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 296 of file round_segment_2d.cpp.

References BBOX_2D::Intersects(), IsPointInside(), OBJECT_2D::m_bbox, BBOX_2D::Max(), and BBOX_2D::Min().

◆ IsPointInside()

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

Implements OBJECT_2D.

Definition at line 327 of file round_segment_2d.cpp.

References RAYSEG2D::DistanceToPointSquared(), m_radius_squared, and m_segment.

Referenced by Intersect(), and IsBBoxInside().

◆ Overlaps()

bool ROUND_SEGMENT_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 120 of file round_segment_2d.cpp.

Friends And Related Function Documentation

◆ ROUND_SEGMENT

friend class ROUND_SEGMENT
friend

Definition at line 71 of file round_segment_2d.h.

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_centroid

◆ m_leftDir

SFVEC2F ROUND_SEGMENT_2D::m_leftDir
private

Definition at line 78 of file round_segment_2d.h.

Referenced by GetLeftDir(), Intersect(), and ROUND_SEGMENT_2D().

◆ m_leftEnd

SFVEC2F ROUND_SEGMENT_2D::m_leftEnd
private

Definition at line 76 of file round_segment_2d.h.

Referenced by GetLeftEnd(), and ROUND_SEGMENT_2D().

◆ m_leftEndMinusStart

SFVEC2F ROUND_SEGMENT_2D::m_leftEndMinusStart
private

Definition at line 77 of file round_segment_2d.h.

Referenced by GetLeftEnd_minus_Start(), Intersect(), Intersects(), and ROUND_SEGMENT_2D().

◆ m_leftStart

SFVEC2F ROUND_SEGMENT_2D::m_leftStart
private

Definition at line 75 of file round_segment_2d.h.

Referenced by GetLeftStar(), Intersect(), Intersects(), and ROUND_SEGMENT_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_radius

float ROUND_SEGMENT_2D::m_radius
private

Definition at line 85 of file round_segment_2d.h.

Referenced by GetRadius(), Intersect(), and ROUND_SEGMENT_2D().

◆ m_radius_squared

float ROUND_SEGMENT_2D::m_radius_squared
private

Definition at line 86 of file round_segment_2d.h.

Referenced by GetRadiusSquared(), Intersects(), IsPointInside(), and ROUND_SEGMENT_2D().

◆ m_rightDir

SFVEC2F ROUND_SEGMENT_2D::m_rightDir
private

Definition at line 83 of file round_segment_2d.h.

Referenced by GetRightDir(), Intersect(), and ROUND_SEGMENT_2D().

◆ m_rightEnd

SFVEC2F ROUND_SEGMENT_2D::m_rightEnd
private

Definition at line 81 of file round_segment_2d.h.

Referenced by GetRightEnd(), and ROUND_SEGMENT_2D().

◆ m_rightEndMinusStart

SFVEC2F ROUND_SEGMENT_2D::m_rightEndMinusStart
private

◆ m_rightStart

SFVEC2F ROUND_SEGMENT_2D::m_rightStart
private

Definition at line 80 of file round_segment_2d.h.

Referenced by GetRightStar(), Intersect(), Intersects(), and ROUND_SEGMENT_2D().

◆ m_segment

RAYSEG2D ROUND_SEGMENT_2D::m_segment
private

◆ m_width

float ROUND_SEGMENT_2D::m_width
private

Definition at line 87 of file round_segment_2d.h.

Referenced by GetWidth(), and ROUND_SEGMENT_2D().


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