KiCad PCB EDA Suite
Loading...
Searching...
No Matches
filled_circle_2d.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 <[email protected]>
5 * Copyright The 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, see <https://www.gnu.org/licenses/>.
19 */
20
24
25#ifndef _FILLED_CIRCLE_2D_H_
26#define _FILLED_CIRCLE_2D_H_
27
28#include "object_2d.h"
29
31{
32public:
33 FILLED_CIRCLE_2D( const SFVEC2F& aCenter, float aRadius, const BOARD_ITEM& aBoardItem );
34
35 float GetRadius() const { return m_radius; }
36 const SFVEC2F& GetCenter() const { return m_center; }
37 float GetRadiusSquared() const { return m_radius_squared; }
38
39 bool Overlaps( const BBOX_2D& aBBox ) const override;
40 bool Intersects( const BBOX_2D& aBBox ) const override;
41 bool Intersect( const RAYSEG2D& aSegRay, float* aOutT, SFVEC2F* aNormalOut ) const override;
42 INTERSECTION_RESULT IsBBoxInside( const BBOX_2D& aBBox ) const override;
43 bool IsPointInside( const SFVEC2F& aPoint ) const override;
44
45private:
47 float m_radius;
49};
50
51
52#endif // _FILLED_CIRCLE_2D_H_
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:81
bool Overlaps(const BBOX_2D &aBBox) const override
Test if the box overlaps the object.
bool IsPointInside(const SFVEC2F &aPoint) 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 Intersects(const BBOX_2D &aBBox) const override
a.Intersects(b) ⇔ !a.Disjoint(b) ⇔ !(a ∩ b = ∅)
float GetRadiusSquared() const
bool Intersect(const RAYSEG2D &aSegRay, float *aOutT, SFVEC2F *aNormalOut) const override
const SFVEC2F & GetCenter() const
float GetRadius() const
FILLED_CIRCLE_2D(const SFVEC2F &aCenter, float aRadius, const BOARD_ITEM &aBoardItem)
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