34#include <drawing_sheet/drawing_sheet_lexer.h>
40using namespace DRAWINGSHEET_T;
45 return DRAWING_SHEET_LEXER::TokenName( aTok );
92 wxMessageBox( ioe.
What(),
_(
"Error writing drawing sheet file" ) );
121 wxMessageBox( ioe.
What(),
_(
"Error writing drawing sheet file" ) );
154 writer.
Format(
this, aItemsList );
162 m_out->
Print( 0,
"(kicad_wks (version %d) (generator pl_editor)\n",
166 Format( aModel, item, 1 );
182 format( aModel, aItem, aNestLevel );
194 wxFAIL_MSG( wxT(
"Cannot format item" ) );
203 m_out->
Print( 0,
"(kicad_wks (version %d) (generator pl_editor)\n",
225 for(
unsigned ii = 0; ii < aSheet->
GetCount(); ii++ )
228 Format( aSheet, item, nestLevel );
251 if( write_thickness || write_size || aItem->
m_Bold
259 if( write_thickness )
316 if( !aItem->
m_Info.IsEmpty() )
341 if( !aItem->
m_Info.IsEmpty() )
363 if( !aItem->
m_Info.IsEmpty() )
383 nestLevel = aNestLevel+2;
415 if( !aItem->
m_Info.IsEmpty() )
420 wxArrayString pngStrings;
423 for(
unsigned ii = 0; ii < pngStrings.GetCount(); ii++ )
bool SaveData(FILE *aFile) const
Write the bitmap data to aFile.
const wxImage * GetOriginalImageData() const
BITMAP_BASE * m_ImageBitmap
unsigned GetPolyIndexStart(unsigned aContour) const
unsigned GetPolyIndexEnd(unsigned aContour) const
std::vector< VECTOR2D > m_Corners
GR_TEXT_H_ALIGN_T m_Hjustify
KIGFX::COLOR4D m_TextColor
VECTOR2D m_BoundingBoxSize
GR_TEXT_V_ALIGN_T m_Vjustify
Drawing sheet structure type definitions.
PAGE_OPTION GetPage1Option() const
DS_ITEM_TYPE GetType() const
VECTOR2D m_IncrementVector
FILE_OUTPUTFORMATTER * m_fileout
DS_DATA_MODEL_FILEIO(const wxString &aFilename)
void Format(DS_DATA_MODEL *aSheet) const
virtual ~DS_DATA_MODEL_IO()
void formatRepeatParameters(DS_DATA_ITEM *aItem) const
void format(DS_DATA_ITEM_TEXT *aItem, int aNestLevel) const
void formatOptions(DS_DATA_ITEM *aItem) const
void formatCoordinate(const char *aToken, POINT_COORD &aCoord) const
~DS_DATA_MODEL_STRINGIO()
STRING_FORMATTER * m_writer
DS_DATA_MODEL_STRINGIO(wxString *aOutputString)
Handle the graphic items list to draw/plot the frame and title block.
VECTOR2D m_DefaultTextSize
unsigned GetCount() const
double m_DefaultLineWidth
DS_DATA_ITEM * GetItem(unsigned aIdx) const
double m_DefaultTextThickness
void SaveInString(wxString *aOutputString)
Save the description in a buffer.
void Save(const wxString &aFullFileName)
Save the description in a file.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
const char * NameAsToken() const
const wxString & GetName() const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
static const char * getTokenName(T aTok)
#define SEXPR_WORKSHEET_FILE_VERSION
This file contains the file format version information for the s-expression drawing sheet file format...
This file contains miscellaneous commonly used macros and functions.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
std::string FormatDouble2Str(double aValue)
Print a float number without using scientific notation and no trailing 0 This function is intended in...
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".