30 changed files with 565 additions and 453 deletions
-
1common/CMakeLists.txt
-
145common/eda_text.cpp
-
149common/font/font.cpp
-
20common/font/glyph.cpp
-
160common/font/outline_font.cpp
-
33common/font/stroke_font.cpp
-
47common/font/triangulate.cpp
-
76common/gal/cairo/cairo_gal.cpp
-
31common/gal/opengl/opengl_gal.cpp
-
12eeschema/lib_pin.cpp
-
13eeschema/lib_symbol.cpp
-
2eeschema/lib_symbol.h
-
3eeschema/sch_base_frame.h
-
17eeschema/sch_edit_frame.cpp
-
3eeschema/sch_edit_frame.h
-
95eeschema/sch_field.cpp
-
15eeschema/sch_field.h
-
20eeschema/sch_item.cpp
-
2eeschema/sch_item.h
-
47eeschema/sch_painter.cpp
-
5eeschema/sch_text.cpp
-
14eeschema/symbol_editor/symbol_edit_frame.cpp
-
3eeschema/symbol_editor/symbol_edit_frame.h
-
16include/eda_text.h
-
33include/font/font.h
-
6include/font/glyph.h
-
9include/font/outline_font.h
-
2include/font/stroke_font.h
-
37include/font/triangulate.h
-
2include/gal/opengl/opengl_gal.h
@ -1,47 +0,0 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2021 Ola Rinta-Koski |
|||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
#include <limits>
|
|||
#include <font/triangulate.h>
|
|||
|
|||
void Triangulate( const SHAPE_POLY_SET& aPolylist, TRIANGULATE_CALLBACK aCallback, |
|||
void* aCallbackData ) |
|||
{ |
|||
SHAPE_POLY_SET polys( aPolylist ); |
|||
|
|||
polys.Fracture( SHAPE_POLY_SET::PM_FAST ); // TODO verify aFastMode
|
|||
polys.CacheTriangulation(); |
|||
|
|||
for( unsigned int i = 0; i < polys.TriangulatedPolyCount(); i++ ) |
|||
{ |
|||
const SHAPE_POLY_SET::TRIANGULATED_POLYGON* polygon = polys.TriangulatedPolygon( i ); |
|||
for ( size_t j = 0; j < polygon->GetTriangleCount(); j++ ) |
|||
{ |
|||
VECTOR2I a; |
|||
VECTOR2I b; |
|||
VECTOR2I c; |
|||
|
|||
polygon->GetTriangle( j, a, b, c ); |
|||
aCallback( i, a, b, c, aCallbackData ); |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
@ -1,37 +0,0 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2021 Ola Rinta-Koski |
|||
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify it |
|||
* under the terms of the GNU General Public License as published by the |
|||
* Free Software Foundation, either version 3 of the License, or (at your |
|||
* option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, but |
|||
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
* General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License along |
|||
* with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#ifndef TRIANGULATE_H |
|||
#define TRIANGULATE_H |
|||
|
|||
#include <math/vector2d.h> |
|||
#include <font/glyph.h> |
|||
#include <geometry/shape_poly_set.h> |
|||
#include <functional> |
|||
|
|||
|
|||
typedef std::function<void( int, const VECTOR2I& aPoint1, const VECTOR2I& aPoint2, |
|||
const VECTOR2I& aPoint3, void* aCallbackData )> |
|||
TRIANGULATE_CALLBACK; |
|||
|
|||
void Triangulate( const SHAPE_POLY_SET& aPolylist, TRIANGULATE_CALLBACK aCallback, |
|||
void* aCallbackData = nullptr ); |
|||
|
|||
#endif // TRIANGULATE_H |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue