120 BOOST_FAIL( wxString::Format(
121 "Unhandled type: %d "
122 "(if you created a new type you need to handle it in this switch statement)",
152 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
154 if( item ==
nullptr )
159 IterateOverPositionsAndReferences<BOARD_ITEM>(
165 PCB_DIMENSION_BASE* originalDimension =
166 dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem );
168 if( originalDimension != nullptr )
169 originalDimension->Update();
171 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate() );
172 VECTOR2I originalPos = item->GetPosition();
178 BOOST_CHECK_EQUAL( item->GetPosition(), originalPos + aRef );
181 CompareItems( item.get(), aOriginalItem );
194 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
196 if( item ==
nullptr )
203 IterateOverPositionsAndReferences<BOARD_ITEM>(
209 PCB_DIMENSION_BASE* originalDimension =
210 dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem );
212 if( originalDimension != nullptr )
213 originalDimension->Update();
215 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate() );
219 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
220 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
221 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
222 item->Rotate( aRef, EDA_ANGLE( 90.0, DEGREES_T ) );
224 CompareItems( item.get(), aOriginalItem );
237 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
239 if( item ==
nullptr )
244 IterateOverPositionsAndReferences<BOARD_ITEM>(
250 PCB_DIMENSION_BASE* originalDimension =
251 dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem );
253 if( originalDimension != nullptr )
254 originalDimension->Update();
256 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate() );
260 item->Flip( aRef, true );
261 item->Flip( aRef, true );
263 CompareItems( item.get(), aOriginalItem );
276 auto item = std::unique_ptr<BOARD_ITEM>( Instantiate( type ) );
278 if( item ==
nullptr )
283 IterateOverPositionsAndReferences<BOARD_ITEM>(
289 PCB_DIMENSION_BASE* originalDimension =
290 dynamic_cast<PCB_DIMENSION_BASE*>( aOriginalItem );
292 if( originalDimension != nullptr )
293 originalDimension->Update();
295 auto item = std::unique_ptr<BOARD_ITEM>( aOriginalItem->Duplicate() );
299 item->Flip( aRef, false );
300 item->Flip( aRef, false );
302 CompareItems( item.get(), aOriginalItem );
309BOOST_AUTO_TEST_SUITE_END()
constexpr EDA_IU_SCALE pcbIUScale
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
void SetParentGroup(PCB_GROUP *aGroup)
Information pertinent to a Pcbnew printed circuit board.
coord_type GetTop() const
coord_type GetRight() const
coord_type GetLeft() const
coord_type GetBottom() const
virtual VECTOR2I GetPosition() const
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Object to handle a bitmap image that can be inserted in a PCB.
For better understanding of the points that make a dimension:
Mark the center of a circle or arc with a cross shape.
A leader is a dimension-like object pointing to a specific point.
An orthogonal dimension is like an aligned dimension, but the extension lines are locked to the X or ...
A radial dimension indicates either the radius or diameter of an arc or circle.
A set of BOARD_ITEMs (i.e., without duplicates).
BOARD_ITEM * Instantiate(KICAD_T aType)
static void CompareItems(BOARD_ITEM *aItem, BOARD_ITEM *aOriginalItem)
TEST_BOARD_ITEM_FIXTURE()
~TEST_BOARD_ITEM_FIXTURE()
std::shared_ptr< DRC_ITEM > m_drcItem
Handle a list of polygons defining a copper zone.
bool AppendCorner(VECTOR2I aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
@ DRCE_MALFORMED_COURTYARD
Class to handle a set of BOARD_ITEMs.
constexpr int mmToIU(double mm) const
BOOST_AUTO_TEST_CASE(Move)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_ITEM_LIST_T
class BOARD_ITEM_LIST, a list of board items
@ PCB_FIELD_T
class PCB_FIELD, text associated with a footprint property
@ PCB_MARKER_T
class PCB_MARKER, a marker used to show something
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_BITMAP_T
class PCB_BITMAP, bitmap on a layer
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_NETINFO_T
class NETINFO_ITEM, a description of a net
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension
constexpr bool IsPcbnewType(const KICAD_T aType)
constexpr bool IsInstantiableType(const KICAD_T aType)
#define BOOST_TEST_CONTEXT(A)