KiCad PCB EDA Suite
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 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_UTILS__H_
25 #define PREVIEW_PREVIEW_UTILS__H_
26 
27 #include <common.h>
28 #include <gal/color4d.h>
29 #include <math/vector2d.h>
30 
31 namespace KIGFX
32 {
33 class GAL;
34 
35 namespace PREVIEW
36 {
37 
42 
47 
52 double PreviewOverlayDeemphAlpha( bool aDeemph = true );
53 
58 
63 wxString DimensionLabel( const wxString& prefix, double aVal,
64  EDA_UNITS_T aUnits );
65 
72 void SetConstantGlyphHeight( KIGFX::GAL& aGal, double aHeight );
73 
84  const VECTOR2D& aCursorPos, const VECTOR2D& aTextQuadrant,
85  const std::vector<wxString>& aStrings );
86 
87 } // PREVIEW
88 } // KIGFX
89 
90 #endif // PREVIEW_PREVIEW_UTILS__H_
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:56
COLOR4D PreviewOverlayDefaultColor()
The default fill/stroke color of preview overlay items.
double PreviewOverlayFillAlpha()
The default alpha of overlay fills.
double PreviewOverlayDeemphAlpha(bool aDeemph=true)
Default alpha of "de-emphasised" features (like previously locked-in lines.
COLOR4D PreviewOverlaySpecialAngleColor()
The colour of "special" angle overlay features.
void SetConstantGlyphHeight(KIGFX::GAL &aGal, double aHeight)
Set the GAL glyph height to a constant scaled value, so that it always looks the same on screen...
The common library.
wxString DimensionLabel(const wxString &prefix, double aVal, EDA_UNITS_T aUnits)
Get a formatted string showing a dimension to a sane precision with an optional prefix and unit suffi...
void DrawTextNextToCursor(KIGFX::GAL &aGal, const VECTOR2D &aCursorPos, const VECTOR2D &aTextQuadrant, const std::vector< wxString > &aStrings)
Draw strings next to the cursor.
EDA_UNITS_T
Definition: common.h:144
Class GAL is the abstract interface for drawing on a 2D-surface.