KiCad PCB EDA Suite
Loading...
Searching...
No Matches
layer_item_2d.h
Go to the documentation of this file.
1
2/*
3 * This program source code file is part of KiCad, a free EDA CAD application.
4 *
5 * Copyright (C) 2015-2016 Mario Luzeiro <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
24#include "object_2d.h"
25#include <vector>
26
27struct RAYSEG2D;
28
29#define CSGITEM_EMPTY 0
30#define CSGITEM_FULL (OBJECT_2D*) ( ( size_t )( -1 ) )
31
71{
72public:
73 LAYER_ITEM_2D( const OBJECT_2D* aObjectA, std::vector<const OBJECT_2D*>* aObjectB,
74 const OBJECT_2D* aObjectC, const BOARD_ITEM& aBoardItem );
75
77
78 // We own at least one list of raw pointers. Don't let the compiler fill in copy c'tors that
79 // will only land us in trouble.
80 LAYER_ITEM_2D( const LAYER_ITEM_2D& ) = delete;
82
83 // Imported from OBJECT_2D
84 bool Overlaps( const BBOX_2D& aBBox ) const override;
85 bool Intersects( const BBOX_2D& aBBox ) const override;
86 bool Intersect( const RAYSEG2D& aSegRay, float* aOutT, SFVEC2F* aNormalOut ) const override;
87 INTERSECTION_RESULT IsBBoxInside( const BBOX_2D& aBBox ) const override;
88 bool IsPointInside( const SFVEC2F& aPoint ) const override;
89
90private:
92 std::vector<const OBJECT_2D*>* m_objectB;
94};
95
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
bool IsPointInside(const SFVEC2F &aPoint) const override
bool Intersects(const BBOX_2D &aBBox) const override
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
const OBJECT_2D * m_objectA
LAYER_ITEM_2D & operator=(const LAYER_ITEM_2D &)=delete
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
LAYER_ITEM_2D(const OBJECT_2D *aObjectA, std::vector< const OBJECT_2D * > *aObjectB, const OBJECT_2D *aObjectC, const BOARD_ITEM &aBoardItem)
INTERSECTION_RESULT IsBBoxInside(const BBOX_2D &aBBox) const override
Test this object if it's completely outside, intersects, or is completely inside aBBox.
bool Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
LAYER_ITEM_2D(const LAYER_ITEM_2D &)=delete
std::vector< const OBJECT_2D * > * m_objectB
const OBJECT_2D * m_objectC
OBJECT_2D(OBJECT_2D_TYPE aObjType, const BOARD_ITEM &aBoardItem)
Definition object_2d.cpp:27
INTERSECTION_RESULT
Definition object_2d.h:33
Manage a bounding box defined by two SFVEC2F min max points.
Definition bbox_2d.h:38
glm::vec2 SFVEC2F
Definition xv3d_types.h:38