KiCad PCB EDA Suite
autoplace_fields.cpp File Reference
#include <boost/range/adaptor/reversed.hpp>
#include <schframe.h>
#include <hotkeys_basic.h>
#include <sch_component.h>
#include <sch_line.h>
#include <lib_pin.h>
#include <class_drawpanel.h>
#include <class_libentry.h>
#include <eeschema_config.h>
#include <kiface_i.h>
#include <vector>
#include <algorithm>

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

#define FIELD_PADDING   10

Definition at line 67 of file autoplace_fields.cpp.

Referenced by AUTOPLACER::get_field_padding().

#define FIELD_PADDING_ALIGNED   18

Definition at line 68 of file autoplace_fields.cpp.

Referenced by AUTOPLACER::get_field_padding().

#define HPADDING   25

Definition at line 70 of file autoplace_fields.cpp.

Referenced by AUTOPLACER::field_box_placement().

#define VPADDING   25

Definition at line 71 of file autoplace_fields.cpp.

Referenced by AUTOPLACER::field_box_placement().

#define WIRE_V_SPACING   100

Function Documentation

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

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

78 {
79  if( value % n )
80  return n * (value / n + (aRoundUp ? 1 : 0));
81  else
82  return value;
83 }
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 90 of file autoplace_fields.cpp.

Referenced by AUTOPLACER::justify_field().

91 {
92  return static_cast<EDA_TEXT_HJUSTIFY_T>( x );
93 }
EDA_TEXT_HJUSTIFY_T
Definition: eda_text.h:47