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 class VIEW;
35 
36 namespace PREVIEW
37 {
38 
43 double PreviewOverlayDeemphAlpha( bool aDeemph = true );
44 
45 
50 wxString DimensionLabel( const wxString& prefix, double aVal,
51  EDA_UNITS_T aUnits );
52 
60 void SetConstantGlyphHeight( KIGFX::GAL& aGal, double aHeight );
61 
72  const VECTOR2D& aCursorPos, const VECTOR2D& aTextQuadrant,
73  const std::vector<wxString>& aStrings );
74 
75 } // PREVIEW
76 } // KIGFX
77 
78 #endif // PREVIEW_PREVIEW_UTILS__H_
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
void DrawTextNextToCursor(KIGFX::VIEW *aView, const VECTOR2D &aCursorPos, const VECTOR2D &aTextQuadrant, const std::vector< wxString > &aStrings)
Draw strings next to the cursor.
double PreviewOverlayDeemphAlpha(bool aDeemph=true)
Default alpha of "de-emphasised" features (like previously locked-in lines.
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...
Class VIEW.
Definition: view.h:58
EDA_UNITS_T
Definition: common.h:143
Class GAL is the abstract interface for drawing on a 2D-surface.