KiCad PCB EDA Suite
autoplace_fields.cpp File Reference
#include <boost/range/adaptor/reversed.hpp>
#include <sch_edit_frame.h>
#include <hotkeys_basic.h>
#include <sch_symbol.h>
#include <sch_line.h>
#include <lib_pin.h>
#include <kiface_base.h>
#include <vector>
#include <algorithm>
#include <tool/tool_manager.h>
#include <tools/ee_selection_tool.h>
#include <eeschema_settings.h>
#include <core/arraydim.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 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 68 of file autoplace_fields.cpp.

◆ HPADDING

#define HPADDING   Mils2iu( 25 )

Definition at line 70 of file autoplace_fields.cpp.

◆ VPADDING

#define VPADDING   Mils2iu( 25 )

Definition at line 71 of file autoplace_fields.cpp.

◆ WIRE_V_SPACING

#define WIRE_V_SPACING   Mils2iu( 100 )

Definition at line 69 of file 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 76 of file autoplace_fields.cpp.

77 {
78  if( value % n )
79  return n * (value / n + (aRoundUp ? 1 : 0));
80  else
81  return value;
82 }

Referenced by AUTOPLACER::computeFBoxSize(), AUTOPLACER::DoAutoplace(), AUTOPLACER::fieldVertPlacement(), and AUTOPLACER::fitFieldsBetweenWires().

◆ 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 88 of file autoplace_fields.cpp.

89 {
90  return static_cast<EDA_TEXT_HJUSTIFY_T>( x );
91 }

Referenced by AUTOPLACER::justifyField().