KiCad PCB EDA Suite
ETEXT Struct Reference

Eagle text element. More...

Public Types

enum  {
  CENTER, CENTER_LEFT, TOP_CENTER, TOP_LEFT,
  TOP_RIGHT, CENTER_RIGHT = -CENTER_LEFT, BOTTOM_CENTER = -TOP_CENTER, BOTTOM_LEFT = -TOP_RIGHT,
  BOTTOM_RIGHT = -TOP_LEFT
}
 

Public Member Functions

 ETEXT (CPTREE &aText)
 

Public Attributes

string text
 
double x
 
double y
 
double size
 
int layer
 
opt_string font
 
opt_double ratio
 
opt_erot rot
 
opt_int align
 

Detailed Description

Eagle text element.

Definition at line 588 of file eagle_plugin.cpp.

Member Enumeration Documentation

anonymous enum
Enumerator
CENTER 
CENTER_LEFT 
TOP_CENTER 
TOP_LEFT 
TOP_RIGHT 
CENTER_RIGHT 
BOTTOM_CENTER 
BOTTOM_LEFT 
BOTTOM_RIGHT 

Definition at line 599 of file eagle_plugin.cpp.

Constructor & Destructor Documentation

ETEXT::ETEXT ( CPTREE aText)

Definition at line 618 of file eagle_plugin.cpp.

References BOTTOM_CENTER, BOTTOM_LEFT, BOTTOM_RIGHT, CENTER, CENTER_LEFT, CENTER_RIGHT, parseOptionalEROT(), TOP_CENTER, TOP_LEFT, and TOP_RIGHT.

619 {
620  CPTREE& attribs = aText.get_child( "<xmlattr>" );
621 
622  /*
623  <!ELEMENT text (#PCDATA)>
624  <!ATTLIST text
625  x %Coord; #REQUIRED
626  y %Coord; #REQUIRED
627  size %Dimension; #REQUIRED
628  layer %Layer; #REQUIRED
629  font %TextFont; "proportional"
630  ratio %Int; "8"
631  rot %Rotation; "R0"
632  align %Align; "bottom-left"
633  >
634  */
635 
636  text = aText.data();
637  x = attribs.get<double>( "x" );
638  y = attribs.get<double>( "y" );
639  size = attribs.get<double>( "size" );
640  layer = attribs.get<int>( "layer" );
641 
642  font = attribs.get_optional<string>( "font" );
643  ratio = attribs.get_optional<double>( "ratio" );
644  rot = parseOptionalEROT( attribs );
645 
646  opt_string stemp = attribs.get_optional<string>( "align" );
647  if( stemp )
648  {
649  // (bottom-left | bottom-center | bottom-right | center-left |
650  // center | center-right | top-left | top-center | top-right)
651  if( !stemp->compare( "center" ) )
653  else if( !stemp->compare( "center-right" ) )
655  else if( !stemp->compare( "top-left" ) )
657  else if( !stemp->compare( "top-center" ) )
659  else if( !stemp->compare( "top-right" ) )
661  else if( !stemp->compare( "bottom-left" ) )
663  else if( !stemp->compare( "bottom-center" ) )
665  else if( !stemp->compare( "bottom-right" ) )
667  else if( !stemp->compare( "center-left" ) )
669  }
670 }
double size
const PTREE CPTREE
Definition: eagle_plugin.h:63
static opt_erot parseOptionalEROT(CPTREE &attribs)
Eagle "rot" fields are optional, handle that by returning opt_erot.
opt_double ratio
string text
opt_int align
opt_erot rot
double y
opt_string font
double x

Member Data Documentation

opt_int ETEXT::align

Definition at line 613 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

opt_string ETEXT::font

Definition at line 595 of file eagle_plugin.cpp.

int ETEXT::layer

Definition at line 594 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

opt_double ETEXT::ratio

Definition at line 596 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

opt_erot ETEXT::rot

Definition at line 597 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

double ETEXT::size

Definition at line 593 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

string ETEXT::text

Definition at line 590 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

double ETEXT::x

Definition at line 591 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().

double ETEXT::y

Definition at line 592 of file eagle_plugin.cpp.

Referenced by EAGLE_PLUGIN::loadPlain(), and EAGLE_PLUGIN::packageText().


The documentation for this struct was generated from the following file: