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

Classes

class  ANGLE_ITEM
 
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. More...
 
class  BEZIER_ASSISTANT
 Represents an assistant draw when interactively drawing a bezier on a canvas. More...
 
class  BEZIER_GEOM_MANAGER
 Manage the construction of a bezier through a series of steps. 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  ELLIPSE_ASSISTANT
 Visual overlay shown while interactively drawing an elliptical arc. More...
 
class  ELLIPSE_GEOM_MANAGER
 Manage the construction of an elliptical arc through sequential setting of critical points: two bounding-box corners (to define the ellipse), then start and end angles on the ellipse. 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-emphasized" 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 wxArrayString &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 34 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 )

◆ DrawTextNextToCursor()

void KIGFX::PREVIEW::DrawTextNextToCursor ( KIGFX::VIEW * aView,
const VECTOR2D & aCursorPos,
const VECTOR2D & aTextQuadrant,
const wxArrayString & aStrings,
bool aDrawingDropShadows )

Draw strings next to the cursor.

The GAL attribute context will be restored to its original state after this function is called.

Parameters
aViewthe GAL to draw on.
aCursorPosthe position of the cursor to draw next to.
aTextQuadranta vector pointing to the quadrant to draw the text in.
aStringslist of strings to draw, top to bottom.
aDrawingDropShadowsis the flag to indicate if drop shadows need to be drawn.

Definition at line 123 of file preview_utils.cpp.

References KIFONT::METRICS::Default(), KIFONT::FONT::Draw(), GetConstantGlyphHeight(), KIFONT::FONT::GetFont(), KIGFX::VIEW::GetGAL(), KIGFX::RENDER_SETTINGS::GetLayerColor(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), GetShadowColor(), KIGFX::GAL::GetStrokeColor(), KIGFX::GAL::GetWorldScale(), KIGFX::PREVIEW::TEXT_DIMS::GlyphSize, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, KIGFX::GAL::IsFlippedX(), LAYER_AUX_ITEMS, KIGFX::PREVIEW::TEXT_DIMS::LinePitch, TEXT_ATTRIBUTES::m_Halign, TEXT_ATTRIBUTES::m_Mirrored, TEXT_ATTRIBUTES::m_Size, TEXT_ATTRIBUTES::m_StrokeWidth, KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetStrokeColor(), KIGFX::PREVIEW::TEXT_DIMS::ShadowWidth, KIGFX::GAL_SCOPED_ATTRS::STROKE_FILL, KIGFX::PREVIEW::TEXT_DIMS::StrokeWidth, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by KIGFX::PREVIEW::ARC_ASSISTANT::drawCenterGuides(), KIGFX::PREVIEW::ARC_ASSISTANT::drawEndpointGuides(), KIGFX::PREVIEW::BEZIER_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw(), and RECT_RADIUS_TEXT_ITEM::ViewDraw().

◆ 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 72 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(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().

◆ GetShadowColor()

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

◆ PreviewOverlayDeemphAlpha()

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

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

Definition at line 27 of file preview_utils.cpp.

Referenced by deemphasise().