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 (C) 1992-2020 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, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
30#ifndef _LAYER_ITEM_2D_H_
31#define _LAYER_ITEM_2D_H_
32
33#include "object_2d.h"
34#include <vector>
35
36struct RAYSEG2D;
37
38#define CSGITEM_EMPTY 0
39#define CSGITEM_FULL (OBJECT_2D*) ( ( size_t )( -1 ) )
40
80{
81public:
82 LAYER_ITEM_2D( const OBJECT_2D* aObjectA, std::vector<const OBJECT_2D*>* aObjectB,
83 const OBJECT_2D* aObjectC, const BOARD_ITEM& aBoardItem );
84
86
87 // Imported from OBJECT_2D
88 bool Overlaps( const BBOX_2D& aBBox ) const override;
89 bool Intersects( const BBOX_2D& aBBox ) const override;
90 bool Intersect( const RAYSEG2D& aSegRay, float* aOutT, SFVEC2F* aNormalOut ) const override;
91 INTERSECTION_RESULT IsBBoxInside( const BBOX_2D& aBBox ) const override;
92 bool IsPointInside( const SFVEC2F& aPoint ) const override;
93
94private:
96 std::vector<const OBJECT_2D*>* m_objectB;
98};
99
100#endif // _LAYER_ITEM_2D_H_
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:77
Make solid geometry for objects on layers.
Definition: layer_item_2d.h:80
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
Definition: layer_item_2d.h:95
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 Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
std::vector< const OBJECT_2D * > * m_objectB
Definition: layer_item_2d.h:96
const OBJECT_2D * m_objectC
Definition: layer_item_2d.h:97
INTERSECTION_RESULT
Definition: object_2d.h:37
Manage a bounding box defined by two SFVEC2F min max points.
Definition: bbox_2d.h:42
Definition: ray.h:106
glm::vec2 SFVEC2F
Definition: xv3d_types.h:42