40#include <wx/mstream.h>
64 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
65 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " ) +
118 wxString::Format( wxT(
"SCH_BITMAP object cannot swap data with %s object." ),
173void SCH_BITMAP::Show(
int nestLevel, std::ostream& os )
const
178 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
m_pos <<
"/>\n";
219 return BITMAPS::image;
225 aList.emplace_back(
_(
"Bitmap" ), wxEmptyString );
227 aList.emplace_back(
_(
"PPI" ), wxString::Format( wxT(
"%d "),
GetImage()->GetPPI() ) );
228 aList.emplace_back(
_(
"Scale" ), wxString::Format( wxT(
"%f "),
GetImageScale() ) );
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.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
int GetDefaultPenWidth() const
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
virtual const COLOR4D & GetBackgroundColor() const =0
Return current background color settings.
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.
double GetImageScale() const
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
Print a schematic item.
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))
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
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.
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 Plot(PLOTTER *aPlotter, bool aBackground) const override
Plot the schematic item to aPlotter.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_ITEM & operator=(const SCH_ITEM &aPin)
virtual wxString GetClass() const override
Return the class name.
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 MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A lower-precision version of StringFromValue().
static constexpr EDA_ANGLE & ANGLE_90
@ 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
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)