KiCad PCB EDA Suite
citemlayercsg2d.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef _CITEMLAYERCSG2D_H_
31 #define _CITEMLAYERCSG2D_H_
32 
33 #include "cobject2d.h"
34 #include <vector>
35 
75 #define CSGITEM_EMPTY 0
76 #define CSGITEM_FULL (COBJECT2D *)((size_t)(-1))
77 
78 class CITEMLAYERCSG2D : public COBJECT2D
79 {
80 private:
82  std::vector<const COBJECT2D *> *m_objectB;
84 
85 public:
86  CITEMLAYERCSG2D( const COBJECT2D *aObjectA,
87  std::vector<const COBJECT2D *> *aObjectB,
88  const COBJECT2D *aObjectC,
89  const BOARD_ITEM &aBoardItem );
90 
92 
93  // Imported from COBJECT2D
94  bool Overlaps( const CBBOX2D &aBBox ) const override;
95  bool Intersects( const CBBOX2D &aBBox ) const override;
96  bool Intersect( const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut ) const override;
97  INTERSECTION_RESULT IsBBoxInside( const CBBOX2D &aBBox ) const override;
98  bool IsPointInside( const SFVEC2F &aPoint ) const override;
99 };
100 
101 
102 #endif // _CITEMLAYERCSG2D_H_
INTERSECTION_RESULT
Definition: cobject2d.h:38
std::vector< const COBJECT2D * > * m_objectB
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
const COBJECT2D * m_objectC
const COBJECT2D * m_objectA
Class CBBOX manages a bounding box defined by two SFVEC2F min max points.
Definition: cbbox2d.h:40
bool Intersects(const CBBOX2D &aBBox) const override
Function Intersects.
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
CITEMLAYERCSG2D(const COBJECT2D *aObjectA, std::vector< const COBJECT2D * > *aObjectB, const COBJECT2D *aObjectC, const BOARD_ITEM &aBoardItem)
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
Function Intersect.
bool IsPointInside(const SFVEC2F &aPoint) const override
bool Overlaps(const CBBOX2D &aBBox) const override
Function Overlaps.
INTERSECTION_RESULT IsBBoxInside(const CBBOX2D &aBBox) const override
Function IsBBoxInside.
Definition: ray.h:86