KiCad PCB EDA Suite
|
#include <triangle_2d.h>
Public Member Functions | |
TRIANGLE_2D (const SFVEC2F &aV1, const SFVEC2F &aV2, const SFVEC2F &aV3, const BOARD_ITEM &aBoardItem) | |
const SFVEC2F & | GetP1 () const |
const SFVEC2F & | GetP2 () const |
const SFVEC2F & | GetP3 () 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 | p1 |
SFVEC2F | p2 |
SFVEC2F | p3 |
float | m_inv_denominator |
float | m_p2y_minus_p3y |
float | m_p3x_minus_p2x |
float | m_p3y_minus_p1y |
float | m_p1x_minus_p3x |
Definition at line 38 of file triangle_2d.h.
TRIANGLE_2D::TRIANGLE_2D | ( | const SFVEC2F & | aV1, |
const SFVEC2F & | aV2, | ||
const SFVEC2F & | aV3, | ||
const BOARD_ITEM & | aBoardItem | ||
) |
Definition at line 36 of file triangle_2d.cpp.
References BBOX_2D::GetCenter(), BBOX_2D::IsInitialized(), OBJECT_2D::m_bbox, OBJECT_2D::m_centroid, m_inv_denominator, m_p1x_minus_p3x, m_p2y_minus_p3y, m_p3x_minus_p2x, m_p3y_minus_p1y, p1, p2, p3, BBOX_2D::Reset(), BBOX_2D::ScaleNextUp(), and BBOX_2D::Union().
|
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().
|
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 44 of file triangle_2d.h.
References p1.
Referenced by RENDER_3D_OPENGL::addObjectTriangles(), RENDER_3D_OPENGL::createBoard(), and RENDER_3D_OPENGL::generateViasAndPads().
|
inline |
Definition at line 45 of file triangle_2d.h.
References p2.
Referenced by RENDER_3D_OPENGL::addObjectTriangles(), RENDER_3D_OPENGL::createBoard(), and RENDER_3D_OPENGL::generateViasAndPads().
|
inline |
Definition at line 46 of file triangle_2d.h.
References p3.
Referenced by RENDER_3D_OPENGL::addObjectTriangles(), RENDER_3D_OPENGL::createBoard(), and RENDER_3D_OPENGL::generateViasAndPads().
|
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 80 of file triangle_2d.cpp.
|
overridevirtual |
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
TODO: Optimize
Implements OBJECT_2D.
Definition at line 63 of file triangle_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 86 of file triangle_2d.cpp.
References BBOX_2D::Intersects(), and OBJECT_2D::m_bbox.
|
overridevirtual |
Implements OBJECT_2D.
Definition at line 96 of file triangle_2d.cpp.
References m_inv_denominator, m_p1x_minus_p3x, m_p2y_minus_p3y, m_p3x_minus_p2x, m_p3y_minus_p1y, and p3.
|
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 73 of file triangle_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(), POLYGON_4PT_2D::Intersects(), LAYER_ITEM_2D::Intersects(), POLYGON_2D::Intersects(), DUMMY_BLOCK_2D::Intersects(), ROUND_SEGMENT_2D::Intersects(), Intersects(), FILLED_CIRCLE_2D::IsBBoxInside(), ROUND_SEGMENT_2D::IsBBoxInside(), IsBBoxInside(), DUMMY_BLOCK_2D::IsPointInside(), LAYER_ITEM_2D::LAYER_ITEM_2D(), POLYGON_2D::POLYGON_2D(), POLYGON_4PT_2D::POLYGON_4PT_2D(), RING_2D::RING_2D(), ROUND_SEGMENT_2D::ROUND_SEGMENT_2D(), and 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::POLYGON_4PT_2D(), RING_2D::RING_2D(), ROUND_SEGMENT_2D::ROUND_SEGMENT_2D(), and TRIANGLE_2D().
|
private |
Definition at line 59 of file triangle_2d.h.
Referenced by IsPointInside(), and 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 63 of file triangle_2d.h.
Referenced by IsPointInside(), and TRIANGLE_2D().
|
private |
Definition at line 60 of file triangle_2d.h.
Referenced by IsPointInside(), and TRIANGLE_2D().
|
private |
Definition at line 61 of file triangle_2d.h.
Referenced by IsPointInside(), and TRIANGLE_2D().
|
private |
Definition at line 62 of file triangle_2d.h.
Referenced by IsPointInside(), and TRIANGLE_2D().
|
private |
Definition at line 55 of file triangle_2d.h.
Referenced by GetP1(), and TRIANGLE_2D().
|
private |
Definition at line 56 of file triangle_2d.h.
Referenced by GetP2(), and TRIANGLE_2D().
|
private |
Definition at line 57 of file triangle_2d.h.
Referenced by GetP3(), IsPointInside(), and TRIANGLE_2D().