76 m_text.SetParentGroup(
nullptr );
101 auto& outline = ruleShape.
Outline( 0 );
103 outline.Append(
VECTOR2I( 22000, 20000) );
104 outline.Append(
VECTOR2I( 22000, 22000) );
105 outline.Append(
VECTOR2I( 20000, 22000) );
106 outline.SetClosed(
true );
107 outline.Simplify(
true );
125 table->SetColCount( 2 );
127 for(
int ii = 0; ii < 4; ++ii )
164 BOOST_FAIL( wxString::Format(
165 "Unhandled type: %d "
166 "(if you created a new type you need to handle it in this switch statement)",
196 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
198 if( item ==
nullptr )
207 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
208 VECTOR2I originalPos = item->GetPosition();
210 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
215 if( schItem != nullptr )
217 schItem->Move( aRef );
218 BOOST_CHECK_EQUAL( schItem->GetPosition(), originalPos + aRef );
220 schItem->Move( -aRef );
223 CompareItems( item.get(), aOriginalItem );
236 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
238 if( item ==
nullptr )
246 if( item->GetClass() ==
"SCH_SHEET_PIN" )
248 auto newItem = std::unique_ptr<EDA_ITEM>( item->Clone() );
252 if( schItem !=
nullptr )
256 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
257 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
258 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
259 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
262 CompareItems( newItem.get(), item.get() );
270 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
272 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
274 if( schItem != nullptr )
276 schItem->SetFieldsAutoplaced( AUTOPLACE_NONE );
277 schItem->Rotate( aRef, false );
278 schItem->Rotate( aRef, false );
279 schItem->Rotate( aRef, false );
280 schItem->Rotate( aRef, false );
283 CompareItems( item.get(), aOriginalItem );
297 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
299 if( item ==
nullptr )
308 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
310 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
314 if( schItem != nullptr )
316 schItem->SetFieldsAutoplaced( AUTOPLACE_NONE );
317 schItem->MirrorHorizontally( aRef.x );
318 schItem->MirrorHorizontally( aRef.x );
321 CompareItems( item.get(), aOriginalItem );
334 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
336 if( item ==
nullptr )
345 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
347 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
352 if( schItem != nullptr )
354 schItem->SetFieldsAutoplaced( AUTOPLACE_NONE );
355 schItem->MirrorVertically( aRef.y );
356 schItem->MirrorVertically( aRef.y );
359 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.
A set of SCH_ITEMs (i.e., without duplicates).
Base class for any item which can be embedded within the SCHEMATIC container class,...
void SetFieldsAutoplaced(AUTOPLACE_ALGO aAlgo)
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 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
static void IterateOverPositionsAndReferences(T *aItem, void(*aCallback)(T *, VECTOR2I))
@ ERCE_DRIVER_CONFLICT
Conflicting drivers (labels, etc) on a subgraph.
Class to handle a set of SCH_ITEMs.
@ USER
The field ID hasn't been set yet; field is invalid.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_CASE(Move)
BOOST_AUTO_TEST_SUITE_END()
std::vector< std::vector< std::string > > table
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")
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