KiCad PCB EDA Suite
eeschema/autoplace_fields.cpp File Reference
#include <boost/range/adaptor/reversed.hpp>
#include <sch_edit_frame.h>
#include <hotkeys_basic.h>
#include <sch_component.h>
#include <sch_line.h>
#include <lib_pin.h>
#include <sch_draw_panel.h>
#include <class_libentry.h>
#include <eeschema_config.h>
#include <kiface_i.h>
#include <vector>
#include <algorithm>
#include <tool/tool_manager.h>
#include <tools/ee_selection_tool.h>
#include <eeschema_settings.h>

Go to the source code of this file.

Classes

class  AUTOPLACER
 
struct  AUTOPLACER::SIDE_AND_NPINS
 
struct  AUTOPLACER::SIDE_AND_COLL
 

Macros

#define FIELD_PADDING   Mils2iu( 10 )
 
#define FIELD_PADDING_ALIGNED   Mils2iu( 18 )
 
#define WIRE_V_SPACING   Mils2iu( 100 )
 
#define HPADDING   Mils2iu( 25 )
 
#define VPADDING   Mils2iu( 25 )
 

Functions

template<typename T >
round_n (const T &value, const T &n, bool aRoundUp)
 Round up/down to the nearest multiple of n. More...
 
EDA_TEXT_HJUSTIFY_T TO_HJUSTIFY (int x)
 Convert an integer to a horizontal justification; neg=L zero=C pos=R. More...
 

Macro Definition Documentation

◆ FIELD_PADDING

#define FIELD_PADDING   Mils2iu( 10 )

Definition at line 70 of file eeschema/autoplace_fields.cpp.

◆ FIELD_PADDING_ALIGNED

#define FIELD_PADDING_ALIGNED   Mils2iu( 18 )

Definition at line 71 of file eeschema/autoplace_fields.cpp.

◆ HPADDING

#define HPADDING   Mils2iu( 25 )

Definition at line 73 of file eeschema/autoplace_fields.cpp.

◆ VPADDING

#define VPADDING   Mils2iu( 25 )

Definition at line 74 of file eeschema/autoplace_fields.cpp.

◆ WIRE_V_SPACING

#define WIRE_V_SPACING   Mils2iu( 100 )

Definition at line 72 of file eeschema/autoplace_fields.cpp.

Function Documentation

◆ round_n()

template<typename T >
T round_n ( const T &  value,
const T &  n,
bool  aRoundUp 
)

Round up/down to the nearest multiple of n.

Definition at line 79 of file eeschema/autoplace_fields.cpp.

80 {
81  if( value % n )
82  return n * (value / n + (aRoundUp ? 1 : 0));
83  else
84  return value;
85 }

Referenced by AUTOPLACER::DoAutoplace(), and AUTOPLACER::fit_fields_between_wires().

◆ TO_HJUSTIFY()

EDA_TEXT_HJUSTIFY_T TO_HJUSTIFY ( int  x)

Convert an integer to a horizontal justification; neg=L zero=C pos=R.

Definition at line 91 of file eeschema/autoplace_fields.cpp.

92 {
93  return static_cast<EDA_TEXT_HJUSTIFY_T>( x );
94 }

Referenced by AUTOPLACER::justify_field().