7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 00:21:31 +00:00

- New typedef LAYER_MSK to encapsulate a layer bitmap

- Renamed ReturnMaskLayer to GetLayerMask (since it's a plain getter)
This commit is contained in:
Lorenzo Marcantonio 2013-03-30 18:24:04 +01:00
parent 1702ab3a00
commit e0303a4558
76 changed files with 329 additions and 307 deletions

View File

@ -320,7 +320,7 @@ void EDA_DRAW_FRAME::ToolOnRightClick( wxCommandEvent& event )
}
void EDA_DRAW_FRAME::PrintPage( wxDC* aDC,int aPrintMask, bool aPrintMirrorMode, void* aData )
void EDA_DRAW_FRAME::PrintPage( wxDC* aDC,LAYER_MSK aPrintMask, bool aPrintMirrorMode, void* aData )
{
wxMessageBox( wxT("EDA_DRAW_FRAME::PrintPage() error") );
}

View File

@ -71,7 +71,7 @@ int GetLayerMask( int aLayerNumber )
/* Look up Table for conversion copper layer count -> general copper layer
* mask: */
int g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS] = {
0x0001, 0x8001, 0x8003, 0x8007,
0x800F, 0x801F, 0x803F, 0x807F,
0x80FF, 0x81FF, 0x83FF, 0x87FF,

View File

@ -144,7 +144,7 @@ void LIB_EDIT_FRAME::SVG_Print_Component( const wxString& FullFileName )
plotBW, plotFrameRef );
}
void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData)
void LIB_EDIT_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirrorMode, void* aData)
{
if( ! m_component )
return;

View File

@ -637,7 +637,7 @@ public:
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, int aPrintMask,
virtual void PrintPage( wxDC* aDC, LAYER_MSK aPrintMask,
bool aPrintMirrorMode, void* aData = NULL );
/**

View File

@ -848,7 +848,8 @@ void SCH_EDIT_FRAME::OnPrint( wxCommandEvent& event )
}
}
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData )
void SCH_EDIT_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirrorMode,
void* aData )
{
GetScreen()->Draw( m_canvas, aDC, GR_DEFAULT_DRAWMODE );
TraceWorkSheet( aDC, GetScreen(), GetDefaultLineThickness(), IU_PER_MILS,

View File

@ -29,7 +29,7 @@ GBR_LAYOUT::~GBR_LAYOUT()
*/
bool GBR_LAYOUT::IsLayerVisible( int aLayerIndex ) const
{
return m_printLayersMask & (1 << aLayerIndex );
return m_printLayersMask & GetLayerMask( aLayerIndex );
}

View File

@ -15,6 +15,7 @@
#include <class_title_block.h>
#include <class_gerber_draw_item.h>
#include <gr_basic.h>
/**
* Class GBR_LAYOUT
@ -27,7 +28,7 @@ private:
PAGE_INFO m_paper;
TITLE_BLOCK m_titles;
wxPoint m_originAxisPosition;
int m_printLayersMask; // When printing: the list of layers to print
LAYER_MSK m_printLayersMask; // When printing: the list of layers to print
public:
DLIST<GERBER_DRAW_ITEM> m_Drawings; // linked list of Gerber Items
@ -90,7 +91,7 @@ public:
* changes the bit-mask of visible layers
* @param aLayerMask = The new bit-mask of visible layers
*/
void SetVisibleLayers( int aLayerMask )
void SetVisibleLayers( LAYER_MSK aLayerMask )
{
m_printLayersMask = aLayerMask;
}

View File

@ -8,6 +8,7 @@
#include <base_units.h>
#include <class_base_screen.h>
#include <layers_id_colors_and_visibility.h>
#define ZOOM_FACTOR( x ) ( x * IU_PER_DECIMILS )

View File

@ -31,6 +31,7 @@
#include <base_struct.h>
#include <dlist.h>
#include <layers_id_colors_and_visibility.h>
#include <gr_basic.h>
class GERBER_IMAGE;
@ -133,9 +134,9 @@ public:
*/
void SetLayer( int aLayer ) { m_Layer = aLayer; }
int ReturnMaskLayer()
LAYER_MSK GetLayerMask()
{
return 1 << m_Layer;
return ::GetLayerMask( m_Layer );
}
bool GetLayerPolarity()

View File

@ -163,7 +163,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
int rowCount;
int menuId = event.GetId();
bool visible = (menuId == ID_SHOW_ALL_COPPERS) ? true : false;;
int visibleLayers = 0;
LAYER_MSK visibleLayers = NO_LAYERS;
switch( menuId )
{
@ -181,9 +181,9 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
wxCheckBox* cb = (wxCheckBox*) getLayerComp( row, 3 );
cb->SetValue( loc_visible );
if( loc_visible )
visibleLayers |= (1 << row);
visibleLayers |= GetLayerMask( row );
else
visibleLayers &= ~(1 << row);
visibleLayers &= ~GetLayerMask( row );
}
myframe->SetVisibleLayers( visibleLayers );
@ -235,12 +235,12 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal )
{
int visibleLayers = myframe->GetVisibleLayers();
LAYER_MSK visibleLayers = myframe->GetVisibleLayers();
if( isVisible )
visibleLayers |= (1 << aLayer);
visibleLayers |= GetLayerMask( aLayer );
else
visibleLayers &= ~(1 << aLayer);
visibleLayers &= ~GetLayerMask( aLayer );
myframe->SetVisibleLayers( visibleLayers );

View File

@ -188,7 +188,7 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
{
m_BoxSelectLayer[layer]->SetValue( option );
if( option )
s_SelectedLayers |= 1 << layer;
s_SelectedLayers |= GetLayerMask( layer );
}
}
}
@ -223,15 +223,15 @@ void DIALOG_PRINT_USING_PRINTER::InitValues( )
int DIALOG_PRINT_USING_PRINTER::SetLayerMaskFromListSelection()
/**************************************************************/
{
int page_count;
s_Parameters.m_PrintMaskLayer = 0;
int page_count = 0;
s_Parameters.m_PrintMaskLayer = NO_LAYERS;
int ii;
for( ii = 0, page_count = 0; ii < GERBVIEW_LAYER_COUNT; ii++ )
{
if( m_BoxSelectLayer[ii]->IsChecked() )
{
page_count++;
s_Parameters.m_PrintMaskLayer |= 1 << ii;
s_Parameters.m_PrintMaskLayer |= GetLayerMask( ii );
}
}

View File

@ -41,11 +41,11 @@
#include <class_GERBER.h>
void GERBVIEW_FRAME::PrintPage( wxDC* aDC, int aPrintMasklayer,
void GERBVIEW_FRAME::PrintPage( wxDC* aDC, LAYER_MSK aPrintMasklayer,
bool aPrintMirrorMode, void* aData )
{
// Save current draw options, because print mode has specific options:
int visiblemask = GetVisibleLayers();
LAYER_MSK visiblemask = GetVisibleLayers();
GBR_DISPLAY_OPTIONS imgDisplayOptions = m_DisplayOptions;
// Set draw options for printing:

View File

@ -537,7 +537,7 @@ void GERBVIEW_FRAME::SetVisibleAlls()
* Returns a bit-mask of all the layers that are visible
* @return int - the visible layers in bit-mapped form.
*/
int GERBVIEW_FRAME::GetVisibleLayers() const
LAYER_MSK GERBVIEW_FRAME::GetVisibleLayers() const
{
return -1; // TODO
}
@ -549,7 +549,7 @@ int GERBVIEW_FRAME::GetVisibleLayers() const
* changes the bit-mask of visible layers
* @param aLayerMask = The new bit-mask of visible layers
*/
void GERBVIEW_FRAME::SetVisibleLayers( int aLayerMask )
void GERBVIEW_FRAME::SetVisibleLayers( LAYER_MSK aLayerMask )
{
GetLayout()->SetVisibleLayers( aLayerMask );
}

View File

@ -37,6 +37,7 @@
#include <gerbview.h>
#include <class_gbr_layout.h>
#include <class_gbr_screen.h>
#include <layers_id_colors_and_visibility.h>
#define NO_AVAILABLE_LAYERS -1
@ -299,7 +300,7 @@ public:
* Returns a bit-mask of all the layers that are visible
* @return int - the visible layers in bit-mapped form.
*/
int GetVisibleLayers() const;
LAYER_MSK GetVisibleLayers() const;
/**
* Function SetVisibleLayers
@ -307,7 +308,7 @@ public:
* changes the bit-mask of visible layers
* @param aLayerMask = The new bit-mask of visible layers
*/
void SetVisibleLayers( int aLayerMask );
void SetVisibleLayers( LAYER_MSK aLayerMask );
/**
* Function IsLayerVisible
@ -716,7 +717,7 @@ public:
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, int aPrintMasklayer, bool aPrintMirrorMode,
virtual void PrintPage( wxDC* aDC, LAYER_MSK aPrintMasklayer, bool aPrintMirrorMode,
void* aData = NULL );
/**

View File

@ -56,7 +56,7 @@ public:
* returns a bit-mask of all the layers that are visible
* @return int - the visible layers in bit-mapped form.
*/
int GetVisibleLayers() const;
LAYER_MSK GetVisibleLayers() const;
/**
* Function SetVisibleAlls
@ -70,7 +70,7 @@ public:
* changes the bit-mask of visible layers
* @param aMask = The new bit-mask of visible layers
*/
void SetVisibleLayers( int aMask );
void SetVisibleLayers( LAYER_MSK aMask );
/**
* Function IsLayerVisible
@ -85,7 +85,7 @@ public:
return false;
// If a layer is disabled, it is automatically invisible
return (bool) ( m_VisibleLayers & m_EnabledLayers & (1 << aLayerIndex) );
return bool( m_VisibleLayers & m_EnabledLayers & GetLayerMask( aLayerIndex ) );
}
/**
@ -143,7 +143,7 @@ public:
* returns a bit-mask of all the layers that are enabled
* @return int - the enabled layers in bit-mapped form.
*/
inline int GetEnabledLayers() const
inline LAYER_MSK GetEnabledLayers() const
{
return m_EnabledLayers;
}
@ -153,7 +153,7 @@ public:
* changes the bit-mask of enabled layers
* @param aMask = The new bit-mask of enabled layers
*/
void SetEnabledLayers( int aMask );
void SetEnabledLayers( LAYER_MSK aMask );
/**
* Function IsLayerEnabled
@ -163,7 +163,7 @@ public:
*/
bool IsLayerEnabled( int aLayerIndex ) const
{
return bool( m_EnabledLayers & (1 << aLayerIndex) );
return bool( m_EnabledLayers & GetLayerMask( aLayerIndex ) );
}
/**
@ -194,11 +194,11 @@ public:
void SetBoardThickness( int aThickness ) { m_boardThickness = aThickness; }
private:
int m_CopperLayerCount; ///< Number of copper layers for this design
int m_EnabledLayers; ///< Bit-mask for layer enabling
int m_VisibleLayers; ///< Bit-mask for layer visibility
int m_VisibleElements; ///< Bit-mask for element category visibility
int m_boardThickness; ///< Board thickness for 3D viewer
int m_CopperLayerCount; ///< Number of copper layers for this design
LAYER_MSK m_EnabledLayers; ///< Bit-mask for layer enabling
LAYER_MSK m_VisibleLayers; ///< Bit-mask for layer visibility
int m_VisibleElements; ///< Bit-mask for element category visibility
int m_boardThickness; ///< Board thickness for 3D viewer
};
#endif // BOARD_DESIGN_SETTINGS_H_

View File

@ -34,7 +34,8 @@
#include <base_struct.h>
#include <gr_basic.h>
#include <boost/ptr_container/ptr_vector.hpp>
#include <gr_basic.h>
#include <layers_id_colors_and_visibility.h>
/// Abbrevation for fomatting internal units to a string.
#define FMT_IU BOARD_ITEM::FormatInternalUnits

View File

@ -5,6 +5,7 @@
#ifndef _COLORS_DESIGN_SETTING_H
#define _COLORS_DESIGN_SETTING_H
#include <layers_id_colors_and_visibility.h>
#define LAYERSCOLORSBUFFERSIZE 32
#define ITEMSCOLORSBUFFERSIZE 32

View File

@ -3,6 +3,7 @@
#include <hotkeys_basic.h>
#include <wx/bmpcbox.h>
#include <layers_id_colors_and_visibility.h>
class wxAuiToolBar;

View File

@ -51,6 +51,7 @@
#define LAYER_COUNT 32
// Masks to identify a layer by a bit map
typedef unsigned LAYER_MSK;
#define LAYER_BACK (1 << LAYER_N_BACK) ///< bit mask for copper layer
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3
@ -92,6 +93,16 @@
#define ALL_CU_LAYERS 0x0000FFFF
#define INTERNAL_LAYERS 0x00007FFE
#define EXTERNAL_LAYERS 0x00008001
#define NO_LAYERS 0x00000000
/** return a one bit layer mask from a layer number
* aLayerNumber = the layer number to convert (0 .. LAYERS-1)
*/
inline LAYER_MSK GetLayerMask( unsigned aLayerNumber )
{
return 1 << aLayerNumber;
}
// layers order in dialogs (plot, print and toolbars)

View File

@ -18,16 +18,8 @@ class TRACK;
class BOARD;
class DISPLAY_OPTIONS;
/**
* Function GetLayerMask
* @return a one bit layer mask from a layer number
* @param aLayerNumber = the layer number to convert (0 .. LAYER_COUNT-1)
*/
int GetLayerMask( int aLayerNumber );
/// Look up Table for conversion copper layer count -> general copper layer mask:
extern int g_TabAllCopperLayerMask[NB_COPPER_LAYERS];
extern LAYER_MSK g_TabAllCopperLayerMask[NB_COPPER_LAYERS];
extern DISPLAY_OPTIONS DisplayOpt;

View File

@ -1219,7 +1219,7 @@ public:
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, int aPrintMask,
virtual void PrintPage( wxDC* aDC, LAYER_MSK aPrintMask,
bool aPrintMirrorMode, void* aData = NULL );
void SetSimulatorCommand( const wxString& aCommand ) { m_simulatorCommand = aCommand; }

View File

@ -270,7 +270,7 @@ public:
* @param aPrintMirrorMode = true to plot mirrored
* @param aData = a pointer on an auxiliary data (NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, int aPrintMaskLayer, bool aPrintMirrorMode,
virtual void PrintPage( wxDC* aDC, LAYER_MSK aPrintMaskLayer, bool aPrintMirrorMode,
void * aData = NULL );
void GetKicadAbout( wxCommandEvent& event );

View File

@ -43,7 +43,9 @@
#include <wx/docview.h>
#include <colors.h>
#include <fctsys.h>
#include <common.h>
#include <layers_id_colors_and_visibility.h>
#ifdef USE_WX_OVERLAY
#include <wx/overlay.h>
@ -880,7 +882,7 @@ public:
* @param aPrintMirrorMode = not used here (Set when printing in mirror mode)
* @param aData = a pointer on an auxiliary data (not always used, NULL if not used)
*/
virtual void PrintPage( wxDC* aDC, int aPrintMask, bool aPrintMirrorMode, void* aData = NULL );
virtual void PrintPage( wxDC* aDC, LAYER_MSK aPrintMask, bool aPrintMirrorMode, void* aData = NULL );
/**
* Function CoordinateToString

View File

@ -127,7 +127,7 @@ void BOARD::Move( const wxPoint& aMoveVector ) // overload
}
void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS* aList )
void BOARD::chainMarkedSegments( wxPoint aPosition, LAYER_MSK aLayerMask, TRACK_PTRS* aList )
{
TRACK* segment; // The current segment being analyzed.
TRACK* via; // The via identified, eventually destroy
@ -166,7 +166,7 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS*
if( via )
{
aLayerMask = via->ReturnMaskLayer();
aLayerMask = via->GetLayerMask();
aList->push_back( via );
}
@ -212,7 +212,7 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS*
* candidate:
* we must analyze connections to its other end
*/
aLayerMask = candidate->ReturnMaskLayer();
aLayerMask = candidate->GetLayerMask();
if( aPosition == candidate->GetStart() )
{
@ -227,7 +227,7 @@ void BOARD::chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS*
/* flag this item an push it in list of selected items */
aList->push_back( candidate );
candidate->SetState( BUSY, ON );
candidate->SetState( BUSY, true );
}
else
{
@ -542,25 +542,25 @@ void BOARD::SetCopperLayerCount( int aCount )
}
int BOARD::GetEnabledLayers() const
LAYER_MSK BOARD::GetEnabledLayers() const
{
return m_designSettings.GetEnabledLayers();
}
int BOARD::GetVisibleLayers() const
LAYER_MSK BOARD::GetVisibleLayers() const
{
return m_designSettings.GetVisibleLayers();
}
void BOARD::SetEnabledLayers( int aLayerMask )
void BOARD::SetEnabledLayers( LAYER_MSK aLayerMask )
{
m_designSettings.SetEnabledLayers( aLayerMask );
}
void BOARD::SetVisibleLayers( int aLayerMask )
void BOARD::SetVisibleLayers( LAYER_MSK aLayerMask )
{
m_designSettings.SetVisibleLayers( aLayerMask );
}
@ -1557,7 +1557,7 @@ TRACK* BOARD::GetViaByPosition( const wxPoint& aPosition, int aLayerMask )
}
D_PAD* BOARD::GetPad( const wxPoint& aPosition, int aLayerMask )
D_PAD* BOARD::GetPad( const wxPoint& aPosition, LAYER_MSK aLayerMask )
{
D_PAD* pad = NULL;
@ -1578,7 +1578,7 @@ D_PAD* BOARD::GetPad( TRACK* aTrace, int aEndPoint )
D_PAD* pad = NULL;
wxPoint aPosition;
int aLayerMask = GetLayerMask( aTrace->GetLayer() );
LAYER_MSK aLayerMask = GetLayerMask( aTrace->GetLayer() );
if( aEndPoint == FLG_START )
{
@ -1601,7 +1601,7 @@ D_PAD* BOARD::GetPad( TRACK* aTrace, int aEndPoint )
}
D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, int aLayerMask )
D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, LAYER_MSK aLayerMask )
{
for( unsigned i=0; i<GetPadCount(); ++i )
{
@ -1619,7 +1619,7 @@ D_PAD* BOARD::GetPadFast( const wxPoint& aPosition, int aLayerMask )
}
D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, int aLayerMask )
D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LAYER_MSK aLayerMask )
{
// Search the aPoint coordinates in aPadList
// aPadList is sorted by X then Y values, and a fast binary search is used
@ -1643,7 +1643,7 @@ D_PAD* BOARD::GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, i
if( pad->GetPosition() == aPosition ) // candidate found
{
// The pad must match the layer mask:
if( (aLayerMask & pad->GetLayerMask()) != 0 )
if( aLayerMask & pad->GetLayerMask())
return pad;
// More than one pad can be at aPosition
@ -1747,7 +1747,7 @@ void BOARD::GetSortedPadListByXthenYCoord( std::vector<D_PAD*>& aVector, int aNe
}
TRACK* BOARD::GetTrace( TRACK* aTrace, const wxPoint& aPosition, int aLayerMask )
TRACK* BOARD::GetTrace( TRACK* aTrace, const wxPoint& aPosition, LAYER_MSK aLayerMask )
{
for( TRACK* track = aTrace; track; track = track->Next() )
{
@ -1798,11 +1798,11 @@ TRACK* BOARD::MarkTrace( TRACK* aTrace, int* aCount,
// Ensure the flag BUSY of all tracks of the board is cleared
// because we use it to mark segments of the track
for( TRACK* track = m_Track; track; track = track->Next() )
track->SetState( BUSY, OFF );
track->SetState( BUSY, false );
/* Set flags of the initial track segment */
aTrace->SetState( BUSY, ON );
int layerMask = aTrace->ReturnMaskLayer();
aTrace->SetState( BUSY, true );
LAYER_MSK layerMask = aTrace->GetLayerMask();
trackList.push_back( aTrace );
@ -1838,13 +1838,13 @@ TRACK* BOARD::MarkTrace( TRACK* aTrace, int* aCount,
if( Segm1 ) // search for others segments connected to the initial segment start point
{
layerMask = Segm1->ReturnMaskLayer();
layerMask = Segm1->GetLayerMask();
chainMarkedSegments( aTrace->GetStart(), layerMask, &trackList );
}
if( Segm2 ) // search for others segments connected to the initial segment end point
{
layerMask = Segm2->ReturnMaskLayer();
layerMask = Segm2->GetLayerMask();
chainMarkedSegments( aTrace->GetStart(), layerMask, &trackList );
}
}
@ -1869,9 +1869,9 @@ TRACK* BOARD::MarkTrace( TRACK* aTrace, int* aCount,
if( via == aTrace )
continue;
via->SetState( BUSY, ON ); // Try to flag it. the flag will be cleared later if needed
via->SetState( BUSY, true ); // Try to flag it. the flag will be cleared later if needed
layerMask = via->ReturnMaskLayer();
layerMask = via->GetLayerMask();
TRACK* track = ::GetTrace( m_Track, NULL, via->GetStart(), layerMask );
@ -1901,7 +1901,7 @@ TRACK* BOARD::MarkTrace( TRACK* aTrace, int* aCount,
{
// The via connects segments of an other track: it is removed
// from list because it is member of an other track
via->SetState( BUSY, OFF );
via->SetState( BUSY, false );
break;
}
}
@ -1984,7 +1984,7 @@ TRACK* BOARD::MarkTrace( TRACK* aTrace, int* aCount,
if( track->GetState( BUSY ) )
{
NbSegmBusy++;
track->SetState( BUSY, OFF );
track->SetState( BUSY, false );
full_len += track->GetLength();
// Add now length die.
@ -2096,7 +2096,7 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, int aActiveLayer,
}
BOARD_CONNECTED_ITEM* BOARD::GetLockPoint( const wxPoint& aPosition, int aLayerMask )
BOARD_CONNECTED_ITEM* BOARD::GetLockPoint( const wxPoint& aPosition, LAYER_MSK aLayerMask )
{
for( MODULE* module = m_Modules; module; module = module->Next() )
{
@ -2155,7 +2155,7 @@ TRACK* BOARD::CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS
// The new segment begins at the new point,
newTrack->SetStart(lockPoint);
newTrack->start = aSegment;
newTrack->SetState( BEGIN_ONPAD, OFF );
newTrack->SetState( BEGIN_ONPAD, false );
DLIST<TRACK>* list = (DLIST<TRACK>*)aSegment->GetList();
wxASSERT( list );
@ -2177,16 +2177,16 @@ TRACK* BOARD::CreateLockPoint( wxPoint& aPosition, TRACK* aSegment, PICKED_ITEMS
// Old track segment now ends at new point.
aSegment->SetEnd(lockPoint);
aSegment->end = newTrack;
aSegment->SetState( END_ONPAD, OFF );
aSegment->SetState( END_ONPAD, false );
D_PAD * pad = GetPad( newTrack, FLG_START );
if ( pad )
{
newTrack->start = pad;
newTrack->SetState( BEGIN_ONPAD, ON );
newTrack->SetState( BEGIN_ONPAD, true );
aSegment->end = pad;
aSegment->SetState( END_ONPAD, ON );
aSegment->SetState( END_ONPAD, true );
}
aPosition = lockPoint;

View File

@ -234,7 +234,7 @@ private:
* @param aLayerMask The allowed layers for segments to search.
* @param aList The track list to fill with points of flagged segments.
*/
void chainMarkedSegments( wxPoint aPosition, int aLayerMask, TRACK_PTRS* aList );
void chainMarkedSegments( wxPoint aPosition, LAYER_MSK aLayerMask, TRACK_PTRS* aList );
void formatNetClass( NETCLASS* aNetClass, OUTPUTFORMATTER* aFormatter, int aNestLevel,
int aControlBits ) const
@ -425,7 +425,7 @@ public:
* Returns a bit-mask of all the layers that are enabled
* @return int - the enabled layers in bit-mapped form.
*/
int GetEnabledLayers() const;
LAYER_MSK GetEnabledLayers() const;
/**
* Function SetEnabledLayers
@ -433,7 +433,7 @@ public:
* Changes the bit-mask of enabled layers
* @param aLayerMask = The new bit-mask of enabled layers
*/
void SetEnabledLayers( int aLayerMask );
void SetEnabledLayers( LAYER_MSK aLayerMask );
/**
* Function IsLayerEnabled
@ -465,7 +465,7 @@ public:
* Returns a bit-mask of all the layers that are visible
* @return int - the visible layers in bit-mapped form.
*/
int GetVisibleLayers() const;
LAYER_MSK GetVisibleLayers() const;
/**
* Function SetVisibleLayers
@ -473,7 +473,7 @@ public:
* changes the bit-mask of visible layers
* @param aLayerMask = The new bit-mask of visible layers
*/
void SetVisibleLayers( int aLayerMask );
void SetVisibleLayers( LAYER_MSK aLayerMask );
// these 2 functions are not tidy at this time, since there are PCB_VISIBLEs that
// are not stored in the bitmap.
@ -1223,7 +1223,7 @@ public:
* @param aLayerMask A layer or layers to mask the hit test.
* @return A pointer to a D_PAD object if found or NULL if not found.
*/
D_PAD* GetPad( const wxPoint& aPosition, int aLayerMask = ALL_LAYERS );
D_PAD* GetPad( const wxPoint& aPosition, LAYER_MSK aLayerMask = ALL_LAYERS );
/**
* Function GetPad
@ -1245,7 +1245,7 @@ public:
* @param aLayer A layer or layers to mask the hit test.
* @return A pointer to a D_PAD object if found or NULL if not found.
*/
D_PAD* GetPadFast( const wxPoint& aPosition, int aLayer );
D_PAD* GetPadFast( const wxPoint& aPosition, LAYER_MSK aLayerMask );
/**
* Function GetPad
@ -1262,7 +1262,7 @@ public:
* @param aLayerMask A layer or layers to mask the hit test.
* @return a D_PAD object pointer to the connected pad.
*/
D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, int aLayerMask );
D_PAD* GetPad( std::vector<D_PAD*>& aPadList, const wxPoint& aPosition, LAYER_MSK aLayerMask );
/**
* Function GetSortedPadListByXthenYCoord
@ -1289,7 +1289,7 @@ public:
* layer mask.
* @return A TRACK object pointer if found otherwise NULL.
*/
TRACK* GetTrace( TRACK* aTrace, const wxPoint& aPosition, int aLayerMask );
TRACK* GetTrace( TRACK* aTrace, const wxPoint& aPosition, LAYER_MSK aLayerMask );
/**
* Function MarkTrace
@ -1348,7 +1348,7 @@ public:
* layer mask.
* @return A pointer to a BOARD_ITEM object if found otherwise NULL.
*/
BOARD_CONNECTED_ITEM* GetLockPoint( const wxPoint& aPosition, int aLayerMask );
BOARD_CONNECTED_ITEM* GetLockPoint( const wxPoint& aPosition, LAYER_MSK aLayerMask );
/**
* Function CreateLockPoint

Some files were not shown because too many files have changed in this diff Show More