KiCad PCB EDA Suite
Loading...
Searching...
No Matches
preview_utils.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-2021 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, 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_UTILS__H_
25#define PREVIEW_PREVIEW_UTILS__H_
26
27#include <eda_units.h>
28#include <gal/color4d.h>
29#include <math/vector2d.h>
30
31namespace KIGFX
32{
33class GAL;
34class VIEW;
35
36namespace PREVIEW
37{
38
40{
44 double LinePitch;
45};
46
50double PreviewOverlayDeemphAlpha( bool aDeemph = true );
51
52
57wxString DimensionLabel( const wxString& prefix, double aVal, const EDA_IU_SCALE& aIuScale, EDA_UNITS aUnits,
58 bool aIncludeUnits = true );
59
68TEXT_DIMS GetConstantGlyphHeight( KIGFX::GAL* aGal, int aRelativeSize = 0 );
69
70COLOR4D GetShadowColor( const COLOR4D& aColor );
71
80void DrawTextNextToCursor( KIGFX::VIEW* aView, const VECTOR2D& aCursorPos,
81 const VECTOR2D& aTextQuadrant, const std::vector<wxString>& aStrings,
82 bool aDrawingDropShadows );
83
84} // PREVIEW
85} // KIGFX
86
87#endif // PREVIEW_PREVIEW_UTILS__H_
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Abstract interface for drawing on a 2D-surface.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Definition: view.h:68
EDA_UNITS
Definition: eda_units.h:46
COLOR4D GetShadowColor(const COLOR4D &aColor)
wxString DimensionLabel(const wxString &prefix, double aVal, const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, bool aIncludeUnits=true)
Get a formatted string showing a dimension to a sane precision with an optional prefix and unit suffi...
void DrawTextNextToCursor(KIGFX::VIEW *aView, const VECTOR2D &aCursorPos, const VECTOR2D &aTextQuadrant, const std::vector< wxString > &aStrings, bool aDrawingDropShadows)
Draw strings next to the cursor.
double PreviewOverlayDeemphAlpha(bool aDeemph=true)
Default alpha of "de-emphasised" features (like previously locked-in lines.
TEXT_DIMS GetConstantGlyphHeight(KIGFX::GAL *aGal, int aRelativeSize=0)
Set the GAL glyph height to a constant scaled value, so that it always looks the same on screen.
The Cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:247