KiCad PCB EDA Suite
|
Simple non-intersecting polygon with 4 points. More...
#include <4pt_polygon_2d.h>
Public Member Functions | |
POLYGON_4PT_2D (const SFVEC2F &v1, const SFVEC2F &v2, const SFVEC2F &v3, const SFVEC2F &v4, const BOARD_ITEM &aBoardItem) | |
const SFVEC2F & | GetV0 () const |
const SFVEC2F & | GetV1 () const |
const SFVEC2F & | GetV2 () const |
const SFVEC2F & | GetV3 () const |
const SFVEC2F & | GetN0 () const |
const SFVEC2F & | GetN1 () const |
const SFVEC2F & | GetN2 () const |
const SFVEC2F & | GetN3 () 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_ITEM & | GetBoardItem () const |
const BBOX_2D & | GetBBox () const |
const SFVEC2F & | GetCentroid () const |
OBJECT_2D_TYPE | GetObjectType () const |
Protected Attributes | |
BBOX_2D | m_bbox |
SFVEC2F | m_centroid |
OBJECT_2D_TYPE | m_obj_type |
const BOARD_ITEM & | m_boardItem |
Private Attributes | |
SFVEC2F | m_segments [4] |
SFVEC2F | m_precalc_slope [4] |
SFVEC2F | m_seg_normal [4] |
Simple non-intersecting polygon with 4 points.
Used for footprint pads. (rectangles, trapezoids, with rotation.etc). This is a simplified version of the POLYGON_2D class.
Definition at line 41 of file 4pt_polygon_2d.h.
POLYGON_4PT_2D::POLYGON_4PT_2D | ( | const SFVEC2F & | v1, |
const SFVEC2F & | v2, | ||
const SFVEC2F & | v3, | ||
const SFVEC2F & | v4, | ||
const BOARD_ITEM & | aBoardItem | ||
) |
Definition at line 34 of file 4pt_polygon_2d.cpp.
References BBOX_2D::GetCenter(), BBOX_2D::IsInitialized(), OBJECT_2D::m_bbox, OBJECT_2D::m_centroid, m_precalc_slope, m_seg_normal, m_segments, BBOX_2D::Reset(), BBOX_2D::ScaleNextUp(), BBOX_2D::Union(), v1, v2, v3, and v4.
|
inlineinherited |
Definition at line 103 of file object_2d.h.
References OBJECT_2D::m_bbox.
Referenced by CONTAINER_2D_BASE::Add(), RENDER_3D_RAYTRACE_BASE::createObject(), RENDER_3D_RAYTRACE_BASE::insertHole(), LAYER_ITEM::LAYER_ITEM(), LAYER_ITEM_2D::LAYER_ITEM_2D(), and BVH_CONTAINER_2D::recursiveBuild_MIDDLE_SPLIT().
|
inlineinherited |
Definition at line 66 of file object_2d.h.
References OBJECT_2D::m_boardItem.
Referenced by RENDER_3D_RAYTRACE_BASE::createItemsFromContainer().
|
inlineinherited |
Definition at line 105 of file object_2d.h.
References OBJECT_2D::m_centroid.
Referenced by LAYER_ITEM::LAYER_ITEM(), sortByCentroidX(), sortByCentroidY(), and sortByCentroidZ().
|
inline |
Definition at line 52 of file 4pt_polygon_2d.h.
References m_seg_normal.
|
inline |
Definition at line 53 of file 4pt_polygon_2d.h.
References m_seg_normal.
|
inline |
Definition at line 54 of file 4pt_polygon_2d.h.
References m_seg_normal.
|
inline |
Definition at line 55 of file 4pt_polygon_2d.h.
References m_seg_normal.
|
inlineinherited |
Definition at line 107 of file object_2d.h.
References OBJECT_2D::m_obj_type.
Referenced by RENDER_3D_OPENGL::createBoard(), RENDER_3D_RAYTRACE_BASE::createObject(), RENDER_3D_OPENGL::generateHoles(), RENDER_3D_OPENGL::generateLayerList(), RENDER_3D_OPENGL::generateViasAndPads(), and LAYER_ITEM_2D::Intersect().
|
inline |
Definition at line 47 of file 4pt_polygon_2d.h.
References m_segments.
Referenced by RENDER_3D_OPENGL::addObjectTriangles().
|
inline |
Definition at line 48 of file 4pt_polygon_2d.h.
References m_segments.
Referenced by RENDER_3D_OPENGL::addObjectTriangles().
|
inline |
Definition at line 49 of file 4pt_polygon_2d.h.
References m_segments.
Referenced by RENDER_3D_OPENGL::addObjectTriangles().
|
inline |
Definition at line 50 of file 4pt_polygon_2d.h.
References m_segments.
Referenced by RENDER_3D_OPENGL::addObjectTriangles().
|
overridevirtual |
aOutT | a value between 0.0 and 1.0 in relation to the time of the hit of the segment. |
Implements OBJECT_2D.
Definition at line 82 of file 4pt_polygon_2d.cpp.
References RAYSEG2D::IntersectSegment(), m_precalc_slope, m_seg_normal, and m_segments.
|
overridevirtual |
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
Implements OBJECT_2D.
Definition at line 69 of file 4pt_polygon_2d.cpp.
References BBOX_2D::Intersects(), and OBJECT_2D::m_bbox.
|
overridevirtual |
Test this object if it's completely outside, intersects, or is completely inside aBBox.
Implements OBJECT_2D.
Definition at line 120 of file 4pt_polygon_2d.cpp.
|
overridevirtual |
|
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.
aBBox | is the bounding box to test. |
Implements OBJECT_2D.
Definition at line 75 of file 4pt_polygon_2d.cpp.
|
protectedinherited |
Definition at line 110 of file object_2d.h.
Referenced by DUMMY_BLOCK_2D::DUMMY_BLOCK_2D(), FILLED_CIRCLE_2D::FILLED_CIRCLE_2D(), OBJECT_2D::GetBBox(), Intersects(), LAYER_ITEM_2D::Intersects(), POLYGON_2D::Intersects(), DUMMY_BLOCK_2D::Intersects(), ROUND_SEGMENT_2D::Intersects(), TRIANGLE_2D::Intersects(), FILLED_CIRCLE_2D::IsBBoxInside(), ROUND_SEGMENT_2D::IsBBoxInside(), TRIANGLE_2D::IsBBoxInside(), DUMMY_BLOCK_2D::IsPointInside(), LAYER_ITEM_2D::LAYER_ITEM_2D(), POLYGON_2D::POLYGON_2D(), POLYGON_4PT_2D(), RING_2D::RING_2D(), ROUND_SEGMENT_2D::ROUND_SEGMENT_2D(), and TRIANGLE_2D::TRIANGLE_2D().
|
protectedinherited |
Definition at line 114 of file object_2d.h.
Referenced by OBJECT_2D::GetBoardItem().
|
protectedinherited |
Definition at line 111 of file object_2d.h.
Referenced by DUMMY_BLOCK_2D::DUMMY_BLOCK_2D(), FILLED_CIRCLE_2D::FILLED_CIRCLE_2D(), OBJECT_2D::GetCentroid(), LAYER_ITEM_2D::LAYER_ITEM_2D(), POLYGON_2D::POLYGON_2D(), POLYGON_4PT_2D(), RING_2D::RING_2D(), ROUND_SEGMENT_2D::ROUND_SEGMENT_2D(), and TRIANGLE_2D::TRIANGLE_2D().
|
protectedinherited |
Definition at line 112 of file object_2d.h.
Referenced by OBJECT_2D::GetObjectType(), and OBJECT_2D::OBJECT_2D().
|
private |
Definition at line 65 of file 4pt_polygon_2d.h.
Referenced by Intersect(), and POLYGON_4PT_2D().
|
private |
Definition at line 66 of file 4pt_polygon_2d.h.
Referenced by GetN0(), GetN1(), GetN2(), GetN3(), Intersect(), and POLYGON_4PT_2D().
|
private |
Definition at line 64 of file 4pt_polygon_2d.h.
Referenced by GetV0(), GetV1(), GetV2(), GetV3(), Intersect(), IsPointInside(), and POLYGON_4PT_2D().