Commit 05faa369 authored by Dick Hollenbeck's avatar Dick Hollenbeck

KICAD_PLUG intermediate work, for eventual nanometer boards

parents d9e0ab02 1b5edd6d
...@@ -761,7 +761,7 @@ public: ...@@ -761,7 +761,7 @@ public:
wxString m_Text; /* text! */ wxString m_Text; /* text! */
wxPoint m_Pos; /* XY position of anchor text. */ wxPoint m_Pos; /* XY position of anchor text. */
wxSize m_Size; /* XY size of text */ wxSize m_Size; /* XY size of text */
bool m_Mirror; /* Display Normal / mirror */ bool m_Mirror; ///< true iff mirrored
int m_Attributs; /* flags (visible...) */ int m_Attributs; /* flags (visible...) */
bool m_Italic; /* true to simulate (or use if exists) bool m_Italic; /* true to simulate (or use if exists)
* an italic font... */ * an italic font... */
...@@ -798,6 +798,9 @@ public: ...@@ -798,6 +798,9 @@ public:
void SetItalic( bool isItalic ) { m_Italic = isItalic; } void SetItalic( bool isItalic ) { m_Italic = isItalic; }
bool IsItalic() const { return m_Italic; } bool IsItalic() const { return m_Italic; }
void SetMirrored( bool doMirror ) { m_Mirror = doMirror; }
bool IsMirrored() const { return m_Mirror; }
/** /**
* Function SetSize * Function SetSize
* sets text size. * sets text size.
......
...@@ -16,15 +16,20 @@ class BOARD; ...@@ -16,15 +16,20 @@ class BOARD;
class EDA_DRAW_PANEL; class EDA_DRAW_PANEL;
/* Shapes for segments (graphic segments and tracks) ( .m_Shape member ) */ /**
enum Track_Shapes { * Enum STROKE_T
S_SEGMENT = 0, /* usual segment : line with rounded ends */ * is the set of shapes for segments (graphic segments and tracks) which are often
S_RECT, /* segment with non rounded ends */ * in the .m_Shape member
S_ARC, /* Arcs (with rounded ends) */ */
S_CIRCLE, /* ring */ enum STROKE_T
S_POLYGON, /* polygon (not yet used for tracks, but could be in microwave apps) */ {
S_CURVE, /* Bezier Curve */ S_SEGMENT = 0, ///< usual segment : line with rounded ends
S_LAST /* last value for this list */ S_RECT, ///< segment with non rounded ends
S_ARC, ///< Arcs (with rounded ends)
S_CIRCLE, ///< ring
S_POLYGON, ///< polygon (not yet used for tracks, but could be in microwave apps)
S_CURVE, ///< Bezier Curve
S_LAST ///< last value for this list
}; };
...@@ -165,9 +170,9 @@ public: ...@@ -165,9 +170,9 @@ public:
/** /**
* Function ShowShape * Function ShowShape
* converts the enum Track_Shapes integer value to a wxString. * converts the enum STROKE_T integer value to a wxString.
*/ */
static wxString ShowShape( Track_Shapes aShape ); static wxString ShowShape( STROKE_T aShape );
/** /**
* Function Save * Function Save
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include "class_board.h" #include "class_board.h"
wxString BOARD_ITEM::ShowShape( Track_Shapes aShape ) wxString BOARD_ITEM::ShowShape( STROKE_T aShape )
{ {
switch( aShape ) switch( aShape )
{ {
......
...@@ -566,7 +566,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const ...@@ -566,7 +566,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const
wxString temp; wxString temp;
text.Printf( _( "Pcb Graphic: %s length: %s on %s" ), text.Printf( _( "Pcb Graphic: %s length: %s on %s" ),
GetChars( ShowShape( (Track_Shapes)m_Shape ) ), GetChars( ShowShape( (STROKE_T) m_Shape ) ),
GetChars( valeur_param( GetLength(), temp ) ), GetChars( valeur_param( GetLength(), temp ) ),
GetChars( GetLayerName() ) ); GetChars( GetLayerName() ) );
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
/* class EDGE_MODULE */ /* class EDGE_MODULE */
/*********************/ /*********************/
EDGE_MODULE::EDGE_MODULE( MODULE* parent ) : EDGE_MODULE::EDGE_MODULE( MODULE* parent, STROKE_T aShape ) :
DRAWSEGMENT( parent, PCB_MODULE_EDGE_T ) DRAWSEGMENT( parent, PCB_MODULE_EDGE_T )
{ {
m_Shape = S_SEGMENT; m_Shape = aShape;
m_Angle = 0; m_Angle = 0;
m_Width = 120; m_Width = 120;
} }
...@@ -422,7 +422,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const ...@@ -422,7 +422,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
{ {
wxString text; wxString text;
text << _( "Graphic" ) << wxT( " " ) << ShowShape( (Track_Shapes) m_Shape ); text << _( "Graphic" ) << wxT( " " ) << ShowShape( (STROKE_T) m_Shape );
text << wxT( " (" ) << GetLayerName() << wxT( ")" ); text << wxT( " (" ) << GetLayerName() << wxT( ")" );
text << _( " of " ) << ( (MODULE*) GetParent() )->GetReference(); text << _( " of " ) << ( (MODULE*) GetParent() )->GetReference();
...@@ -441,7 +441,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const ...@@ -441,7 +441,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
*/ */
void EDGE_MODULE::Show( int nestLevel, std::ostream& os ) void EDGE_MODULE::Show( int nestLevel, std::ostream& os )
{ {
wxString shape = ShowShape( (Track_Shapes) m_Shape ); wxString shape = ShowShape( (STROKE_T) m_Shape );
// for now, make it look like XML: // for now, make it look like XML:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
wxPoint m_End0; // End point, relative to module origin, orient 0. wxPoint m_End0; // End point, relative to module origin, orient 0.
public: public:
EDGE_MODULE( MODULE* parent ); EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT );
EDGE_MODULE( EDGE_MODULE* edge ); EDGE_MODULE( EDGE_MODULE* edge );
~EDGE_MODULE(); ~EDGE_MODULE();
......
...@@ -100,7 +100,7 @@ public: ...@@ -100,7 +100,7 @@ public:
virtual void Move( const wxPoint& aMoveVector ) virtual void Move( const wxPoint& aMoveVector )
{ {
m_Start += aMoveVector; m_Start += aMoveVector;
m_End += aMoveVector; m_End += aMoveVector;
} }
/** /**
...@@ -128,7 +128,7 @@ public: ...@@ -128,7 +128,7 @@ public:
void SetPosition( const wxPoint& aPos ) { m_Start = aPos; } // overload void SetPosition( const wxPoint& aPos ) { m_Start = aPos; } // overload
void SetEnd( const wxPoint& aEnd ) { m_Start = aEnd; } void SetEnd( const wxPoint& aEnd ) { m_End = aEnd; }
EDA_RECT GetBoundingBox() const; EDA_RECT GetBoundingBox() const;
......
This diff is collapsed.
...@@ -102,6 +102,19 @@ protected: ...@@ -102,6 +102,19 @@ protected:
*/ */
BIU biuParse( const char* aValue, const char** nptrptr = NULL ); BIU biuParse( const char* aValue, const char** nptrptr = NULL );
/**
* Function dblParse
* parses an ASCII decimal floating point value without scaling into a double.
*
* @param aValue is the ASCII value in C locale form with possible leading whitespace
*
* @param nptrptr may be NULL, but if not, then it tells where to put a
* pointer to the next unconsumed input text. See "man strtod" for more information.
*
* @return double - the string converted to a primitive double type
*/
double dblParse( const char* aValue, const char** nptrptr = NULL );
// load / parse functions // load / parse functions
void loadAllSections( bool doAppend ); void loadAllSections( bool doAppend );
......
...@@ -229,7 +229,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, TYPE_COLLECTOR* items ) ...@@ -229,7 +229,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, TYPE_COLLECTOR* items )
DRAWSEGMENT* graphic = (DRAWSEGMENT*) (*items)[i]; DRAWSEGMENT* graphic = (DRAWSEGMENT*) (*items)[i];
printf( "type=%s, GetStart()=%d,%d GetEnd()=%d,%d\n", printf( "type=%s, GetStart()=%d,%d GetEnd()=%d,%d\n",
TO_UTF8( BOARD_ITEM::ShowShape( (Track_Shapes)graphic->m_Shape ) ), TO_UTF8( BOARD_ITEM::ShowShape( (STROKE_T) graphic->m_Shape ) ),
graphic->GetStart().x, graphic->GetStart().x,
graphic->GetStart().y, graphic->GetStart().y,
graphic->GetEnd().x, graphic->GetEnd().x,
...@@ -667,7 +667,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule ) ...@@ -667,7 +667,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
case S_ARC: case S_ARC:
default: default:
D( printf("makeIMAGE(): unsupported shape %s\n", D( printf("makeIMAGE(): unsupported shape %s\n",
TO_UTF8( BOARD_ITEM::ShowShape( (Track_Shapes)graphic->m_Shape)) );) TO_UTF8( BOARD_ITEM::ShowShape( (STROKE_T) graphic->m_Shape)) );)
continue; continue;
} }
} }
...@@ -858,7 +858,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ER ...@@ -858,7 +858,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ER
wxString error; wxString error;
error.Printf( _("Unsupported DRAWSEGMENT type %s"), error.Printf( _("Unsupported DRAWSEGMENT type %s"),
GetChars( BOARD_ITEM::ShowShape( (Track_Shapes) graphic->m_Shape ) ) ); GetChars( BOARD_ITEM::ShowShape( (STROKE_T) graphic->m_Shape ) ) );
ThrowIOError( error ); ThrowIOError( error );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment