42#include <wx/mstream.h>
69 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
70 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " )
100 wxString::Format( wxT(
"% object cannot swap data with %s object." ),
183void PCB_REFERENCE_IMAGE::Show(
int nestLevel, std::ostream& os )
const
219 std::vector<MSG_PANEL_ITEM>& aList )
221 aList.emplace_back(
_(
"Reference Image" ), wxEmptyString );
223 aList.emplace_back(
_(
"PPI" ),
225 aList.emplace_back(
_(
"Scale" ),
228 aList.emplace_back(
_(
"Width" ),
230 aList.emplace_back(
_(
"Height" ),
249 return *
this == other;
272 double similarity = 1.0;
359 const wxString groupImage =
_HKI(
"Image Properties" );
389 const wxString greyscale =
_HKI(
"Greyscale" );
constexpr EDA_IU_SCALE pcbIUScale
BITMAPS
A list of all bitmap identifiers.
@ HIDDEN
Inactive layers are hidden.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
constexpr const Vec & GetPosition() const
constexpr size_type GetWidth() const
constexpr size_type GetHeight() const
The base class for create windows for drawing purpose.
EDA_ITEM & operator=(const EDA_ITEM &aItem)
Assign the members of aItem to another object.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * m_parent
Owner.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Contains methods for drawing PCB-specific items.
virtual PCB_RENDER_SETTINGS * GetSettings() override
Return a pointer to current settings that are going to be used when drawing items.
PCB specific render settings.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
bool GetHighContrast() const
bool GetLayerIsHighContrast(int aLayerId) const
Return information whether the queried layer is marked as high-contrast.
virtual wxString GetClass() const =0
Return the class name.
static constexpr double LOD_HIDE
Return this constant from ViewGetLOD() to hide the item unconditionally.
static constexpr double LOD_SHOW
Return this constant from ViewGetLOD() to show the item unconditionally.
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.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
Object to handle a bitmap image that can be inserted in a PCB.
void SetTransformOriginOffsetY(int aY)
void swapData(BOARD_ITEM *aItem) override
VECTOR2I GetPosition() const override
Get the position of the image (this is the center of the image).
double Similarity(const BOARD_ITEM &aBoardItem) const override
Return a measure of how likely the other object is to represent the same object.
void Move(const VECTOR2I &aMoveVector) override
Move this object.
virtual std::vector< int > ViewGetLayers() const override
double GetImageScale() const
int GetTransformOriginOffsetY() const
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)
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
bool operator==(const PCB_REFERENCE_IMAGE &aOther) const
void SetImageScale(double aScale)
int GetTransformOriginOffsetX() const
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
wxString GetClass() const override
Return the class name.
void Rotate(const VECTOR2I &aCenter, const EDA_ANGLE &aAngle) override
Rotate this object.
void SetPosition(const VECTOR2I &aPosition) override
Set the position of the image.
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetWidth(int aWidth)
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.
PCB_REFERENCE_IMAGE(BOARD_ITEM *aParent, const VECTOR2I &pos=VECTOR2I(0, 0), PCB_LAYER_ID aLayer=F_Cu)
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.
REFERENCE_IMAGE m_referenceImage
void SetHeight(int aHeight)
PCB_REFERENCE_IMAGE & operator=(const BOARD_ITEM &aItem)
void CopyFrom(const BOARD_ITEM *aOther) override
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.
PROPERTY_BASE & ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew, const wxString &aGroup=wxEmptyString)
Replace an existing property for a specific type.
VECTOR2I GetPosition() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
a few functions useful in geometry calculations.
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
Draw images.
PCB_LAYER_ID
A quick note on layer IDs:
bool BoxHitTest(const VECTOR2I &aHitPoint, const BOX2I &aHittee, int aAccuracy)
Perform a point-to-box hit test.
static struct PCB_REFERENCE_IMAGE_DESC _PCB_REFERENCE_IMAGE_DESC
@ PT_COORD
Coordinate expressed in distance units (mm/inch)
PCB_REFERENCE_IMAGE_DESC()
@ PCB_REFERENCE_IMAGE_T
class PCB_REFERENCE_IMAGE, bitmap on a layer
VECTOR2< int32_t > VECTOR2I