KiCad PCB EDA Suite
create_layer_items.cpp File Reference

This file implements the creation of the pcb board. More...

Go to the source code of this file.


void addTextSegmToContainer (int x0, int y0, int xf, int yf)


static int s_textWidth
static CGENERICCONTAINER2Ds_dstcontainer = NULL
static float s_biuTo3Dunits
static const CBBOX2Ds_boardBBox3DU = NULL
static const BOARD_ITEMs_boardItem = NULL

Detailed Description

This file implements the creation of the pcb board.

It is based on the function found in the files: board_items_to_polygon_shape_transform.cpp board_items_to_polygon_shape_transform.cpp

Definition in file create_layer_items.cpp.

Function Documentation

void addTextSegmToContainer ( int  x0,
int  y0,
int  xf,
int  yf 

Definition at line 69 of file create_layer_items.cpp.

References CGENERICCONTAINER2D::Add(), Is_segment_a_circle(), s_biuTo3Dunits, and s_textWidth.

Referenced by CINFO3D_VISU::AddGraphicsShapesWithClearanceToContainer(), and CINFO3D_VISU::AddShapeWithClearanceToContainer().

70 {
71  wxASSERT( s_boardBBox3DU != NULL );
72  wxASSERT( s_dstcontainer != NULL );
74  const SFVEC2F start3DU( x0 * s_biuTo3Dunits, -y0 * s_biuTo3Dunits );
75  const SFVEC2F end3DU ( xf * s_biuTo3Dunits, -yf * s_biuTo3Dunits );
77  if( Is_segment_a_circle( start3DU, end3DU ) )
78  s_dstcontainer->Add( new CFILLEDCIRCLE2D( start3DU,
80  *s_boardItem) );
81  else
82  s_dstcontainer->Add( new CROUNDSEGMENT2D( start3DU,
83  end3DU,
84  s_textWidth * s_biuTo3Dunits,
85  *s_boardItem ) );
86 }
static const CBBOX2D * s_boardBBox3DU
static const BOARD_ITEM * s_boardItem
bool Is_segment_a_circle(const SFVEC2F &aStart, const SFVEC2F &aEnd)
Segment_is_a_circle - check if segment start and end is very close to each other should used to check...
static float s_biuTo3Dunits
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
void Add(COBJECT2D *aObject)
Definition: ccontainer2d.h:51
static int s_textWidth
static CGENERICCONTAINER2D * s_dstcontainer

Variable Documentation

const CBBOX2D* s_boardBBox3DU = NULL

Definition at line 65 of file create_layer_items.cpp.

const BOARD_ITEM* s_boardItem = NULL

Definition at line 66 of file create_layer_items.cpp.


Definition at line 63 of file create_layer_items.cpp.