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 The KiCad Developers, see AUTHORS.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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef PREVIEW_PREVIEW_DRAW_CONTEXT__H_
21#define PREVIEW_PREVIEW_DRAW_CONTEXT__H_
22
23#include <gal/painter.h>
24#include <math/vector2d.h>
25
26namespace KIGFX
27{
28class GAL;
29class VIEW;
30
31namespace PREVIEW
32{
41{
42public:
43 DRAW_CONTEXT( KIGFX::VIEW& aView );
44
52 void DrawCircle( const VECTOR2I& aOrigin, double aRad, bool aDeEmphasised );
53
63 void DrawCircleDashed( const VECTOR2I& aOrigin, double aRad, double aStepAngle,
64 double aFillAngle, bool aDeEmphasised );
65
73 void DrawLine( const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDeEmphasised );
74
84 void DrawLineDashed( const VECTOR2I& aStart, const VECTOR2I& aEn, int aDashStep,
85 int aDashFill, bool aDeEmphasised );
86
96 const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDeEmphasised );
97
107 void DrawArcWithAngleHighlight( const VECTOR2I& aOrigin, double aRad, double aStartAngle,
108 double aEndAngle );
109
110private:
115
118
120
123
126};
127
128} // namespace PREVIEW
129} // namespace KIGFX
130
131#endif // PREVIEW_PREVIEW_DRAW_CONTEXT__H_
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
Abstract interface for drawing on a 2D-surface.
float m_lineWidth
The line width to use for items.
const KIGFX::RENDER_SETTINGS & m_render_settings
The current layer to draw onto.
void DrawCircleDashed(const VECTOR2I &aOrigin, double aRad, double aStepAngle, double aFillAngle, bool aDeEmphasised)
Draw a dashed preview circle on the current layer.
DRAW_CONTEXT(KIGFX::VIEW &aView)
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:63
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition layer_ids.h:224
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:29
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683