KiCad PCB EDA Suite
ARRAY_OPTIONS Class Referenceabstract

Options that govern the setup of an "array" of multiple item. More...

#include <array_options.h>

Inheritance diagram for ARRAY_OPTIONS:
ARRAY_CIRCULAR_OPTIONS ARRAY_GRID_OPTIONS

Classes

struct  TRANSFORM
 Transform applied to an object by this array. More...
 

Public Types

enum  ARRAY_TYPE_T { ARRAY_GRID, ARRAY_CIRCULAR }
 

Public Member Functions

 ARRAY_OPTIONS (ARRAY_TYPE_T aType)
 
virtual ~ARRAY_OPTIONS ()
 
virtual TRANSFORM GetTransform (int aN, const VECTOR2I &aPos) const =0
 Get the transform of the n-th point in the array. More...
 
virtual int GetArraySize () const =0
 The number of points in this array. More...
 
virtual wxString GetItemNumber (int n) const =0
 Get the position number (name) for the n'th array point. More...
 
bool ShouldNumberItems () const
 
void SetShouldNumber (bool aShouldNumber)
 
bool GetNumberingStartIsSpecified () const
 
void SetNumberingStartIsSpecified (bool aIsSpecified)
 

Protected Attributes

ARRAY_TYPE_T m_type
 
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...
 

Detailed Description

Options that govern the setup of an "array" of multiple item.

The base ARRAY_OPTIONS do not encode a specific geometry or numbering method, this is done by derived classes.

Definition at line 36 of file array_options.h.

Member Enumeration Documentation

◆ ARRAY_TYPE_T

Enumerator
ARRAY_GRID 

A grid (x*y) array.

ARRAY_CIRCULAR 

A circular array.

Definition at line 39 of file array_options.h.

40  {
41  ARRAY_GRID,
43  };
A grid (x*y) array.
Definition: array_options.h:41

Constructor & Destructor Documentation

◆ ARRAY_OPTIONS()

ARRAY_OPTIONS::ARRAY_OPTIONS ( ARRAY_TYPE_T  aType)
inline

Definition at line 45 of file array_options.h.

46  : m_type( aType ), m_shouldNumber( false ), m_numberingStartIsSpecified( false )
47  {
48  }
bool m_numberingStartIsSpecified
True if this array'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.
ARRAY_TYPE_T m_type

◆ ~ARRAY_OPTIONS()

virtual ARRAY_OPTIONS::~ARRAY_OPTIONS ( )
inlinevirtual

Definition at line 50 of file array_options.h.

50 {};

Member Function Documentation

◆ GetArraySize()

virtual int ARRAY_OPTIONS::GetArraySize ( ) const
pure virtual

The number of points in this array.

Implemented in ARRAY_CIRCULAR_OPTIONS, and ARRAY_GRID_OPTIONS.

◆ GetItemNumber()

virtual wxString ARRAY_OPTIONS::GetItemNumber ( int  n) const
pure virtual

Get the position number (name) for the n'th array point.

Parameters
narray point index, from 0 to GetArraySize() - 1
Returns
the point's name

Implemented in ARRAY_CIRCULAR_OPTIONS, and ARRAY_GRID_OPTIONS.

Referenced by ARRAY_PAD_NAME_PROVIDER::getNextName().

◆ GetNumberingStartIsSpecified()

bool ARRAY_OPTIONS::GetNumberingStartIsSpecified ( ) 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 100 of file array_options.h.

101  {
103  }
bool m_numberingStartIsSpecified
True if this array'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.

References m_numberingStartIsSpecified, and m_shouldNumber.

Referenced by ARRAY_PAD_NAME_PROVIDER::ARRAY_PAD_NAME_PROVIDER().

◆ GetTransform()

virtual TRANSFORM ARRAY_OPTIONS::GetTransform ( int  aN,
const VECTOR2I aPos 
) const
pure virtual

Get the transform of the n-th point in the array.

Parameters
aNthe index of the array point (0 is the original point)
aPosthe existing item position
Returns
a transform (an offset and a rotation)

Implemented in ARRAY_CIRCULAR_OPTIONS, and ARRAY_GRID_OPTIONS.

Referenced by TransformItem().

◆ SetNumberingStartIsSpecified()

void ARRAY_OPTIONS::SetNumberingStartIsSpecified ( bool  aIsSpecified)
inline

Definition at line 105 of file array_options.h.

106  {
107  m_numberingStartIsSpecified = aIsSpecified;
108  }
bool m_numberingStartIsSpecified
True if this array's number starts from the preset point False if the array numbering starts from som...

References m_numberingStartIsSpecified.

◆ SetShouldNumber()

void ARRAY_OPTIONS::SetShouldNumber ( bool  aShouldNumber)
inline

Definition at line 90 of file array_options.h.

91  {
92  m_shouldNumber = aShouldNumber;
93  }
bool m_shouldNumber
True if this array numbers the new items.

References m_shouldNumber.

◆ ShouldNumberItems()

bool ARRAY_OPTIONS::ShouldNumberItems ( ) const
inline
Returns
are the items in this array numbered, or are all the items numbered the same?

Definition at line 85 of file array_options.h.

86  {
87  return m_shouldNumber;
88  }
bool m_shouldNumber
True if this array numbers the new items.

References m_shouldNumber.

Member Data Documentation

◆ m_numberingStartIsSpecified

bool 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 119 of file array_options.h.

Referenced by GetNumberingStartIsSpecified(), and SetNumberingStartIsSpecified().

◆ m_shouldNumber

bool ARRAY_OPTIONS::m_shouldNumber
protected

True if this array numbers the new items.

Definition at line 115 of file array_options.h.

Referenced by GetNumberingStartIsSpecified(), SetShouldNumber(), and ShouldNumberItems().

◆ m_type

ARRAY_TYPE_T ARRAY_OPTIONS::m_type
protected

Definition at line 112 of file array_options.h.


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