Commit 460dcfc6 authored by Maciej Suminski's avatar Maciej Suminski

Removed SELECTION layer.

parent 24af7490
...@@ -261,7 +261,6 @@ enum PCB_VISIBLE ...@@ -261,7 +261,6 @@ enum PCB_VISIBLE
PAD_BK_NETNAMES_VISIBLE, PAD_BK_NETNAMES_VISIBLE,
PADS_NETNAMES_VISIBLE, PADS_NETNAMES_VISIBLE,
SELECTION,
WORKSHEET, WORKSHEET,
GP_OVERLAY, // General purpose overlay GP_OVERLAY, // General purpose overlay
......
...@@ -72,7 +72,7 @@ static const wxString FastGrid2Entry( wxT( "FastGrid2" ) ); ...@@ -72,7 +72,7 @@ static const wxString FastGrid2Entry( wxT( "FastGrid2" ) );
const LAYER_NUM PCB_BASE_FRAME::GAL_LAYER_ORDER[] = const LAYER_NUM PCB_BASE_FRAME::GAL_LAYER_ORDER[] =
{ {
ITEM_GAL_LAYER( GP_OVERLAY ), ITEM_GAL_LAYER( SELECTION ), ITEM_GAL_LAYER( GP_OVERLAY ),
ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ),
DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N, DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N,
UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31, UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31,
...@@ -895,7 +895,6 @@ void PCB_BASE_FRAME::LoadSettings() ...@@ -895,7 +895,6 @@ void PCB_BASE_FRAME::LoadSettings()
view->SetRequired( SOLDERPASTE_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); view->SetRequired( SOLDERPASTE_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) );
view->SetRequired( SOLDERMASK_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); view->SetRequired( SOLDERMASK_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) );
view->SetLayerTarget( ITEM_GAL_LAYER( SELECTION ), KiGfx::TARGET_OVERLAY );
view->SetLayerTarget( ITEM_GAL_LAYER( GP_OVERLAY ), KiGfx::TARGET_OVERLAY ); view->SetLayerTarget( ITEM_GAL_LAYER( GP_OVERLAY ), KiGfx::TARGET_OVERLAY );
// Apply layer coloring scheme & display options // Apply layer coloring scheme & display options
......
...@@ -508,18 +508,6 @@ const BOX2I DIMENSION::ViewBBox() const ...@@ -508,18 +508,6 @@ const BOX2I DIMENSION::ViewBBox() const
} }
void DIMENSION::ViewGetLayers( int aLayers[], int& aCount ) const
{
// Layer that simply displays the text
aLayers[0] = m_Layer;
// On the general purpose overlay there is a selection box displayed
aLayers[1] = ITEM_GAL_LAYER( SELECTION );
aCount = 2;
}
EDA_ITEM* DIMENSION::Clone() const EDA_ITEM* DIMENSION::Clone() const
{ {
return new DIMENSION( *this ); return new DIMENSION( *this );
......
...@@ -147,9 +147,6 @@ public: ...@@ -147,9 +147,6 @@ public:
/// @copydoc VIEW_ITEM::ViewBBox() /// @copydoc VIEW_ITEM::ViewBBox()
virtual const BOX2I ViewBBox() const; virtual const BOX2I ViewBBox() const;
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;
#if defined(DEBUG) #if defined(DEBUG)
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
......
...@@ -1024,10 +1024,3 @@ void MODULE::SetOrientation( double newangle ) ...@@ -1024,10 +1024,3 @@ void MODULE::SetOrientation( double newangle )
CalculateBoundingBox(); CalculateBoundingBox();
} }
void MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 2;
aLayers[0] = ITEM_GAL_LAYER( SELECTION ); // Selection box
aLayers[1] = m_Layer;
}
...@@ -499,9 +499,6 @@ public: ...@@ -499,9 +499,6 @@ public:
/// Return the initial comments block or NULL if none, without transfer of ownership. /// Return the initial comments block or NULL if none, without transfer of ownership.
const wxArrayString* GetInitialComments() const { return m_initial_comments; } const wxArrayString* GetInitialComments() const { return m_initial_comments; }
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;
#if defined(DEBUG) #if defined(DEBUG)
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
......
...@@ -224,14 +224,3 @@ const BOX2I TEXTE_PCB::ViewBBox() const ...@@ -224,14 +224,3 @@ const BOX2I TEXTE_PCB::ViewBBox() const
} }
} }
void TEXTE_PCB::ViewGetLayers( int aLayers[], int& aCount ) const
{
// Layer that simply displays the text
aLayers[0] = m_Layer;
// On the general purpose overlay there is a selection box displayed
aLayers[1] = ITEM_GAL_LAYER( SELECTION );
aCount = 2;
}
...@@ -134,9 +134,6 @@ public: ...@@ -134,9 +134,6 @@ public:
/// @copydoc VIEW_ITEM::ViewBBox() /// @copydoc VIEW_ITEM::ViewBBox()
virtual const BOX2I ViewBBox() const; virtual const BOX2I ViewBBox() const;
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;
#if defined(DEBUG) #if defined(DEBUG)
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
#endif #endif
......
...@@ -472,8 +472,5 @@ void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const ...@@ -472,8 +472,5 @@ void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
break; break;
} }
// On the general purpose overlay there is a selection box displayed aCount = 1;
aLayers[1] = ITEM_GAL_LAYER( SELECTION );
aCount = 2;
} }
...@@ -76,7 +76,6 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings ...@@ -76,7 +76,6 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings
m_layerColors[ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); m_layerColors[ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 );
m_layerColors[ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); m_layerColors[ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 );
m_layerColors[ITEM_GAL_LAYER( WORKSHEET )] = COLOR4D( 0.5, 0.0, 0.0, 1.0 ); m_layerColors[ITEM_GAL_LAYER( WORKSHEET )] = COLOR4D( 0.5, 0.0, 0.0, 1.0 );
m_layerColors[ITEM_GAL_LAYER( SELECTION )] = COLOR4D( 1.0, 1.0, 1.0, 0.5 );
// Netnames for copper layers // Netnames for copper layers
for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; ++layer ) for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; ++layer )
...@@ -227,10 +226,6 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer ) ...@@ -227,10 +226,6 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw( (DRAWSEGMENT*) aItem ); draw( (DRAWSEGMENT*) aItem );
break; break;
case PCB_MODULE_T:
draw( (MODULE*) aItem, aLayer );
break;
case PCB_TEXT_T: case PCB_TEXT_T:
draw( (TEXTE_PCB*) aItem, aLayer ); draw( (TEXTE_PCB*) aItem, aLayer );
break; break;
...@@ -699,63 +694,35 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment ) ...@@ -699,63 +694,35 @@ void PCB_PAINTER::draw( const DRAWSEGMENT* aSegment )
} }
void PCB_PAINTER::draw( const MODULE* aModule, int aLayer )
{
// For modules we have to draw a selection box if needed
if( aLayer == ITEM_GAL_LAYER( SELECTION ) )
{
if( aModule->IsSelected() )
drawSelectionBox( aModule );
}
}
void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer ) void PCB_PAINTER::draw( const TEXTE_PCB* aText, int aLayer )
{ {
if( aLayer == ITEM_GAL_LAYER( SELECTION ) ) if( aText->GetText().Length() == 0 )
{ return;
if( aText->IsSelected() )
drawSelectionBox( aText );
}
else
{
if( aText->GetText().Length() == 0 )
return;
COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aText->GetLayer() ); COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aText->GetLayer() );
VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y ); VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y );
double orientation = aText->GetOrientation() * M_PI / 1800.0; double orientation = aText->GetOrientation() * M_PI / 1800.0;
m_gal->SetStrokeColor( strokeColor ); m_gal->SetStrokeColor( strokeColor );
m_gal->SetLineWidth( aText->GetThickness() ); m_gal->SetLineWidth( aText->GetThickness() );
m_gal->SetTextAttributes( aText ); m_gal->SetTextAttributes( aText );
m_gal->StrokeText( std::string( aText->GetText().mb_str() ), position, orientation ); m_gal->StrokeText( std::string( aText->GetText().mb_str() ), position, orientation );
}
} }
void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer ) void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
{ {
if( aLayer == ITEM_GAL_LAYER( SELECTION ) ) if( aText->GetLength() == 0 )
{ return;
if( aText->IsSelected() )
drawSelectionBox( aText );
}
else
{
if( aText->GetLength() == 0 )
return;
COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aLayer ); COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aLayer );
VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y ); VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y );
double orientation = aText->GetDrawRotation() * M_PI / 1800.0; double orientation = aText->GetDrawRotation() * M_PI / 1800.0;
m_gal->SetStrokeColor( strokeColor );
m_gal->SetLineWidth( aText->GetThickness() );
m_gal->SetTextAttributes( aText );
m_gal->StrokeText( std::string( aText->GetText().mb_str() ), position, orientation );
}
m_gal->SetStrokeColor( strokeColor );
m_gal->SetLineWidth( aText->GetThickness() );
m_gal->SetTextAttributes( aText );
m_gal->StrokeText( std::string( aText->GetText().mb_str() ), position, orientation );
} }
...@@ -830,41 +797,32 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone ) ...@@ -830,41 +797,32 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone )
void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer ) void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer )
{ {
if( aLayer == ITEM_GAL_LAYER( SELECTION ) ) COLOR4D strokeColor = m_pcbSettings->GetColor( aDimension, aLayer );
{
if( aDimension->IsSelected() )
drawSelectionBox( aDimension );
}
else
{
int layer = aDimension->GetLayer();
COLOR4D strokeColor = m_pcbSettings->GetColor( aDimension, layer );
m_gal->SetStrokeColor( strokeColor ); m_gal->SetStrokeColor( strokeColor );
m_gal->SetIsFill( false ); m_gal->SetIsFill( false );
m_gal->SetIsStroke( true ); m_gal->SetIsStroke( true );
m_gal->SetLineWidth( aDimension->GetWidth() ); m_gal->SetLineWidth( aDimension->GetWidth() );
// Draw an arrow // Draw an arrow
m_gal->DrawLine( VECTOR2D( aDimension->m_crossBarO ), VECTOR2D( aDimension->m_crossBarF ) ); m_gal->DrawLine( VECTOR2D( aDimension->m_crossBarO ), VECTOR2D( aDimension->m_crossBarF ) );
m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineGO ), m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineGO ),
VECTOR2D( aDimension->m_featureLineGF ) ); VECTOR2D( aDimension->m_featureLineGF ) );
m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineDO ), m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineDO ),
VECTOR2D( aDimension->m_featureLineDF ) ); VECTOR2D( aDimension->m_featureLineDF ) );
m_gal->DrawLine( VECTOR2D( aDimension->m_arrowD1O ), VECTOR2D( aDimension->m_arrowD1F ) ); m_gal->DrawLine( VECTOR2D( aDimension->m_arrowD1O ), VECTOR2D( aDimension->m_arrowD1F ) );
m_gal->DrawLine( VECTOR2D( aDimension->m_arrowD2O ), VECTOR2D( aDimension->m_arrowD2F ) ); m_gal->DrawLine( VECTOR2D( aDimension->m_arrowD2O ), VECTOR2D( aDimension->m_arrowD2F ) );
m_gal->DrawLine( VECTOR2D( aDimension->m_arrowG1O ), VECTOR2D( aDimension->m_arrowG1F ) ); m_gal->DrawLine( VECTOR2D( aDimension->m_arrowG1O ), VECTOR2D( aDimension->m_arrowG1F ) );
m_gal->DrawLine( VECTOR2D( aDimension->m_arrowG2O ), VECTOR2D( aDimension->m_arrowG2F ) ); m_gal->DrawLine( VECTOR2D( aDimension->m_arrowG2O ), VECTOR2D( aDimension->m_arrowG2F ) );
// Draw text // Draw text
TEXTE_PCB& text = aDimension->Text(); TEXTE_PCB& text = aDimension->Text();
VECTOR2D position( text.GetTextPosition().x, text.GetTextPosition().y ); VECTOR2D position( text.GetTextPosition().x, text.GetTextPosition().y );
double orientation = text.GetOrientation() * M_PI / 1800.0; double orientation = text.GetOrientation() * M_PI / 1800.0;
m_gal->SetLineWidth( text.GetThickness() ); m_gal->SetLineWidth( text.GetThickness() );
m_gal->SetTextAttributes( &text ); m_gal->SetTextAttributes( &text );
m_gal->StrokeText( std::string( text.GetText().mb_str() ), position, orientation ); m_gal->StrokeText( std::string( text.GetText().mb_str() ), position, orientation );
}
} }
...@@ -904,14 +862,4 @@ void PCB_PAINTER::draw( const PCB_TARGET* aTarget ) ...@@ -904,14 +862,4 @@ void PCB_PAINTER::draw( const PCB_TARGET* aTarget )
} }
void PCB_PAINTER::drawSelectionBox( const VIEW_ITEM* aItem ) const
{
BOX2I boundingBox = aItem->ViewBBox();
m_gal->SetIsStroke( false );
m_gal->SetIsFill( true );
m_gal->SetFillColor( m_pcbSettings->GetLayerColor( ITEM_GAL_LAYER( SELECTION ) ) );
m_gal->DrawRectangle( boundingBox.GetOrigin(), boundingBox.GetEnd() );
}
const double PCB_RENDER_SETTINGS::MAX_FONT_SIZE = 100000000; const double PCB_RENDER_SETTINGS::MAX_FONT_SIZE = 100000000;
...@@ -146,15 +146,11 @@ protected: ...@@ -146,15 +146,11 @@ protected:
void draw( const SEGVIA*, int ); void draw( const SEGVIA*, int );
void draw( const D_PAD*, int ); void draw( const D_PAD*, int );
void draw( const DRAWSEGMENT* ); void draw( const DRAWSEGMENT* );
void draw( const MODULE*, int );
void draw( const TEXTE_PCB*, int ); void draw( const TEXTE_PCB*, int );
void draw( const TEXTE_MODULE*, int ); void draw( const TEXTE_MODULE*, int );
void draw( const ZONE_CONTAINER* ); void draw( const ZONE_CONTAINER* );
void draw( const DIMENSION*, int ); void draw( const DIMENSION*, int );
void draw( const PCB_TARGET* ); void draw( const PCB_TARGET* );
/// Draws a white semitransparent box indicating an item as selected
void drawSelectionBox( const VIEW_ITEM* aItem ) const;
}; };
} // namespace KiGfx } // namespace KiGfx
......
...@@ -791,7 +791,7 @@ void PCB_EDIT_FRAME::setHighContrastLayer( LAYER_NUM aLayer ) ...@@ -791,7 +791,7 @@ void PCB_EDIT_FRAME::setHighContrastLayer( LAYER_NUM aLayer )
GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ), GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ),
ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ),
ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ),
ITEM_GAL_LAYER( SELECTION ), ITEM_GAL_LAYER( GP_OVERLAY ) ITEM_GAL_LAYER( GP_OVERLAY )
}; };
for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i ) for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i )
...@@ -831,7 +831,7 @@ void PCB_EDIT_FRAME::setTopLayer( LAYER_NUM aLayer ) ...@@ -831,7 +831,7 @@ void PCB_EDIT_FRAME::setTopLayer( LAYER_NUM aLayer )
GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ), GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ),
ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ),
ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ),
ITEM_GAL_LAYER( SELECTION ), ITEM_GAL_LAYER( GP_OVERLAY ) ITEM_GAL_LAYER( GP_OVERLAY )
}; };
for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i ) for( unsigned int i = 0; i < sizeof( layers ) / sizeof( LAYER_NUM ); ++i )
......
...@@ -52,7 +52,7 @@ public: ...@@ -52,7 +52,7 @@ public:
} }
private: private:
static const int BrightBoxLayer = ITEM_GAL_LAYER( SELECTION ); static const int BrightBoxLayer = ITEM_GAL_LAYER( GP_OVERLAY );
static const KiGfx::COLOR4D BrightColor; static const KiGfx::COLOR4D BrightColor;
static const double LineWidth = 100000.0; static const double LineWidth = 100000.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment