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 <geometry/ellipse.h>
25#include <math/vector2d.h>
26
27namespace KIGFX
28{
29class GAL;
30class VIEW;
31
32namespace PREVIEW
33{
42{
43public:
44 DRAW_CONTEXT( KIGFX::VIEW& aView );
45
52 void DrawRectangle( const VECTOR2I& aC1, const VECTOR2I& aC2, bool aDeEmphasised );
53
61 void DrawCircle( const VECTOR2I& aOrigin, double aRad, bool aDeEmphasised );
62
72 void DrawCircleDashed( const VECTOR2I& aOrigin, double aRad, double aStepAngle,
73 double aFillAngle, bool aDeEmphasised );
74
75
79 void DrawEllipse( const VECTOR2I& aOrigin, double aA, double aB, EDA_ANGLE aRot, bool aDeEmphasised );
80 void DrawEllipse( const ELLIPSE<int>& aEllipse, bool aDeEmphasised );
81
89 void DrawLine( const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDeEmphasised );
90
100 void DrawLineDashed( const VECTOR2I& aStart, const VECTOR2I& aEn, int aDashStep,
101 int aDashFill, bool aDeEmphasised );
102
112 const VECTOR2I& aStart, const VECTOR2I& aEnd, bool aDeEmphasised );
113
123 void DrawArcWithAngleHighlight( const VECTOR2I& aOrigin, double aRad, double aStartAngle,
124 double aEndAngle );
125
126private:
131
134
136
139
142};
143
144} // namespace PREVIEW
145} // namespace KIGFX
146
147#endif // PREVIEW_PREVIEW_DRAW_CONTEXT__H_
Plain ellipse / elliptical-arc data.
Definition ellipse.h:32
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.
void DrawRectangle(const VECTOR2I &aC1, const VECTOR2I &aC2, bool aDeEmphasised)
Draw a rectangle on the current layer.
void DrawEllipse(const VECTOR2I &aOrigin, double aA, double aB, EDA_ANGLE aRot, bool aDeEmphasised)
Draw a preview ellipse 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