22#ifndef _ODB_FEATURE_H_
23#define _ODB_FEATURE_H_
67 bool aMirror,
double aResize = 1.0 );
72 FILL_T aFillType = FILL_T::FILLED_SHAPE );
83 FILL_T aFillType = FILL_T::FILLED_SHAPE );
102 wxString sym =
"donut_r" + aOuterDim +
ODB_DIM_X + aInnerDim;
108 wxString sym =
"rect" + aWidth +
ODB_DIM_X + aHeight;
114 wxString sym =
"oval" + aWidth +
ODB_DIM_X + aHeight;
119 const wxString& aRadius )
126 const wxString& aLineWidth,
const wxString& aRadius )
128 wxString sym =
"donut_rc" + aOuterWidth +
ODB_DIM_X + aOuterHeight +
ODB_DIM_X + aLineWidth
134 const wxString& aRadius,
int aPositions )
155 uint32_t
GetSymbolIndex( std::map<wxString, uint32_t>& aSymMap,
const wxString& aKey )
157 if( aSymMap.count( aKey ) )
159 return aSymMap.at( aKey );
165 aSymMap.emplace( aKey, index );
182 template <
typename T,
typename... Args>
185 auto feature = std::make_unique<T>(
m_featuresList.size(), std::forward<Args>( args )... );
230 ODB_LINE( uint32_t aIndex,
const std::pair<wxString, wxString>& aStart,
231 const std::pair<wxString, wxString>& aEnd, uint32_t aSym ) :
243 std::pair<wxString, wxString>
m_end;
254 ODB_ARC( uint32_t aIndex,
const std::pair<wxString, wxString>& aStart,
255 const std::pair<wxString, wxString>& aEnd,
256 const std::pair<wxString, wxString>& aCenter, uint32_t aSym,
268 std::pair<wxString, wxString>
m_end;
277 ODB_PAD( uint32_t aIndex,
const std::pair<wxString, wxString>& aCenter, uint32_t aSym,
302 FILL_T aFillType = FILL_T::FILLED_SHAPE );
345 void WriteData( std::ostream& ost )
const;
Information pertinent to a Pcbnew printed circuit board.
void AddPadShape(const PAD &aPad, PCB_LAYER_ID aLayer)
uint32_t AddRoundRectDonutSymbol(const wxString &aOuterWidth, const wxString &aOuterHeight, const wxString &aLineWidth, const wxString &aRadius)
std::map< wxString, uint32_t > m_circleSymMap
void AddShape(const PCB_SHAPE &aShape, PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
uint32_t AddRectSymbol(const wxString &aWidth, const wxString &aHeight)
std::map< wxString, uint32_t > m_chamRectSymMap
void AddVia(const PCB_VIA *aVia, PCB_LAYER_ID aLayer)
std::map< wxString, uint32_t > m_rectSymMap
PCB_IO_ODBPP * GetODBPlugin()
void InitFeatureList(PCB_LAYER_ID aLayer, std::vector< BOARD_ITEM * > &aItems)
void AddFeatureLine(const VECTOR2I &aStart, const VECTOR2I &aEnd, uint64_t aWidth)
void AddViaProtection(const PCB_VIA *aVia, bool drill, PCB_LAYER_ID aLayer)
void AddFeatureArc(const VECTOR2I &aStart, const VECTOR2I &aEnd, const VECTOR2I &aCenter, uint64_t aWidth, ODB_DIRECTION aDirection)
uint32_t GetSymbolIndex(std::map< wxString, uint32_t > &aSymMap, const wxString &aKey)
std::map< uint32_t, wxString > m_allSymMap
bool AddPolygon(const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType, int aWidth, LINE_STYLE aDashType)
void GenerateFeatureFile(std::ostream &ost) const
std::map< BOARD_ITEM *, std::vector< uint32_t > > m_featureIDMap
void AddViaDrillHole(const PCB_VIA *aVia, PCB_LAYER_ID aLayer)
std::map< wxString, uint32_t > m_roundRectDonutSymMap
FEATURES_MANAGER(BOARD *aBoard, PCB_IO_ODBPP *aPlugin, const wxString &aLayerName)
std::map< wxString, uint32_t > m_ovalSymMap
void AddPadCircle(const VECTOR2I &aCenter, uint64_t aDiameter, const EDA_ANGLE &aAngle, bool aMirror, double aResize=1.0)
std::map< wxString, uint32_t > m_roundDonutSymMap
std::map< wxString, uint32_t > m_roundRectSymMap
void AddFeatureSurface(const SHAPE_POLY_SET::POLYGON &aPolygon, FILL_T aFillType=FILL_T::FILLED_SHAPE)
uint32_t AddRoundRectSymbol(const wxString &aWidth, const wxString &aHeight, const wxString &aRadius)
uint32_t AddOvalSymbol(const wxString &aWidth, const wxString &aHeight)
void GenerateProfileFeatures(std::ostream &ost) const
std::list< std::unique_ptr< ODB_FEATURE > > m_featuresList
void AddFeature(Args &&... args)
bool AddPolygonCutouts(const SHAPE_POLY_SET::POLYGON &aPolygon)
virtual ~FEATURES_MANAGER()
uint32_t AddCircleSymbol(const wxString &aDiameter)
uint32_t AddChamferRectSymbol(const wxString &aWidth, const wxString &aHeight, const wxString &aRadius, int aPositions)
std::map< wxString, uint32_t > m_padSymMap
uint32_t AddRoundDonutSymbol(const wxString &aOuterDim, const wxString &aInnerDim)
bool AddContour(const SHAPE_POLY_SET &aPolySet, int aOutline=0, FILL_T aFillType=FILL_T::FILLED_SHAPE)
std::pair< wxString, wxString > m_end
std::pair< wxString, wxString > m_start
ODB_ARC(uint32_t aIndex, const std::pair< wxString, wxString > &aStart, const std::pair< wxString, wxString > &aEnd, const std::pair< wxString, wxString > &aCenter, uint32_t aSym, ODB_DIRECTION aDirection)
virtual void WriteRecordContent(std::ostream &ost) override
virtual FEATURE_TYPE GetFeatureType() override
ODB_DIRECTION m_direction
std::pair< wxString, wxString > m_center
virtual void WriteRecordContent(std::ostream &ost)=0
virtual ~ODB_FEATURE()=default
virtual void WriteFeatures(std::ostream &ost)
virtual FEATURE_TYPE GetFeatureType()=0
ODB_FEATURE(uint32_t aIndex)
virtual void WriteRecordContent(std::ostream &ost) override
ODB_LINE(uint32_t aIndex, const std::pair< wxString, wxString > &aStart, const std::pair< wxString, wxString > &aEnd, uint32_t aSym)
virtual FEATURE_TYPE GetFeatureType() override
std::pair< wxString, wxString > m_start
std::pair< wxString, wxString > m_end
ODB_PAD(uint32_t aIndex, const std::pair< wxString, wxString > &aCenter, uint32_t aSym, EDA_ANGLE aAngle=ANGLE_0, bool aMirror=false, double aResize=1.0)
virtual void WriteRecordContent(std::ostream &ost) override
virtual FEATURE_TYPE GetFeatureType() override
std::pair< wxString, wxString > m_center
void WriteData(std::ostream &ost) const
std::vector< std::vector< SURFACE_LINE > > m_polygons
void AddPolygonHoles(const SHAPE_POLY_SET::POLYGON &aPolygon)
std::unique_ptr< ODB_SURFACE_DATA > m_surfaces
virtual void WriteRecordContent(std::ostream &ost) override
virtual FEATURE_TYPE GetFeatureType() override
virtual ~ODB_SURFACE()=default
Represent a set of closed polygons.
std::vector< SHAPE_LINE_CHAIN > POLYGON
represents a single polygon outline with holes.
@ RECT_CHAMFER_BOTTOM_RIGHT
@ RECT_CHAMFER_BOTTOM_LEFT
static constexpr EDA_ANGLE ANGLE_0
PCB_LAYER_ID
A quick note on layer IDs:
LINE_STYLE
Dashed line types.
ODB_DIRECTION m_direction
SURFACE_LINE(const VECTOR2I &aEnd)
SURFACE_LINE(const VECTOR2I &aEnd, const VECTOR2I &aCenter, ODB_DIRECTION aDirection)