KiCad PCB EDA Suite
Loading...
Searching...
No Matches
graphics_importer_pcbnew.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) 2016 CERN
5 * Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * @author Maciej Suminski <[email protected]>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27#ifndef GRAPHICS_IMPORTER_PCBNEW_H
28#define GRAPHICS_IMPORTER_PCBNEW_H
29
31#include <layer_ids.h>
32
34
36{
37public:
39
40 void SetLayer( PCB_LAYER_ID aLayer ) { m_layer = aLayer; }
41 PCB_LAYER_ID GetLayer() const { return m_layer; }
42
43 void AddLine( const VECTOR2D& aStart, const VECTOR2D& aEnd,
44 const IMPORTED_STROKE& aStroke ) override;
45
46 void AddCircle( const VECTOR2D& aCenter, double aRadius, const IMPORTED_STROKE& aStroke,
47 bool aFilled, const COLOR4D& aFillColor = COLOR4D::UNSPECIFIED ) override;
48
49 void AddArc( const VECTOR2D& aCenter, const VECTOR2D& aStart, const EDA_ANGLE& aAngle,
50 const IMPORTED_STROKE& aStroke ) override;
51
52 void AddPolygon( const std::vector<VECTOR2D>& aVertices, const IMPORTED_STROKE& aStroke,
53 bool aFilled, const COLOR4D& aFillColor = COLOR4D::UNSPECIFIED ) override;
54
55 void AddText( const VECTOR2D& aOrigin, const wxString& aText, double aHeight, double aWidth,
56 double aThickness, double aOrientation, GR_TEXT_H_ALIGN_T aHJustify,
57 GR_TEXT_V_ALIGN_T aVJustify,
58 const COLOR4D& aColor = COLOR4D::UNSPECIFIED ) override;
59
60 void AddSpline( const VECTOR2D& aStart, const VECTOR2D& aBezierControl1,
61 const VECTOR2D& aBezierControl2, const VECTOR2D& aEnd,
62 const IMPORTED_STROKE& aStroke ) override;
63
70 VECTOR2I MapCoordinate( const VECTOR2D& aCoordinate );
71
78 int MapLineWidth( double aLineWidth );
79
81
82protected:
86};
87
88
89
90#endif /* GRAPHICS_IMPORTER_PCBNEW_H */
Abstract interface for BOARD_ITEMs capable of storing other items inside.
void AddText(const VECTOR2D &aOrigin, const wxString &aText, double aHeight, double aWidth, double aThickness, double aOrientation, GR_TEXT_H_ALIGN_T aHJustify, GR_TEXT_V_ALIGN_T aVJustify, const COLOR4D &aColor=COLOR4D::UNSPECIFIED) override
Create an object representing a text.
BOARD_ITEM_CONTAINER * m_parent
void AddArc(const VECTOR2D &aCenter, const VECTOR2D &aStart, const EDA_ANGLE &aAngle, const IMPORTED_STROKE &aStroke) override
Create an object representing an arc.
void AddCircle(const VECTOR2D &aCenter, double aRadius, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor=COLOR4D::UNSPECIFIED) override
Create an object representing a circle.
void AddLine(const VECTOR2D &aStart, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing a line segment.
void SetLayer(PCB_LAYER_ID aLayer)
void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing an arc.
int MapLineWidth(double aLineWidth)
If aLineWidth < 0, the default line thickness value is returned.
PCB_LAYER_ID m_layer
< Target layer for the imported shapes.
void AddPolygon(const std::vector< VECTOR2D > &aVertices, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor=COLOR4D::UNSPECIFIED) override
Create an object representing a polygon.
STROKE_PARAMS MapStrokeParams(const IMPORTED_STROKE &aStroke)
VECTOR2I MapCoordinate(const VECTOR2D &aCoordinate)
Convert an imported coordinate to a board coordinate, according to the internal units,...
Interface that creates objects representing shapes for a given data model.
A clone of IMPORTED_STROKE, but with floating-point width.
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Simple container to manage line stroke parameters.
Definition: stroke_params.h:79
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
GR_TEXT_H_ALIGN_T
GR_TEXT_V_ALIGN_T