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:
wxString m_Text; /* text! */
wxPoint m_Pos; /* XY position of anchor 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...) */
bool m_Italic; /* true to simulate (or use if exists)
* an italic font... */
......@@ -798,6 +798,9 @@ public:
void SetItalic( bool isItalic ) { m_Italic = isItalic; }
bool IsItalic() const { return m_Italic; }
void SetMirrored( bool doMirror ) { m_Mirror = doMirror; }
bool IsMirrored() const { return m_Mirror; }
/**
* Function SetSize
* sets text size.
......
......@@ -16,15 +16,20 @@ class BOARD;
class EDA_DRAW_PANEL;
/* Shapes for segments (graphic segments and tracks) ( .m_Shape member ) */
enum Track_Shapes {
S_SEGMENT = 0, /* usual segment : line with rounded ends */
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 */
/**
* Enum STROKE_T
* is the set of shapes for segments (graphic segments and tracks) which are often
* in the .m_Shape member
*/
enum STROKE_T
{
S_SEGMENT = 0, ///< usual segment : line with rounded ends
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:
/**
* 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
......
......@@ -10,7 +10,7 @@
#include "class_board.h"
wxString BOARD_ITEM::ShowShape( Track_Shapes aShape )
wxString BOARD_ITEM::ShowShape( STROKE_T aShape )
{
switch( aShape )
{
......
......@@ -566,7 +566,7 @@ wxString DRAWSEGMENT::GetSelectMenuText() const
wxString temp;
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( GetLayerName() ) );
......
......@@ -30,10 +30,10 @@
/* class EDGE_MODULE */
/*********************/
EDGE_MODULE::EDGE_MODULE( MODULE* parent ) :
EDGE_MODULE::EDGE_MODULE( MODULE* parent, STROKE_T aShape ) :
DRAWSEGMENT( parent, PCB_MODULE_EDGE_T )
{
m_Shape = S_SEGMENT;
m_Shape = aShape;
m_Angle = 0;
m_Width = 120;
}
......@@ -422,7 +422,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
{
wxString text;
text << _( "Graphic" ) << wxT( " " ) << ShowShape( (Track_Shapes) m_Shape );
text << _( "Graphic" ) << wxT( " " ) << ShowShape( (STROKE_T) m_Shape );
text << wxT( " (" ) << GetLayerName() << wxT( ")" );
text << _( " of " ) << ( (MODULE*) GetParent() )->GetReference();
......@@ -441,7 +441,7 @@ wxString EDGE_MODULE::GetSelectMenuText() const
*/
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:
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() <<
......
......@@ -22,7 +22,7 @@ public:
wxPoint m_End0; // End point, relative to module origin, orient 0.
public:
EDGE_MODULE( MODULE* parent );
EDGE_MODULE( MODULE* parent, STROKE_T aShape = S_SEGMENT );
EDGE_MODULE( EDGE_MODULE* edge );
~EDGE_MODULE();
......
......@@ -100,7 +100,7 @@ public:
virtual void Move( const wxPoint& aMoveVector )
{
m_Start += aMoveVector;
m_End += aMoveVector;
m_End += aMoveVector;
}
/**
......@@ -128,7 +128,7 @@ public:
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;
......
This diff is collapsed.
......@@ -102,6 +102,19 @@ protected:
*/
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
void loadAllSections( bool doAppend );
......
......@@ -229,7 +229,7 @@ static DRAWSEGMENT* findPoint( const wxPoint& aPoint, TYPE_COLLECTOR* items )
DRAWSEGMENT* graphic = (DRAWSEGMENT*) (*items)[i];
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().y,
graphic->GetEnd().x,
......@@ -667,7 +667,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
case S_ARC:
default:
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;
}
}
......@@ -858,7 +858,7 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ER
wxString error;
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 );
}
......
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