40#include <wx/mstream.h>
65 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
66 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " ) +
119 wxString::Format( wxT(
"SCH_BITMAP object cannot swap data with %s object." ),
138 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
174void SCH_BITMAP::Show(
int nestLevel, std::ostream& os )
const
179 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
m_pos <<
"/>\n";
208 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
221 return BITMAPS::image;
227 aList.emplace_back(
_(
"Bitmap" ), wxEmptyString );
229 aList.emplace_back(
_(
"PPI" ), wxString::Format( wxT(
"%d "),
GetImage()->GetPPI() ) );
230 aList.emplace_back(
_(
"Scale" ), wxString::Format( wxT(
"%f "),
GetImageScale() ) );
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
This class handle bitmap images in KiCad.
void Rotate(bool aRotateCCW)
Rotate image CW or CCW.
void PlotImage(PLOTTER *aPlotter, const VECTOR2I &aPos, const KIGFX::COLOR4D &aDefaultColor, int aDefaultPensize) const
Plot bitmap on plotter.
const BOX2I GetBoundingBox() const
Return the orthogonal, bounding box of this object for display purposes.
void Mirror(bool aVertically)
Mirror image vertically (i.e.
void DrawBitmap(wxDC *aDC, const VECTOR2I &aPos, const KIGFX::COLOR4D &aBackgroundColor=KIGFX::COLOR4D::UNSPECIFIED)
void SetPixelSizeIu(double aPixSize)
bool ReadImageFile(const wxString &aFullFilename)
Reads and stores in memory an image file.
bool Intersects(const BOX2< Vec > &aRect) const
void Move(const Vec &aMoveVector)
Move the rectangle by the aMoveVector.
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.
KICAD_T Type() const
Returns the type of object.
int GetDefaultPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
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()
Object to handle a bitmap image that can be inserted in a schematic.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
double GetImageScale() const
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
SCH_BITMAP(const VECTOR2I &pos=VECTOR2I(0, 0))
VECTOR2I GetPosition() const override
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
BITMAP_BASE * GetImage() const
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
BITMAP_BASE * m_bitmapBase
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
wxString GetClass() const override
Return the class name.
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
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.
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
SCH_BITMAP & operator=(const SCH_ITEM &aItem)
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
bool ReadImageFile(const wxString &aFullFilename)
Read and store an image file.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
bool operator==(const SCH_ITEM &aOther) const override
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_ITEM & operator=(const SCH_ITEM &aPin)
SCH_LAYER_ID GetLayer() const
Return the layer this item is on.
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
wxString GetClass() const override
Return the class name.
const KIGFX::COLOR4D & GetBackgroundColor() const override
Return current background color settings.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_270
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
@ LAYER_SELECTION_SHADOWS
void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
static struct SCH_BITMAP_DESC _SCH_BITMAP_DESC
constexpr int MilsToIU(int mils) const
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.