72 m_text.SetParentGroup(
nullptr );
97 auto& outline = ruleShape.
Outline( 0 );
99 outline.Append(
VECTOR2I( 22000, 20000) );
100 outline.Append(
VECTOR2I( 22000, 22000) );
101 outline.Append(
VECTOR2I( 20000, 22000) );
102 outline.SetClosed(
true );
103 outline.Simplify(
true );
120 table->SetColCount( 2 );
122 for(
int ii = 0; ii < 4; ++ii )
159 BOOST_FAIL( wxString::Format(
160 "Unhandled type: %d "
161 "(if you created a new type you need to handle it in this switch statement)",
191 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
193 if( item ==
nullptr )
202 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
203 VECTOR2I originalPos = item->GetPosition();
205 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
210 if( schItem != nullptr )
212 schItem->Move( aRef );
213 BOOST_CHECK_EQUAL( schItem->GetPosition(), originalPos + aRef );
215 schItem->Move( -aRef );
218 CompareItems( item.get(), aOriginalItem );
231 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
233 if( item ==
nullptr )
241 if( item->GetClass() ==
"SCH_SHEET_PIN" )
243 auto newItem = std::unique_ptr<EDA_ITEM>( item->Clone() );
247 if( schItem !=
nullptr )
251 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
252 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
253 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
254 schItem->
Rotate( m_sheet.GetBodyBoundingBox().GetCenter(),
false );
257 CompareItems( newItem.get(), item.get() );
265 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
267 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
269 if( schItem != nullptr )
271 schItem->SetFieldsAutoplaced( AUTOPLACE_NONE );
272 schItem->Rotate( aRef, false );
273 schItem->Rotate( aRef, false );
274 schItem->Rotate( aRef, false );
275 schItem->Rotate( aRef, false );
278 CompareItems( item.get(), aOriginalItem );
288 const VECTOR2I textPos( 1000, 2000 );
297 text.SetHorizJustify( hJustify );
300 text.Rotate( ref,
false );
301 text.Rotate( ref,
true );
317 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
319 if( item ==
nullptr )
328 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
330 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
334 if( schItem != nullptr )
336 schItem->SetFieldsAutoplaced( AUTOPLACE_NONE );
337 schItem->MirrorHorizontally( aRef.x );
338 schItem->MirrorHorizontally( aRef.x );
341 CompareItems( item.get(), aOriginalItem );
354 auto item = std::unique_ptr<EDA_ITEM>( Instantiate( type ) );
356 if( item ==
nullptr )
365 auto item = std::unique_ptr<EDA_ITEM>( aOriginalItem->Clone() );
367 SCH_ITEM* schItem = dynamic_cast<SCH_ITEM*>( item.get() );
372 if( schItem != nullptr )
374 schItem->SetFieldsAutoplaced( AUTOPLACE_NONE );
375 schItem->MirrorVertically( aRef.y );
376 schItem->MirrorVertically( aRef.y );
379 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.
virtual 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 constexpr EDA_ANGLE ANGLE_HORIZONTAL
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_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_AUTO_TEST_CASE(Move)
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_CONTEXT("Test Clearance")
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.
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