43#include <wx/mstream.h>
65 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
66 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " )
118 wxString::Format( wxT(
"PCB_BITMAP object cannot swap data with %s object." ),
135 constexpr double HIDE = std::numeric_limits<double>::max();
152 return BOX2I( topLeft, size );
193 for(
double ang = 45.0; ang < norm.
AsDegrees(); ang += 90.0 )
199void PCB_BITMAP::Show(
int nestLevel, std::ostream& os )
const
204 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
m_pos <<
"/>\n";
234 return BITMAPS::image;
240 aList.emplace_back(
_(
"Bitmap" ), wxEmptyString );
242 aList.emplace_back(
_(
"PPI" ), wxString::Format( wxT(
"%d "),
GetImage()->GetPPI() ) );
243 aList.emplace_back(
_(
"Scale" ), wxString::Format( wxT(
"%f "),
GetImageScale() ) );
266 const wxString groupBitmap =
_HKI(
"Bitmap Properties" );
273 const wxString greyscale =
_HKI(
"Greyscale" );
constexpr EDA_IU_SCALE pcbIUScale
BITMAPS
A list of all bitmap identifiers.
This class handle bitmap images in KiCad.
void Rotate(bool aRotateCCW)
Rotate image CW or CCW.
void Mirror(bool aVertically)
Mirror image vertically (i.e.
void SetPixelSizeIu(double aPixSize)
bool ReadImageFile(const wxString &aFullFilename)
Reads and stores in memory an image file.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
const Vec & GetPosition() const
bool Intersects(const BOX2< Vec > &aRect) const
coord_type GetHeight() const
coord_type GetWidth() const
bool Contains(const Vec &aPoint) const
BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
KICAD_T Type() const
Returns the type of object.
virtual wxString GetClass() const =0
Return the class name.
EDA_ITEM * m_parent
Linked list: Link (parent struct)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
Object to handle a bitmap image that can be inserted in a PCB.
BITMAP_BASE * m_bitmapBase
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
void SetImageScale(double aScale)
double GetImageScale() const
PCB_BITMAP(BOARD_ITEM *aParent, const VECTOR2I &pos=VECTOR2I(0, 0), PCB_LAYER_ID aLayer=F_Cu)
void swapData(BOARD_ITEM *aItem) override
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
wxString GetClass() const override
Return the class name.
const VECTOR2I GetSize() const
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const BITMAP_BASE * GetImage() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
bool ReadImageFile(const wxString &aFullFilename)
Read and store an image file.
void Rotate(const VECTOR2I &aCenter, const EDA_ANGLE &aAngle) override
Rotate this object.
PCB_BITMAP & operator=(const BOARD_ITEM &aItem)
void Flip(const VECTOR2I &aCentre, bool aFlipLeftRight) override
Flip this object, i.e.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
wxString LayerName(int aLayer)
Returns the default display name for a given layer.
#define BITMAP_LAYER_FOR(boardLayer)
Macros for getting the extra layers for a given board layer.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
PCB_LAYER_ID
A quick note on layer IDs:
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
static struct PCB_BITMAP_DESC _PCB_BITMAP_DESC
constexpr int MilsToIU(int mils) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
@ PCB_BITMAP_T
class PCB_BITMAP, bitmap on a layer