KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ruler_item.cpp File Reference

Go to the source code of this file.

Classes

struct  TICK_FORMAT
 Description of a "tick format" for a scale factor - how many ticks there are between medium/major ticks and how each scale relates to the last one. More...
 

Functions

static int getShadowLayer (KIGFX::GAL *aGal)
 
static double getTickLineWidth (const TEXT_DIMS &textDims, bool aDrawingDropShadows)
 
static TICK_FORMAT getTickFormatForScale (double aScale, double &aTickSpace, EDA_UNITS aUnits)
 
void drawTicksAlongLine (KIGFX::VIEW *aView, const VECTOR2D &aOrigin, const VECTOR2D &aLine, double aMinorTickLen, const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, bool aDrawingDropShadows)
 Draw labelled ticks on a line.
 
void drawBacksideTicks (KIGFX::VIEW *aView, const VECTOR2D &aOrigin, const VECTOR2D &aLine, double aTickLen, int aNumDivisions, bool aDrawingDropShadows)
 Draw simple ticks on the back of a line such that the line is divided into n parts.
 

Variables

static const double maxTickDensity = 10.0
 
static const double midTickLengthFactor = 1.5
 
static const double majorTickLengthFactor = 2.5
 

Function Documentation

◆ drawBacksideTicks()

void drawBacksideTicks ( KIGFX::VIEW aView,
const VECTOR2D aOrigin,
const VECTOR2D aLine,
double  aTickLen,
int  aNumDivisions,
bool  aDrawingDropShadows 
)

Draw simple ticks on the back of a line such that the line is divided into n parts.

Parameters
aGalthe GAL to draw on
aOriginstart of line to draw ticks on
aLineline vector
aTickLenlength of ticks in IU
aNumDivisionsnumber of parts to divide the line into

Definition at line 238 of file ruler_item.cpp.

References ANGLE_90, BOX2< Vec >::Contains(), KIGFX::GAL::DrawLine(), VECTOR2< T >::EuclideanNorm(), KIGFX::PREVIEW::GetConstantGlyphHeight(), KIGFX::VIEW::GetGAL(), BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), getTickLineWidth(), KIGFX::VIEW::GetViewport(), BOX2< Vec >::Inflate(), KIGFX::VIEW::IsMirroredX(), VECTOR2< T >::Resize(), RotatePoint(), and KIGFX::GAL::SetLineWidth().

Referenced by KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ drawTicksAlongLine()

void drawTicksAlongLine ( KIGFX::VIEW aView,
const VECTOR2D aOrigin,
const VECTOR2D aLine,
double  aMinorTickLen,
const EDA_IU_SCALE aIuScale,
EDA_UNITS  aUnits,
bool  aDrawingDropShadows 
)

◆ getShadowLayer()

static int getShadowLayer ( KIGFX::GAL aGal)
static

◆ getTickFormatForScale()

static TICK_FORMAT getTickFormatForScale ( double  aScale,
double &  aTickSpace,
EDA_UNITS  aUnits 
)
static

◆ getTickLineWidth()

static double getTickLineWidth ( const TEXT_DIMS textDims,
bool  aDrawingDropShadows 
)
static

Variable Documentation

◆ majorTickLengthFactor

const double majorTickLengthFactor = 2.5
static

Definition at line 36 of file ruler_item.cpp.

Referenced by drawTicksAlongLine(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ maxTickDensity

const double maxTickDensity = 10.0
static

Definition at line 34 of file ruler_item.cpp.

Referenced by getTickFormatForScale().

◆ midTickLengthFactor

const double midTickLengthFactor = 1.5
static

Definition at line 35 of file ruler_item.cpp.

Referenced by drawTicksAlongLine(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().