70 std::vector<int> layers( 1 );
104 std::vector<MSG_PANEL_ITEM>& aList )
109 if( dataItem ==
nullptr )
116 aList.emplace_back(
_(
"Line" ), wxEmptyString );
120 aList.emplace_back(
_(
"Rectangle" ), wxEmptyString );
133 aList.emplace_back(
_(
"Imported Shape" ), wxEmptyString );
137 aList.emplace_back(
_(
"Image" ), wxEmptyString );
145 default: msg =
_(
"All Pages" );
break;
148 aList.emplace_back(
_(
"First Page Option" ), msg );
152 aList.emplace_back(
_(
"Repeat Count" ), msg );
156 aList.emplace_back(
_(
"Repeat Label Increment" ), msg );
158 msg.Printf( wxT(
"(%s, %s)" ),
162 aList.emplace_back(
_(
"Repeat Position Increment" ), msg );
164 aList.emplace_back(
_(
"Comment" ), dataItem->
m_Info );
177 Print( aSettings, aOffset, color );
199 wxFAIL_MSG( wxT(
"Indeterminate state legal only in dialogs." ) );
209 wxFAIL_MSG( wxT(
"Indeterminate state legal only in dialogs." ) );
238 return wxString::Format(
_(
"Text '%s'" ),
252 std::vector<VECTOR2I> points_moved;
254 for(
int idx = 0; idx <
m_Polygons.OutlineCount(); ++idx )
256 points_moved.clear();
259 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
261 points_moved.emplace_back( outline.
CPoint( ii ).
x + aOffset.
x,
262 outline.
CPoint( ii ).
y + aOffset.
y );
265 GRPoly( DC, (
int) points_moved.size(), &points_moved[0],
true, penWidth, color, color );
289 return m_Polygons.Collide( aPosition, aAccuracy );
307 for(
int idx = 0; idx <
m_Polygons.OutlineCount(); ++idx )
311 for(
int ii = 0; ii < outline.
PointCount(); ii++ )
334 return _(
"Imported shape" );
433 return wxString::Format(
_(
"Rectangle, width %s height %s" ),
459 int mindist = aAccuracy + (
GetPenWidth() / 2 ) + 1;
466 return wxString::Format(
_(
"Line, length %s" ),
524 return _(
"Page limits" );
551 if(
model.GetCount() == 0 && !
model.VoidListAllowed() )
552 model.LoadDrawingSheet( wxEmptyString,
nullptr );
564 wsItem->SyncDrawItems(
this,
nullptr );
571 std::vector<DS_DRAW_ITEM_BASE*> second_items;
576 item->PrintWsItem( aSettings );
578 second_items.push_back( item );
582 item->PrintWsItem( aSettings );
constexpr EDA_IU_SCALE unityScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
void DrawBitmap(wxDC *aDC, const VECTOR2I &aPos, const KIGFX::COLOR4D &aBackgroundColor=KIGFX::COLOR4D::UNSPECIFIED) const
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr void SetHeight(size_type val)
constexpr void SetOrigin(const Vec &pos)
constexpr size_type GetWidth() const
constexpr void SetSize(const SizeVec &size)
constexpr size_type GetHeight() const
constexpr bool Contains(const Vec &aPoint) const
constexpr void SetWidth(size_type val)
constexpr void SetX(coord_type val)
constexpr void SetY(coord_type val)
constexpr void Offset(coord_type dx, coord_type dy)
constexpr bool Intersects(const BOX2< Vec > &aRect) const
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
BITMAP_BASE * m_ImageBitmap
Drawing sheet structure type definitions.
PAGE_OPTION GetPage1Option() const
DS_ITEM_TYPE GetType() const
VECTOR2D m_IncrementVector
Handle the graphic items list to draw/plot the frame and title block.
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
Base class to handle basic graphic items.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
const BOX2I GetBoundingBox() const override=0
Return the orthogonal bounding box of this object for display purposes.
virtual int GetPenWidth() const
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.
DS_DATA_ITEM * GetPeer() const
const KIFONT::METRICS & GetFontMetrics() const
std::vector< int > ViewGetLayers() const override
Return the all the layers within the VIEW the object is painted on.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
const VECTOR2I & GetStart() const
const VECTOR2I & GetEnd() const
DS_DRAW_ITEM_BASE * GetFirst()
void BuildDrawItemsList(const PAGE_INFO &aPageInfo, const TITLE_BLOCK &aTitleBlock)
Drawing or plot the drawing sheet.
void Print(const RENDER_SETTINGS *aSettings)
Draws the item list created by BuildDrawItemsList.
const TITLE_BLOCK * m_titleBlock
bool m_isFirstPage
Is this the first page or not.
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
DS_DRAW_ITEM_BASE * GetNext()
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
SHAPE_POLY_SET m_Polygons
The list of polygons.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
void SetPosition(const VECTOR2I &aPos) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
const VECTOR2I & GetEnd() const
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const VECTOR2I & GetStart() const
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void PrintWsItem(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
virtual const BOX2I GetApproxBBox() override
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
The base class for create windows for drawing purpose.
COLOR4D GetTextColor() const
virtual VECTOR2I GetTextPos() const
virtual const wxString & GetText() const
Return the string associated with the text object.
BOX2I GetTextBox(const RENDER_SETTINGS *aSettings, int aLine=-1) const
Useful in multiline texts to calculate the full text or a line area (for zones filling,...
virtual bool TextHitTest(const VECTOR2I &aPoint, int aAccuracy=0) const
Test if aPoint is within the bounds of this object.
const TEXT_ATTRIBUTES & GetAttributes() const
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset, const COLOR4D &aColor)
Print this text object to the device context aDC.
virtual wxString GetShownText(bool aAllowExtraText, int aDepth=0) const
Return the string actually shown after processing of the base text.
static const METRICS & Default()
A color representation with 4 components: red, green, blue, alpha.
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
Describe the page size and margins of a paper page on which to eventually print or plot.
wxString GetTypeAsString() const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
int PointCount() const
Return the number of points (vertices) in this line chain.
const VECTOR2I & CPoint(int aIndex) const
Return a reference to a given point in the line chain.
GR_TEXT_H_ALIGN_T m_Halign
Hold the information shown in the lower right corner of a plot, printout, or editing view.
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRLine(wxDC *DC, int x1, int y1, int x2, int y2, int width, const COLOR4D &Color, wxPenStyle aStyle)
void GRPoly(wxDC *DC, int n, const VECTOR2I *Points, bool Fill, int width, const COLOR4D &Color, const COLOR4D &BgColor)
Draw a new polyline and fill it if Fill, in drawing space.
@ LAYER_DRAWINGSHEET_PAGEn
Sheet Editor previewing pages after first page.
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
@ LAYER_DRAWINGSHEET_PAGE1
Sheet Editor previewing first page.
KICOMMON_API wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
KICOMMON_API wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
KICOMMON_API wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
std::vector< FAB_LAYER_COLOR > dummy
@ GR_TEXT_H_ALIGN_INDETERMINATE
@ GR_TEXT_V_ALIGN_INDETERMINATE
bool TestSegmentHit(const VECTOR2I &aRefPoint, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aDist)
Test if aRefPoint is with aDistance on the line defined by aStart and aEnd.
VECTOR2< int32_t > VECTOR2I