& aVector, int aNetCode = -1 ) const;
/**
- * Returns data on the length and number of track segments connected to a given track.
+ * Return data on the length and number of track segments connected to a given track.
* This uses the connectivity data for the board to calculate connections
*
* @param aTrack Starting track (can also be a via) to check against for connection.
@@ -1033,14 +1006,15 @@ public:
/**
* Collect all the TRACKs and VIAs that are members of a net given by aNetCode.
* Used from python.
+ *
* @param aNetCode gives the id of the net.
- * @return TRACKS - which are in the net identified by @a aNetCode.
+ * @return list of track which are in the net identified by @a aNetCode.
*/
TRACKS TracksInNet( int aNetCode );
/**
* Get a footprint by its bounding rectangle at \a aPosition on \a aLayer.
- *
+ *
* If more than one footprint is at \a aPosition, then the closest footprint on the
* active layer is returned. The distance is calculated via manhattan distance from
* the center of the bounding rectangle to \a aPosition.
@@ -1095,14 +1069,15 @@ public:
*/
void OnItemsChanged( std::vector& aItems );
- /*
+ /**
* Consistency check of internal m_groups structure.
+ *
* @param repair if true, modify groups structure until it passes the sanity check.
* @return empty string on success. Or error description if there's a problem.
*/
wxString GroupsSanityCheck( bool repair = false );
- /*
+ /**
* @param repair if true, make one modification to groups structure that brings it
* closer to passing the sanity check.
* @return empty string on success. Or error description if there's a problem.
@@ -1117,15 +1092,14 @@ public:
bool enter : 1;
};
- /*
+ /**
* Check which selection tool group operations are legal given the selection.
+ *
* @return bit field of legal ops.
*/
GroupLegalOpsField GroupLegalOps( const PCB_SELECTION& selection ) const;
-public:
// ------------ Run-time caches -------------
-
std::mutex m_CachesMutex;
std::map< std::pair, bool > m_InsideCourtyardCache;
std::map< std::pair, bool > m_InsideFCourtyardCache;
@@ -1133,5 +1107,65 @@ public:
std::map< std::pair, bool > m_InsideAreaCache;
std::map< ZONE*, std::unique_ptr > m_CopperZoneRTrees;
+
+private:
+ // The default copy constructor & operator= are inadequate,
+ // either write one or do not use it at all
+ BOARD( const BOARD& aOther ) = delete;
+
+ BOARD& operator=( const BOARD& aOther ) = delete;
+
+ template
+ void InvokeListeners( Func&& aFunc, Args&&... args )
+ {
+ for( auto&& l : m_listeners )
+ ( l->*aFunc )( std::forward( args )... );
+ }
+
+ friend class PCB_EDIT_FRAME;
+
+ /// What is this board being used for
+ BOARD_USE m_boardUse;
+ int m_timeStamp; // actually a modification counter
+
+ wxString m_fileName;
+ MARKERS m_markers;
+ DRAWINGS m_drawings;
+ FOOTPRINTS m_footprints;
+ TRACKS m_tracks;
+ GROUPS m_groups;
+ ZONES m_zones;
+
+ LAYER m_layers[PCB_LAYER_ID_COUNT];
+
+ HIGH_LIGHT_INFO m_highLight; // current high light data
+ HIGH_LIGHT_INFO m_highLightPrevious; // a previously stored high light data
+
+ int m_fileFormatVersionAtLoad; // the version loaded from the file
+
+ std::map m_properties;
+ std::shared_ptr m_connectivity;
+
+ PAGE_INFO m_paper;
+ TITLE_BLOCK m_titles; // text in lower right of screen and plots
+ PCB_PLOT_PARAMS m_plotOptions;
+ PROJECT* m_project; // project this board is a part of
+
+ /**
+ * All of the board design settings are stored as a JSON object inside the project file. The
+ * object itself is located here because the alternative is to require a valid project be
+ * passed in when constructing a BOARD, since things in the BOARD constructor rely on access
+ * to the BOARD_DESIGN_SETTINGS object.
+ *
+ * A reference to this object is set up in the PROJECT_FILE for the PROJECT this board is
+ * part of, so that the JSON load/store operations work. This link is established when
+ * boards are loaded from disk.
+ */
+ std::unique_ptr m_designSettings;
+
+ NETINFO_LIST m_NetInfo; // net info list (name, design constraints...
+
+ std::vector m_listeners;
};
+
#endif // CLASS_BOARD_H_
diff --git a/pcbnew/cleanup_item.h b/pcbnew/cleanup_item.h
index ea6b4dffbe..acdba779e8 100644
--- a/pcbnew/cleanup_item.h
+++ b/pcbnew/cleanup_item.h
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
- * Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -48,32 +48,27 @@ enum CLEANUP_RC_CODE {
class CLEANUP_ITEM : public RC_ITEM
{
-private:
- wxString m_errorMessage;
-
public:
CLEANUP_ITEM( int aErrorCode );
/**
- * Function GetErrorText
- * returns the string form of a drc error code.
+ * Return the string form of a drc error code.
*/
wxString GetErrorText( int aErrorCode = -1, bool aTranslate = true ) const;
+
+private:
+ wxString m_errorMessage;
};
/**
- * VECTOR_CLEANUP_ITEMS_PROVIDER
- * is an implementation of the interface named RC_ITEMS_PROVIDER which uses a vector
+ * An implementation of the interface named RC_ITEMS_PROVIDER which uses a vector
* of pointers to CLEANUP_ITEMs to fulfill the interface. No ownership is taken of the
* vector.
*/
class VECTOR_CLEANUP_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
{
- std::vector >* m_sourceVector; // owns its CLEANUP_ITEMs
-
public:
-
VECTOR_CLEANUP_ITEMS_PROVIDER( std::vector >* aList ) :
m_sourceVector( aList )
{
@@ -115,6 +110,9 @@ public:
m_sourceVector->clear();
}
}
+
+private:
+ std::vector >* m_sourceVector; // owns its CLEANUP_ITEMs
};
diff --git a/pcbnew/collectors.h b/pcbnew/collectors.h
index 186131877b..c343e1ce11 100644
--- a/pcbnew/collectors.h
+++ b/pcbnew/collectors.h
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2007-2008 SoftPLC Corporation, Dick Hollenbeck
- * Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -59,96 +59,95 @@
*/
class COLLECTORS_GUIDE
{
-
public:
virtual ~COLLECTORS_GUIDE() {}
/**
- * @return bool - true if the given layer is locked, else false.
+ * @return true if the given layer is locked, else false.
*/
virtual bool IsLayerLocked( PCB_LAYER_ID layer ) const = 0;
/**
- * @return bool - true if the given layer is visible, else false.
+ * @return true if the given layer is visible, else false.
*/
virtual bool IsLayerVisible( PCB_LAYER_ID layer ) const = 0;
/**
- * @return bool - true if should ignore locked layers, else false.
+ * @return true if should ignore locked layers, else false.
*/
virtual bool IgnoreLockedLayers() const = 0;
/**
- * @return bool - true if should ignore non-visible layers, else false.
+ * @return true if should ignore non-visible layers, else false.
*/
virtual bool IgnoreNonVisibleLayers() const = 0;
/**
- * @return int - the preferred layer for HitTest()ing.
+ * @return the preferred layer for HitTest()ing.
*/
virtual PCB_LAYER_ID GetPreferredLayer() const = 0;
/**
* Provide wildcard behavior regarding the preferred layer.
*
- * @return bool - true if should ignore preferred layer, else false.
+ * @return true if should ignore preferred layer, else false.
*/
virtual bool IgnorePreferredLayer() const = 0;
/**
- * @return bool - true if should ignore locked items, else false.
+ * @return true if should ignore locked items, else false.
*/
virtual bool IgnoreLockedItems() const = 0;
/**
* Determine if the secondary criteria or 2nd choice items should be included.
*
- * @return bool - true if should include, else false.
+ * @return true if should include, else false.
*/
virtual bool IncludeSecondary() const = 0;
/**
- * @return bool - true if footprint texts marked as "no show" should be ignored.
+ * @return true if footprint texts marked as "no show" should be ignored.
*/
virtual bool IgnoreHiddenFPText() const = 0;
/**
- * @return bool - true if should ignore footprint text on back layers
+ * @return true if should ignore footprint text on back layers
*/
virtual bool IgnoreFPTextOnBack() const = 0;
/**
- * @return bool - true if should ignore footprint text on front layers.
+ * @return true if should ignore footprint text on front layers.
*/
virtual bool IgnoreFPTextOnFront() const = 0;
/**
- * @return bool - true if should ignore FOOTPRINTs on Back Side.
+ * @return true if should ignore FOOTPRINTs on Back Side.
*/
virtual bool IgnoreFootprintsOnBack() const = 0;
/**
- * @return bool - ture if should ignore FOOTPRINTs on Front Side.
+ * @return true if should ignore FOOTPRINTs on Front Side.
*/
virtual bool IgnoreFootprintsOnFront() const = 0;
/**
- * @return bool - true if should ignore Pads on Back Side.
+ * @return true if should ignore Pads on Back Side.
*/
virtual bool IgnorePadsOnBack() const = 0;
/**
- * @return bool - ture if should ignore PADSs on Front Side.
+ * @return true if should ignore PADSs on Front Side.
*/
virtual bool IgnorePadsOnFront() const = 0;
/**
- * @return bool - ture if should ignore through-hole PADSs.
+ * @return true if should ignore through-hole PADSs.
*/
virtual bool IgnoreThroughHolePads() const = 0;
/**
- * @return bool - true if should ignore PADSs on Front side and Back side.
+ * @return true if should ignore PADSs on Front side and Back side.
*/
virtual bool IgnorePads() const
{
@@ -156,12 +155,12 @@ public:
}
/**
- * @return bool - true if should ignore footprint values.
+ * @return true if should ignore footprint values.
*/
virtual bool IgnoreFPValues() const = 0;
/**
- * @return bool - true if should ignore footprint references.
+ * @return true if should ignore footprint references.
*/
virtual bool IgnoreFPReferences() const = 0;
@@ -193,8 +192,8 @@ public:
virtual double OnePixelInIU() const = 0;
/**
- * @return bool - true if Inspect() should use BOARD_ITEM::HitTest()
- * or false if Inspect() should use BOARD_ITEM::BoundsTest().
+ * @return true if Inspect() should use BOARD_ITEM::HitTest()
+ * or false if Inspect() should use BOARD_ITEM::BoundsTest().
virtual bool UseHitTesting() const = 0;
*/
};
@@ -217,14 +216,14 @@ public:
* Overload the COLLECTOR::operator[](int) to return a #BOARD_ITEM instead of an #EDA_ITEM.
*
* @param ndx The index into the list.
- * @return BOARD_ITEM* - or something derived from it, or NULL.
+ * @return a board item or NULL.
*/
BOARD_ITEM* operator[]( int ndx ) const override
{
if( (unsigned)ndx < (unsigned)GetCount() )
return (BOARD_ITEM*) m_list[ ndx ];
- return NULL;
+ return nullptr;
}
};
@@ -250,7 +249,7 @@ protected:
std::vector m_List2nd;
/**
- * Determines which items are to be collected by Inspect()
+ * Determine which items are to be collected by Inspect().
*/
const COLLECTORS_GUIDE* m_Guide;
@@ -313,12 +312,9 @@ public:
*/
static const KICAD_T DraggableItems[];
- /**
- * Constructor GENERALCOLLECTOR
- */
GENERAL_COLLECTOR()
{
- m_Guide = NULL;
+ m_Guide = nullptr;
m_PrimaryLength = 0;
SetScanTypes( AllBoardItems );
}
@@ -343,19 +339,19 @@ public:
const COLLECTORS_GUIDE* GetGuide() const { return m_Guide; }
/**
- * @return int - The number if items which met the primary search criteria
+ * @return The number of items which met the primary search criteria
*/
int GetPrimaryCount() { return m_PrimaryLength; }
/**
* The examining function within the INSPECTOR which is passed to the Iterate function.
*
- * Searches and collects all the objects which match the test data.
+ * Search and collect all the objects which match the test data.
*
* @param testItem An EDA_ITEM to examine.
* @param testData is not used in this class.
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
- * else SCAN_CONTINUE;
+ * else SCAN_CONTINUE;
*/
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
@@ -370,7 +366,7 @@ public:
* @param aGuide The COLLECTORS_GUIDE to use in collecting items.
*/
void Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
- const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide );
+ const wxPoint& aRefPos, const COLLECTORS_GUIDE& aGuide );
};
@@ -380,40 +376,6 @@ public:
*/
class GENERAL_COLLECTORS_GUIDE : public COLLECTORS_GUIDE
{
-private:
- // the storage architecture here is not important, since this is only
- // a carrier object and its functions are what is used, and data only indirectly.
-
- PCB_LAYER_ID m_preferredLayer;
- bool m_ignorePreferredLayer;
-
- LSET m_lockedLayers; ///< bit-mapped layer locked bits
- bool m_ignoreLockedLayers;
-
- LSET m_visibleLayers; ///< bit-mapped layer visible bits
- bool m_ignoreNonVisibleLayers;
-
- bool m_ignoreLockedItems;
- bool m_includeSecondary;
-
- bool m_ignoreHiddenFPText;
- bool m_ignoreFPTextOnBack;
- bool m_ignoreFPTextOnFront;
- bool m_ignoreFootprintsOnBack;
- bool m_ignoreFootprintsOnFront;
- bool m_ignorePadsOnFront;
- bool m_ignorePadsOnBack;
- bool m_ignoreThroughHolePads;
- bool m_ignoreFPValues;
- bool m_ignoreFPReferences;
- bool m_ignoreThroughVias;
- bool m_ignoreBlindBuriedVias;
- bool m_ignoreMicroVias;
- bool m_ignoreTracks;
- bool m_ignoreZoneFills;
-
- double m_onePixelInIU;
-
public:
/**
@@ -421,8 +383,8 @@ public:
*
* Add more constructors as needed.
*
- * @param aVisibleLayerMask = current visible layers (bit mask)
- * @param aPreferredLayer = the layer to search first
+ * @param aVisibleLayerMask is the current visible layers (bit mask).
+ * @param aPreferredLayer is the layer to search first.
*/
GENERAL_COLLECTORS_GUIDE( LSET aVisibleLayerMask, PCB_LAYER_ID aPreferredLayer,
KIGFX::VIEW* aView )
@@ -465,7 +427,7 @@ public:
}
/**
- * @return bool - true if the given layer is locked, else false.
+ * @return true if the given layer is locked, else false.
*/
bool IsLayerLocked( PCB_LAYER_ID aLayerId ) const override
{
@@ -478,7 +440,7 @@ public:
}
/**
- * @return bool - true if the given layer is visible, else false.
+ * @return true if the given layer is visible, else false.
*/
bool IsLayerVisible( PCB_LAYER_ID aLayerId ) const override
{
@@ -491,13 +453,13 @@ public:
void SetLayerVisibleBits( LSET aLayerBits ) { m_visibleLayers = aLayerBits; }
/**
- * @return bool - true if should ignore locked layers, else false.
+ * @return true if should ignore locked layers, else false.
*/
bool IgnoreLockedLayers() const override { return m_ignoreLockedLayers; }
void SetIgnoreLockedLayers( bool ignore ) { m_ignoreLockedLayers = ignore; }
/**
- * @return bool - true if should ignore non-visible layers, else false.
+ * @return true if should ignore non-visible layers, else false.
*/
bool IgnoreNonVisibleLayers() const override { return m_ignoreNonVisibleLayers; }
void SetIgnoreNonVisibleLayers( bool ignore ) { m_ignoreLockedLayers = ignore; }
@@ -511,13 +473,13 @@ public:
/**
* Provide wildcard behavior regarding the preferred layer.
*
- * @return bool - true if should ignore preferred layer, else false.
+ * @return true if should ignore preferred layer, else false.
*/
bool IgnorePreferredLayer() const override { return m_ignorePreferredLayer; }
void SetIgnorePreferredLayer( bool ignore ) { m_ignorePreferredLayer = ignore; }
/**
- * @return bool - true if should ignore locked items, else false.
+ * @return true if should ignore locked items, else false.
*/
bool IgnoreLockedItems() const override { return m_ignoreLockedItems; }
void SetIgnoreLockedItems( bool ignore ) { m_ignoreLockedItems = ignore; }
@@ -525,67 +487,67 @@ public:
/**
* Determine if the secondary criteria, or 2nd choice items should be included.
*
- * @return bool - true if should include, else false.
+ * @return true if should include, else false.
*/
bool IncludeSecondary() const override { return m_includeSecondary; }
void SetIncludeSecondary( bool include ) { m_includeSecondary = include; }
/**
- * @return bool - true if MTexts marked as "no show" should be ignored.
+ * @return true if MTexts marked as "no show" should be ignored.
*/
bool IgnoreHiddenFPText() const override { return m_ignoreHiddenFPText; }
void SetIgnoreMTextsMarkedNoShow( bool ignore ) { m_ignoreHiddenFPText = ignore; }
/**
- * @return bool - true if should ignore MTexts on back layers
+ * @return true if should ignore MTexts on back layers
*/
bool IgnoreFPTextOnBack() const override { return m_ignoreFPTextOnBack; }
void SetIgnoreMTextsOnBack( bool ignore ) { m_ignoreFPTextOnBack = ignore; }
/**
- * @return bool - true if should ignore MTexts on front layers
+ * @return true if should ignore MTexts on front layers
*/
bool IgnoreFPTextOnFront() const override { return m_ignoreFPTextOnFront; }
void SetIgnoreMTextsOnFront( bool ignore ) { m_ignoreFPTextOnFront = ignore; }
/**
- * @return bool - true if should ignore MODULEs on the back side
+ * @return true if should ignore MODULEs on the back side
*/
bool IgnoreFootprintsOnBack() const override { return m_ignoreFootprintsOnBack; }
void SetIgnoreModulesOnBack( bool ignore ) { m_ignoreFootprintsOnBack = ignore; }
/**
- * @return bool - true if should ignore MODULEs on component layer.
+ * @return true if should ignore MODULEs on component layer.
*/
bool IgnoreFootprintsOnFront() const override { return m_ignoreFootprintsOnFront; }
void SetIgnoreModulesOnFront( bool ignore ) { m_ignoreFootprintsOnFront = ignore; }
/**
- * @return bool - true if should ignore Pads on Back Side.
+ * @return true if should ignore Pads on Back Side.
*/
bool IgnorePadsOnBack() const override { return m_ignorePadsOnBack; }
void SetIgnorePadsOnBack(bool ignore) { m_ignorePadsOnBack = ignore; }
/**
- * @return bool - true if should ignore PADSs on Front Side.
+ * @return true if should ignore PADSs on Front Side.
*/
bool IgnorePadsOnFront() const override { return m_ignorePadsOnFront; }
void SetIgnorePadsOnFront(bool ignore) { m_ignorePadsOnFront = ignore; }
/**
- * @return bool - true if should ignore through-hole PADSs.
+ * @return true if should ignore through-hole PADSs.
*/
bool IgnoreThroughHolePads() const override { return m_ignoreThroughHolePads; }
void SetIgnoreThroughHolePads(bool ignore) { m_ignoreThroughHolePads = ignore; }
/**
- * @return bool - true if should ignore footprints values.
+ * @return true if should ignore footprints values.
*/
bool IgnoreFPValues() const override { return m_ignoreFPValues; }
void SetIgnoreModulesVals(bool ignore) { m_ignoreFPValues = ignore; }
/**
- * @return bool - true if should ignore footprints references.
+ * @return true if should ignore footprints references.
*/
bool IgnoreFPReferences() const override { return m_ignoreFPReferences; }
void SetIgnoreModulesRefs(bool ignore) { m_ignoreFPReferences = ignore; }
@@ -607,6 +569,40 @@ public:
double OnePixelInIU() const override { return m_onePixelInIU; }
void SetOnePixelInIU( double aValue ) { m_onePixelInIU = aValue; }
+
+private:
+ // the storage architecture here is not important, since this is only
+ // a carrier object and its functions are what is used, and data only indirectly.
+
+ PCB_LAYER_ID m_preferredLayer;
+ bool m_ignorePreferredLayer;
+
+ LSET m_lockedLayers; ///< bit-mapped layer locked bits
+ bool m_ignoreLockedLayers;
+
+ LSET m_visibleLayers; ///< bit-mapped layer visible bits
+ bool m_ignoreNonVisibleLayers;
+
+ bool m_ignoreLockedItems;
+ bool m_includeSecondary;
+
+ bool m_ignoreHiddenFPText;
+ bool m_ignoreFPTextOnBack;
+ bool m_ignoreFPTextOnFront;
+ bool m_ignoreFootprintsOnBack;
+ bool m_ignoreFootprintsOnFront;
+ bool m_ignorePadsOnFront;
+ bool m_ignorePadsOnBack;
+ bool m_ignoreThroughHolePads;
+ bool m_ignoreFPValues;
+ bool m_ignoreFPReferences;
+ bool m_ignoreThroughVias;
+ bool m_ignoreBlindBuriedVias;
+ bool m_ignoreMicroVias;
+ bool m_ignoreTracks;
+ bool m_ignoreZoneFills;
+
+ double m_onePixelInIU;
};
@@ -624,8 +620,7 @@ public:
*
* @param testItem An EDA_ITEM to examine.
* @param testData is not used in this class.
- * @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
- * else SCAN_CONTINUE;
+ * @return SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE;
*/
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
@@ -646,8 +641,6 @@ public:
*/
class PCB_LAYER_COLLECTOR : public PCB_COLLECTOR
{
- PCB_LAYER_ID m_layer_id;
-
public:
PCB_LAYER_COLLECTOR( PCB_LAYER_ID aLayerId = UNDEFINED_LAYER ) :
m_layer_id( aLayerId )
@@ -667,12 +660,15 @@ public:
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
/**
- * Tests a BOARD_ITEM using this class's Inspector method, which does the collection.
+ * Test a BOARD_ITEM using this class's Inspector method, which does the collection.
*
* @param aBoard The BOARD_ITEM to scan.
* @param aScanList The KICAD_Ts to gather up.
*/
void Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] );
+
+private:
+ PCB_LAYER_ID m_layer_id;
};
#endif // COLLECTORS_H
diff --git a/pcbnew/dimension.h b/pcbnew/dimension.h
index 75f92eee8e..c70263d4b8 100644
--- a/pcbnew/dimension.h
+++ b/pcbnew/dimension.h
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
- * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -141,7 +141,7 @@ public:
wxString GetValueText() const;
/**
- * Updates the dimension's cached text and geometry
+ * Update the dimension's cached text and geometry.
*/
void Update()
{
@@ -195,14 +195,16 @@ public:
}
/**
- * Sets the override text - has no effect if m_overrideValue == false
- * @param aNewText is the text to use as the value
+ * Set the override text - has no effect if m_overrideValue == false.
+ *
+ * @param aNewText is the text to use as the value.
*/
void SetText( const wxString& aNewText );
/**
- * Retrieves the value text or override text, not including prefix or suffix
- * @return the value portion of the dimension text (either overridden or not)
+ * Retrieve the value text or override text, not including prefix or suffix.
+ *
+ * @return the value portion of the dimension text (either overridden or not).
*/
const wxString GetText() const;
@@ -210,7 +212,7 @@ public:
const PCB_TEXT& Text() const { return m_text; }
/**
- * @return a list of line segments that make up this dimension (for drawing, plotting, etc)
+ * @return a list of line segments that make up this dimension (for drawing, plotting, etc).
*/
const std::vector>& GetShapes() const { return m_shapes; }
@@ -221,10 +223,12 @@ public:
void Flip( const wxPoint& aCentre, bool aFlipLeftRight ) override;
/**
- * Mirror the Dimension , relative to a given horizontal axis
- * the text is not mirrored. only its position (and angle) is mirrored
- * the layer is not changed
- * @param axis_pos : vertical axis position
+ * Mirror the dimension relative to a given horizontal axis.
+ *
+ * The text is not mirrored. Only its position (and angle) is mirrored. The layer is not
+ * changed.
+ *
+ * @param axis_pos is the vertical axis position to mirror around.
*/
void Mirror( const wxPoint& axis_pos, bool aMirrorLeftRight = false );
@@ -252,12 +256,12 @@ public:
protected:
/**
- * Updates the cached geometry of the dimension after changing any of its properties
+ * Update the cached geometry of the dimension after changing any of its properties.
*/
virtual void updateGeometry() = 0;
/**
- * Updates the text field value from the current geometry (called by updateGeometry normally)
+ * Update the text field value from the current geometry (called by updateGeometry normally).
*/
virtual void updateText();
@@ -265,15 +269,17 @@ protected:
void addShape( const ShapeType& aShape );
/**
- * Finds the intersection between a given segment and polygon outline
- * @param aPoly is the polygon to collide
- * @param aSeg is the segment to collide
- * @param aStart if true will start from aSeg.A, otherwise aSeg.B
- * @return a point on aSeg that collides with aPoly closest to the start, if one exists
+ * Find the intersection between a given segment and polygon outline.
+ *
+ * @param aPoly is the polygon to collide.
+ * @param aSeg is the segment to collide.
+ * @param aStart if true will start from aSeg.A, otherwise aSeg.B.
+ * @return a point on aSeg that collides with aPoly closest to the start, if one exists.
*/
- static OPT_VECTOR2I segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg, bool aStart = true );
+ static OPT_VECTOR2I segPolyIntersection( const SHAPE_POLY_SET& aPoly, const SEG& aSeg,
+ bool aStart = true );
static OPT_VECTOR2I segCircleIntersection( CIRCLE& aCircle, SEG& aSeg, bool aStart = true );
-
+
// Value format
bool m_overrideTextEnabled; ///< Manually specify the displayed measurement value
wxString m_valueString; ///< Displayed value when m_overrideValue = true
@@ -304,6 +310,7 @@ protected:
static constexpr float s_arrowAngle = 27.5;
};
+
/**
* For better understanding of the points that make a dimension:
*
@@ -333,14 +340,6 @@ protected:
*/
class ALIGNED_DIMENSION : public DIMENSION_BASE
{
-protected:
- // Geometry
- int m_height; ///< Perpendicular distance from features to crossbar
- int m_extensionHeight; ///< Length of extension lines past the crossbar
-
- wxPoint m_crossBarStart; ///< Crossbar start control point
- wxPoint m_crossBarEnd; ///< Crossbar end control point
-
public:
ALIGNED_DIMENSION( BOARD_ITEM* aParent, KICAD_T aType = PCB_DIM_ALIGNED_T );
@@ -365,15 +364,17 @@ public:
const wxPoint& GetCrossbarEnd() const { return m_crossBarEnd; }
/**
- * Sets the distance from the feature points to the crossbar line
+ * Set the distance from the feature points to the crossbar line.
+ *
* @param aHeight is the new height.
*/
void SetHeight( int aHeight ) { m_height = aHeight; }
int GetHeight() const { return m_height; }
/**
- * Updates stored height basing on points coordinates.
- * @param aCrossbarStart is the start point of the crossbar
+ * Update the stored height basing on points coordinates.
+ *
+ * @param aCrossbarStart is the start point of the crossbar.
*/
void UpdateHeight( const wxPoint& aCrossbarStart, const wxPoint& aCrossbarEnd );
@@ -381,8 +382,8 @@ public:
int GetExtensionHeight() const { return m_extensionHeight; }
/**
- * Function GetAngle
- * Returns angle of the crossbar.
+ * Return the angle of the crossbar.
+ *
* @return Angle of the crossbar line expressed in radians.
*/
double GetAngle() const
@@ -400,10 +401,17 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override;
protected:
-
void updateGeometry() override;
void updateText() override;
+
+ // Geometry
+ int m_height; ///< Perpendicular distance from features to crossbar
+ int m_extensionHeight; ///< Length of extension lines past the crossbar
+
+ wxPoint m_crossBarStart; ///< Crossbar start control point
+ wxPoint m_crossBarEnd; ///< Crossbar end control point
+
};
@@ -420,11 +428,6 @@ public:
VERTICAL // Aligned with y-axis
};
-private:
- // Geometry
- DIR m_orientation; ///< What axis to lock the dimension line to
-
-public:
ORTHOGONAL_DIMENSION( BOARD_ITEM* aParent );
~ORTHOGONAL_DIMENSION() = default;
@@ -441,8 +444,9 @@ public:
BITMAPS GetMenuImage() const override;
/**
- * Sets the orientation of the dimension line (so, perpendicular to the feature lines)
- * @param aOrientation is the orientation the dimension should take
+ * Set the orientation of the dimension line (so, perpendicular to the feature lines).
+ *
+ * @param aOrientation is the orientation the dimension should take.
*/
void SetOrientation( DIR aOrientation ) { m_orientation = aOrientation; }
DIR GetOrientation() const { return m_orientation; }
@@ -454,10 +458,14 @@ public:
void Rotate( const wxPoint& aRotCentre, double aAngle ) override;
protected:
-
void updateGeometry() override;
void updateText() override;
+
+private:
+ // Geometry
+ DIR m_orientation; ///< What axis to lock the dimension line to.
+
};
@@ -477,8 +485,6 @@ protected:
*/
class LEADER : public DIMENSION_BASE
{
- DIM_TEXT_FRAME m_textFrame;
-
public:
LEADER( BOARD_ITEM* aParent );
@@ -504,19 +510,21 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector& aList ) override;
protected:
-
void updateGeometry() override;
+
+private:
+ DIM_TEXT_FRAME m_textFrame;
};
/**
- * Marks the center of a circle or arc with a cross shape
+ * Mark the center of a circle or arc with a cross shape.
+ *
* The size and orientation of the cross is adjustable.
* m_start always marks the center being measured; m_end marks the end of one leg of the cross.
*/
class CENTER_DIMENSION : public DIMENSION_BASE
{
-
public:
CENTER_DIMENSION( BOARD_ITEM* aParent );
@@ -541,7 +549,6 @@ public:
const BOX2I ViewBBox() const override;
protected:
-
void updateGeometry() override;
};
diff --git a/pcbnew/footprint_info_impl.h b/pcbnew/footprint_info_impl.h
index c6610a1ddf..329a2d1e15 100644
--- a/pcbnew/footprint_info_impl.h
+++ b/pcbnew/footprint_info_impl.h
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
- * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -83,36 +83,6 @@ protected:
class FOOTPRINT_LIST_IMPL : public FOOTPRINT_LIST
{
- FOOTPRINT_ASYNC_LOADER* m_loader;
- std::vector m_threads;
- SYNC_QUEUE m_queue_in;
- SYNC_QUEUE m_queue_out;
- std::atomic_size_t m_count_finished;
- long long m_list_timestamp;
- PROGRESS_REPORTER* m_progress_reporter;
- std::atomic_bool m_cancelled;
- std::mutex m_join;
-
- /**
- * Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors.
- *
- * @return true if no error occurred.
- */
- bool CatchErrors( const std::function& aFunc );
-
-protected:
- void startWorkers( FP_LIB_TABLE* aTable, wxString const* aNickname,
- FOOTPRINT_ASYNC_LOADER* aLoader, unsigned aNThreads ) override;
- bool joinWorkers() override;
-
- void stopWorkers() override;
-
- /**
- * Function loader_job
- * loads footprints from m_queue_in.
- */
- void loader_job();
-
public:
FOOTPRINT_LIST_IMPL();
virtual ~FOOTPRINT_LIST_IMPL();
@@ -122,6 +92,36 @@ public:
bool ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* aNickname = nullptr,
PROGRESS_REPORTER* aProgressReporter = nullptr ) override;
+
+protected:
+ void startWorkers( FP_LIB_TABLE* aTable, wxString const* aNickname,
+ FOOTPRINT_ASYNC_LOADER* aLoader, unsigned aNThreads ) override;
+ bool joinWorkers() override;
+
+ void stopWorkers() override;
+
+ /**
+ * Load footprints from m_queue_in.
+ */
+ void loader_job();
+
+private:
+ /**
+ * Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors.
+ *
+ * @return true if no error occurred.
+ */
+ bool CatchErrors( const std::function& aFunc );
+
+ FOOTPRINT_ASYNC_LOADER* m_loader;
+ std::vector m_threads;
+ SYNC_QUEUE m_queue_in;
+ SYNC_QUEUE m_queue_out;
+ std::atomic_size_t m_count_finished;
+ long long m_list_timestamp;
+ PROGRESS_REPORTER* m_progress_reporter;
+ std::atomic_bool m_cancelled;
+ std::mutex m_join;
};
extern FOOTPRINT_LIST_IMPL GFootprintList; // KIFACE scope.
diff --git a/pcbnew/footprint_wizard.h b/pcbnew/footprint_wizard.h
index f5a5cada44..d9d10b26d1 100644
--- a/pcbnew/footprint_wizard.h
+++ b/pcbnew/footprint_wizard.h
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2013 NBEE Embedded Systems SL, Miguel Angel Ajo
- * Copyright (C) 2013-2020 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 2013-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -46,8 +46,7 @@ const wxString WIZARD_PARAM_UNITS_PERCENT = "%"; // Percent (0% -> 1
const wxString WIZARD_PARAM_UNITS_STRING = "string"; // String
/**
- * FOOTPRINT_WIZARD
- * This is the parent class from where any footprint wizard class must derive
+ * The parent class from where any footprint wizard class must derive.
*/
class FOOTPRINT_WIZARD
{
@@ -56,113 +55,98 @@ public:
virtual ~FOOTPRINT_WIZARD();
/**
- * Function GetName
- * @return the name of the wizard
+ * @return the name of the wizard.
*/
virtual wxString GetName() = 0;
/**
- * Function GetImage
- * @return an svg image of the wizard to be rendered
+ * @return an svg image of the wizard to be rendered.
*/
virtual wxString GetImage() = 0;
/**
- * Function GetDescription
- * @return a description of the footprint wizard
+ * @return a description of the footprint wizard.
*/
virtual wxString GetDescription() = 0;
/**
- * Function GetNumParameterPages
- * @return the number of parameter pages that this wizard will show to the user
+ * @return the number of parameter pages that this wizard will show to the user.
*/
virtual int GetNumParameterPages() = 0;
/**
- * Function GetParameterPageName
- * @param aPage is the page we want the name of
- * @return a string with the page name
+ * @param aPage is the page we want the name of.
+ * @return a string with the page name.
*/
virtual wxString GetParameterPageName( int aPage ) = 0;
/**
- * Function GetParameterNames
- * @param aPage is the page we want the parameter names of
- * @return an array string with the parameter names on a certain page
+ * @param aPage is the page we want the parameter names of.
+ * @return an array string with the parameter names on a certain page.
*/
virtual wxArrayString GetParameterNames( int aPage ) = 0;
/**
- * Function GetParameterTypes
- * @param aPage is the page we want the parameter types of
+ * @param aPage is the page we want the parameter types of.
* @return an array string with the parameter types on a certain page
- * "IU" for internal units, "UNITS" for units (0,1,2,3...,N)
+ * "IU" for internal units, "UNITS" for units (0,1,2,3...,N).
*/
virtual wxArrayString GetParameterTypes( int aPage ) = 0;
/**
- * Function GetParameterValues
- * @param aPage is the page we want the parameter values of
- * @return an array of parameter values
+ * @param aPage is the page we want the parameter values of.
+ * @return an array of parameter values.
*/
virtual wxArrayString GetParameterValues( int aPage ) = 0;
/**
- * Function GetParameterErrors
- * @param aPage is the page we want to know the errors of
- * @return an array of errors (if any) for the parameters, empty strings for OK parameters
+ * @param aPage is the page we want to know the errors of.
+ * @return an array of errors (if any) for the parameters, empty strings for OK parameters.
*/
virtual wxArrayString GetParameterErrors( int aPage ) = 0;
/**
- * Function GetParameterHints
- * @param aPage is the page we want to know the hints of
- * @return an array of hints (if any) for the parameters, empty string for no hints
+ * @param aPage is the page we want to know the hints of.
+ * @return an array of hints (if any) for the parameters, empty string for no hints.
*/
virtual wxArrayString GetParameterHints( int aPage ) = 0;
/**
- * Function GetParamaterDesignators
- * @param aPage is the page we want to know the designators of
- * @return an array of designators (blank strings for no designators
+ * @param aPage is the page we want to know the designators of.
+ * @return an array of designators (blank strings for no designators.
*/
virtual wxArrayString GetParameterDesignators( int aPage ) = 0;
/**
- * Function SetParameterValues
- * @param aPage is the page we want to set the parameters in
- * @param aValues are the values we want to set into the parameters
- * @return an array of parameter values
+ * @param aPage is the page we want to set the parameters in.
+ * @param aValues are the values we want to set into the parameters.
+ * @return an array of parameter values.
*/
virtual wxString SetParameterValues( int aPage, wxArrayString& aValues ) = 0;
/**
- * Function ResetParameters
- * Reset all wizard parameters to default values
+ * Reset all wizard parameters to default values.
*/
virtual void ResetParameters() = 0;
/**
- * Function GetFootprint
- * This method builds the footprint itself and returns it to the caller function
- * @return PCB footprint built from the parameters given to the class
- * @param aMessage a wxString to store messages (if any) generated by the
- * footprint generator
+ * Build the footprint itself and returns it to the caller function.
+ *
+ * @param aMessage is storage for messages (if any) generated by the footprint generator.
+ * @return a footprint built from the parameters given to the class.
*/
virtual FOOTPRINT* GetFootprint( wxString* aMessage ) = 0;
/**
- * Function GetObject
- * This method gets the pointer to the object from where this wizard constructs
- * @return it's a void pointer, as it could be a PyObject or any other
+ * Get the object from where this wizard constructs.
+ *
+ * @return it's a void pointer as it could be a PyObject or any other.
*/
virtual void* GetObject() = 0;
/**
- * Function register_wizard
- * It's the standard method of a "FOOTPRINT_WIZARD" to register itself into
+ * The standard method of a "FOOTPRINT_WIZARD" to register itself into
* the FOOTPRINT_WIZARD_LIST singleton manager
*/
void register_wizard();
@@ -171,54 +155,50 @@ public:
class FOOTPRINT_WIZARD_LIST
{
-private:
- /**
- * FOOTPRINT_WIZARD system wide static list
- */
- static std::vector m_FootprintWizards;
-
public:
/**
- * Function register_wizard
* A footprint wizard calls this static method when it wants to register itself
- * into the system wizards
- * Note: if it is already registered, this function do nothing
- * if n existing wizard with the same name exists, this existing wizard will be
- * unregistered.
- * @param aWizard is the footprint wizard to be registered
+ * into the system wizards.
+ *
+ * @note If it is already registered, this function does nothing if an existing wizard
+ * with the same name exists, this existing wizard will be unregistered.
+ *
+ * @param aWizard is the footprint wizard to be registered.
*/
static void register_wizard( FOOTPRINT_WIZARD* aWizard );
/**
- * Function deregister_object
- * Anyone calls this method to deregister an object which builds a wizard,
- * it will lookup on the vector calling GetObject until find, then removed
- * and deleted
+ * Unregister an object which builds a wizard.
*
- * @param aObject is the footprint wizard object to be deregistered
+ * Lookup in the vector calling GetObject until find, then removed and deleted.
+ *
+ * @param aObject is the footprint wizard object to be unregistered.
*/
static bool deregister_object( void* aObject );
/**
- * Function GetWizard
- * @param aName is the footprint wizard name
+ * @param aName is the footprint wizard name.
* @return a wizard object by it's name or NULL if it isn't available.
*/
static FOOTPRINT_WIZARD* GetWizard( const wxString& aName );
/**
- * Function GetWizard
+ * @param aIndex is the wizard index in list.
* @return a wizard object by it's number or NULL if it isn't available.
- * @param aIndex is the wizard index in list
*/
static FOOTPRINT_WIZARD* GetWizard( int aIndex );
/**
- * Function GetWizardsCount
* @return the number of wizards available into the system
*/
static int GetWizardsCount();
+
+private:
+ /**
+ * FOOTPRINT_WIZARD system wide static list
+ */
+ static std::vector m_FootprintWizards;
};
#endif /* PCBNEW_FOOTPRINT_WIZARDS_H */
diff --git a/pcbnew/footprint_wizard_frame.h b/pcbnew/footprint_wizard_frame.h
index 5828006e86..1a630e45c3 100644
--- a/pcbnew/footprint_wizard_frame.h
+++ b/pcbnew/footprint_wizard_frame.h
@@ -49,31 +49,9 @@ enum WizardParameterColumnNames
WIZ_COL_UNITS
};
-/**
- * FOOTPRINT_WIZARD_FRAME
- */
class FOOTPRINT_WIZARD_FRAME : public PCB_BASE_EDIT_FRAME
{
-private:
- wxPanel* m_parametersPanel; ///< Panel for the page list and parameter grid
- wxListBox* m_pageList; ///< The list of pages
- WX_GRID* m_parameterGrid; ///< The list of parameters
- int m_parameterGridPage; ///< the page currently displayed by m_parameterGrid
- ///< it is most of time the m_pageList selection, but
- ///< can differ during transitions between pages.
- wxTextCtrl* m_buildMessageBox;
-
- wxString m_auiPerspective; ///< Encoded string describing the AUI layout
-
- bool m_wizardListShown; ///< A show-once flag for the wizard list
-
-protected:
- wxString m_wizardName; ///< name of the current wizard
- wxString m_wizardDescription; ///< description of the wizard
- wxString m_wizardStatus; ///< current wizard status
-
public:
-
FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* parent, FRAME_T aFrameType );
~FOOTPRINT_WIZARD_FRAME();
@@ -205,6 +183,24 @@ private:
void OnEditItemRequest( BOARD_ITEM* aItem ) override {}
DECLARE_EVENT_TABLE()
+
+protected:
+ wxString m_wizardName; ///< name of the current wizard
+ wxString m_wizardDescription; ///< description of the wizard
+ wxString m_wizardStatus; ///< current wizard status
+
+private:
+ wxPanel* m_parametersPanel; ///< Panel for the page list and parameter grid
+ wxListBox* m_pageList; ///< The list of pages
+ WX_GRID* m_parameterGrid; ///< The list of parameters
+ int m_parameterGridPage; ///< the page currently displayed by m_parameterGrid
+ ///< it is most of time the m_pageList selection, but
+ ///< can differ during transitions between pages.
+ wxTextCtrl* m_buildMessageBox;
+
+ wxString m_auiPerspective; ///< Encoded string describing the AUI layout
+
+ bool m_wizardListShown; ///< A show-once flag for the wizard list
};
diff --git a/pcbnew/pcb_layer_box_selector.h b/pcbnew/pcb_layer_box_selector.h
index cecf984796..70287daa05 100644
--- a/pcbnew/pcb_layer_box_selector.h
+++ b/pcbnew/pcb_layer_box_selector.h
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012-2015 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
- * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -34,27 +34,18 @@ class PCB_BASE_FRAME;
*/
class PCB_LAYER_BOX_SELECTOR : public LAYER_BOX_SELECTOR
{
- PCB_BASE_FRAME* m_boardFrame;
-
- LSET m_layerMaskDisable; // A mask to remove some (not allowed) layers
- // from layer list
- bool m_showNotEnabledBrdlayers; // true to list all allowed layers
- // (with not activated layers flagged)
- wxString m_undefinedLayerName; // if not empty add an item with this name which sets
- // the layer to UNDEFINED_LAYER
-
public:
// If you are thinking the constructor is a bit curious, just remember it is automatically
// generated when used in wxFormBuilder files, and so must have the same signature as the
// wxBitmapComboBox constructor. In particular, value and style are not used by this class.
PCB_LAYER_BOX_SELECTOR( wxWindow* parent, wxWindowID id,
- const wxString& value = wxEmptyString,
- const wxPoint& pos = wxDefaultPosition,
- const wxSize& size = wxDefaultSize,
- int n = 0, const wxString choices[] = NULL, int style = 0 ) :
+ const wxString& value = wxEmptyString,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int n = 0, const wxString choices[] = nullptr, int style = 0 ) :
LAYER_BOX_SELECTOR( parent, id, pos, size, n, choices )
{
- m_boardFrame = NULL;
+ m_boardFrame = nullptr;
m_showNotEnabledBrdlayers = false;
}
@@ -63,7 +54,7 @@ public:
// use with wxFormBuilder.
void SetBoardFrame( PCB_BASE_FRAME* aFrame ) { m_boardFrame = aFrame; };
- // SetLayerSet allows disableing some layers, which are not shown in list
+ // SetLayerSet allows disabling some layers, which are not shown in list
void SetNotAllowedLayerSet( LSET aMask ) { m_layerMaskDisable = aMask; }
// If the UNDEFINED_LAYER should be selectable, give it a name here. Usually either
@@ -74,7 +65,7 @@ public:
void Resync() override;
// Allow (or not) the layers not activated for the current board to be shown in layer
- // selector. Not actavated layers have their names appended with "(not activated)".
+ // selector. Not activated layers have their names appended with "(not activated)".
void ShowNonActivatedLayers( bool aShow ) { m_showNotEnabledBrdlayers = aShow; }
private:
@@ -88,6 +79,15 @@ private:
wxString getLayerName( LAYER_NUM aLayer ) const override;
LSET getEnabledLayers() const;
+
+ PCB_BASE_FRAME* m_boardFrame;
+
+ LSET m_layerMaskDisable; // A mask to remove some (not allowed) layers
+ // from layer list
+ bool m_showNotEnabledBrdlayers; // true to list all allowed layers
+ // (with not activated layers flagged)
+ wxString m_undefinedLayerName; // if not empty add an item with this name which sets
+ // the layer to UNDEFINED_LAYER
};
#endif // PCB_LAYER_BOX_SELECTOR_H
diff --git a/pcbnew/pcb_plot_params.h b/pcbnew/pcb_plot_params.h
index 635e50d20c..c01abeb251 100644
--- a/pcbnew/pcb_plot_params.h
+++ b/pcbnew/pcb_plot_params.h
@@ -31,12 +31,10 @@ class COLOR_SETTINGS;
class PCB_PLOT_PARAMS_PARSER;
/**
- * PCB_PLOT_PARAMS
- * handles plot parameters and options when plotting/printing a board.
+ * Parameters and options when plotting/printing a board.
*/
class PCB_PLOT_PARAMS
{
- friend class PCB_PLOT_PARAMS_PARSER;
public:
enum DrillMarksType {
NO_DRILL_SHAPE = 0,
@@ -44,149 +42,6 @@ public:
FULL_DRILL_SHAPE = 2
};
-private:
- // If true, do not plot NPTH pads
- // (mainly used to disable NPTH pads plotting on copper layers)
- bool m_skipNPTH_Pads;
-
- /** FILLED or SKETCH selects how to plot filled objects.
- * FILLED or SKETCH not available with all drivers: some have fixed mode
- */
- OUTLINE_MODE m_plotMode;
-
- /** DXF format: Plot items in outline (polygon) mode
- * In polygon mode, each item to plot is converted to a polygon, and all
- * polygons are merged.
- */
- bool m_DXFplotPolygonMode;
-
- /**
- * DXF format: Units to use when plotting the DXF
- */
- DXF_UNITS m_DXFplotUnits;
-
- /// Plot format type (chooses the driver to be used)
- PLOT_FORMAT m_format;
-
- /// Holes can be not plotted, have a small mark or plotted in actual size
- DrillMarksType m_drillMarks;
-
- /// Choose how represent text with PS, PDF and DXF drivers
- PLOT_TEXT_MODE m_textMode;
-
- /// When true set the scale to fit the board in the page
- bool m_autoScale;
-
- /// Global scale factor, 1.0 plots a board with its actual size.
- double m_scale;
-
- /// Mirror the plot around the X axis
- bool m_mirror;
-
- /// Plot in negative color (supported only by some drivers)
- bool m_negative;
-
- /// True if vias are drawn on Mask layer (ie untented, *exposed* by mask)
- bool m_plotViaOnMaskLayer;
-
- /// True to plot/print frame references
- bool m_plotFrameRef;
-
- /// If false always plot (merge) the pcb edge layer on other layers
- bool m_excludeEdgeLayer;
-
- /// Set of layers to plot
- LSET m_layerSelection;
-
- /** When plotting gerber files, use a conventional set of Protel extensions
- * instead of .gbr, that is now the offical gerber file extension
- * this is a deprecated feature
- */
- bool m_useGerberProtelExtensions;
-
- /// Include attributes from the Gerber X2 format (chapter 5 in revision J2)
- bool m_useGerberX2format;
-
- /// Disable aperure macros in Gerber format (only for broken Gerber readers)
- /// Ideally, should be never selected.
- bool m_gerberDisableApertMacros;
-
- /// Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
- bool m_includeGerberNetlistInfo;
-
- /// generate the auxiliary "job file" in gerber format
- bool m_createGerberJobFile;
-
- /// precision of coordinates in Gerber files: accepted 5 or 6
- /// when units are in mm (6 or 7 in inches, but Pcbnew uses mm).
- /// 6 is the internal resolution of Pcbnew, but not alwys accepted by board maker
- /// 5 is the minimal value for professional boards.
- int m_gerberPrecision;
-
- /// precision of coordinates in SVG files: accepted 3 - 6
- /// 6 is the internal resolution of Pcbnew
- unsigned m_svgPrecision;
-
- /// units for SVG plot
- /// false for metric, true for inch/mils
- bool m_svgUseInch;
-
- /// Plot gerbers using auxiliary (drill) origin instead of absolue coordinates
- bool m_useAuxOrigin;
-
- /// On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
- bool m_subtractMaskFromSilk;
-
- /// Autoscale the plot to fit an A4 (landscape?) sheet
- bool m_A4Output;
-
- /// Scale ratio index (UI only)
- int m_scaleSelection;
-
- /// Output directory for plot files (usually relative to the board file)
- wxString m_outputDirectory;
-
- /// Enable plotting of part references
- bool m_plotReference;
-
- /// Enable plotting of part values
- bool m_plotValue;
-
- /// Force plotting of fields marked invisible
- bool m_plotInvisibleText;
-
- /// Plots pads outlines on fab layers
- bool m_sketchPadsOnFabLayers;
- int m_sketchPadLineWidth;
-
- /* These next two scale factors are intended to compensate plotters
- * (mainly printers) X and Y scale error. Therefore they are expected very
- * near 1.0; only X and Y dimensions are adjusted: circles are plotted as
- * circles, even if X and Y fine scale differ; because of this it is mostly
- * useful for printers: postscript plots would be best adjusted using
- * the prologue (that would change the whole output matrix
- */
-
- double m_fineScaleAdjustX; ///< fine scale adjust X axis
- double m_fineScaleAdjustY; ///< fine scale adjust Y axis
-
- /** This width factor is intended to compensate PS printers/ plotters that do
- * not strictly obey line width settings. Only used to plot pads and tracks
- */
- int m_widthAdjust;
-
- int m_HPGLPenNum; ///< HPGL only: pen number selection(1 to 9)
- int m_HPGLPenSpeed; ///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
- double m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, useful to fill areas
- ///< However, it is in mm in hpgl files.
-
- /// Pointer to active color settings to be used for plotting
- COLOR_SETTINGS* m_colors;
-
- /// Dummy colors object that can be created if there is no Pgm context
- std::shared_ptr m_default_colors;
-
-public:
PCB_PLOT_PARAMS();
void SetSkipPlotNPTH_Pads( bool aSkip ) { m_skipNPTH_Pads = aSkip; }
@@ -196,11 +51,12 @@ public:
void Parse( PCB_PLOT_PARAMS_PARSER* aParser );
/**
- * Compare current settings to aPcbPlotParams, including not saved parameters in brd file
- * @param aPcbPlotParams = the PCB_PLOT_PARAMS to compare
- * @param aCompareOnlySavedPrms = true to compare only saved in file parameters,
- * and false to compare the full set of parameters.
- * @return true is parameters are same, false if one (or more) parameter does not match
+ * Compare current settings to aPcbPlotParams, including not saved parameters in brd file.
+ *
+ * @param aPcbPlotParams is the #PCB_PLOT_PARAMS to compare/
+ * @param aCompareOnlySavedPrms set to true to compare only saved in file parameters,
+ * or false to compare the full set of parameters.
+ * @return true is parameters are same, false if one (or more) parameter does not match.
*/
bool IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams ) const;
@@ -305,9 +161,11 @@ public:
unsigned GetSvgPrecision() const { return m_svgPrecision; }
bool GetSvgUseInch() const { return m_svgUseInch; }
- /** Default precision of coordinates in Gerber files.
- * when units are in mm (7 in inches, but Pcbnew uses mm).
- * 6 is the internal resolution of Pcbnew, so the default is 6
+ /**
+ * Default precision of coordinates in Gerber files.
+ *
+ * When units are in mm (7 in inches, but Pcbnew uses mm).
+ * 6 is the internal resolution of Pcbnew, so the default is 6.
*/
static int GetGerberDefaultPrecision() { return 6; }
@@ -337,6 +195,154 @@ public:
void SetHPGLPenNum( int aVal ) { m_HPGLPenNum = aVal; }
int GetHPGLPenNum() const { return m_HPGLPenNum; }
+
+private:
+ friend class PCB_PLOT_PARAMS_PARSER;
+
+ // If true, do not plot NPTH pads
+ // (mainly used to disable NPTH pads plotting on copper layers)
+ bool m_skipNPTH_Pads;
+
+ /**
+ * FILLED or SKETCH selects how to plot filled objects.
+ *
+ * FILLED or SKETCH not available with all drivers: some have fixed mode
+ */
+ OUTLINE_MODE m_plotMode;
+
+ /**
+ * DXF format: Plot items in outline (polygon) mode.
+ *
+ * In polygon mode, each item to plot is converted to a polygon and all polygons are merged.
+ */
+ bool m_DXFplotPolygonMode;
+
+ /**
+ * DXF format: Units to use when plotting the DXF
+ */
+ DXF_UNITS m_DXFplotUnits;
+
+ /// Plot format type (chooses the driver to be used)
+ PLOT_FORMAT m_format;
+
+ /// Holes can be not plotted, have a small mark or plotted in actual size
+ DrillMarksType m_drillMarks;
+
+ /// Choose how represent text with PS, PDF and DXF drivers
+ PLOT_TEXT_MODE m_textMode;
+
+ /// When true set the scale to fit the board in the page
+ bool m_autoScale;
+
+ /// Global scale factor, 1.0 plots a board with its actual size.
+ double m_scale;
+
+ /// Mirror the plot around the X axis
+ bool m_mirror;
+
+ /// Plot in negative color (supported only by some drivers)
+ bool m_negative;
+
+ /// True if vias are drawn on Mask layer (ie untented, *exposed* by mask)
+ bool m_plotViaOnMaskLayer;
+
+ /// True to plot/print frame references
+ bool m_plotFrameRef;
+
+ /// If false always plot (merge) the pcb edge layer on other layers
+ bool m_excludeEdgeLayer;
+
+ /// Set of layers to plot
+ LSET m_layerSelection;
+
+ /** When plotting gerber files, use a conventional set of Protel extensions
+ * instead of .gbr, that is now the official gerber file extension
+ * this is a deprecated feature
+ */
+ bool m_useGerberProtelExtensions;
+
+ /// Include attributes from the Gerber X2 format (chapter 5 in revision J2)
+ bool m_useGerberX2format;
+
+ /// Disable aperture macros in Gerber format (only for broken Gerber readers)
+ /// Ideally, should be never selected.
+ bool m_gerberDisableApertMacros;
+
+ /// Include netlist info (only in Gerber X2 format) (chapter ? in revision ?)
+ bool m_includeGerberNetlistInfo;
+
+ /// generate the auxiliary "job file" in gerber format
+ bool m_createGerberJobFile;
+
+ /// precision of coordinates in Gerber files: accepted 5 or 6
+ /// when units are in mm (6 or 7 in inches, but Pcbnew uses mm).
+ /// 6 is the internal resolution of Pcbnew, but not always accepted by board maker
+ /// 5 is the minimal value for professional boards.
+ int m_gerberPrecision;
+
+ /// precision of coordinates in SVG files: accepted 3 - 6
+ /// 6 is the internal resolution of Pcbnew
+ unsigned m_svgPrecision;
+
+ /// units for SVG plot
+ /// false for metric, true for inch/mils
+ bool m_svgUseInch;
+
+ /// Plot gerbers using auxiliary (drill) origin instead of absolute coordinates
+ bool m_useAuxOrigin;
+
+ /// On gerbers 'scrape' away the solder mask from silkscreen (trim silks)
+ bool m_subtractMaskFromSilk;
+
+ /// Autoscale the plot to fit an A4 (landscape?) sheet
+ bool m_A4Output;
+
+ /// Scale ratio index (UI only)
+ int m_scaleSelection;
+
+ /// Output directory for plot files (usually relative to the board file)
+ wxString m_outputDirectory;
+
+ /// Enable plotting of part references
+ bool m_plotReference;
+
+ /// Enable plotting of part values
+ bool m_plotValue;
+
+ /// Force plotting of fields marked invisible
+ bool m_plotInvisibleText;
+
+ /// Plots pads outlines on fab layers
+ bool m_sketchPadsOnFabLayers;
+ int m_sketchPadLineWidth;
+
+ /* These next two scale factors are intended to compensate plotters
+ * (mainly printers) X and Y scale error. Therefore they are expected very
+ * near 1.0; only X and Y dimensions are adjusted: circles are plotted as
+ * circles, even if X and Y fine scale differ; because of this it is mostly
+ * useful for printers: postscript plots would be best adjusted using
+ * the prologue (that would change the whole output matrix
+ */
+
+ double m_fineScaleAdjustX; ///< fine scale adjust X axis
+ double m_fineScaleAdjustY; ///< fine scale adjust Y axis
+
+ /**
+ * This width factor is intended to compensate PS printers/ plotters that do
+ * not strictly obey line width settings. Only used to plot pads and tracks.
+ */
+ int m_widthAdjust;
+
+ int m_HPGLPenNum; ///< HPGL only: pen number selection(1 to 9)
+ int m_HPGLPenSpeed; ///< HPGL only: pen speed, always in cm/s (1 to 99 cm/s)
+ double m_HPGLPenDiam; ///< HPGL only: pen diameter in MILS, useful to fill areas
+ ///< However, it is in mm in hpgl files.
+
+ /// Pointer to active color settings to be used for plotting
+ COLOR_SETTINGS* m_colors;
+
+ /// Dummy colors object that can be created if there is no Pgm context
+ std::shared_ptr m_default_colors;
};
diff --git a/pcbnew/pcb_shape.h b/pcbnew/pcb_shape.h
index 91a11643aa..264811334c 100644
--- a/pcbnew/pcb_shape.h
+++ b/pcbnew/pcb_shape.h
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 Jean-Pierre Charras jp.charras at wanadoo.fr
- * Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -41,26 +41,6 @@ class MSG_PANEL_ITEM;
class PCB_SHAPE : public BOARD_ITEM
{
-protected:
- int m_width; // thickness of lines ...
- bool m_filled; // Pretty much what it says on the tin...
- wxPoint m_start; // Line start point or Circle and Arc center
- wxPoint m_end; // Line end point or circle and arc start point
- wxPoint m_thirdPoint; // Used only for Arcs: arc end point
-
- PCB_SHAPE_TYPE m_shape; // Shape: line, Circle, Arc
- double m_angle; // Used only for Arcs: Arc angle in 1/10 deg
- wxPoint m_bezierC1; // Bezier Control Point 1
- wxPoint m_bezierC2; // Bezier Control Point 2
-
- std::vector m_bezierPoints;
- SHAPE_POLY_SET m_poly; // Stores the S_POLYGON shape
-
- // Computes the bounding box for an arc
- void computeArcBBox( EDA_RECT& aBBox ) const;
-
- const std::vector buildBezierToSegmentsPointsList( int aMinSegLen ) const;
-
public:
PCB_SHAPE( BOARD_ITEM* aParent = NULL, KICAD_T idtype = PCB_SHAPE_T );
@@ -117,10 +97,11 @@ public:
int GetWidth() const { return m_width; }
/**
- * Sets the angle for arcs, and normalizes it within the range 0 - 360 degrees.
+ * Set the angle for arcs, and normalizes it within the range 0 - 360 degrees.
+ *
* @param aAngle is tenths of degrees, but will soon be degrees.
- * @param aUpdateEnd = true to update also arc end coordinates m_thirdPoint,
- * so must be called after setting m_Start and m_End
+ * @param aUpdateEnd set to true to update also arc end coordinates m_thirdPoint,
+ * so must be called after setting m_Start and m_End.
*/
virtual void SetAngle( double aAngle, bool aUpdateEnd = true );
double GetAngle() const { return m_angle; }
@@ -138,8 +119,7 @@ public:
wxPoint GetPosition() const override;
/**
- * Function GetStart
- * returns the starting point of the graphic
+ * Return the starting point of the graphic.
*/
const wxPoint& GetStart() const { return m_start; }
int GetStartY() { return m_start.y; }
@@ -149,8 +129,7 @@ public:
void SetStartX( int x ) { m_start.x = x; }
/**
- * Function GetEnd
- * returns the ending point of the graphic
+ * Return the ending point of the graphic.
*/
const wxPoint& GetEnd() const { return m_end; }
int GetEndY() { return m_end.y; }
@@ -181,27 +160,26 @@ public:
std::vector GetRectCorners() const;
/**
- * function GetArcAngleStart()
- * @return the angle of the starting point of this arc, between 0 and 3600 in 0.1 deg
+ * @return the angle of the starting point of this arc, between 0 and 3600 in 0.1 deg.
*/
double GetArcAngleStart() const;
/**
- * function GetArcAngleEnd()
- * @return the angle of the ending point of this arc, between 0 and 3600 in 0.1 deg
+ * @return the angle of the ending point of this arc, between 0 and 3600 in 0.1 deg.
*/
double GetArcAngleEnd() const;
/**
- * Function GetRadius
- * returns the radius of this item
- * Has meaning only for arc and circle
+ * Return the radius of this item.
+ *
+ * Has meaning only for arcs and circles.
*/
int GetRadius() const;
/**
- * Initialize the start arc point. can be used for circles
- * to initialize one point of the cicumference
+ * Initialize the start arc point.
+ *
+ * Can be used for circles to initialize one point of the cicumference.
*/
void SetArcStart( const wxPoint& aArcStartPoint )
{
@@ -209,16 +187,15 @@ public:
}
/**
- * Initialize the end arc point. can be used for circles
- * to initialize one point of the cicumference
+ * Initialize the end arc point.
+ *
+ * Can be used for circles to initialize one point of the cicumference.
*/
void SetArcEnd( const wxPoint& aArcEndPoint )
{
m_thirdPoint = aArcEndPoint;
}
- /** For arcs and circles:
- */
void SetCenter( const wxPoint& aCenterPoint ) { m_start = aCenterPoint; }
/**
@@ -235,17 +212,18 @@ public:
}
/**
- * Function GetParentFootprint
- * returns a pointer to the parent footprint, or NULL if PCB_SHAPE does not
- * belong to a footprint.
- * @return FOOTPRINT* - pointer to the parent footprint or NULL.
+ * Return the parent footprint or NULL if PCB_SHAPE does not belong to a footprint.
+ *
+ * @return the parent footprint or NULL.
*/
FOOTPRINT* GetParentFootprint() const;
// Accessors:
const std::vector& GetBezierPoints() const { return m_bezierPoints; }
- /** Build and return the list of corners in a std::vector
+ /**
+ * Build and return the list of corners in a std::vector
+ *
* It must be used only to convert the SHAPE_POLY_SET internal corner buffer
* to a list of wxPoints, and nothing else, because it duplicates the buffer,
* that is inefficient to know for instance the corner count
@@ -273,20 +251,22 @@ public:
m_bezierPoints = aPoints;
}
- /** Rebuild the m_BezierPoints vertex list that approximate the Bezier curve
- * by a list of segments
- * Has meaning only for S_CURVE DRAW_SEGMENT shape
- * @param aMinSegLen is the min length of segments approximating the shape.
- * the last segment can be shorter
- * This param avoid having too many very short segment in list.
- * a good value is m_Width/2 to m_Width
+ /**
+ * Rebuild the m_BezierPoints vertex list that approximate the Bezier curve
+ * by a list of segments.
+ *
+ * Has meaning only for S_CURVE DRAW_SEGMENT shape.
+ *
+ * @param aMinSegLen is the min length of segments approximating the he. shape last segment
+ * can be shorter. This parameter avoids having too many very short segment in list.
+ * A good value is m_Width/2 to m_Width.
*/
void RebuildBezierToSegmentsPointsList( int aMinSegLen );
void SetPolyPoints( const std::vector& aPoints );
/**
- * Makes a set of SHAPE objects representing the PCB_SHAPE. Caller owns the objects.
+ * Make a set of SHAPE objects representing the PCB_SHAPE. Caller owns the objects.
*/
std::vector MakeEffectiveShapes() const; // fixme: move to shape_compound
std::shared_ptr GetEffectiveShape( PCB_LAYER_ID aLayer = UNDEFINED_LAYER ) const override;
@@ -304,11 +284,11 @@ public:
}
/**
- * Function GetLength
- * returns the length of the track using the hypotenuse calculation.
- * @return double - the length of the track
+ * Return the length of the track using the hypotenuse calculation.
+ *
+ * @return the length of the track
*/
- double GetLength() const;
+ double GetLength() const;
virtual void Move( const wxPoint& aMoveVector ) override;
@@ -319,15 +299,15 @@ public:
void Scale( double aScale );
/**
- * Function TransformShapeWithClearanceToPolygon
- * Convert the draw segment to a closed polygon
- * Used in filling zones calculations
- * Circles and arcs are approximated by segments
- * @param aCornerBuffer = a buffer to store the polygon
- * @param aClearanceValue = the clearance around the pad
- * @param aError = the maximum deviation from a true arc
- * @param ignoreLineWidth = used for edge cut items where the line width is only
- * for visualization
+ * Convert the draw segment to a closed polygon.
+ *
+ * Used in filling zones calculations. Circles and arcs are approximated by segments.
+ *
+ * @param aCornerBuffer is a buffer to store the polygon.
+ * @param aClearanceValue is the clearance around the pad.
+ * @param aError is the maximum deviation from a true arc.
+ * @param ignoreLineWidth is used for edge cut items where the line width is only
+ * for visualization
*/
void TransformShapeWithClearanceToPolygon( SHAPE_POLY_SET& aCornerBuffer,
PCB_LAYER_ID aLayer, int aClearanceValue,
@@ -352,6 +332,26 @@ public:
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
#endif
+
+protected:
+ // Compute the bounding box for an arc
+ void computeArcBBox( EDA_RECT& aBBox ) const;
+
+ const std::vector buildBezierToSegmentsPointsList( int aMinSegLen ) const;
+
+ int m_width; // thickness of lines ...
+ bool m_filled; // Pretty much what it says on the tin...
+ wxPoint m_start; // Line start point or Circle and Arc center
+ wxPoint m_end; // Line end point or circle and arc start point
+ wxPoint m_thirdPoint; // Used only for Arcs: arc end point
+
+ PCB_SHAPE_TYPE m_shape; // Shape: line, Circle, Arc
+ double m_angle; // Used only for Arcs: Arc angle in 1/10 deg
+ wxPoint m_bezierC1; // Bezier Control Point 1
+ wxPoint m_bezierC2; // Bezier Control Point 2
+
+ std::vector m_bezierPoints;
+ SHAPE_POLY_SET m_poly; // Stores the S_POLYGON shape
};
#endif // PCB_SHAPE_H
diff --git a/pcbnew/pcb_target.h b/pcbnew/pcb_target.h
index 6815c051b8..76545e1f5e 100644
--- a/pcbnew/pcb_target.h
+++ b/pcbnew/pcb_target.h
@@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
- * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -34,11 +34,6 @@ class LINE_READER;
class PCB_TARGET : public BOARD_ITEM
{
- int m_shape; // bit 0 : 0 = draw +, 1 = draw X
- int m_size;
- int m_lineWidth;
- wxPoint m_pos;
-
public:
PCB_TARGET( BOARD_ITEM* aParent );
@@ -104,6 +99,12 @@ public:
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
#endif
+
+private:
+ int m_shape; // bit 0 : 0 = draw +, 1 = draw X
+ int m_size;
+ int m_lineWidth;
+ wxPoint m_pos;
};
diff --git a/pcbnew/pcbplot.h b/pcbnew/pcbplot.h
index 2de7a71ad4..33f17ec388 100644
--- a/pcbnew/pcbplot.h
+++ b/pcbnew/pcbplot.h
@@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
- * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
+ * Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -60,10 +60,6 @@ class wxFileName;
// A helper class to plot board items
class BRDITEMS_PLOTTER : public PCB_PLOT_PARAMS
{
- PLOTTER* m_plotter;
- BOARD* m_board;
- LSET m_layerMask;
-
public:
BRDITEMS_PLOTTER( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS& aPlotOpts )
: PCB_PLOT_PARAMS( aPlotOpts )
@@ -105,45 +101,48 @@ public:
/**
* Plot a pad.
- * unlike other items, a pad had not a specific color,
- * and be drawn as a non filled item although the plot mode is filled
- * color and plot mode are needed by this function
+ *
+ * Unlike other items, a pad had not a specific color and be drawn as a non filled item
+ * although the plot mode is filled color and plot mode are needed by this function.
*/
void PlotPad( const PAD* aPad, COLOR4D aColor, OUTLINE_MODE aPlotMode );
/**
- * plot items like text and graphics,
- * but not tracks and footprints
+ * Plot items like text and graphics but not tracks and footprints.
*/
void PlotBoardGraphicItems();
- /** Function PlotDrillMarks
+ /**
* Draw a drill mark for pads and vias.
- * Must be called after all drawings, because it
- * redraw the drill mark on a pad or via, as a negative (i.e. white) shape in
- * FILLED plot mode (for PS and PDF outputs)
+ *
+ * Must be called after all drawings, because it redraws the drill mark on a pad or via, as
+ * a negative (i.e. white) shape in FILLED plot mode (for PS and PDF outputs).
*/
void PlotDrillMarks();
/**
- * Function getColor
- * @return the layer color
- * @param aLayer = the layer id
- * White color is special: cannot be seen on a white paper
- * and in B&W mode, is plotted as white but other colors are plotted in BLACK
- * so the returned color is LIGHTGRAY when the layer color is WHITE
+ * White color is special because it cannot be seen on a white paper in B&W mode. It is
+ * plotted as white but other colors are plotted in BLACK so the returned color is LIGHTGRAY
+ * when the layer color is WHITE.
+ *
+ * @param aLayer is the layer id.
+ * @return the layer color.
*/
COLOR4D getColor( LAYER_NUM aLayer ) const;
private:
- /** Helper function to plot a single drill mark. It compensate and clamp
- * the drill mark size depending on the current plot options
+ /**
+ * Helper function to plot a single drill mark.
+ *
+ * It compensate and clamp the drill mark size depending on the current plot options.
*/
- void plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape,
- const wxPoint& aDrillPos, wxSize aDrillSize,
- const wxSize& aPadSize,
+ void plotOneDrillMark( PAD_DRILL_SHAPE_T aDrillShape, const wxPoint& aDrillPos,
+ wxSize aDrillSize, const wxSize& aPadSize,
double aOrientation, int aSmallDrill );
+ PLOTTER* m_plotter;
+ BOARD* m_board;
+ LSET m_layerMask;
};
PLOTTER* StartPlotBoard( BOARD* aBoard,
@@ -153,27 +152,28 @@ PLOTTER* StartPlotBoard( BOARD* aBoard,
const wxString& aSheetDesc );
/**
- * Function PlotOneBoardLayer
- * main function to plot one copper or technical layer.
- * It prepare options and calls the specialized plot function,
- * according to the layer type
- * @param aBoard = the board to plot
- * @param aPlotter = the plotter to use
- * @param aLayer = the layer id to plot
- * @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only
+ * Plot one copper or technical layer.
+ *
+ * It prepares options and calls the specialized plot function according to the layer type.
+ *
+ * @param aBoard is the board to plot.
+ * @param aPlotter is the plotter to use.
+ * @param aLayer is the layer id to plot.
+ * @param aPlotOpt is the plot options (files, sketch). Has meaning for some formats only.
*/
void PlotOneBoardLayer( BOARD* aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer,
const PCB_PLOT_PARAMS& aPlotOpt );
/**
- * Function PlotStandardLayer
- * plot copper or technical layers.
- * not used for silk screen layers, because these layers have specific
- * requirements, mainly for pads
- * @param aBoard = the board to plot
- * @param aPlotter = the plotter to use
- * @param aLayerMask = the mask to define the layers to plot
- * @param aPlotOpt = the plot options (files, sketch). Has meaning for some formats only
+ * Plot copper or technical layers.
+ *
+ * This is not used for silk screen layers because these layers have specific requirements.
+ * This is mainly for pads.
+ *
+ * @param aBoard is the board to plot.
+ * @param aPlotter is the plotter to use.
+ * @param aLayerMask is the mask to define the layers to plot.
+ * @param aPlotOpt is the plot options (files, sketch). Has meaning for some formats only.
*
* aPlotOpt has 3 important options to control this plot,
* which are set, depending on the layer type to plot
@@ -183,34 +183,34 @@ void PlotOneBoardLayer( BOARD* aBoard, PLOTTER* aPlotter, PCB_LAYER_ID aLayer,
* SetSkipPlotNPTH_Pads( bool aSkip )
* aSkip = true to skip NPTH Pads, when the pad size and the pad hole
* have the same size. Used in GERBER format only.
- * SetDrillMarksType( DrillMarksType aVal ) controle the actual hole:
+ * SetDrillMarksType( DrillMarksType aVal ) control the actual hole:
* no hole, small hole, actual hole
*/
void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
const PCB_PLOT_PARAMS& aPlotOpt );
/**
- * Function PlotLayerOutlines
- * plot copper outline of a copper layer.
- * @param aBoard = the board to plot
- * @param aPlotter = the plotter to use
- * @param aLayerMask = the mask to define the layers to plot
- * @param aPlotOpt = the plot options. Has meaning for some formats only
+ * Plot copper outline of a copper layer.
+ *
+ * @param aBoard is the board to plot.
+ * @param aPlotter is the plotter to use.
+ * @param aLayerMask is the mask to define the layers to plot.
+ * @param aPlotOpt is the plot options. Has meaning for some formats only.
*/
void PlotLayerOutlines( BOARD* aBoard, PLOTTER* aPlotter,
LSET aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt );
/**
- * Function BuildPlotFileName (helper function)
- * Complete a plot filename: forces the output directory,
- * add a suffix to the name and sets the specified extension
- * the suffix is usually the layer name
- * replaces not allowed chars in suffix by '_'
- * @param aFilename = the wxFileName to initialize
- * Contains the base filename
- * @param aOutputDir = the path
- * @param aSuffix = the suffix to add to the base filename
- * @param aExtension = the file extension
+ * Complete a plot filename.
+ *
+ * It forces the output directory, adds a suffix to the name, and sets the specified extension.
+ * The suffix is usually the layer name and replaces illegal file name character in the suffix
+ * with an underscore character.
+ *
+ * @param aFilename is the file name to initialize that contains the base filename.
+ * @param aOutputDir is the path.
+ * @param aSuffix is the suffix to add to the base filename.
+ * @param aExtension is the file extension.
*/
void BuildPlotFileName( wxFileName* aFilename,
const wxString& aOutputDir,
@@ -219,56 +219,56 @@ void BuildPlotFileName( wxFileName* aFilename,
/**
- * Function GetGerberProtelExtension
* @return the appropriate Gerber file extension for \a aLayer
- * used by Protel, and still sometimes in use (although the
- * official Gerber Ext is now .gbr)
*/
const wxString GetGerberProtelExtension( LAYER_NUM aLayer );
/**
- * Function GetGerberFileFunctionAttribute
- * Returns the "file function" attribute for \a aLayer, as defined in the
- * Gerber file format specification J1 (chapter 5). The returned string includes
- * the "%TF.FileFunction" attribute prefix and the "*%" suffix.
- * @param aBoard = the board, needed to get the total count of copper layers
- * @param aLayer = the layer number to create the attribute for
+ * Return the "file function" attribute for \a aLayer, as defined in the
+ * Gerber file format specification J1 (chapter 5).
+ *
+ * The returned string includes the "%TF.FileFunction" attribute prefix and the "*%" suffix.
+ *
+ * @param aBoard is the board, needed to get the total count of copper layers.
+ * @param aLayer is the layer number to create the attribute for.
* @return The attribute, as a text string
*/
const wxString GetGerberFileFunctionAttribute( const BOARD* aBoard, LAYER_NUM aLayer );
/**
- * Calculates some X2 attributes, as defined in the
- * Gerber file format specification J4 (chapter 5) and add them
- * the to the gerber file header:
+ * Calculate some X2 attributes as defined in the Gerber file format specification J4
+ * (chapter 5) and add them the to the gerber file header.
+ *
* TF.GenerationSoftware
* TF.CreationDate
* TF.ProjectId
* file format attribute is not added
- * @param aPlotter = the current plotter.
- * @param aBoard = the board, needed to extract some info
- * @param aUseX1CompatibilityMode = false to generate X2 attributes, true to
- * use X1 compatibility (X2 attributes added as structured comments,
- * starting by "G04 #@! " followed by the X2 attribute
+ *
+ * @param aPlotter is the current plotter.
+ * @param aBoard is the board, needed to extract some info.
+ * @param aUseX1CompatibilityMode set to false to generate X2 attributes, true to
+ * use X1 compatibility (X2 attributes added as structured comments,
+ * starting by "G04 #@! " followed by the X2 attribute
*/
-void AddGerberX2Header( PLOTTER* aPlotter,
- const BOARD* aBoard, bool aUseX1CompatibilityMode = false );
+void AddGerberX2Header( PLOTTER* aPlotter, const BOARD* aBoard,
+ bool aUseX1CompatibilityMode = false );
/**
- * Calculates some X2 attributes, as defined in the Gerber file format
- * specification and add them to the gerber file header:
+ * Calculate some X2 attributes as defined in the Gerber file format specification and add them
+ * to the gerber file header.
+ *
* TF.GenerationSoftware
* TF.CreationDate
* TF.ProjectId
* TF.FileFunction
* TF.FilePolarity
*
- * @param aPlotter = the current plotter.
- * @param aBoard = the board, needed to extract some info
- * @param aLayer = the layer number to create the attribute for
- * @param aUseX1CompatibilityMode = false to generate X2 attributes, true to
- * use X1 compatibility (X2 attributes added as structured comments,
- * starting by "G04 #@! " followed by the X2 attribute
+ * @param aPlotter is the current plotter.
+ * @param aBoard is the board, needed to extract some info.
+ * @param aLayer is the layer number to create the attribute for.
+ * @param aUseX1CompatibilityMode set to false to generate X2 attributes, true to use X1
+ * compatibility (X2 attributes added as structured comments, starting by "G04 #@! "
+ * followed by the X2 attribute.
*/
void AddGerberX2Attribute( PLOTTER* aPlotter, const BOARD* aBoard,
LAYER_NUM aLayer, bool aUseX1CompatibilityMode );