42#include <wx/mstream.h>
57 m_referenceImage( aSchBitmap.m_referenceImage )
64 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
65 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " ) +
91 wxString::Format( wxT(
"SCH_BITMAP object cannot swap data with %s object." ),
106 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
152void SCH_BITMAP::Show(
int nestLevel, std::ostream& os )
const
157 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
GetPosition() <<
"/>\n";
175 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
188 return BITMAPS::image;
194 aList.emplace_back(
_(
"Bitmap" ), wxEmptyString );
196 aList.emplace_back(
_(
"PPI" ),
198 aList.emplace_back(
_(
"Scale" ),
201 aList.emplace_back(
_(
"Width" ),
203 aList.emplace_back(
_(
"Height" ),
313 PROPERTY_DISPLAY::PT_COORD ) );
318 PROPERTY_DISPLAY::PT_COORD ) );
320 const wxString groupImage =
_HKI(
"Image Properties" );
328 _HKI(
"Transform Offset X" ),
335 _HKI(
"Transform Offset Y" ),
345 PROPERTY_DISPLAY::PT_COORD ),
352 PROPERTY_DISPLAY::PT_COORD ),
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
void PlotImage(PLOTTER *aPlotter, const VECTOR2I &aPos, const KIGFX::COLOR4D &aDefaultColor, int aDefaultPensize) const
Plot bitmap on plotter.
void DrawBitmap(wxDC *aDC, const VECTOR2I &aPos, const KIGFX::COLOR4D &aBackgroundColor=KIGFX::COLOR4D::UNSPECIFIED) const
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()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
void SwapData(REFERENCE_IMAGE &aItem)
void Rotate(const VECTOR2I &aCenter, const EDA_ANGLE &aAngle)
void SetTransformOriginOffset(const VECTOR2I &aCenter)
VECTOR2I GetTransformOriginOffset() const
Get the center of scaling, etc, relative to the image center (GetPosition()).
VECTOR2I GetPosition() const
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection)
void SetHeight(int aHeight)
void SetPosition(const VECTOR2I &aPos)
void SetWidth(int aWidth)
const BITMAP_BASE & GetImage() const
Get the underlying image.
double Similarity(const REFERENCE_IMAGE &aOther) const
double GetImageScale() const
void SetImageScale(double aScale)
Set the image "zoom" value.
BOX2I GetBoundingBox() const
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))
void SetWidth(int aWidth)
VECTOR2I GetPosition() const override
int GetTransformOriginOffsetY() const
void SetHeight(int aHeight)
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.
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
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.
void SetTransformOriginOffsetX(int aX)
void SetPosition(const VECTOR2I &aPosition) override
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
SCH_BITMAP & operator=(const SCH_ITEM &aItem)
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
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.
REFERENCE_IMAGE m_referenceImage
int GetTransformOriginOffsetX() const
void SetTransformOriginOffsetY(int aY)
void SetImageScale(double aScale)
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
a few functions useful in geometry calculations.
@ LAYER_DRAW_BITMAPS
to handle and draw images bitmaps
@ LAYER_SELECTION_SHADOWS
bool BoxHitTest(const VECTOR2I &aHitPoint, const BOX2I &aHittee, int aAccuracy)
Perform a point-to-box hit test.
static struct SCH_BITMAP_DESC _SCH_BITMAP_DESC
VECTOR2< int32_t > VECTOR2I