73 wxString
GetClass()
const override {
return wxT(
"PCB_GRIDITEM" ); }
75 void Serialize( google::protobuf::Any& aContainer )
const override;
76 bool Deserialize(
const google::protobuf::Any& aContainer )
override;
98 wxFAIL_MSG( wxT(
"Grids don't have layers. Calling this has no meaning." ) );
108 m_spacing = { std::max( aSpacing.
x, 1 ), std::max( aSpacing.
y, 1 ) };
189 bool HitTest(
const VECTOR2I& aPosition,
int aAccuracy = 0 )
const override;
190 bool HitTest(
const BOX2I& aRect,
bool aContained,
int aAccuracy = 0 )
const override;
194 ERROR_LOC aErrorLoc,
bool ignoreLineWidth =
false )
const override
214 void Show(
int nestLevel, std::ostream& os )
const override { ShowDummy( os ); }
ERROR_LOC
When approximating an arc or circle, should the error be placed on the outside or inside of the curve...
BITMAPS
A list of all bitmap identifiers.
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)
Information pertinent to a Pcbnew printed circuit board.
A color representation with 4 components: red, green, blue, alpha.
The SIMULATOR_FRAME holds the main user-interface for running simulations.
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.
EDA_ITEM(EDA_ITEM *parent, KICAD_T idType, bool isSCH_ITEM=false, bool isBOARD_ITEM=false)
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
LSET is a set of PCB_LAYER_IDs.
static const LSET & AllLayersMask()
EDA_ANGLE GetOrientationAt(const VECTOR2I &aPos) const
World-space angle of this grid's local-x axis at aPos.
EDA_ANGLE GetPhiExtent() const
double GetPhiExtentDegrees() const
VECTOR2I GetSpacing() const
void SetRadiusExtent(int aR)
void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle) override
Rotate this object.
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
void SetAffectsRouting(bool aOn)
void SetPosition(const VECTOR2I &aPos) override
void SetRadiusSpacing(int aR)
static bool ClassOf(const EDA_ITEM *aItem)
double GetCoverageArea() const
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void SetOrientation(const EDA_ANGLE &aAngle)
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
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.
void SetGridItemType(PCB_GRID_TYPE aType)
bool GetAffectsRouting() const
void SetExtent(const VECTOR2I &aExtent)
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
VECTOR2I GetExtent() const
unsigned GetAssignedPriority() const
void SetTickInterval(unsigned aInterval)
bool HitTestArea(const VECTOR2I &aPos, int aTolerance=0) const
unsigned GetTickInterval() const
void SetOrientationDegrees(double aDeg)
VECTOR2I GetPosition() const override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
unsigned m_priority
Higher wins in overlap resolution; 0 reserved for global grid.
int GetRadiusSpacing() const
GRID_GEOMETRY AsGridGeometry() const
Project this grid into a GRID_GEOMETRY (doubles, radians) for shared math.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
void SetSpacing(const VECTOR2I &aSpacing)
void SetPhiExtentDegrees(double aDeg)
void SetAffectsPlacement(bool aOn)
bool operator==(const PCB_GRID_ITEM &aOther) const
double ViewGetLOD(int aLayer, const KIGFX::VIEW *aView) const override
Return the level of detail (LOD) of the item.
double GetPhiSpacingDegrees() const
EDA_ANGLE GetOrientation() const
bool GetAffectsCursor() const
void TransformShapeToPolygon(SHAPE_POLY_SET &aBuffer, PCB_LAYER_ID aLayer, int aClearance, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const override
Convert the item shape to a closed polygon.
double GetOrientationDegrees() const
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
void swapData(BOARD_ITEM *aImage) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
EDA_ANGLE GetPhiSpacing() const
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
wxString GetClass() const override
Return the class name.
void SetPhiSpacingDegrees(double aDeg)
void Move(const VECTOR2I &aMoveVector) override
Move this object.
PCB_GRID_ITEM(BOARD_ITEM *aParent)
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
PCB_GRID_AFFECTS m_affects
PCB_GRID_AFFECTS & Affects()
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetAssignedPriority(unsigned aPriority)
Priority 0 is reserved for the global background grid; user-assigned 0 is bumped to 1.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void SetLayerSet(const LSET &aLayers) override
bool GetAffectsPlacement() const
SHAPE_LINE_CHAIN buildOutlineWorld() const
Build a closed world-space outline polygon (rect or wedge).
void SetAffectsCursor(bool aOn)
LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
int GetRadiusExtent() const
const PCB_GRID_AFFECTS & Affects() const
PCB_GRID_TYPE GetGridItemType() const
unsigned m_tickInterval
0 = no major ticks; N = every Nth line is major.
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represent a set of closed polygons.
FLASHING
Enum used during connectivity building to ensure we do not query connectivity while building the data...
@ DEFAULT
Flashing follows connectivity.
PCB_LAYER_ID
A quick note on layer IDs:
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
EDA_ANGLE GridFrameAngleAt(const BOARD &aBoard, const VECTOR2I &aPos, PCB_GRID_ROLE aRole)
World frame angle of the grid active for aRole at aPos; ANGLE_0 when no grid applies.
PCB_GRID_ITEM * FindActiveGridAt(const BOARD &aBoard, const VECTOR2I &aPos, PCB_GRID_ROLE aRole)
Pick the grid item active for aRole at aPos.
EDA_ANGLE GridFrameRotationDelta(const EDA_ANGLE &aFrom, const EDA_ANGLE &aTo, const EDA_ANGLE &aRotationStep)
Minimal rotation that re-aligns an item from frame angle aFrom to aTo, reduced modulo min( aRotationS...
Geometry of a regular grid (cartesian or polar) and the math operations for snapping and coverage tes...
bool Contains(const VECTOR2D &aPoint, double aTolerance=0.0) const
bool operator==(const PCB_GRID_AFFECTS &aOther) const
bool routing
Used by the router as a local routing frame.
bool cursor
Replace the display grid for cursor snapping inside coverage.
bool placement
Used by edit/move tools for placement snap.
@ PCB_GRID_ITEM_T
a subgrid placed on a board
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D