85 std::map<size_t, EDA_ITEM_FLAGS> itemFlags;
94 aCollector->
Remove( item );
115 wxFAIL_MSG( wxS(
"Unknown drawing sheet item type" ) );
123 aCollector->
Append( item );
162 drawItem->SetPosition(
GetStartPosIU( drawItem->GetIndexInPeer() ) );
163 drawItem->SetEnd(
GetEndPosIU( drawItem->GetIndexInPeer() ) );
176 switch(
m_Pos.m_Anchor )
179 position =
model.m_RB_Corner - aPosition;
183 position.
x =
model.m_RB_Corner.x - aPosition.
x;
184 position.
y = aPosition.
y -
model.m_LT_Corner.y;
188 position.
x = aPosition.
x -
model.m_LT_Corner.x;
189 position.
y =
model.m_RB_Corner.y - aPosition.
y;
193 position = aPosition -
model.m_LT_Corner;
197 m_Pos.m_Pos = position;
218 switch(
m_End.m_Anchor )
221 position =
model.m_RB_Corner - aPosition;
225 position.
x =
model.m_RB_Corner.x - aPosition.
x;
226 position.
y = aPosition.
y -
model.m_LT_Corner.y;
230 position.
x = aPosition.
x -
model.m_LT_Corner.x;
231 position.
y =
model.m_RB_Corner.y - aPosition.
y;
235 position = aPosition -
model.m_LT_Corner;
244 m_End.m_Pos = position;
269 switch(
m_Pos.m_Anchor )
272 pos =
model.m_RB_Corner - pos;
276 pos.
x =
model.m_RB_Corner.x - pos.
x;
277 pos.
y =
model.m_LT_Corner.y + pos.
y;
281 pos.
x =
model.m_LT_Corner.x + pos.
x;
282 pos.
y =
model.m_RB_Corner.y - pos.
y;
286 pos =
model.m_LT_Corner + pos;
305 switch(
m_End.m_Anchor )
342 std::vector<VECTOR2D> corners = {
GetStartPos( ii ) };
348 for(
const VECTOR2D& pos : corners )
350 if(
model.m_RB_Corner.x < pos.x ||
model.m_LT_Corner.x > pos.x )
353 if(
model.m_RB_Corner.y < pos.y ||
model.m_LT_Corner.y > pos.y )
386 std::map<int, EDA_ITEM_FLAGS> itemFlags;
395 aCollector->
Remove( item );
412 poly_shape->SetFlags( itemFlags[ j ] );
431 aCollector->
Append( poly_shape );
434 aView->
Add( poly_shape );
470 for(
unsigned ii = 1; ii <
m_Corners.size(); ii++ )
497 if(
model.m_LT_Corner.x > pos.
x ||
model.m_LT_Corner.y > pos.
y )
503 if(
model.m_RB_Corner.x < pos.
x ||
model.m_RB_Corner.y < pos.
y )
514 return VECTOR2I(
int( pos.
x ),
int( pos.
y ) );
537 bool multilines =
false;
561 std::map<size_t, EDA_ITEM_FLAGS> itemFlags;
567 itemFlags[ i ] =
text->GetFlags();
591 text->SetFlags( itemFlags[ j ] );
603 text->SetMultilineAllowed( multilines );
643 bool multiline =
false;
645 for(
unsigned ii = 0; ii <
m_FullText.Len(); ii++ )
700 dummy.SetMultilineAllowed(
true );
721 std::map<size_t, EDA_ITEM_FLAGS> itemFlags;
730 aCollector->
Remove( item );
760 aCollector->
Append( bitmap );
763 aView->
Add( bitmap );
constexpr EDA_IU_SCALE unityScale
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
constexpr size_type GetWidth() const
constexpr size_type GetHeight() const
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
BITMAP_BASE * m_ImageBitmap
void SyncDrawItems(DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView) override
void SetPPI(int aBitmapPPI)
unsigned GetPolyIndexStart(unsigned aContour) const
unsigned GetPolyIndexEnd(unsigned aContour) const
const VECTOR2I GetCornerPositionIU(unsigned aIdx, int aRepeat=0) const
void SetBoundingBox()
Calculate the bounding box of the set polygons.
virtual int GetPenSizeIU() override
void SyncDrawItems(DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView) override
bool IsInsidePage(int ii) const override
const VECTOR2D GetCornerPosition(unsigned aIdx, int aRepeat=0) const
std::vector< VECTOR2D > m_Corners
bool ReplaceAntiSlashSequence()
Replace the '\''n' sequence by EOL and the sequence '\''\' by only one '\' inside m_FullText.
void SyncDrawItems(DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView) override
void IncrementLabel(int aIncr)
Build an incremented copy of m_TextBase into m_FullText.
void SetConstrainedTextSize()
Calculate m_ConstrainedTextSize from m_TextSize to keep the X size and the full Y size of the text sm...
GR_TEXT_H_ALIGN_T m_Hjustify
KIGFX::COLOR4D m_TextColor
virtual int GetPenSizeIU() override
VECTOR2D m_BoundingBoxSize
VECTOR2D m_ConstrainedTextSize
DS_DATA_ITEM_TEXT(const wxString &aTextBase)
GR_TEXT_V_ALIGN_T m_Vjustify
DS_DATA_ITEM(DS_ITEM_TYPE aType)
const VECTOR2D GetEndPos(int ii=0) const
void MoveStartPointToIU(const VECTOR2I &aPosition)
Move the starting point of the item to a new position.
const VECTOR2D GetStartPos(int ii=0) const
void MoveStartPointTo(const VECTOR2D &aPosition)
Move the starting point of the item to a new position.
void MoveEndPointTo(const VECTOR2D &aPosition)
Move the ending point of the item to a new position.
virtual int GetPenSizeIU()
void MoveEndPointToIU(const VECTOR2I &aPosition)
Move the ending point of the item to a new position.
DS_ITEM_TYPE GetType() const
void MoveTo(const VECTOR2D &aPosition)
Move item to a new position.
void MoveToIU(const VECTOR2I &aPosition)
Move item to a new position.
std::vector< DS_DRAW_ITEM_BASE * > m_drawItems
const wxString GetClassName() const
const VECTOR2I GetStartPosIU(int ii=0) const
const VECTOR2I GetEndPosIU(int ii=0) const
VECTOR2D m_IncrementVector
virtual void SyncDrawItems(DS_DRAW_ITEM_LIST *aCollector, KIGFX::VIEW *aView)
virtual bool IsInsidePage(int ii) const
Handle the graphic items list to draw/plot the frame and title block.
VECTOR2D m_DefaultTextSize
static DS_DATA_MODEL & GetTheInstance()
Return the instance of DS_DATA_MODEL used in the application.
Base class to handle basic graphic items.
Store the list of graphic items: rect, lines, polygons and texts to draw/plot the title block and fra...
int GetDefaultPenSize() const
const EDA_IU_SCALE & GetIuScale() const
wxString BuildFullText(const wxString &aTextbase)
void Append(DS_DRAW_ITEM_BASE *aItem)
double GetMilsToIUfactor()
Get the scalar to convert pages units (mils) to draw/plot units.
void Remove(DS_DRAW_ITEM_BASE *aItem)
Non filled rectangle with thick segment.
void SetFlags(EDA_ITEM_FLAGS aMask)
EDA_ITEM_FLAGS GetFlags() const
A color representation with 4 components: red, green, blue, alpha.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Add a VIEW_ITEM to the view.
virtual void Remove(VIEW_ITEM *aItem)
Remove a VIEW_ITEM from the view.
Represent a set of closed polygons.
int Append(int x, int y, int aOutline=-1, int aHole=-1, bool aAllowDuplication=false)
Appends a vertex at the end of the given outline/hole (default: the last outline)
int NewOutline()
Creates a new empty polygon in the set and returns its index.
Heuristically increment a string's n'th part from the right.
void SetAlphabeticMaxIndex(int aMaxIndex)
Set the maximum index for alphabetic parts.
void SetSkipIOSQXZ(bool aSkip)
If a alphabetic part is found, skip the letters I, O, S, Q, X, Z.
std::optional< wxString > Increment(const wxString &aStr, int aDelta, size_t aRightIndex) const
Increment the n-th part from the right of the given string.
int GetPenSizeForBold(int aTextSize)
std::vector< FAB_LAYER_COLOR > dummy
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
VECTOR2< int32_t > VECTOR2I
VECTOR2< double > VECTOR2D