Merged 'development'
This commit is contained in:
commit
ac489ece7b
|
@ -32,7 +32,7 @@ set(GAL_SRCS
|
|||
# Common part
|
||||
drawpanel_gal.cpp
|
||||
painter.cpp
|
||||
worksheet_item.cpp
|
||||
worksheet_viewitem.cpp
|
||||
gal/graphics_abstraction_layer.cpp
|
||||
gal/stroke_font.cpp
|
||||
gal/color4d.cpp
|
||||
|
|
|
@ -676,9 +676,9 @@ struct VIEW::unlinkItem
|
|||
};
|
||||
|
||||
|
||||
struct VIEW::recacheLayer
|
||||
struct VIEW::recacheItem
|
||||
{
|
||||
recacheLayer( VIEW* aView, GAL* aGal, int aLayer, bool aImmediately ) :
|
||||
recacheItem( VIEW* aView, GAL* aGal, int aLayer, bool aImmediately ) :
|
||||
view( aView ), gal( aGal ), layer( aLayer ), immediately( aImmediately )
|
||||
{
|
||||
}
|
||||
|
@ -688,9 +688,7 @@ struct VIEW::recacheLayer
|
|||
// Remove previously cached group
|
||||
int prevGroup = aItem->getGroup( layer );
|
||||
if( prevGroup >= 0 )
|
||||
{
|
||||
gal->DeleteGroup( prevGroup );
|
||||
}
|
||||
|
||||
if( immediately )
|
||||
{
|
||||
|
@ -882,6 +880,10 @@ void VIEW::updateItemGeometry( VIEW_ITEM* aItem, int aLayer )
|
|||
m_gal->SetLayerDepth( l.renderingOrder );
|
||||
|
||||
// Redraw the item from scratch
|
||||
int prevGroup = aItem->getGroup( aLayer );
|
||||
if( prevGroup >= 0 )
|
||||
m_gal->DeleteGroup( prevGroup );
|
||||
|
||||
int group = m_gal->BeginGroup();
|
||||
aItem->setGroup( aLayer, group );
|
||||
m_painter->Draw( static_cast<EDA_ITEM*>( aItem ), aLayer );
|
||||
|
@ -966,7 +968,7 @@ void VIEW::RecacheAllItems( bool aImmediately )
|
|||
{
|
||||
m_gal->SetTarget( l->target );
|
||||
m_gal->SetLayerDepth( l->renderingOrder );
|
||||
recacheLayer visitor( this, m_gal, l->id, aImmediately );
|
||||
recacheItem visitor( this, m_gal, l->id, aImmediately );
|
||||
l->items->Query( r, visitor );
|
||||
MarkTargetDirty( l->target );
|
||||
}
|
||||
|
|
|
@ -71,16 +71,6 @@ void VIEW_GROUP::Clear()
|
|||
}
|
||||
|
||||
|
||||
void VIEW_GROUP::FreeItems()
|
||||
{
|
||||
BOOST_FOREACH( VIEW_ITEM* item, m_items )
|
||||
{
|
||||
delete item;
|
||||
}
|
||||
m_items.clear();
|
||||
}
|
||||
|
||||
|
||||
unsigned int VIEW_GROUP::GetSize() const
|
||||
{
|
||||
return m_items.size();
|
||||
|
@ -102,6 +92,8 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
|
|||
// Draw all items immediately (without caching)
|
||||
BOOST_FOREACH( VIEW_ITEM* item, m_items )
|
||||
{
|
||||
aGal->PushDepth();
|
||||
|
||||
int layers[VIEW::VIEW_MAX_LAYERS], layers_count;
|
||||
item->ViewGetLayers( layers, layers_count );
|
||||
m_view->SortLayers( layers, layers_count );
|
||||
|
@ -110,12 +102,14 @@ void VIEW_GROUP::ViewDraw( int aLayer, GAL* aGal ) const
|
|||
{
|
||||
if( m_view->IsCached( layers[i] ) && m_view->IsLayerVisible( layers[i] ) )
|
||||
{
|
||||
aGal->SetLayerDepth( m_view->GetLayerOrder( layers[i] ) );
|
||||
aGal->AdvanceDepth();
|
||||
|
||||
if( !painter->Draw( item, layers[i] ) )
|
||||
item->ViewDraw( layers[i], aGal ); // Alternative drawing method
|
||||
}
|
||||
}
|
||||
|
||||
aGal->PopDepth();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -128,6 +122,34 @@ void VIEW_GROUP::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
}
|
||||
|
||||
|
||||
void VIEW_GROUP::FreeItems()
|
||||
{
|
||||
BOOST_FOREACH( VIEW_ITEM* item, m_items )
|
||||
{
|
||||
delete item;
|
||||
}
|
||||
m_items.clear();
|
||||
}
|
||||
|
||||
|
||||
void VIEW_GROUP::ItemsSetVisibility( bool aVisible )
|
||||
{
|
||||
std::set<VIEW_ITEM*>::const_iterator it, it_end;
|
||||
|
||||
for( it = m_items.begin(), it_end = m_items.end(); it != it_end; ++it )
|
||||
(*it)->ViewSetVisible( aVisible );
|
||||
}
|
||||
|
||||
|
||||
void VIEW_GROUP::ItemsViewUpdate( VIEW_ITEM::ViewUpdateFlags aFlags )
|
||||
{
|
||||
std::set<VIEW_ITEM*>::const_iterator it, it_end;
|
||||
|
||||
for( it = m_items.begin(), it_end = m_items.end(); it != it_end; ++it )
|
||||
(*it)->ViewUpdate( aFlags );
|
||||
}
|
||||
|
||||
|
||||
void VIEW_GROUP::updateBbox()
|
||||
{
|
||||
// Save the used VIEW, as it used nulled during Remove()
|
||||
|
|
|
@ -23,11 +23,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @file worksheet_item.cpp
|
||||
* @file worksheet_viewitem.cpp
|
||||
* @brief Class that handles properties and drawing of worksheet layout.
|
||||
*/
|
||||
|
||||
#include <worksheet_item.h>
|
||||
#include <worksheet_viewitem.h>
|
||||
#include <worksheet_shape_builder.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
#include <painter.h>
|
||||
|
@ -36,28 +36,28 @@
|
|||
|
||||
using namespace KiGfx;
|
||||
|
||||
WORKSHEET_ITEM::WORKSHEET_ITEM( const std::string& aFileName, const std::string& aSheetName,
|
||||
WORKSHEET_VIEWITEM::WORKSHEET_VIEWITEM( const std::string& aFileName, const std::string& aSheetName,
|
||||
const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock ) :
|
||||
EDA_ITEM( NOT_USED ), // this item is never added to a BOARD so it needs no type
|
||||
m_fileName( aFileName ), m_sheetName( aSheetName ),
|
||||
m_titleBlock( aTitleBlock ), m_pageInfo( aPageInfo ), m_sheetNumber( 1 ), m_sheetCount( 1 ) {}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::SetPageInfo( const PAGE_INFO* aPageInfo )
|
||||
void WORKSHEET_VIEWITEM::SetPageInfo( const PAGE_INFO* aPageInfo )
|
||||
{
|
||||
m_pageInfo = aPageInfo;
|
||||
ViewUpdate( GEOMETRY );
|
||||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::SetTitleBlock( const TITLE_BLOCK* aTitleBlock )
|
||||
void WORKSHEET_VIEWITEM::SetTitleBlock( const TITLE_BLOCK* aTitleBlock )
|
||||
{
|
||||
m_titleBlock = aTitleBlock;
|
||||
ViewUpdate( GEOMETRY );
|
||||
}
|
||||
|
||||
|
||||
const BOX2I WORKSHEET_ITEM::ViewBBox() const
|
||||
const BOX2I WORKSHEET_VIEWITEM::ViewBBox() const
|
||||
{
|
||||
BOX2I bbox;
|
||||
|
||||
|
@ -76,7 +76,7 @@ const BOX2I WORKSHEET_ITEM::ViewBBox() const
|
|||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::ViewDraw( int aLayer, GAL* aGal ) const
|
||||
void WORKSHEET_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
|
||||
{
|
||||
RENDER_SETTINGS* settings = m_view->GetPainter()->GetSettings();
|
||||
wxString fileName( m_fileName.c_str(), wxConvUTF8 );
|
||||
|
@ -128,14 +128,14 @@ void WORKSHEET_ITEM::ViewDraw( int aLayer, GAL* aGal ) const
|
|||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
void WORKSHEET_VIEWITEM::ViewGetLayers( int aLayers[], int& aCount ) const
|
||||
{
|
||||
aCount = 1;
|
||||
aLayers[0] = ITEM_GAL_LAYER( WORKSHEET );
|
||||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_LINE* aItem, GAL* aGal ) const
|
||||
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_LINE* aItem, GAL* aGal ) const
|
||||
{
|
||||
aGal->SetIsStroke( true );
|
||||
aGal->SetIsFill( false );
|
||||
|
@ -145,7 +145,7 @@ void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_LINE* aItem, GAL* aGal ) const
|
|||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_RECT* aItem, GAL* aGal ) const
|
||||
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_RECT* aItem, GAL* aGal ) const
|
||||
{
|
||||
aGal->SetIsStroke( true );
|
||||
aGal->SetIsFill( false );
|
||||
|
@ -155,7 +155,7 @@ void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_RECT* aItem, GAL* aGal ) const
|
|||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_POLYGON* aItem, GAL* aGal ) const
|
||||
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_POLYGON* aItem, GAL* aGal ) const
|
||||
{
|
||||
std::deque<VECTOR2D> corners;
|
||||
BOOST_FOREACH( wxPoint point, aItem->m_Corners )
|
||||
|
@ -181,7 +181,7 @@ void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_POLYGON* aItem, GAL* aGal ) const
|
|||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
|
||||
void WORKSHEET_VIEWITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
|
||||
{
|
||||
VECTOR2D position( aItem->GetTextPosition().x, aItem->GetTextPosition().y );
|
||||
|
||||
|
@ -192,7 +192,7 @@ void WORKSHEET_ITEM::draw( const WS_DRAW_ITEM_TEXT* aItem, GAL* aGal ) const
|
|||
}
|
||||
|
||||
|
||||
void WORKSHEET_ITEM::drawBorder( GAL* aGal ) const
|
||||
void WORKSHEET_VIEWITEM::drawBorder( GAL* aGal ) const
|
||||
{
|
||||
VECTOR2D origin = VECTOR2D( 0.0, 0.0 );
|
||||
VECTOR2D end = VECTOR2D( m_pageInfo->GetWidthMils() * 25400,
|
|
@ -38,13 +38,11 @@ namespace KiGfx
|
|||
*/
|
||||
enum RenderTarget
|
||||
{
|
||||
TARGET_CACHED, ///< Main rendering target (cached)
|
||||
TARGET_CACHED = 0, ///< Main rendering target (cached)
|
||||
TARGET_NONCACHED, ///< Auxiliary rendering target (noncached)
|
||||
TARGET_OVERLAY ///< Items that may change while the view stays the same (noncached)
|
||||
TARGET_OVERLAY, ///< Items that may change while the view stays the same (noncached)
|
||||
TARGETS_NUMBER ///< Number of available rendering targets
|
||||
};
|
||||
|
||||
/// Number of available rendering targets
|
||||
static const int TARGETS_NUMBER = 3;
|
||||
}
|
||||
|
||||
#endif /* DEFINITIONS_H_ */
|
||||
|
|
|
@ -798,7 +798,7 @@ public:
|
|||
*/
|
||||
inline void AdvanceDepth()
|
||||
{
|
||||
layerDepth -= std::numeric_limits<double>::epsilon();
|
||||
layerDepth -= 0.001;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -261,7 +261,6 @@ enum PCB_VISIBLE
|
|||
PAD_BK_NETNAMES_VISIBLE,
|
||||
PADS_NETNAMES_VISIBLE,
|
||||
|
||||
SELECTION,
|
||||
WORKSHEET,
|
||||
GP_OVERLAY, // General purpose overlay
|
||||
|
||||
|
|
|
@ -500,7 +500,7 @@ private:
|
|||
|
||||
// Function objects that need to access VIEW/VIEW_ITEM private/protected members
|
||||
struct clearLayerCache;
|
||||
struct recacheLayer;
|
||||
struct recacheItem;
|
||||
struct drawItem;
|
||||
struct unlinkItem;
|
||||
struct updateItemsColor;
|
||||
|
|
|
@ -45,6 +45,10 @@ public:
|
|||
VIEW_GROUP( VIEW* aView = NULL );
|
||||
virtual ~VIEW_GROUP();
|
||||
|
||||
/// Helper typedefs
|
||||
typedef std::set<VIEW_ITEM*>::const_iterator const_iter;
|
||||
typedef std::set<VIEW_ITEM*>::iterator iter;
|
||||
|
||||
/**
|
||||
* Function Add()
|
||||
* Adds an item to the group.
|
||||
|
@ -71,7 +75,7 @@ public:
|
|||
* Function Begin()
|
||||
* Returns iterator to beginning.
|
||||
*/
|
||||
inline std::set<VIEW_ITEM*>::const_iterator Begin() const
|
||||
inline const_iter Begin() const
|
||||
{
|
||||
return m_items.begin();
|
||||
}
|
||||
|
@ -80,7 +84,7 @@ public:
|
|||
* Function End()
|
||||
* Returns iterator to end.
|
||||
*/
|
||||
inline std::set<VIEW_ITEM*>::const_iterator End() const
|
||||
inline const_iter End() const
|
||||
{
|
||||
return m_items.end();
|
||||
}
|
||||
|
@ -147,6 +151,22 @@ public:
|
|||
return m_view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function ItemsSetVisibility()
|
||||
* Sets visibility of items stored in the VIEW_GROUP.
|
||||
*
|
||||
* @param aVisible decides if items should be visible or not.
|
||||
*/
|
||||
virtual void ItemsSetVisibility( bool aVisible );
|
||||
|
||||
/**
|
||||
* Function ItemsViewUpdate()
|
||||
* Updates items stored in the VIEW_GROUP.
|
||||
*
|
||||
* @param aFlags determines the way in which items will be updated.
|
||||
*/
|
||||
virtual void ItemsViewUpdate( VIEW_ITEM::ViewUpdateFlags aFlags );
|
||||
|
||||
protected:
|
||||
/// These functions cannot be used with VIEW_GROUP as they are intended only to work with
|
||||
/// singular VIEW_ITEMs (there is only one-to-one relation between item/layer combination and
|
||||
|
|
|
@ -23,12 +23,12 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* @file worksheet_item.h
|
||||
* @file worksheet_viewitem.h
|
||||
* @brief Class that handles properties and drawing of worksheet layout.
|
||||
*/
|
||||
|
||||
#ifndef WORKSHEET_ITEM_H
|
||||
#define WORKSHEET_ITEM_H
|
||||
#ifndef WORKSHEET_VIEWITEM_H
|
||||
#define WORKSHEET_VIEWITEM_H
|
||||
|
||||
#include <base_struct.h>
|
||||
|
||||
|
@ -44,12 +44,11 @@ namespace KiGfx
|
|||
{
|
||||
class GAL;
|
||||
|
||||
class WORKSHEET_ITEM : public EDA_ITEM
|
||||
class WORKSHEET_VIEWITEM : public EDA_ITEM
|
||||
{
|
||||
public:
|
||||
WORKSHEET_ITEM( const std::string& aFileName, const std::string& aSheetName,
|
||||
WORKSHEET_VIEWITEM( const std::string& aFileName, const std::string& aSheetName,
|
||||
const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock );
|
||||
~WORKSHEET_ITEM() {}
|
||||
|
||||
/**
|
||||
* Function SetFileName()
|
||||
|
@ -160,4 +159,4 @@ protected:
|
|||
};
|
||||
}
|
||||
|
||||
#endif /* WORKSHEET_ITEM_H */
|
||||
#endif /* WORKSHEET_VIEWITEM_H */
|
|
@ -115,6 +115,8 @@ protected:
|
|||
MODULE* loadFootprint( const FPID& aFootprintId )
|
||||
throw( IO_ERROR, PARSE_ERROR );
|
||||
|
||||
///> Rendering order of layers on GAL-based canvas (lower index in the array
|
||||
///> means that layer is displayed closer to the user, ie. on the top).
|
||||
static const LAYER_NUM GAL_LAYER_ORDER[];
|
||||
|
||||
public:
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include <math/vector2d.h>
|
||||
#include <trigo.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <worksheet_item.h>
|
||||
#include <worksheet_viewitem.h>
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tool_dispatcher.h>
|
||||
|
@ -70,11 +70,9 @@ static const wxString DisplayModuleTextEntry( wxT( "DiModTx" ) );
|
|||
static const wxString FastGrid1Entry( wxT( "FastGrid1" ) );
|
||||
static const wxString FastGrid2Entry( wxT( "FastGrid2" ) );
|
||||
|
||||
/// Rendering order of layers on GAL-based canvas (lower index in the array
|
||||
/// means that layer is displayed closer to the user, ie. on the top).
|
||||
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 ),
|
||||
DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N,
|
||||
UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31,
|
||||
|
@ -242,7 +240,7 @@ void PCB_BASE_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
|
|||
}
|
||||
|
||||
// Add an entry for the worksheet layout
|
||||
KiGfx::WORKSHEET_ITEM* worksheet = new KiGfx::WORKSHEET_ITEM(
|
||||
KiGfx::WORKSHEET_VIEWITEM* worksheet = new KiGfx::WORKSHEET_VIEWITEM(
|
||||
std::string( aBoard->GetFileName().mb_str() ),
|
||||
std::string( GetScreenDesc().mb_str() ),
|
||||
&GetPageSettings(), &GetTitleBlock() );
|
||||
|
@ -897,7 +895,6 @@ void PCB_BASE_FRAME::LoadSettings()
|
|||
view->SetRequired( SOLDERPASTE_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 );
|
||||
|
||||
// Apply layer coloring scheme & display options
|
||||
|
|
|
@ -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
|
||||
{
|
||||
return new DIMENSION( *this );
|
||||
|
|
|
@ -147,9 +147,6 @@ public:
|
|||
/// @copydoc VIEW_ITEM::ViewBBox()
|
||||
virtual const BOX2I ViewBBox() const;
|
||||
|
||||
/// @copydoc VIEW_ITEM::ViewGetLayers()
|
||||
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;
|
||||
|
||||
#if defined(DEBUG)
|
||||
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
|
|
|
@ -1024,10 +1024,3 @@ void MODULE::SetOrientation( double newangle )
|
|||
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:
|
|||
/// Return the initial comments block or NULL if none, without transfer of ownership.
|
||||
const wxArrayString* GetInitialComments() const { return m_initial_comments; }
|
||||
|
||||
/// @copydoc VIEW_ITEM::ViewGetLayers()
|
||||
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;
|
||||
|
||||
#if defined(DEBUG)
|
||||
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
|
|
|
@ -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:
|
|||
/// @copydoc VIEW_ITEM::ViewBBox()
|
||||
virtual const BOX2I ViewBBox() const;
|
||||
|
||||
/// @copydoc VIEW_ITEM::ViewGetLayers()
|
||||
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;
|
||||
|
||||
#if defined(DEBUG)
|
||||
virtual void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
|
||||
#endif
|
||||
|
|
|
@ -472,8 +472,5 @@ void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
break;
|
||||
}
|
||||
|
||||
// On the general purpose overlay there is a selection box displayed
|
||||
aLayers[1] = ITEM_GAL_LAYER( SELECTION );
|
||||
|
||||
aCount = 2;
|
||||
aCount = 1;
|
||||
}
|
||||
|
|
|
@ -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_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( SELECTION )] = COLOR4D( 1.0, 1.0, 1.0, 0.5 );
|
||||
|
||||
// Netnames for copper layers
|
||||
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 )
|
|||
draw( (DRAWSEGMENT*) aItem );
|
||||
break;
|
||||
|
||||
case PCB_MODULE_T:
|
||||
draw( (MODULE*) aItem, aLayer );
|
||||
break;
|
||||
|
||||
case PCB_TEXT_T:
|
||||
draw( (TEXTE_PCB*) aItem, aLayer );
|
||||
break;
|
||||
|
@ -593,8 +588,6 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
|
|||
VECTOR2D deltaPadSize = size - padSize; // = solder[Paste/Mask]Margin or 0
|
||||
VECTOR2D delta = VECTOR2D( aPad->GetDelta().x / 2,
|
||||
aPad->GetDelta().y / 2 );
|
||||
VECTOR2D inflate = VECTOR2D( delta.y * ( deltaPadSize.x / size.x ),
|
||||
delta.x * ( deltaPadSize.y / size.y ) );
|
||||
|
||||
aPad->BuildPadPolygon( corners, wxSize( deltaPadSize.x, deltaPadSize.y ), 0.0 );
|
||||
pointList.push_back( VECTOR2D( corners[0] ) );
|
||||
|
@ -699,63 +692,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 )
|
||||
{
|
||||
if( aLayer == ITEM_GAL_LAYER( SELECTION ) )
|
||||
{
|
||||
if( aText->IsSelected() )
|
||||
drawSelectionBox( aText );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( aText->GetText().Length() == 0 )
|
||||
return;
|
||||
if( aText->GetText().Length() == 0 )
|
||||
return;
|
||||
|
||||
COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aText->GetLayer() );
|
||||
VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y );
|
||||
double orientation = aText->GetOrientation() * M_PI / 1800.0;
|
||||
COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aText->GetLayer() );
|
||||
VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y );
|
||||
double orientation = aText->GetOrientation() * 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 );
|
||||
}
|
||||
|
||||
|
||||
void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
|
||||
{
|
||||
if( aLayer == ITEM_GAL_LAYER( SELECTION ) )
|
||||
{
|
||||
if( aText->IsSelected() )
|
||||
drawSelectionBox( aText );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( aText->GetLength() == 0 )
|
||||
return;
|
||||
if( aText->GetLength() == 0 )
|
||||
return;
|
||||
|
||||
COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aLayer );
|
||||
VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y );
|
||||
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 );
|
||||
}
|
||||
COLOR4D strokeColor = m_pcbSettings->GetColor( aText, aLayer );
|
||||
VECTOR2D position( aText->GetTextPosition().x, aText->GetTextPosition().y );
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -830,41 +795,32 @@ void PCB_PAINTER::draw( const ZONE_CONTAINER* aZone )
|
|||
|
||||
void PCB_PAINTER::draw( const DIMENSION* aDimension, int aLayer )
|
||||
{
|
||||
if( aLayer == ITEM_GAL_LAYER( SELECTION ) )
|
||||
{
|
||||
if( aDimension->IsSelected() )
|
||||
drawSelectionBox( aDimension );
|
||||
}
|
||||
else
|
||||
{
|
||||
int layer = aDimension->GetLayer();
|
||||
COLOR4D strokeColor = m_pcbSettings->GetColor( aDimension, layer );
|
||||
COLOR4D strokeColor = m_pcbSettings->GetColor( aDimension, aLayer );
|
||||
|
||||
m_gal->SetStrokeColor( strokeColor );
|
||||
m_gal->SetIsFill( false );
|
||||
m_gal->SetIsStroke( true );
|
||||
m_gal->SetLineWidth( aDimension->GetWidth() );
|
||||
m_gal->SetStrokeColor( strokeColor );
|
||||
m_gal->SetIsFill( false );
|
||||
m_gal->SetIsStroke( true );
|
||||
m_gal->SetLineWidth( aDimension->GetWidth() );
|
||||
|
||||
// Draw an arrow
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_crossBarO ), VECTOR2D( aDimension->m_crossBarF ) );
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineGO ),
|
||||
VECTOR2D( aDimension->m_featureLineGF ) );
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineDO ),
|
||||
VECTOR2D( aDimension->m_featureLineDF ) );
|
||||
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_arrowG1O ), VECTOR2D( aDimension->m_arrowG1F ) );
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_arrowG2O ), VECTOR2D( aDimension->m_arrowG2F ) );
|
||||
// Draw an arrow
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_crossBarO ), VECTOR2D( aDimension->m_crossBarF ) );
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineGO ),
|
||||
VECTOR2D( aDimension->m_featureLineGF ) );
|
||||
m_gal->DrawLine( VECTOR2D( aDimension->m_featureLineDO ),
|
||||
VECTOR2D( |