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_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>

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   10
 
#define FIELD_PADDING_ALIGNED   18
 
#define WIRE_V_SPACING   100
 
#define HPADDING   25
 
#define VPADDING   25
 

Functions

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

Macro Definition Documentation

◆ FIELD_PADDING

#define FIELD_PADDING   10

Definition at line 69 of file autoplace_fields.cpp.

◆ FIELD_PADDING_ALIGNED

#define FIELD_PADDING_ALIGNED   18

Definition at line 70 of file autoplace_fields.cpp.

◆ HPADDING

#define HPADDING   25

Definition at line 72 of file autoplace_fields.cpp.

◆ VPADDING

#define VPADDING   25

Definition at line 73 of file autoplace_fields.cpp.

◆ WIRE_V_SPACING

#define WIRE_V_SPACING   100

Definition at line 71 of file autoplace_fields.cpp.

Function Documentation

◆ round_n()

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

Function round_n Round up/down to the nearest multiple of n.

Definition at line 79 of file 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)

Function TO_HJUSTIFY Converts an integer to a horizontal justification; neg=L zero=C pos=R.

Definition at line 92 of file autoplace_fields.cpp.

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

Referenced by AUTOPLACER::justify_field().