90 auto& outline = ruleShape.
Outline( 0 );
92 outline.Append(
VECTOR2I( 22000, 20000) );
93 outline.Append(
VECTOR2I( 22000, 22000) );
94 outline.Append(
VECTOR2I( 20000, 22000) );
95 outline.SetClosed(
true );
96 outline.Simplify(
true );
114 for(
int ii = 0; ii < 4; ++ii )
140 BOOST_FAIL( wxString::Format(
141 "Unhandled type: %d "
142 "(if you created a new type you need to handle it in this switch statement)",
172 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
174 if( item ==
nullptr )
177 BOOST_TEST_CONTEXT(
"Class: " << item->GetClass() )
179 IterateOverPositionsAndReferences<EDA_ITEM>(
183 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
184 VECTOR2I originalPos = item->GetPosition();
186 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
191 if( schItem != nullptr )
193 schItem->Move( aRef );
194 BOOST_CHECK_EQUAL( schItem->GetPosition(), originalPos + aRef );
196 schItem->Move( -aRef );
199 CompareItems( item.get(), aOriginalItem );
212 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
214 if( item ==
nullptr )
217 BOOST_TEST_CONTEXT(
"Class: " << item->GetClass() )
222 if( item->GetClass() ==
"SCH_SHEET_PIN" )
224 auto newItem = std::unique_ptr<EDA_ITEM>( item->Clone() );
228 if( schItem !=
nullptr )
232 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(), false );
233 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(), false );
234 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(), false );
235 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(), false );
238 CompareItems( newItem.get(), item.get() );
242 IterateOverPositionsAndReferences<EDA_ITEM>(
246 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
248 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
250 if( schItem != nullptr )
252 schItem->ClearFieldsAutoplaced();
253 schItem->Rotate( aRef, false );
254 schItem->Rotate( aRef, false );
255 schItem->Rotate( aRef, false );
256 schItem->Rotate( aRef, false );
259 CompareItems( item.get(), aOriginalItem );
273 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
275 if( item ==
nullptr )
278 BOOST_TEST_CONTEXT(
"Class: " << item->GetClass() )
280 IterateOverPositionsAndReferences<EDA_ITEM>(
284 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
286 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
290 if( schItem != nullptr )
292 schItem->ClearFieldsAutoplaced();
293 schItem->MirrorHorizontally( aRef.x );
294 schItem->MirrorHorizontally( aRef.x );
297 CompareItems( item.get(), aOriginalItem );
310 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
312 if( item ==
nullptr )
315 BOOST_TEST_CONTEXT(
"Class: " << item->GetClass() )
317 IterateOverPositionsAndReferences<EDA_ITEM>(
321 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
323 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
328 if( schItem != nullptr )
330 schItem->ClearFieldsAutoplaced();
331 schItem->MirrorVertically( aRef.y );
332 schItem->MirrorVertically( aRef.y );
335 CompareItems( item.get(), aOriginalItem );
constexpr EDA_IU_SCALE schIUScale
constexpr coord_type GetLeft() const
constexpr coord_type GetRight() const
constexpr coord_type GetTop() const
constexpr coord_type GetBottom() const
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
void SetPolyShape(const SHAPE_POLY_SET &aShape)
Define a library symbol object.
Object to handle a bitmap image that can be inserted in a schematic.
Class for a bus to bus entry.
Class for a wire to bus entry.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
void ClearFieldsAutoplaced()
virtual void Rotate(const VECTOR2I &aCenter, bool aRotateCCW)
Rotate the item around aCenter 90 degrees in the clockwise direction.
Segment description base class to describe items which have 2 end points (track, wire,...
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void SetSize(const VECTOR2I &aSize)
void SetPosition(const VECTOR2I &aPosition) override
VECTOR2I GetPosition() const override
void SetColCount(int aCount)
void InsertCell(int aIdx, SCH_TABLECELL *aCell)
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
Represent a set of closed polygons.
SHAPE_LINE_CHAIN & Outline(int aIndex)
Return the reference to aIndex-th outline in the set.
int NewOutline()
Creates a new empty polygon in the set and returns its index.
EDA_ITEM * Instantiate(KICAD_T aType)
static void CompareItems(EDA_ITEM *aItem, EDA_ITEM *aOriginalItem)
std::shared_ptr< ERC_ITEM > m_ercItem
@ ERCE_DRIVER_CONFLICT
Conflicting drivers (labels, etc) on a subgraph.
constexpr int mmToIU(double mm) const
BOOST_AUTO_TEST_CASE(Move)
BOOST_AUTO_TEST_SUITE_END()
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
constexpr bool IsInstantiableType(const KICAD_T aType)
constexpr bool IsEeschemaType(const KICAD_T aType)
VECTOR2< int32_t > VECTOR2I