Refactor DIMENSION to hide internal details; add some new properties

This is a board file format change to account for the new properties.
Also, we now only store the critical information about the dimension's
geometry in the board, rather than storing every drawn line.

The DIMENSION object is now an abstract base, and ALIGNED_DIMENSION
is the implementation that exists today (we will add more dimension
types in the future)
This commit is contained in:
Jon Evans
2020-09-11 21:12:36 -04:00
parent 50b92379c8
commit b11e315d10
29 changed files with 979 additions and 1139 deletions
+7 -28
View File
@@ -360,7 +360,7 @@ void BRDITEMS_PLOTTER::PlotDimension( DIMENSION* aDim )
DRAWSEGMENT draw;
draw.SetWidth( aDim->GetWidth() );
draw.SetWidth( aDim->GetLineThickness() );
draw.SetLayer( aDim->GetLayer() );
COLOR4D color = ColorSettings()->GetColor( aDim->GetLayer() );
@@ -371,33 +371,12 @@ void BRDITEMS_PLOTTER::PlotDimension( DIMENSION* aDim )
PlotTextePcb( &aDim->Text() );
draw.SetStart( aDim->m_crossBarO );
draw.SetEnd( aDim->m_crossBarF );
PlotDrawSegment( &draw );
draw.SetStart( aDim->m_featureLineGO);
draw.SetEnd( aDim->m_featureLineGF );
PlotDrawSegment( &draw );
draw.SetStart( aDim->m_featureLineDO );
draw.SetEnd( aDim->m_featureLineDF );
PlotDrawSegment( &draw );
draw.SetStart( aDim->m_crossBarF );
draw.SetEnd( aDim->m_arrowD1F );
PlotDrawSegment( &draw );
draw.SetStart( aDim->m_crossBarF );
draw.SetEnd( aDim->m_arrowD2F );
PlotDrawSegment( &draw );
draw.SetStart( aDim->m_crossBarO );
draw.SetEnd( aDim->m_arrowG1F );
PlotDrawSegment( &draw );
draw.SetStart( aDim->m_crossBarO );
draw.SetEnd( aDim->m_arrowG2F );
PlotDrawSegment( &draw );
for( const SEG& seg : aDim->GetLines() )
{
draw.SetStart( wxPoint( seg.A ) );
draw.SetEnd( wxPoint( seg.B ) );
PlotDrawSegment( &draw );
}
}