88 std::map<size_t, EDA_ITEM_FLAGS> itemFlags;
97 aCollector->
Remove( item );
118 wxFAIL_MSG( wxS(
"Unknown drawing sheet item type" ) );
126 aCollector->
Append( item );
165 drawItem->SetPosition(
GetStartPosIU( drawItem->GetIndexInPeer() ) );
166 drawItem->SetEnd(
GetEndPosIU( drawItem->GetIndexInPeer() ) );
179 switch(
m_Pos.m_Anchor )
182 position =
model.m_RB_Corner - aPosition;
186 position.
x =
model.m_RB_Corner.x - aPosition.
x;
187 position.
y = aPosition.
y -
model.m_LT_Corner.y;
191 position.
x = aPosition.
x -
model.m_LT_Corner.x;
192 position.
y =
model.m_RB_Corner.y - aPosition.
y;
196 position = aPosition -
model.m_LT_Corner;
200 m_Pos.m_Pos = position;
221 switch(
m_End.m_Anchor )
224 position =
model.m_RB_Corner - aPosition;
228 position.
x =
model.m_RB_Corner.x - aPosition.
x;
229 position.
y = aPosition.
y -
model.m_LT_Corner.y;
233 position.
x = aPosition.
x -
model.m_LT_Corner.x;
234 position.
y =
model.m_RB_Corner.y - aPosition.
y;
238 position = aPosition -
model.m_LT_Corner;
247 m_End.m_Pos = position;
272 switch(
m_Pos.m_Anchor )
275 pos =
model.m_RB_Corner - pos;
279 pos.
x =
model.m_RB_Corner.x - pos.
x;
280 pos.
y =
model.m_LT_Corner.y + pos.
y;
284 pos.
x =
model.m_LT_Corner.x + pos.
x;
285 pos.
y =
model.m_RB_Corner.y - pos.
y;
289 pos =
model.m_LT_Corner + pos;
308 switch(
m_End.m_Anchor )
347 if(
model.m_RB_Corner.x < pos.x ||
model.m_LT_Corner.x > pos.x )
350 if(
model.m_RB_Corner.y < pos.y ||
model.m_LT_Corner.y > pos.y )
383 std::map<int, EDA_ITEM_FLAGS> itemFlags;
392 aCollector->
Remove( item );
409 poly_shape->SetFlags( itemFlags[ j ] );
428 aCollector->
Append( poly_shape );
431 aView->
Add( poly_shape );
467 for(
unsigned ii = 1; ii <
m_Corners.size(); ii++ )
494 if(
model.m_LT_Corner.x > pos.
x ||
model.m_LT_Corner.y > pos.
y )
500 if(
model.m_RB_Corner.x < pos.
x ||
model.m_RB_Corner.y < pos.
y )
511 return VECTOR2I(
int( pos.
x ),
int( pos.
y ) );
534 bool multilines =
false;
558 std::map<size_t, EDA_ITEM_FLAGS> itemFlags;
564 itemFlags[ i ] =
text->GetFlags();
588 text->SetFlags( itemFlags[ j ] );
600 text->SetMultilineAllowed( multilines );
628 if( lbchar >=
'0' && lbchar <=
'9' )
641 bool multiline =
false;
643 for(
unsigned ii = 0; ii <
m_FullText.Len(); ii++ )
698 dummy.SetMultilineAllowed(
true );
719 std::map<size_t, EDA_ITEM_FLAGS> itemFlags;
728 aCollector->
Remove( item );
758 aCollector->
Append( bitmap );
761 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)
Try to build text which is an increment of m_TextBase has meaning only if m_TextBase is a basic text ...
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.
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