KiCad PCB EDA Suite
DIALOG_CREATE_ARRAY::ARRAY_OPTIONS Struct Referenceabstract

Persistent dialog options. More...

#include <dialog_create_array.h>

Inheritance diagram for DIALOG_CREATE_ARRAY::ARRAY_OPTIONS:
DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS

Public Member Functions

 ARRAY_OPTIONS (ARRAY_TYPE_T aType)
 
virtual ~ARRAY_OPTIONS ()
 
virtual void TransformItem (int n, BOARD_ITEM *item, const wxPoint &rotPoint) const =0
 
virtual int GetArraySize () const =0
 
virtual wxString GetItemNumber (int n) const =0
 
virtual wxString InterpolateNumberIntoString (int n, const wxString &pattern) const
 
bool ShouldNumberItems () const
 
bool NumberingStartIsSpecified () const
 

Public Attributes

ARRAY_TYPE_T m_type
 

Static Protected Member Functions

static wxString getCoordinateNumber (int n, ARRAY_NUMBERING_TYPE_T type)
 

Protected Attributes

bool m_shouldNumber
 True if this array numbers the new items. More...
 
bool m_numberingStartIsSpecified
 True if this array's number starts from the preset point False if the array numbering starts from some externally provided point. More...
 

Friends

class DIALOG_CREATE_ARRAY
 

Detailed Description

Persistent dialog options.

Definition at line 203 of file dialog_create_array.h.

Constructor & Destructor Documentation

DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::ARRAY_OPTIONS ( ARRAY_TYPE_T  aType)
inline

Definition at line 205 of file dialog_create_array.h.

205  :
206  m_type( aType ),
207  m_shouldNumber( false ),
209  {}
bool m_numberingStartIsSpecified
True if this array&#39;s number starts from the preset point False if the array numbering starts from som...
bool m_shouldNumber
True if this array numbers the new items.
virtual DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::~ARRAY_OPTIONS ( )
inlinevirtual

Definition at line 211 of file dialog_create_array.h.

211 {};

Member Function Documentation

virtual int DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::GetArraySize ( ) const
pure virtual
wxString DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::getCoordinateNumber ( int  n,
ARRAY_NUMBERING_TYPE_T  type 
)
staticprotected

Definition at line 471 of file dialog_create_array.cpp.

References alphabetFromNumberingScheme(), and schemeNonUnitColsStartAt0().

473 {
474  wxString itemNum;
475  const wxString& alphabet = alphabetFromNumberingScheme( type );
476 
477  const bool nonUnitColsStartAt0 = schemeNonUnitColsStartAt0( type );
478 
479  bool firstRound = true;
480  int radix = alphabet.Length();
481 
482  do {
483  int modN = n % radix;
484 
485  if( nonUnitColsStartAt0 && !firstRound )
486  modN--; // Start the "tens/hundreds/etc column" at "Ax", not "Bx"
487 
488  itemNum.insert( 0, 1, alphabet[modN] );
489 
490  n /= radix;
491  firstRound = false;
492  } while( n );
493 
494  return itemNum;
495 }
static bool schemeNonUnitColsStartAt0(DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type)
static const wxString & alphabetFromNumberingScheme(DIALOG_CREATE_ARRAY::ARRAY_NUMBERING_TYPE_T type)
virtual wxString DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::GetItemNumber ( int  n) const
pure virtual
wxString DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::InterpolateNumberIntoString ( int  n,
const wxString &  pattern 
) const
virtual

Definition at line 498 of file dialog_create_array.cpp.

500 {
501  wxString newStr( aPattern );
502  newStr.Replace( "%s", GetItemNumber( aN ), false );
503 
504  return newStr;
505 }
virtual wxString GetItemNumber(int n) const =0
bool DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::NumberingStartIsSpecified ( ) const
inline
Returns
is the numbering is enabled and should start at a point specified in these options or is it implicit according to the calling code?

Definition at line 242 of file dialog_create_array.h.

References CONFIG_SAVE_RESTORE_WINDOW::CONFIG_CTRL_T::type.

Referenced by ARRAY_CREATOR::Invoke().

243  {
245  }
bool m_numberingStartIsSpecified
True if this array&#39;s number starts from the preset point False if the array numbering starts from som...
bool m_shouldNumber
True if this array numbers the new items.
bool DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::ShouldNumberItems ( ) const
inline
Returns
are the items in this array numberred, or are all the items numbered the same

Definition at line 232 of file dialog_create_array.h.

Referenced by ARRAY_CREATOR::Invoke().

233  {
234  return m_shouldNumber;
235  }
bool m_shouldNumber
True if this array numbers the new items.
virtual void DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::TransformItem ( int  n,
BOARD_ITEM item,
const wxPoint rotPoint 
) const
pure virtual

Function GetArrayPositions Returns the set of points that represent the array in order, if that is important

TODO: Can/should this be done with some sort of iterator?

Implemented in DIALOG_CREATE_ARRAY::ARRAY_CIRCULAR_OPTIONS, and DIALOG_CREATE_ARRAY::ARRAY_GRID_OPTIONS.

Referenced by ARRAY_CREATOR::Invoke().

Friends And Related Function Documentation

friend class DIALOG_CREATE_ARRAY
friend

Definition at line 251 of file dialog_create_array.h.

Member Data Documentation

bool DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::m_numberingStartIsSpecified
protected

True if this array's number starts from the preset point False if the array numbering starts from some externally provided point.

Definition at line 258 of file dialog_create_array.h.

Referenced by DIALOG_CREATE_ARRAY::TransferDataFromWindow().

bool DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::m_shouldNumber
protected

True if this array numbers the new items.

Definition at line 254 of file dialog_create_array.h.

Referenced by DIALOG_CREATE_ARRAY::TransferDataFromWindow().

ARRAY_TYPE_T DIALOG_CREATE_ARRAY::ARRAY_OPTIONS::m_type

Definition at line 211 of file dialog_create_array.h.


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