KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGFX::PREVIEW Namespace Reference

Classes

class  ARC_ASSISTANT
 Represents an assistant draw when interactively drawing an arc on a canvas. More...
 
class  ARC_GEOM_MANAGER
 Manage the construction of a circular arc though sequential setting of critical points: center, arc start and arc end. More...
 
class  CENTRELINE_RECT_ITEM
 Represent an area drawn by drawing a rectangle of a given aspect along a vector, with the midpoint of one side on the start point and the mid point of the opposite side on the end. More...
 
class  DRAW_CONTEXT
 A KIGFX::PREVIEW::DRAW_CONTEXT is a wrapper around a GAL and some other settings that makes it easy to draw preview items consistently. More...
 
class  MULTISTEP_GEOM_MANAGER
 A geometry manager that works by accepting a sequence of points and advancing though stages of geometric construction with each point "locked in". More...
 
class  POLYGON_ITEM
 A preview item which shows an in-progress polygon, which can be used for zone outlines, etc. More...
 
class  RULER_ITEM
 A drawn ruler item for showing the distance between two points. More...
 
class  SELECTION_AREA
 Represent a selection area (currently a rectangle) in a VIEW, drawn corner-to-corner between two points. More...
 
class  SIMPLE_OVERLAY_ITEM
 SIMPLE_OVERLAY_ITEM is class that represents a visual area drawn on a canvas, used to temporarily demarcate an area or show something on an overlay. More...
 
struct  TEXT_DIMS
 
class  TWO_POINT_ASSISTANT
 Represents an assistant draw when interactively drawing a line or circle on a canvas. More...
 
class  TWO_POINT_GEOMETRY_MANAGER
 Represent a very simple geometry manager for items that have a start and end point. More...
 

Enumerations

enum class  GEOM_SHAPE {
  SEGMENT = 0 , RECT , ARC , CIRCLE ,
  POLYGON , CURVE
}
 

Functions

double PreviewOverlayDeemphAlpha (bool aDeemph=true)
 Default alpha of "de-emphasised" features (like previously locked-in lines.
 
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 suffix.
 
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.
 
COLOR4D GetShadowColor (const COLOR4D &aColor)
 
void DrawTextNextToCursor (KIGFX::VIEW *aView, const VECTOR2D &aCursorPos, const VECTOR2D &aTextQuadrant, const std::vector< wxString > &aStrings, bool aDrawingDropShadows)
 Draw strings next to the cursor.
 

Enumeration Type Documentation

◆ GEOM_SHAPE

enum class KIGFX::PREVIEW::GEOM_SHAPE
strong
Enumerator
SEGMENT 
RECT 
ARC 
CIRCLE 
POLYGON 
CURVE 

Definition at line 37 of file two_point_assistant.h.

Function Documentation

◆ DimensionLabel()

wxString KIGFX::PREVIEW::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 suffix.

Definition at line 33 of file preview_utils.cpp.

References CENTIMETRES, DEGREES, EDA_UNIT_UTILS::GetText(), INCHES, MICROMETRES, MILLIMETRES, MILS, PERCENT, EDA_UNIT_UTILS::UI::ToUserUnit(), and UNSCALED.

Referenced by drawCursorStrings(), drawTicksAlongLine(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), and KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw().

◆ DrawTextNextToCursor()

◆ GetConstantGlyphHeight()

KIGFX::PREVIEW::TEXT_DIMS KIGFX::PREVIEW::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.

Parameters
aGalthe GAL to draw on.
aRelativeSizesimilar to HTML font sizes; 0 will give a standard size while +1 etc. will give larger and -1 etc. will give smaller.
Returns
the text widths for the resulting glyph size.

Definition at line 67 of file preview_utils.cpp.

References HIDPI_GL_CANVAS::GetScaleFactor(), KIGFX::GAL::GetWorldScale(), KIGFX::PREVIEW::TEXT_DIMS::GlyphSize, KIGFX::PREVIEW::TEXT_DIMS::LinePitch, KIGFX::PREVIEW::TEXT_DIMS::ShadowWidth, and KIGFX::PREVIEW::TEXT_DIMS::StrokeWidth.

Referenced by drawBacksideTicks(), DrawTextNextToCursor(), drawTicksAlongLine(), TUNING_STATUS_VIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ GetShadowColor()

KIGFX::COLOR4D KIGFX::PREVIEW::GetShadowColor ( const COLOR4D aColor)

◆ PreviewOverlayDeemphAlpha()

double KIGFX::PREVIEW::PreviewOverlayDeemphAlpha ( bool  aDeemph = true)

Default alpha of "de-emphasised" features (like previously locked-in lines.

Definition at line 27 of file preview_utils.cpp.

Referenced by deemphasise().