KiCad PCB EDA Suite
create_3Dgraphic_brd_items.cpp File Reference

Go to the source code of this file.

Functions

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

Variables

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

Function Documentation

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

Definition at line 69 of file create_3Dgraphic_brd_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 );
73 
74  const SFVEC2F start3DU( x0 * s_biuTo3Dunits, -y0 * s_biuTo3Dunits );
75  const SFVEC2F end3DU ( xf * s_biuTo3Dunits, -yf * s_biuTo3Dunits );
76 
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 int s_textWidth
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...
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
static float s_biuTo3Dunits
static const CBBOX2D * s_boardBBox3DU
static CGENERICCONTAINER2D * s_dstcontainer
void Add(COBJECT2D *aObject)
Definition: ccontainer2d.h:51
static const BOARD_ITEM * s_boardItem

Variable Documentation

const CBBOX2D* s_boardBBox3DU = NULL
static

Definition at line 65 of file create_3Dgraphic_brd_items.cpp.

const BOARD_ITEM* s_boardItem = NULL
static

Definition at line 66 of file create_3Dgraphic_brd_items.cpp.

CGENERICCONTAINER2D* s_dstcontainer = NULL
static

Definition at line 63 of file create_3Dgraphic_brd_items.cpp.