52#define CHECK_ENUM_CLASS_EQUAL( L, R ) \
53 BOOST_CHECK_EQUAL( static_cast<int>( L ), static_cast<int>( R ) )
79 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"LayerWildcard.kicad_pcb" );
82 BOOST_CHECK( testBoard->Zones().size() == 1 );
84 ZONE* z = testBoard->Zones()[0];
94 auto tmpBoard = std::filesystem::temp_directory_path() /
"Issue19775_RoundTrip.kicad_pcb";
98 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"LayerEnumerate.kicad_pcb" );
99 kicadPlugin.SaveBoard( tmpBoard.string(), *testBoard );
103 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( tmpBoard.string() );
106 BOOST_CHECK( testBoard->Zones().size() == 1 );
108 ZONE* z = testBoard->Zones()[0];
129 +
"plugins/kicad_sexpr/Issue23125_EmptyZone/";
131 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"EmptyZone.kicad_pcb" );
138 ZONE* z = testBoard->Zones()[0];
155 for(
int ii = 0; ii < 2; ++ii )
167 BOOST_REQUIRE_EQUAL( board.
Drawings().size(), 2u );
169 const wxString
path =
170 ( std::filesystem::temp_directory_path() /
"qa_coincident_drawings.kicad_pcb" ).
string();
172 kicadPlugin.SaveBoard(
path, board );
174 std::unique_ptr<BOARD> reloaded = kicadPlugin.LoadBoard(
path );
179 std::filesystem::remove(
path.ToStdString() );
186 +
"plugins/kicad_sexpr/";
188 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"ScientificNotation.kicad_pcb" );
211 +
"plugins/kicad_sexpr/Issue23625_CorruptedStackup/";
213 std::unique_ptr<BOARD> testBoard;
215 BOOST_CHECK_NO_THROW( testBoard = kicadPlugin.LoadBoard( dataPath +
"corrupted_stackup.kicad_pcb" ) );
218 testBoard->GetDesignSettings().GetStackupDescriptor();
223 BOOST_CHECK_LE( stackup.
GetCount(), 128 );
224 BOOST_CHECK_GT( stackup.
GetCount(), 0 );
238 +
"plugins/kicad_sexpr/Issue24133_DuplicatedStackup/";
240 std::unique_ptr<BOARD> testBoard;
242 BOOST_CHECK_NO_THROW( testBoard = kicadPlugin.LoadBoard( dataPath +
"duplicated_stackup.kicad_pcb" ) );
244 const BOARD_STACKUP& stackup = testBoard->GetDesignSettings().GetStackupDescriptor();
266 std::string destinationPath = dataPath +
"issue3812.kicad_pcb";
268 std::string sourcePath = dataPath +
"issue18142.kicad_pcb";
269 std::map<std::string, UTF8> props;
283 int copperLayerCount = 0;
291 return copperLayerCount;
305 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( destinationPath );
307 const BOARD_STACKUP& initialStackup = testBoard->GetDesignSettings().GetStackupDescriptor();
308 const BOARD_STACKUP_ITEM* initialFirstDielectric = findFirstDielectric( initialStackup );
309 const int initialCopperLayerCount = testBoard->GetCopperLayerCount();
310 const LSET initialEnabledLayers = testBoard->GetEnabledLayers();
311 const wxString initialFinishType = initialStackup.
m_FinishType;
313 BOOST_REQUIRE_EQUAL( initialCopperLayerCount, 4 );
314 BOOST_REQUIRE_EQUAL( countCopperLayers( initialStackup ), 4 );
316 BOOST_REQUIRE_EQUAL( initialFinishType, wxS(
"ENIG" ) );
317 const wxString initialFirstDielectricMaterial = initialFirstDielectric->
GetMaterial();
318 const int initialFirstDielectricThickness = initialFirstDielectric->
GetThickness();
320 kicadPlugin.LoadAndAppendBoard( sourcePath, *testBoard, &props );
322 const int appendedCopperLayerCount = testBoard->GetCopperLayerCount();
324 if( appendedCopperLayerCount > initialCopperLayerCount )
325 testBoard->SetCopperLayerCount( appendedCopperLayerCount );
327 LSET enabledLayers = testBoard->GetEnabledLayers();
328 enabledLayers |= initialEnabledLayers;
329 testBoard->SetEnabledLayers( enabledLayers );
330 testBoard->GetDesignSettings().GetStackupDescriptor().SynchronizeWithBoard( &testBoard->GetDesignSettings() );
332 const BOARD_STACKUP& finalStackup = testBoard->GetDesignSettings().GetStackupDescriptor();
356 std::string destinationPath = dataPath +
"issue3812.kicad_pcb";
358 std::string sourcePath = dataPath +
"issue18142.kicad_pcb";
360 std::map<std::string, UTF8> props;
363 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( destinationPath );
365 BOOST_REQUIRE_EQUAL( testBoard->GetLayerName(
F_Cu ), wxS(
"Top_layer" ) );
366 BOOST_REQUIRE_EQUAL( testBoard->GetLayerName(
In1_Cu ), wxS(
"GND_layer" ) );
367 BOOST_REQUIRE_EQUAL( testBoard->GetLayerName(
In2_Cu ), wxS(
"VDD_layer" ) );
368 BOOST_REQUIRE_EQUAL( testBoard->GetLayerName(
B_Cu ), wxS(
"Bottom_layer" ) );
370 kicadPlugin.LoadAndAppendBoard( sourcePath, *testBoard, &props );
379 BOOST_CHECK( testBoard->IsLayerEnabled(
In3_Cu ) );
380 BOOST_CHECK( testBoard->IsLayerEnabled(
In4_Cu ) );
395 std::string sourcePath = dataPath +
"issue3812.kicad_pcb";
397 std::map<std::string, UTF8> props;
406 if( track->GetLayer() == aLayer )
414 const wxString fName = wxS(
"Top_layer" );
415 const wxString in1Name = wxS(
"GND_layer" );
416 const wxString in2Name = wxS(
"VDD_layer" );
417 const wxString bName = wxS(
"Bottom_layer" );
420 std::vector<wxString> seenNames;
422 kicadPlugin.RegisterCallback(
423 [&](
const std::vector<INPUT_LAYER_DESC>& aDescs ) -> std::map<wxString, PCB_LAYER_ID>
426 seenNames.push_back( desc.Name );
431 std::unique_ptr<BOARD> identityBoard = std::make_unique<BOARD>();
433 kicadPlugin.LoadAndAppendBoard( sourcePath, *identityBoard, &props );
436 BOOST_CHECK( std::find( seenNames.begin(), seenNames.end(), in1Name ) != seenNames.end() );
437 BOOST_CHECK( std::find( seenNames.begin(), seenNames.end(), in2Name ) != seenNames.end() );
439 const int idIn1 = countTracksOn( identityBoard.get(),
In1_Cu );
440 const int idIn2 = countTracksOn( identityBoard.get(),
In2_Cu );
442 BOOST_REQUIRE_GT( idIn2, 0 );
445 kicadPlugin.RegisterCallback(
446 [&](
const std::vector<INPUT_LAYER_DESC>& ) -> std::map<wxString, PCB_LAYER_ID>
451 std::unique_ptr<BOARD> swapBoard = std::make_unique<BOARD>();
453 kicadPlugin.LoadAndAppendBoard( sourcePath, *swapBoard, &props );
455 const int swIn1 = countTracksOn( swapBoard.get(),
In1_Cu );
456 const int swIn2 = countTracksOn( swapBoard.get(),
In2_Cu );
472 std::string standardNames = dataPath +
"issue18142.kicad_pcb";
473 std::string customNames = dataPath +
"issue3812.kicad_pcb";
475 std::map<std::string, UTF8> props;
478 bool handlerCalled =
false;
480 kicadPlugin.RegisterCallback(
481 [&](
const std::vector<INPUT_LAYER_DESC>& ) -> std::map<wxString, PCB_LAYER_ID>
483 handlerCalled =
true;
489 std::unique_ptr<BOARD> matchBoard = kicadPlugin.LoadBoard( standardNames );
490 handlerCalled =
false;
491 kicadPlugin.LoadAndAppendBoard( standardNames, *matchBoard, &props );
492 BOOST_CHECK( !handlerCalled );
497 std::unique_ptr<BOARD> mismatchBoard = kicadPlugin.LoadBoard( standardNames );
498 handlerCalled =
false;
499 kicadPlugin.LoadAndAppendBoard( customNames, *mismatchBoard, &props );
500 BOOST_CHECK( handlerCalled );
526 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
533 fp->
SetFPID(
LIB_ID( wxT(
"scratch" ), wxT(
"test_fp_save_netinfo" ) ) );
555 BOOST_REQUIRE_EQUAL(
pad->GetNet(), net );
556 BOOST_REQUIRE_EQUAL( shape->
GetNet(), net );
557 BOOST_REQUIRE_EQUAL( zone->
GetNet(), net );
560 BOOST_REQUIRE_NO_THROW( kicadPlugin.FootprintSave( tmpLib.
Path().string(), fp ) );
562 auto savedFile = tmpLib.
Path() /
"test_fp_save_netinfo.kicad_mod";
565 std::ifstream in( savedFile );
566 BOOST_REQUIRE_MESSAGE( in.is_open(),
567 "Failed to open serialized footprint: " << savedFile.string() );
569 std::stringstream ss;
577 const std::string contents = ss.str();
580 BOOST_CHECK_MESSAGE( contents.find(
"(net " ) == std::string::npos,
581 "Saved footprint library file must not contain (net ...) tokens:\n"
589 std::unique_ptr<FOOTPRINT> detached(
static_cast<FOOTPRINT*
>( fp->
Clone() ) );
590 detached->SetParent(
nullptr );
591 detached->SetParentGroup(
nullptr );
592 detached->ClearAllNets();
598 detached->RunOnChildren(
601 switch( aItem->
Type() )
630 std::unique_ptr<BOARD> writeBoard = std::make_unique<BOARD>();
632 ZONE* zone =
new ZONE( writeBoard.get() );
649 writeBoard->Add( zone );
651 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
652 /
"copper_thieving_roundtrip.kicad_pcb";
655 writer.
SaveBoard( tmpPath.string(), *writeBoard );
658 std::unique_ptr<BOARD> readBoard = reader.
LoadBoard( tmpPath.string() );
660 BOOST_REQUIRE_EQUAL( readBoard->Zones().size(), 1u );
662 ZONE* loaded = readBoard->Zones()[0];
676 std::filesystem::remove( tmpPath );
686 const std::array<THIEVING_PATTERN, 3> patterns = {
696 std::unique_ptr<BOARD> writeBoard = std::make_unique<BOARD>();
698 ZONE* zone =
new ZONE( writeBoard.get() );
710 writeBoard->Add( zone );
712 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
713 /
"copper_thieving_pattern.kicad_pcb";
715 writer.
SaveBoard( tmpPath.string(), *writeBoard );
718 std::unique_ptr<BOARD> readBoard = reader.
LoadBoard( tmpPath.string() );
720 BOOST_REQUIRE_EQUAL( readBoard->Zones().size(), 1u );
721 BOOST_CHECK( readBoard->Zones()[0]->GetThievingSettings().pattern == pattern );
723 std::filesystem::remove( tmpPath );
737 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
738 /
"copper_thieving_old_version.kicad_pcb";
739 std::ofstream out( tmpPath );
742 out <<
"(kicad_pcb (version 20260512) (generator \"test\") (generator_version \"test\")"
743 <<
" (general (thickness 1.6)) (paper \"A4\")"
744 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal))"
745 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000001\")"
746 <<
" (hatch edge 0.5)"
747 <<
" (connect_pads (clearance 0))"
748 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
749 <<
" (fill yes (mode thieving) (thermal_gap 0.5) (thermal_bridge_width 0.5)"
750 <<
" (island_removal_mode 0))"
751 <<
" (polygon (pts (xy 0 0) (xy 5 0) (xy 5 5) (xy 0 5))))"
758 std::filesystem::remove( tmpPath );
765 std::filesystem::path tmpPath = tempDir.
Path() /
"malformed_dimension_text.kicad_pcb";
766 std::ofstream out( tmpPath );
767 out <<
"(kicad_pcb (version 20240108) (generator \"test\")"
768 <<
" (general (thickness 1.6)) (paper \"A4\")"
769 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal) (36 \"B.SilkS\" user \"b.silkscreen\"))"
770 <<
" (dimension (type aligned) (layer \"B.SilkS\")"
771 <<
" (gr_text \"1 mm\" (at broken))))";
788 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
789 /
"copper_thieving_malformed.kicad_pcb";
790 std::ofstream out( tmpPath );
791 out <<
"(kicad_pcb (version 20260513) (generator \"test\") (generator_version \"test\")"
792 <<
" (general (thickness 1.6)) (paper \"A4\")"
793 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal))"
794 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000002\")"
795 <<
" (hatch edge 0.5)"
796 <<
" (connect_pads (clearance 0))"
797 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
798 <<
" (fill yes (mode thieving)"
799 <<
" (thermal_gap 0.5) (thermal_bridge_width 0.5)"
800 <<
" (island_removal_mode 0)"
801 <<
" (thieving (type dots) (size -1) (gap 0)"
802 <<
" (width -5) (stagger no) (orientation 0)))"
803 <<
" (polygon (pts (xy 0 0) (xy 5 0) (xy 5 5) (xy 0 5))))"
808 std::unique_ptr<BOARD> readBoard = reader.
LoadBoard( tmpPath.string() );
810 BOOST_REQUIRE_EQUAL( readBoard->Zones().size(), 1u );
814 BOOST_CHECK_GT( loaded.
gap, 0 );
817 std::filesystem::remove( tmpPath );
831 std::filesystem::path tmpPath = tempDir.
Path() /
"thermal_zone_block.kicad_pcb";
832 std::ofstream out( tmpPath );
836 out <<
"(kicad_pcb (version 20260513) (generator \"test\") (generator_version \"test\")"
837 <<
" (general (thickness 1.6)) (paper \"A4\")"
838 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal))"
839 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000001\")"
840 <<
" (hatch edge 0.5)"
841 <<
" (connect_pads (clearance 0.5))"
842 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
843 <<
" (fill yes (thermal_gap 0.5) (thermal_bridge_width 0.5) (island_removal_mode 0))"
844 <<
" (polygon (pts (xy 0 0) (xy 5 0) (xy 5 5) (xy 0 5))))"
845 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000002\")"
847 <<
" (hatch edge 0.5)"
848 <<
" (connect_pads yes (clearance 0.5))"
849 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
850 <<
" (fill yes (thermal_gap 0.5) (thermal_bridge_width 0.5) (island_removal_mode 0)"
851 <<
" (smoothing fillet) (radius 1))"
852 <<
" (polygon (pts (xy 10 0) (xy 15 0) (xy 15 5) (xy 10 5))))"
857 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
859 ZONE_SETTINGS settings = board->GetDesignSettings().GetDefaultZoneSettings();
866 board->GetDesignSettings().SetDefaultZoneSettings( settings );
868 kicadPlugin.LoadAndAppendBoard( tmpPath.string(), *board );
870 BOOST_REQUIRE_EQUAL( board->Zones().size(), 2u );
873 ZONE* omitted = board->Zones()[0];
879 BOOST_CHECK( !omitted->
IsLocked() );
882 ZONE* explicitZone = board->Zones()[1];
886 BOOST_CHECK( explicitZone->
IsLocked() );
901 CANCEL_AT_LINE_READER(
const std::string& aText,
unsigned aCancelLine,
bool* aCancelFlag ) :
903 m_cancelLine( aCancelLine ),
904 m_cancelFlag( aCancelFlag )
910 if( !*m_cancelFlag &&
LineNumber() >= m_cancelLine )
912 *m_cancelFlag =
true;
913 std::this_thread::sleep_for( std::chrono::milliseconds( 300 ) );
920 unsigned m_cancelLine;
927 CANCELLING_REPORTER(
bool* aCancelFlag ) :
928 m_cancelFlag( aCancelFlag )
937 void Report(
const wxString& )
override {}
941 void SetTitle(
const wxString& )
override {}
942 bool IsCancelled()
const override {
return *m_cancelFlag; }
950 std::unique_ptr<BOARD>
source = std::make_unique<BOARD>();
955 for(
int i = 0; i < 400; i++ )
967 kicadPlugin.FormatBoardToFormatter( &fmt,
source.get() );
973 unsigned lineCount = std::count(
text.begin(),
text.end(),
'\n' );
976 std::unique_ptr<BOARD> dest = std::make_unique<BOARD>();
983 dest->Add( existing );
985 size_t tracksBefore = dest->Tracks().size();
986 unsigned netsBefore = dest->GetNetInfo().GetNetCount();
988 bool cancelRequested =
false;
990 CANCEL_AT_LINE_READER reader(
text, lineCount / 2, &cancelRequested );
991 CANCELLING_REPORTER
reporter( &cancelRequested );
993 BOOST_CHECK_THROW( kicadPlugin.DoLoad( reader, *dest,
false,
nullptr, &
reporter, lineCount ),
IO_ERROR );
994 BOOST_CHECK( cancelRequested );
1007 std::filesystem::path libPath = std::filesystem::temp_directory_path() /
"kicad_qa_no_such_library.pretty";
1011 wxArrayString names;
1013 BOOST_CHECK_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ),
IO_ERROR );
1015 BOOST_CHECK_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ),
IO_ERROR );
1025 std::filesystem::path libPath = temp.
Path() /
"warning.pretty";
1026 std::filesystem::create_directories( libPath );
1028 std::filesystem::path
source =
1031 for(
const char*
name : {
"R_0402_1005Metric",
"R_0603_1608Metric" } )
1032 std::filesystem::copy_file(
source / ( std::string(
name ) +
".kicad_mod" ),
1033 libPath / ( std::string(
name ) +
".kicad_mod" ) );
1036 std::filesystem::path zeroPad = libPath /
"R_0402_1005Metric.kicad_mod";
1037 std::ifstream in( zeroPad );
1038 std::string
text( ( std::istreambuf_iterator<char>( in ) ), std::istreambuf_iterator<char>() );
1041 size_t at =
text.find(
"(size 0.54 0.64)" );
1043 text.replace( at, std::string(
"(size 0.54 0.64)" ).size(),
"(size 0 0)" );
1044 std::ofstream( zeroPad ) <<
text;
1046 wxArrayString names;
1048 BOOST_CHECK_NO_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ) );
1050 BOOST_CHECK( names.Index( wxS(
"R_0402_1005Metric" ) ) != wxNOT_FOUND );
1053 std::ofstream( libPath /
"broken.kicad_mod" ) <<
"(footprint";
1055 kicadPlugin.ClearCachedFootprints( libPath.string() );
1058 BOOST_CHECK_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ),
IO_ERROR );
constexpr EDA_IU_SCALE pcbIUScale
General utilities for PCB file IO for QA programs.
@ BS_ITEM_TYPE_DIELECTRIC
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the item.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
NETINFO_ITEM * GetNet() const
Return NETINFO_ITEM object for a given item.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool IsLocked() const override
Manage one layer needed to make a physical board.
int GetThickness(int aDielectricSubLayer=0) const
wxString GetMaterial(int aDielectricSubLayer=0) const
Manage layers needed to make a physical board.
int BuildBoardThicknessFromStackup() const
wxString m_FinishType
The name of external copper finish.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
const TRACKS & Tracks() const
const DRAWINGS & Drawings() const
KICAD_T Type() const
Returns the type of object.
EDA_ANGLE GetAngle() const
void SetAngle(const EDA_ANGLE &aAngle)
VECTOR2I GetArcMid() const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
const std::filesystem::path & Path() const
Get the path to the temporary directory as a std::filesystem::path.
A logical library item identifier and consists of various portions much like a URI.
virtual unsigned LineNumber() const
Return the line number of the last line read from this LINE_READER.
LSET is a set of PCB_LAYER_IDs.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Handle the data for a net.
static NETINFO_ITEM * OrphanedItem()
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
@ NORMAL
Shape is the same on all layers.
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
void SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
std::unique_ptr< BOARD > LoadBoard(const wxString &aFileName, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr)
Load information from some input file format that this PCB_IO implementation knows about into new BOA...
void SetWidth(int aWidth) override
void SetEnd(const VECTOR2I &aEnd) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
virtual void SetWidth(int aWidth)
A progress reporter interface for use in multi-threaded environments.
virtual bool IsCancelled() const =0
virtual void AddPhases(int aNumPhases)=0
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
virtual void SetNumPhases(int aNumPhases)=0
Set the number of phases.
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual void BeginPhase(int aPhase)=0
Initialize the aPhase virtual zone of the dialog progress bar.
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
virtual void SetTitle(const wxString &aTitle)=0
Change the title displayed on the window caption.
virtual void AdvanceProgress()=0
Increment the progress bar length (inside the current virtual zone).
virtual void SetCurrentProgress(double aProgress)=0
Set the progress value to aProgress (0..1).
virtual void SetMaxProgress(int aMaxProgress)=0
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
int TotalVertices() const
Return total number of vertices stored in the set.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
STRING_LINE_READER(const std::string &aString, const wxString &aSource)
Construct a string line reader.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
void SetCornerSmoothingType(CORNER_SMOOTHING aType)
void SetPadConnection(ZONE_CONNECTION aPadConnection)
void SetCornerRadius(int aRadius)
ZONE_FILL_MODE m_FillMode
int m_HatchSmoothingLevel
Handle a list of polygons defining a copper zone.
const THIEVING_SETTINGS & GetThievingSettings() const
bool AppendCorner(const VECTOR2I &aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
ZONE_LAYER_PROPERTIES & LayerProperties(PCB_LAYER_ID aLayer)
std::shared_ptr< SHAPE_POLY_SET > GetFilledPolysList(PCB_LAYER_ID aLayer) const
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool IsCopperThieving() const
ZONE_SETTINGS::CORNER_SMOOTHING GetCornerSmoothingType() const
void SetFillMode(ZONE_FILL_MODE aFillMode)
ZONE_CONNECTION GetPadConnection() const
void SetThievingSettings(const THIEVING_SETTINGS &aSettings)
VECTOR2I GetPosition() const override
void SetNet(NETINFO_ITEM *aNetInfo) override
Override that drops aNetInfo when this zone is in copper-thieving fill mode.
ZONE_FILL_MODE GetFillMode() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
int GetHatchSmoothingLevel() const
unsigned int GetCornerRadius() const
int GetNumCorners(void) const
Access to m_Poly parameters.
PCB_LAYER_ID
A quick note on layer IDs:
std::string GetTestDataRootDir()
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
constexpr char APPEND_PRESERVE_DESTINATION_STACKUP[]
PCB_IO_KICAD_SEXPR kicadPlugin
Parameters that drive copper-thieving fill generation.
EDA_ORIENTATION orientation
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST(netlist.find("R_G1 ARM_OUT1 DIE_B R='0.001 / ((SW_STATE)") !=std::string::npos)
IbisParser parser & reporter
#define CHECK_ENUM_CLASS_EQUAL(L, R)
BOOST_AUTO_TEST_CASE(Issue19775_ZoneLayerWildcards)
Declares the struct as the Boost test fixture.
BOOST_TEST_CONTEXT("Test Clearance")
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_PAD_T
class PAD, a pad in a footprint
VECTOR2< int32_t > VECTOR2I
THIEVING_PATTERN
Shape stamped onto the grid for a copper-thieving fill.
@ THERMAL
Use thermal relief for pads.
@ FULL
pads are covered by copper