KiCad PCB EDA Suite
cfilledcircle2d.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 _CFILLEDCIRCLE2D_H_
31 #define _CFILLEDCIRCLE2D_H_
32 
33 #include "cobject2d.h"
34 
35 class CFILLEDCIRCLE2D : public COBJECT2D
36 {
37 public:
38  float GetRadius() const { return m_radius; }
39  const SFVEC2F &GetCenter() const { return m_center; }
40  float GetRadiusSquared() const { return m_radius_squared; }
41 
42 private:
44  float m_radius;
46 
47 public:
48  CFILLEDCIRCLE2D( const SFVEC2F &aCenter, float aRadius, const BOARD_ITEM &aBoardItem );
49 
50  // Imported from COBJECT2D
51  bool Overlaps( const CBBOX2D &aBBox ) const override;
52  bool Intersects( const CBBOX2D &aBBox ) const override;
53  bool Intersect( const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut ) const override;
54  INTERSECTION_RESULT IsBBoxInside( const CBBOX2D &aBBox ) const override;
55  bool IsPointInside( const SFVEC2F &aPoint ) const override;
56 };
57 
58 
59 #endif // _CFILLEDCIRCLE2D_H_
INTERSECTION_RESULT
Definition: cobject2d.h:38
Class BOARD_ITEM is a base class for any item which can be embedded within the BOARD container class...
Class CBBOX manages a bounding box defined by two SFVEC2F min max points.
Definition: cbbox2d.h:40
CFILLEDCIRCLE2D(const SFVEC2F &aCenter, float aRadius, const BOARD_ITEM &aBoardItem)
float GetRadiusSquared() const
const SFVEC2F & GetCenter() const
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
bool Overlaps(const CBBOX2D &aBBox) const override
Function Overlaps.
INTERSECTION_RESULT IsBBoxInside(const CBBOX2D &aBBox) const override
Function IsBBoxInside.
float GetRadius() const
bool Intersects(const CBBOX2D &aBBox) const override
Function Intersects.
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
Function Intersect.
bool IsPointInside(const SFVEC2F &aPoint) const override
Definition: ray.h:86