KiCad PCB EDA Suite
Loading...
Searching...
No Matches
draw_context.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) 2017-2023 Kicad Developers, see change_log.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef PREVIEW_PREVIEW_DRAW_CONTEXT__H_
25#define PREVIEW_PREVIEW_DRAW_CONTEXT__H_
26
27#include <gal/painter.h>
28#include <math/vector2d.h>
29
30namespace KIGFX
31{
32class GAL;
33class VIEW;
34
35namespace PREVIEW
36{
45 {
46 public:
47 DRAW_CONTEXT( KIGFX::VIEW& aView );
48
56 void DrawCircle( const VECTOR2I& aOrigin, double aRad, bool aDeEmphasised );
57
67 void DrawCircleDashed( const VECTOR2I& aOrigin, double aRad, double aStepAngle,
68 double aFillAngle, bool aDeEmphasised );
69
77 void DrawLine( const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDeEmphasised );
78
88 void DrawLineDashed( const VECTOR2I& aStart, const VECTOR2I& aEn, int aDashStep,
89 int aDashFill, bool aDeEmphasised );
90
100 const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDeEmphasised );
101
112 const VECTOR2I& aOrigin, double aRad, double aStartAngle, double aEndAngle );
113
114 private:
119
122
124
127
130 };
131
132} // namespace PREVIEW
133} // namespace KIGFX
134
135#endif // PREVIEW_PREVIEW_DRAW_CONTEXT__H_
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Abstract interface for drawing on a 2D-surface.
A KIGFX::PREVIEW::DRAW_CONTEXT is a wrapper around a GAL and some other settings that makes it easy t...
Definition: draw_context.h:45
float m_lineWidth
The line width to use for items.
Definition: draw_context.h:129
const KIGFX::RENDER_SETTINGS & m_render_settings
The current layer to draw onto.
Definition: draw_context.h:123
void DrawCircleDashed(const VECTOR2I &aOrigin, double aRad, double aStepAngle, double aFillAngle, bool aDeEmphasised)
Draw a dashed preview circle on the current layer.
void DrawArcWithAngleHighlight(const VECTOR2I &aOrigin, double aRad, double aStartAngle, double aEndAngle)
Draw an arc on the current layer, with a special highlight when the line angle is a multiple of 45 de...
void DrawLine(const VECTOR2I &aStart, const VECTOR2I &aEnd, bool aDeEmphasised)
Draw a simple line on the current layer.
void DrawLineWithAngleHighlight(const VECTOR2I &aStart, const VECTOR2I &aEnd, bool aDeEmphasised)
Draw a straight line on the current layer, with a special highlight when the line angle is a multiple...
void DrawLineDashed(const VECTOR2I &aStart, const VECTOR2I &aEn, int aDashStep, int aDashFill, bool aDeEmphasised)
Draw a dashed line on the current layer.
COLOR4D getSpecialAngleColour() const
The GAL to draw into.
void DrawCircle(const VECTOR2I &aOrigin, double aRad, bool aDeEmphasised)
Draw a preview circle on the current layer.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition: layer_ids.h:193
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247