Translate French code names and comments and other minor code cleaning.
This commit is contained in:
parent
4230ac4ca7
commit
e26cdada42
|
@ -20,7 +20,6 @@
|
|||
|
||||
|
||||
/* Forward declarations of classes. */
|
||||
class WinEDA_CvpcbFrame;
|
||||
class FOOTPRINT_EDIT_FRAME;
|
||||
class BOARD;
|
||||
class MODULE;
|
||||
|
@ -461,7 +460,7 @@ public:
|
|||
bool aPlotVia, GRTraceMode aPlotMode,
|
||||
bool aSkipNPTH_Pads = false );
|
||||
|
||||
void Plot_Serigraphie( PLOTTER* plotter, int masque_layer, GRTraceMode trace_mode );
|
||||
void PlotSilkScreen( PLOTTER* plotter, int masque_layer, GRTraceMode trace_mode );
|
||||
|
||||
/**
|
||||
* Function PlotDrillMark
|
||||
|
|
|
@ -1145,9 +1145,9 @@ public:
|
|||
void Delete_Drawings_All_Layer( int aLayer );
|
||||
|
||||
// Dimension handling:
|
||||
void Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC );
|
||||
DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC );
|
||||
void Delete_Dimension( DIMENSION* Dimension, wxDC* DC );
|
||||
void ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* aDC );
|
||||
DIMENSION* EditDimension( DIMENSION* aDimension, wxDC* aDC );
|
||||
void DeleteDimension( DIMENSION* aDimension, wxDC* aDC );
|
||||
|
||||
// netlist handling:
|
||||
void InstallNetlistFrame( wxDC* DC );
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*****************************/
|
||||
/* DIMENSION class definition */
|
||||
/*****************************/
|
||||
/**
|
||||
* @file class_dimension.cpp
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "gr_basic.h"
|
||||
|
@ -14,6 +14,7 @@
|
|||
#include "protos.h"
|
||||
#include "richio.h"
|
||||
|
||||
|
||||
DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
|
||||
BOARD_ITEM( aParent, TYPE_DIMENSION )
|
||||
{
|
||||
|
@ -32,25 +33,18 @@ DIMENSION::~DIMENSION()
|
|||
}
|
||||
|
||||
|
||||
/* Setup the dimension text */
|
||||
void DIMENSION::SetText( const wxString& NewText )
|
||||
{
|
||||
m_Text->m_Text = NewText;
|
||||
}
|
||||
|
||||
|
||||
/* Return the dimension text
|
||||
*/
|
||||
wxString DIMENSION::GetText( void ) const
|
||||
{
|
||||
return m_Text->m_Text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SetLayer
|
||||
* sets the layer this item is on.
|
||||
* @param aLayer The layer number.
|
||||
*/
|
||||
|
||||
void DIMENSION::SetLayer( int aLayer )
|
||||
{
|
||||
m_Layer = aLayer;
|
||||
|
@ -69,34 +63,34 @@ void DIMENSION::Copy( DIMENSION* source )
|
|||
m_TimeStamp = GetTimeStamp();
|
||||
m_Text->Copy( source->m_Text );
|
||||
|
||||
Barre_ox = source->Barre_ox;
|
||||
Barre_oy = source->Barre_oy;
|
||||
Barre_fx = source->Barre_fx;
|
||||
Barre_fy = source->Barre_fy;
|
||||
TraitG_ox = source->TraitG_ox;
|
||||
TraitG_oy = source->TraitG_oy;
|
||||
TraitG_fx = source->TraitG_fx;
|
||||
TraitG_fy = source->TraitG_fy;
|
||||
TraitD_ox = source->TraitD_ox;
|
||||
TraitD_oy = source->TraitD_oy;
|
||||
TraitD_fx = source->TraitD_fx;
|
||||
TraitD_fy = source->TraitD_fy;
|
||||
FlecheD1_ox = source->FlecheD1_ox;
|
||||
FlecheD1_oy = source->FlecheD1_oy;
|
||||
FlecheD1_fx = source->FlecheD1_fx;
|
||||
FlecheD1_fy = source->FlecheD1_fy;
|
||||
FlecheD2_ox = source->FlecheD2_ox;
|
||||
FlecheD2_oy = source->FlecheD2_oy;
|
||||
FlecheD2_fx = source->FlecheD2_fx;
|
||||
FlecheD2_fy = source->FlecheD2_fy;
|
||||
FlecheG1_ox = source->FlecheG1_ox;
|
||||
FlecheG1_oy = source->FlecheG1_oy;
|
||||
FlecheG1_fx = source->FlecheG1_fx;
|
||||
FlecheG1_fy = source->FlecheG1_fy;
|
||||
FlecheG2_ox = source->FlecheG2_ox;
|
||||
FlecheG2_oy = source->FlecheG2_oy;
|
||||
FlecheG2_fx = source->FlecheG2_fx;
|
||||
FlecheG2_fy = source->FlecheG2_fy;
|
||||
m_crossBarOx = source->m_crossBarOx;
|
||||
m_crossBarOy = source->m_crossBarOy;
|
||||
m_crossBarFx = source->m_crossBarFx;
|
||||
m_crossBarFy = source->m_crossBarFy;
|
||||
m_featureLineGOx = source->m_featureLineGOx;
|
||||
m_featureLineGOy = source->m_featureLineGOy;
|
||||
m_featureLineGFx = source->m_featureLineGFx;
|
||||
m_featureLineGFy = source->m_featureLineGFy;
|
||||
m_featureLineDOx = source->m_featureLineDOx;
|
||||
m_featureLineDOy = source->m_featureLineDOy;
|
||||
m_featureLineDFx = source->m_featureLineDFx;
|
||||
m_featureLineDFy = source->m_featureLineDFy;
|
||||
m_arrowD1Ox = source->m_arrowD1Ox;
|
||||
m_arrowD1Oy = source->m_arrowD1Oy;
|
||||
m_arrowD1Fx = source->m_arrowD1Fx;
|
||||
m_arrowD1Fy = source->m_arrowD1Fy;
|
||||
m_arrowD2Ox = source->m_arrowD2Ox;
|
||||
m_arrowD2Oy = source->m_arrowD2Oy;
|
||||
m_arrowD2Fx = source->m_arrowD2Fx;
|
||||
m_arrowD2Fy = source->m_arrowD2Fy;
|
||||
m_arrowG1Ox = source->m_arrowG1Ox;
|
||||
m_arrowG1Oy = source->m_arrowG1Oy;
|
||||
m_arrowG1Fx = source->m_arrowG1Fx;
|
||||
m_arrowG1Fy = source->m_arrowG1Fy;
|
||||
m_arrowG2Ox = source->m_arrowG2Ox;
|
||||
m_arrowG2Oy = source->m_arrowG2Oy;
|
||||
m_arrowG2Fx = source->m_arrowG2Fx;
|
||||
m_arrowG2Fy = source->m_arrowG2Fy;
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,56 +159,56 @@ bool DIMENSION::ReadDimensionDescr( LINE_READER* aReader )
|
|||
case 'b':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d",
|
||||
&Dummy,
|
||||
&Barre_ox, &Barre_oy,
|
||||
&Barre_fx, &Barre_fy,
|
||||
&m_crossBarOx, &m_crossBarOy,
|
||||
&m_crossBarFx, &m_crossBarFy,
|
||||
&m_Width );
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d",
|
||||
&Dummy,
|
||||
&TraitD_ox, &TraitD_oy,
|
||||
&TraitD_fx, &TraitD_fy,
|
||||
&m_featureLineDOx, &m_featureLineDOy,
|
||||
&m_featureLineDFx, &m_featureLineDFy,
|
||||
&Dummy );
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d",
|
||||
&Dummy,
|
||||
&TraitG_ox, &TraitG_oy,
|
||||
&TraitG_fx, &TraitG_fy,
|
||||
&m_featureLineGOx, &m_featureLineGOy,
|
||||
&m_featureLineGFx, &m_featureLineGFy,
|
||||
&Dummy );
|
||||
break;
|
||||
|
||||
case '1':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d",
|
||||
&Dummy,
|
||||
&FlecheD1_ox, &FlecheD1_oy,
|
||||
&FlecheD1_fx, &FlecheD1_fy,
|
||||
&m_arrowD1Ox, &m_arrowD1Oy,
|
||||
&m_arrowD1Fx, &m_arrowD1Fy,
|
||||
&Dummy );
|
||||
break;
|
||||
|
||||
case '2':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d",
|
||||
&Dummy,
|
||||
&FlecheD2_ox, &FlecheD2_oy,
|
||||
&FlecheD2_fx, &FlecheD2_fy,
|
||||
&m_arrowD2Ox, &m_arrowD2Oy,
|
||||
&m_arrowD2Fx, &m_arrowD2Fy,
|
||||
&Dummy );
|
||||
break;
|
||||
|
||||
case '3':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d\n",
|
||||
&Dummy,
|
||||
&FlecheG1_ox, &FlecheG1_oy,
|
||||
&FlecheG1_fx, &FlecheG1_fy,
|
||||
&m_arrowG1Ox, &m_arrowG1Oy,
|
||||
&m_arrowG1Fx, &m_arrowG1Fy,
|
||||
&Dummy );
|
||||
break;
|
||||
|
||||
case '4':
|
||||
sscanf( Line + 2, " %d %d %d %d %d %d",
|
||||
&Dummy,
|
||||
&FlecheG2_ox, &FlecheG2_oy,
|
||||
&FlecheG2_fx, &FlecheG2_fy,
|
||||
&m_arrowG2Ox, &m_arrowG2Oy,
|
||||
&m_arrowG2Fx, &m_arrowG2Fy,
|
||||
&Dummy );
|
||||
break;
|
||||
}
|
||||
|
@ -227,50 +221,41 @@ bool DIMENSION::ReadDimensionDescr( LINE_READER* aReader )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function Move
|
||||
* @param offset : moving vector
|
||||
*/
|
||||
void DIMENSION::Move(const wxPoint& offset)
|
||||
{
|
||||
m_Pos += offset;
|
||||
m_Text->m_Pos += offset;
|
||||
Barre_ox += offset.x;
|
||||
Barre_oy += offset.y;
|
||||
Barre_fx += offset.x;
|
||||
Barre_fy += offset.y;
|
||||
TraitG_ox += offset.x;
|
||||
TraitG_oy += offset.y;
|
||||
TraitG_fx += offset.x;
|
||||
TraitG_fy += offset.y;
|
||||
TraitD_ox += offset.x;
|
||||
TraitD_oy += offset.y;
|
||||
TraitD_fx += offset.x;
|
||||
TraitD_fy += offset.y;
|
||||
FlecheG1_ox += offset.x;
|
||||
FlecheG1_oy += offset.y;
|
||||
FlecheG1_fx += offset.x;
|
||||
FlecheG1_fy += offset.y;
|
||||
FlecheG2_ox += offset.x;
|
||||
FlecheG2_oy += offset.y;
|
||||
FlecheG2_fx += offset.x;
|
||||
FlecheG2_fy += offset.y;
|
||||
FlecheD1_ox += offset.x;
|
||||
FlecheD1_oy += offset.y;
|
||||
FlecheD1_fx += offset.x;
|
||||
FlecheD1_fy += offset.y;
|
||||
FlecheD2_ox += offset.x;
|
||||
FlecheD2_oy += offset.y;
|
||||
FlecheD2_fx += offset.x;
|
||||
FlecheD2_fy += offset.y;
|
||||
m_crossBarOx += offset.x;
|
||||
m_crossBarOy += offset.y;
|
||||
m_crossBarFx += offset.x;
|
||||
m_crossBarFy += offset.y;
|
||||
m_featureLineGOx += offset.x;
|
||||
m_featureLineGOy += offset.y;
|
||||
m_featureLineGFx += offset.x;
|
||||
m_featureLineGFy += offset.y;
|
||||
m_featureLineDOx += offset.x;
|
||||
m_featureLineDOy += offset.y;
|
||||
m_featureLineDFx += offset.x;
|
||||
m_featureLineDFy += offset.y;
|
||||
m_arrowG1Ox += offset.x;
|
||||
m_arrowG1Oy += offset.y;
|
||||
m_arrowG1Fx += offset.x;
|
||||
m_arrowG1Fy += offset.y;
|
||||
m_arrowG2Ox += offset.x;
|
||||
m_arrowG2Oy += offset.y;
|
||||
m_arrowG2Fx += offset.x;
|
||||
m_arrowG2Fy += offset.y;
|
||||
m_arrowD1Ox += offset.x;
|
||||
m_arrowD1Oy += offset.y;
|
||||
m_arrowD1Fx += offset.x;
|
||||
m_arrowD1Fy += offset.y;
|
||||
m_arrowD2Ox += offset.x;
|
||||
m_arrowD2Oy += offset.y;
|
||||
m_arrowD2Fx += offset.x;
|
||||
m_arrowD2Fy += offset.y;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function Rotate
|
||||
* @param aRotCentre - the rotation point.
|
||||
* @param aAngle - the rotation angle in 0.1 degree.
|
||||
*/
|
||||
void DIMENSION::Rotate(const wxPoint& aRotCentre, int aAngle)
|
||||
{
|
||||
RotatePoint( &m_Pos, aRotCentre, aAngle );
|
||||
|
@ -284,28 +269,23 @@ void DIMENSION::Rotate(const wxPoint& aRotCentre, int aAngle)
|
|||
if( ( m_Text->m_Orient > 900 ) && ( m_Text->m_Orient <2700 ) )
|
||||
m_Text->m_Orient -= 1800;
|
||||
|
||||
RotatePoint( &Barre_ox, &Barre_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &Barre_fx, &Barre_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &TraitG_ox, &TraitG_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &TraitG_fx, &TraitG_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &TraitD_ox, &TraitD_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &TraitD_fx, &TraitD_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheG1_ox, &FlecheG1_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheG1_fx, &FlecheG1_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheG2_ox, &FlecheG2_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheG2_fx, &FlecheG2_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheD1_ox, &FlecheD1_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheD1_fx, &FlecheD1_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheD2_ox, &FlecheD2_oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &FlecheD2_fx, &FlecheD2_fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_crossBarOx, &m_crossBarOy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_crossBarFx, &m_crossBarFy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_featureLineGOx, &m_featureLineGOy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_featureLineGFx, &m_featureLineGFy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_featureLineDOx, &m_featureLineDOy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_featureLineDFx, &m_featureLineDFy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowG1Ox, &m_arrowG1Oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowG1Fx, &m_arrowG1Fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowG2Ox, &m_arrowG2Oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowG2Fx, &m_arrowG2Fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowD1Ox, &m_arrowD1Oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowD1Fx, &m_arrowD1Fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowD2Ox, &m_arrowD2Oy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
RotatePoint( &m_arrowD2Fx, &m_arrowD2Fy, aRotCentre.x, aRotCentre.y, aAngle );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function Flip
|
||||
* Flip this object, i.e. change the board side for this object
|
||||
* @param aCentre - the rotation point.
|
||||
*/
|
||||
void DIMENSION::Flip(const wxPoint& aCentre )
|
||||
{
|
||||
Mirror( aCentre );
|
||||
|
@ -313,13 +293,6 @@ void DIMENSION::Flip(const wxPoint& aCentre )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function Mirror
|
||||
* Mirror the Dimension , relative to a given horizontal axis
|
||||
* the text is not mirrored. only its position (and angle) is mirrored
|
||||
* the layer is not changed
|
||||
* @param axis_pos : vertical axis position
|
||||
*/
|
||||
void DIMENSION::Mirror(const wxPoint& axis_pos)
|
||||
{
|
||||
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
|
||||
|
@ -334,26 +307,27 @@ void DIMENSION::Mirror(const wxPoint& axis_pos)
|
|||
if( ( m_Text->m_Orient > 900 ) && ( m_Text->m_Orient < 2700 ) )
|
||||
m_Text->m_Orient -= 1800;
|
||||
|
||||
INVERT( Barre_oy );
|
||||
INVERT( Barre_fy );
|
||||
INVERT( TraitG_oy );
|
||||
INVERT( TraitG_fy );
|
||||
INVERT( TraitD_oy );
|
||||
INVERT( TraitD_fy );
|
||||
INVERT( FlecheG1_oy );
|
||||
INVERT( FlecheG1_fy );
|
||||
INVERT( FlecheG2_oy );
|
||||
INVERT( FlecheG2_fy );
|
||||
INVERT( FlecheD1_oy );
|
||||
INVERT( FlecheD1_fy );
|
||||
INVERT( FlecheD2_oy );
|
||||
INVERT( FlecheD2_fy );
|
||||
INVERT( m_crossBarOy );
|
||||
INVERT( m_crossBarFy );
|
||||
INVERT( m_featureLineGOy );
|
||||
INVERT( m_featureLineGFy );
|
||||
INVERT( m_featureLineDOy );
|
||||
INVERT( m_featureLineDFy );
|
||||
INVERT( m_arrowG1Oy );
|
||||
INVERT( m_arrowG1Fy );
|
||||
INVERT( m_arrowG2Oy );
|
||||
INVERT( m_arrowG2Fy );
|
||||
INVERT( m_arrowD1Oy );
|
||||
INVERT( m_arrowD1Fy );
|
||||
INVERT( m_arrowD2Oy );
|
||||
INVERT( m_arrowD2Fy );
|
||||
}
|
||||
|
||||
|
||||
bool DIMENSION::Save( FILE* aFile ) const
|
||||
{
|
||||
bool rc = false;
|
||||
|
||||
// note: COTATION was the previous name of DIMENSION
|
||||
// this old keyword is used here for compatibility
|
||||
const char keyWordLine[] = "$COTATION\n";
|
||||
|
@ -378,33 +352,33 @@ bool DIMENSION::Save( FILE* aFile ) const
|
|||
m_Text->m_Mirror ? 0 : 1 );
|
||||
|
||||
fprintf( aFile, "Sb %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
Barre_ox, Barre_oy,
|
||||
Barre_fx, Barre_fy, m_Width );
|
||||
m_crossBarOx, m_crossBarOy,
|
||||
m_crossBarFx, m_crossBarFy, m_Width );
|
||||
|
||||
fprintf( aFile, "Sd %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
TraitD_ox, TraitD_oy,
|
||||
TraitD_fx, TraitD_fy, m_Width );
|
||||
m_featureLineDOx, m_featureLineDOy,
|
||||
m_featureLineDFx, m_featureLineDFy, m_Width );
|
||||
|
||||
fprintf( aFile, "Sg %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
TraitG_ox, TraitG_oy,
|
||||
TraitG_fx, TraitG_fy, m_Width );
|
||||
m_featureLineGOx, m_featureLineGOy,
|
||||
m_featureLineGFx, m_featureLineGFy, m_Width );
|
||||
|
||||
fprintf( aFile, "S1 %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
FlecheD1_ox, FlecheD1_oy,
|
||||
FlecheD1_fx, FlecheD1_fy, m_Width );
|
||||
m_arrowD1Ox, m_arrowD1Oy,
|
||||
m_arrowD1Fx, m_arrowD1Fy, m_Width );
|
||||
|
||||
fprintf( aFile, "S2 %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
FlecheD2_ox, FlecheD2_oy,
|
||||
FlecheD2_fx, FlecheD2_fy, m_Width );
|
||||
m_arrowD2Ox, m_arrowD2Oy,
|
||||
m_arrowD2Fx, m_arrowD2Fy, m_Width );
|
||||
|
||||
|
||||
fprintf( aFile, "S3 %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
FlecheG1_ox, FlecheG1_oy,
|
||||
FlecheG1_fx, FlecheG1_fy, m_Width );
|
||||
m_arrowG1Ox, m_arrowG1Oy,
|
||||
m_arrowG1Fx, m_arrowG1Fy, m_Width );
|
||||
|
||||
fprintf( aFile, "S4 %d %d %d %d %d %d\n", S_SEGMENT,
|
||||
FlecheG2_ox, FlecheG2_oy,
|
||||
FlecheG2_fx, FlecheG2_fy, m_Width );
|
||||
m_arrowG2Ox, m_arrowG2Oy,
|
||||
m_arrowG2Fx, m_arrowG2Fy, m_Width );
|
||||
|
||||
if( fputs( keyWordLineEnd, aFile ) == EOF )
|
||||
goto out;
|
||||
|
@ -416,32 +390,26 @@ out:
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function AdjustDimensionDetails
|
||||
* Calculate coordinates of segments used to draw the dimension.
|
||||
* @param aDoNotChangeText (bool) if false, the dimension text is initialized
|
||||
*/
|
||||
void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
||||
{
|
||||
#define ARROW_SIZE 500 //size of arrows
|
||||
int ii;
|
||||
int mesure, deltax, deltay; /* valeur de la mesure sur les axes X et Y */
|
||||
int fleche_up_X = 0, fleche_up_Y = 0; /* coord des fleches : barre / */
|
||||
int fleche_dw_X = 0, fleche_dw_Y = 0; /* coord des fleches : barre \ */
|
||||
int hx, hy; /* coord des traits de rappel de cote */
|
||||
int mesure, deltax, deltay; /* value of the measure on X and Y axes */
|
||||
int arrow_up_X = 0, arrow_up_Y = 0; /* coordinates of arrow line / */
|
||||
int arrow_dw_X = 0, arrow_dw_Y = 0; /* coordinates of arrow line \ */
|
||||
int hx, hy; /* dimension line interval */
|
||||
float angle, angle_f;
|
||||
wxString msg;
|
||||
|
||||
/* Init layer : */
|
||||
m_Text->SetLayer( GetLayer() );
|
||||
|
||||
/* calculate the size of the dimension
|
||||
* (text + line above the text) */
|
||||
/* calculate the size of the dimension (text + line above the text) */
|
||||
ii = m_Text->m_Size.y +
|
||||
m_Text->m_Thickness + (m_Width * 3);
|
||||
|
||||
deltax = TraitD_ox - TraitG_ox;
|
||||
deltay = TraitD_oy - TraitG_oy;
|
||||
deltax = m_featureLineDOx - m_featureLineGOx;
|
||||
deltay = m_featureLineDOy - m_featureLineGOy;
|
||||
|
||||
/* Calculate dimension value */
|
||||
mesure = wxRound(hypot( (double) deltax, (double) deltay ) );
|
||||
|
@ -451,69 +419,69 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
|||
else
|
||||
angle = 0.0;
|
||||
|
||||
/* Calcul des parametre dimensions X et Y des fleches et traits de cotes */
|
||||
/* Calculation of parameters X and Y dimensions of the arrows and lines. */
|
||||
hx = hy = ii;
|
||||
|
||||
/* On tient compte de l'inclinaison de la cote */
|
||||
/* Taking into account the slope of the side lines. */
|
||||
if( mesure )
|
||||
{
|
||||
hx = (abs) ( (int) ( ( (double) deltay * hx ) / mesure ) );
|
||||
hy = (abs) ( (int) ( ( (double) deltax * hy ) / mesure ) );
|
||||
|
||||
if( TraitG_ox > Barre_ox )
|
||||
if( m_featureLineGOx > m_crossBarOx )
|
||||
hx = -hx;
|
||||
|
||||
if( TraitG_ox == Barre_ox )
|
||||
if( m_featureLineGOx == m_crossBarOx )
|
||||
hx = 0;
|
||||
|
||||
if( TraitG_oy > Barre_oy )
|
||||
if( m_featureLineGOy > m_crossBarOy )
|
||||
hy = -hy;
|
||||
|
||||
if( TraitG_oy == Barre_oy )
|
||||
if( m_featureLineGOy == m_crossBarOy )
|
||||
hy = 0;
|
||||
|
||||
angle_f = angle + (M_PI * 27.5 / 180);
|
||||
fleche_up_X = (int) ( ARROW_SIZE * cos( angle_f ) );
|
||||
fleche_up_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
|
||||
arrow_up_X = (int) ( ARROW_SIZE * cos( angle_f ) );
|
||||
arrow_up_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
|
||||
angle_f = angle - (M_PI * 27.5 / 180);
|
||||
fleche_dw_X = (int) ( ARROW_SIZE * cos( angle_f ) );
|
||||
fleche_dw_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
|
||||
arrow_dw_X = (int) ( ARROW_SIZE * cos( angle_f ) );
|
||||
arrow_dw_Y = (int) ( ARROW_SIZE * sin( angle_f ) );
|
||||
}
|
||||
|
||||
|
||||
FlecheG1_ox = Barre_ox;
|
||||
FlecheG1_oy = Barre_oy;
|
||||
FlecheG1_fx = Barre_ox + fleche_up_X;
|
||||
FlecheG1_fy = Barre_oy + fleche_up_Y;
|
||||
m_arrowG1Ox = m_crossBarOx;
|
||||
m_arrowG1Oy = m_crossBarOy;
|
||||
m_arrowG1Fx = m_crossBarOx + arrow_up_X;
|
||||
m_arrowG1Fy = m_crossBarOy + arrow_up_Y;
|
||||
|
||||
FlecheG2_ox = Barre_ox;
|
||||
FlecheG2_oy = Barre_oy;
|
||||
FlecheG2_fx = Barre_ox + fleche_dw_X;
|
||||
FlecheG2_fy = Barre_oy + fleche_dw_Y;
|
||||
m_arrowG2Ox = m_crossBarOx;
|
||||
m_arrowG2Oy = m_crossBarOy;
|
||||
m_arrowG2Fx = m_crossBarOx + arrow_dw_X;
|
||||
m_arrowG2Fy = m_crossBarOy + arrow_dw_Y;
|
||||
|
||||
/*la fleche de droite est symetrique a celle de gauche:
|
||||
* / = -\ et \ = -/
|
||||
/* The right arrow is symmetrical to the left.
|
||||
* / = -\ and \ = -/
|
||||
*/
|
||||
FlecheD1_ox = Barre_fx;
|
||||
FlecheD1_oy = Barre_fy;
|
||||
FlecheD1_fx = Barre_fx - fleche_dw_X;
|
||||
FlecheD1_fy = Barre_fy - fleche_dw_Y;
|
||||
m_arrowD1Ox = m_crossBarFx;
|
||||
m_arrowD1Oy = m_crossBarFy;
|
||||
m_arrowD1Fx = m_crossBarFx - arrow_dw_X;
|
||||
m_arrowD1Fy = m_crossBarFy - arrow_dw_Y;
|
||||
|
||||
FlecheD2_ox = Barre_fx;
|
||||
FlecheD2_oy = Barre_fy;
|
||||
FlecheD2_fx = Barre_fx - fleche_up_X;
|
||||
FlecheD2_fy = Barre_fy - fleche_up_Y;
|
||||
m_arrowD2Ox = m_crossBarFx;
|
||||
m_arrowD2Oy = m_crossBarFy;
|
||||
m_arrowD2Fx = m_crossBarFx - arrow_up_X;
|
||||
m_arrowD2Fy = m_crossBarFy - arrow_up_Y;
|
||||
|
||||
|
||||
TraitG_fx = Barre_ox + hx;
|
||||
TraitG_fy = Barre_oy + hy;
|
||||
m_featureLineGFx = m_crossBarOx + hx;
|
||||
m_featureLineGFy = m_crossBarOy + hy;
|
||||
|
||||
TraitD_fx = Barre_fx + hx;
|
||||
TraitD_fy = Barre_fy + hy;
|
||||
m_featureLineDFx = m_crossBarFx + hx;
|
||||
m_featureLineDFy = m_crossBarFy + hy;
|
||||
|
||||
/* Calculate the better text position and orientation: */
|
||||
m_Pos.x = m_Text->m_Pos.x = (Barre_fx + TraitG_fx) / 2;
|
||||
m_Pos.y = m_Text->m_Pos.y = (Barre_fy + TraitG_fy) / 2;
|
||||
m_Pos.x = m_Text->m_Pos.x = (m_crossBarFx + m_featureLineGFx) / 2;
|
||||
m_Pos.y = m_Text->m_Pos.y = (m_crossBarFy + m_featureLineGFy) / 2;
|
||||
|
||||
m_Text->m_Orient = -(int) (angle * 1800 / M_PI);
|
||||
|
||||
|
@ -535,8 +503,6 @@ void DIMENSION::AdjustDimensionDetails( bool aDoNotChangeText )
|
|||
}
|
||||
|
||||
|
||||
/* Print 1 dimension: segments and text
|
||||
*/
|
||||
void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxPoint& offset )
|
||||
{
|
||||
int ox, oy, typeaff, width, gcolor;
|
||||
|
@ -567,56 +533,56 @@ void DIMENSION::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int mode_color, const wxP
|
|||
|
||||
case FILLED:
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
Barre_ox - ox, Barre_oy - oy,
|
||||
Barre_fx - ox, Barre_fy - oy, width, gcolor );
|
||||
m_crossBarOx - ox, m_crossBarOy - oy,
|
||||
m_crossBarFx - ox, m_crossBarFy - oy, width, gcolor );
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
TraitG_ox - ox, TraitG_oy - oy,
|
||||
TraitG_fx - ox, TraitG_fy - oy, width, gcolor );
|
||||
m_featureLineGOx - ox, m_featureLineGOy - oy,
|
||||
m_featureLineGFx - ox, m_featureLineGFy - oy, width, gcolor );
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
TraitD_ox - ox, TraitD_oy - oy,
|
||||
TraitD_fx - ox, TraitD_fy - oy, width, gcolor );
|
||||
m_featureLineDOx - ox, m_featureLineDOy - oy,
|
||||
m_featureLineDFx - ox, m_featureLineDFy - oy, width, gcolor );
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
FlecheD1_ox - ox, FlecheD1_oy - oy,
|
||||
FlecheD1_fx - ox, FlecheD1_fy - oy, width, gcolor );
|
||||
m_arrowD1Ox - ox, m_arrowD1Oy - oy,
|
||||
m_arrowD1Fx - ox, m_arrowD1Fy - oy, width, gcolor );
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
FlecheD2_ox - ox, FlecheD2_oy - oy,
|
||||
FlecheD2_fx - ox, FlecheD2_fy - oy, width, gcolor );
|
||||
m_arrowD2Ox - ox, m_arrowD2Oy - oy,
|
||||
m_arrowD2Fx - ox, m_arrowD2Fy - oy, width, gcolor );
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
FlecheG1_ox - ox, FlecheG1_oy - oy,
|
||||
FlecheG1_fx - ox, FlecheG1_fy - oy, width, gcolor );
|
||||
m_arrowG1Ox - ox, m_arrowG1Oy - oy,
|
||||
m_arrowG1Fx - ox, m_arrowG1Fy - oy, width, gcolor );
|
||||
GRLine( &panel->m_ClipBox, DC,
|
||||
FlecheG2_ox - ox, FlecheG2_oy - oy,
|
||||
FlecheG2_fx - ox, FlecheG2_fy - oy, width, gcolor );
|
||||
m_arrowG2Ox - ox, m_arrowG2Oy - oy,
|
||||
m_arrowG2Fx - ox, m_arrowG2Fy - oy, width, gcolor );
|
||||
break;
|
||||
|
||||
case SKETCH:
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
Barre_ox - ox, Barre_oy - oy,
|
||||
Barre_fx - ox, Barre_fy - oy,
|
||||
m_crossBarOx - ox, m_crossBarOy - oy,
|
||||
m_crossBarFx - ox, m_crossBarFy - oy,
|
||||
width, gcolor );
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
TraitG_ox - ox, TraitG_oy - oy,
|
||||
TraitG_fx - ox, TraitG_fy - oy,
|
||||
m_featureLineGOx - ox, m_featureLineGOy - oy,
|
||||
m_featureLineGFx - ox, m_featureLineGFy - oy,
|
||||
width, gcolor );
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
TraitD_ox - ox, TraitD_oy - oy,
|
||||
TraitD_fx - ox, TraitD_fy - oy,
|
||||
m_featureLineDOx - ox, m_featureLineDOy - oy,
|
||||
m_featureLineDFx - ox, m_featureLineDFy - oy,
|
||||
width, gcolor );
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
FlecheD1_ox - ox, FlecheD1_oy - oy,
|
||||
FlecheD1_fx - ox, FlecheD1_fy - oy,
|
||||
m_arrowD1Ox - ox, m_arrowD1Oy - oy,
|
||||
m_arrowD1Fx - ox, m_arrowD1Fy - oy,
|
||||
width, gcolor );
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
FlecheD2_ox - ox, FlecheD2_oy - oy,
|
||||
FlecheD2_fx - ox, FlecheD2_fy - oy,
|
||||
m_arrowD2Ox - ox, m_arrowD2Oy - oy,
|
||||
m_arrowD2Fx - ox, m_arrowD2Fy - oy,
|
||||
width, gcolor );
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
FlecheG1_ox - ox, FlecheG1_oy - oy,
|
||||
FlecheG1_fx - ox, FlecheG1_fy - oy,
|
||||
m_arrowG1Ox - ox, m_arrowG1Oy - oy,
|
||||
m_arrowG1Fx - ox, m_arrowG1Fy - oy,
|
||||
width, gcolor );
|
||||
GRCSegm( &panel->m_ClipBox, DC,
|
||||
FlecheG2_ox - ox, FlecheG2_oy - oy,
|
||||
FlecheG2_fx - ox, FlecheG2_fy - oy,
|
||||
m_arrowG2Ox - ox, m_arrowG2Oy - oy,
|
||||
m_arrowG2Fx - ox, m_arrowG2Fy - oy,
|
||||
width, gcolor );
|
||||
break;
|
||||
}
|
||||
|
@ -631,102 +597,96 @@ void DIMENSION::DisplayInfo( EDA_DRAW_FRAME* frame )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function HitTest
|
||||
* tests if the given wxPoint is within the bounds of this object.
|
||||
* @param ref_pos A wxPoint to test
|
||||
* @return bool - true if a hit, else false
|
||||
*/
|
||||
bool DIMENSION::HitTest( const wxPoint& ref_pos )
|
||||
bool DIMENSION::HitTest( const wxPoint& aPoint )
|
||||
{
|
||||
int ux0, uy0;
|
||||
int dx, dy, spot_cX, spot_cY;
|
||||
int ux0, uy0;
|
||||
int dx, dy, spot_cX, spot_cY;
|
||||
|
||||
if( m_Text && m_Text->TextHitTest( ref_pos ) )
|
||||
return true;
|
||||
if( m_Text && m_Text->TextHitTest( aPoint ) )
|
||||
return true;
|
||||
|
||||
/* Locate SEGMENTS? */
|
||||
ux0 = Barre_ox;
|
||||
uy0 = Barre_oy;
|
||||
ux0 = m_crossBarOx;
|
||||
uy0 = m_crossBarOy;
|
||||
|
||||
/* Recalculate coordinates with ux0, uy0 = origin. */
|
||||
dx = Barre_fx - ux0;
|
||||
dy = Barre_fy - uy0;
|
||||
dx = m_crossBarFx - ux0;
|
||||
dy = m_crossBarFy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
||||
ux0 = TraitG_ox;
|
||||
uy0 = TraitG_oy;
|
||||
ux0 = m_featureLineGOx;
|
||||
uy0 = m_featureLineGOy;
|
||||
|
||||
dx = TraitG_fx - ux0;
|
||||
dy = TraitG_fy - uy0;
|
||||
dx = m_featureLineGFx - ux0;
|
||||
dy = m_featureLineGFy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
||||
ux0 = TraitD_ox;
|
||||
uy0 = TraitD_oy;
|
||||
ux0 = m_featureLineDOx;
|
||||
uy0 = m_featureLineDOy;
|
||||
|
||||
dx = TraitD_fx - ux0;
|
||||
dy = TraitD_fy - uy0;
|
||||
dx = m_featureLineDFx - ux0;
|
||||
dy = m_featureLineDFy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
||||
ux0 = FlecheD1_ox;
|
||||
uy0 = FlecheD1_oy;
|
||||
ux0 = m_arrowD1Ox;
|
||||
uy0 = m_arrowD1Oy;
|
||||
|
||||
dx = FlecheD1_fx - ux0;
|
||||
dy = FlecheD1_fy - uy0;
|
||||
dx = m_arrowD1Fx - ux0;
|
||||
dy = m_arrowD1Fy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
||||
ux0 = FlecheD2_ox;
|
||||
uy0 = FlecheD2_oy;
|
||||
ux0 = m_arrowD2Ox;
|
||||
uy0 = m_arrowD2Oy;
|
||||
|
||||
dx = FlecheD2_fx - ux0;
|
||||
dy = FlecheD2_fy - uy0;
|
||||
dx = m_arrowD2Fx - ux0;
|
||||
dy = m_arrowD2Fy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
||||
ux0 = FlecheG1_ox;
|
||||
uy0 = FlecheG1_oy;
|
||||
ux0 = m_arrowG1Ox;
|
||||
uy0 = m_arrowG1Oy;
|
||||
|
||||
dx = FlecheG1_fx - ux0;
|
||||
dy = FlecheG1_fy - uy0;
|
||||
dx = m_arrowG1Fx - ux0;
|
||||
dy = m_arrowG1Fy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
||||
ux0 = FlecheG2_ox;
|
||||
uy0 = FlecheG2_oy;
|
||||
ux0 = m_arrowG2Ox;
|
||||
uy0 = m_arrowG2Oy;
|
||||
|
||||
dx = FlecheG2_fx - ux0;
|
||||
dy = FlecheG2_fy - uy0;
|
||||
dx = m_arrowG2Fx - ux0;
|
||||
dy = m_arrowG2Fy - uy0;
|
||||
|
||||
spot_cX = ref_pos.x - ux0;
|
||||
spot_cY = ref_pos.y - uy0;
|
||||
spot_cX = aPoint.x - ux0;
|
||||
spot_cY = aPoint.y - uy0;
|
||||
|
||||
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
|
||||
return true;
|
||||
|
@ -735,12 +695,6 @@ bool DIMENSION::HitTest( const wxPoint& ref_pos )
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function HitTest (overlaid)
|
||||
* tests if the given EDA_RECT intersect this object.
|
||||
* @param refArea : the given EDA_RECT
|
||||
* @return bool - true if a hit, else false
|
||||
*/
|
||||
bool DIMENSION::HitTest( EDA_RECT& refArea )
|
||||
{
|
||||
if( refArea.Contains( m_Pos ) )
|
||||
|
@ -761,23 +715,23 @@ EDA_RECT DIMENSION::GetBoundingBox() const
|
|||
ymin = bBox.GetY();
|
||||
ymax = bBox.GetBottom();
|
||||
|
||||
xmin = MIN( xmin, Barre_ox );
|
||||
xmin = MIN( xmin, Barre_fx );
|
||||
ymin = MIN( ymin, Barre_oy );
|
||||
ymin = MIN( ymin, Barre_fy );
|
||||
xmax = MAX( xmax, Barre_ox );
|
||||
xmax = MAX( xmax, Barre_fx );
|
||||
ymax = MAX( ymax, Barre_oy );
|
||||
ymax = MAX( ymax, Barre_fy );
|
||||
xmin = MIN( xmin, m_crossBarOx );
|
||||
xmin = MIN( xmin, m_crossBarFx );
|
||||
ymin = MIN( ymin, m_crossBarOy );
|
||||
ymin = MIN( ymin, m_crossBarFy );
|
||||
xmax = MAX( xmax, m_crossBarOx );
|
||||
xmax = MAX( xmax, m_crossBarFx );
|
||||
ymax = MAX( ymax, m_crossBarOy );
|
||||
ymax = MAX( ymax, m_crossBarFy );
|
||||
|
||||
xmin = MIN( xmin, TraitG_ox );
|
||||
xmin = MIN( xmin, TraitG_fx );
|
||||
ymin = MIN( ymin, TraitG_oy );
|
||||
ymin = MIN( ymin, TraitG_fy );
|
||||
xmax = MAX( xmax, TraitG_ox );
|
||||
xmax = MAX( xmax, TraitG_fx );
|
||||
ymax = MAX( ymax, TraitG_oy );
|
||||
ymax = MAX( ymax, TraitG_fy );
|
||||
xmin = MIN( xmin, m_featureLineGOx );
|
||||
xmin = MIN( xmin, m_featureLineGFx );
|
||||
ymin = MIN( ymin, m_featureLineGOy );
|
||||
ymin = MIN( ymin, m_featureLineGFy );
|
||||
xmax = MAX( xmax, m_featureLineGOx );
|
||||
xmax = MAX( xmax, m_featureLineGFx );
|
||||
ymax = MAX( ymax, m_featureLineGOy );
|
||||
ymax = MAX( ymax, m_featureLineGFy );
|
||||
|
||||
bBox.SetX( xmin );
|
||||
bBox.SetY( ymin );
|
||||
|
|
|
@ -1,12 +1,17 @@
|
|||
/******************************/
|
||||
/* DIMENSION class definition */
|
||||
/******************************/
|
||||
/**
|
||||
* @file class_dimension.h
|
||||
* @brief DIMENSION class definition.
|
||||
*/
|
||||
|
||||
#ifndef DIMENSION_H
|
||||
#define DIMENSION_H
|
||||
|
||||
#include "base_struct.h"
|
||||
#include "richio.h"
|
||||
#include "class_board_item.h"
|
||||
|
||||
|
||||
class EDA_RECT;
|
||||
class READER;
|
||||
class EDA_DRAW_PANEL;
|
||||
|
||||
|
||||
class DIMENSION : public BOARD_ITEM
|
||||
|
@ -19,13 +24,13 @@ public:
|
|||
int m_Value; /* value of PCB dimensions. */
|
||||
|
||||
TEXTE_PCB* m_Text;
|
||||
int Barre_ox, Barre_oy, Barre_fx, Barre_fy;
|
||||
int TraitG_ox, TraitG_oy, TraitG_fx, TraitG_fy;
|
||||
int TraitD_ox, TraitD_oy, TraitD_fx, TraitD_fy;
|
||||
int FlecheD1_ox, FlecheD1_oy, FlecheD1_fx, FlecheD1_fy;
|
||||
int FlecheD2_ox, FlecheD2_oy, FlecheD2_fx, FlecheD2_fy;
|
||||
int FlecheG1_ox, FlecheG1_oy, FlecheG1_fx, FlecheG1_fy;
|
||||
int FlecheG2_ox, FlecheG2_oy, FlecheG2_fx, FlecheG2_fy;
|
||||
int m_crossBarOx, m_crossBarOy, m_crossBarFx, m_crossBarFy;
|
||||
int m_featureLineGOx, m_featureLineGOy, m_featureLineGFx, m_featureLineGFy;
|
||||
int m_featureLineDOx, m_featureLineDOy, m_featureLineDFx, m_featureLineDFy;
|
||||
int m_arrowD1Ox, m_arrowD1Oy, m_arrowD1Fx, m_arrowD1Fy;
|
||||
int m_arrowD2Ox, m_arrowD2Oy, m_arrowD2Fx, m_arrowD2Fy;
|
||||
int m_arrowG1Ox, m_arrowG1Oy, m_arrowG1Fx, m_arrowG1Fy;
|
||||
int m_arrowG2Ox, m_arrowG2Oy, m_arrowG2Fx, m_arrowG2Fy;
|
||||
|
||||
public:
|
||||
DIMENSION( BOARD_ITEM* aParent );
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
#include <vector>
|
||||
#include "gr_basic.h"
|
||||
#include "PolyLine.h"
|
||||
#include "richio.h"
|
||||
#include "class_zone_setting.h"
|
||||
|
||||
|
||||
class EDA_RECT;
|
||||
class LINE_READER;
|
||||
class EDA_DRAW_FRAME;
|
||||
class EDA_DRAW_PANEL;
|
||||
class PCB_EDIT_FRAME;
|
||||
|
@ -32,6 +32,7 @@ public:
|
|||
|
||||
public:
|
||||
SEGMENT() {}
|
||||
|
||||
SEGMENT( const wxPoint& aStart, const wxPoint& aEnd)
|
||||
{
|
||||
m_Start = aStart;
|
||||
|
@ -40,51 +41,69 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/************************/
|
||||
/* class ZONE_CONTAINER */
|
||||
/************************/
|
||||
|
||||
/* handle a list of polygons delimiting a copper zone
|
||||
* a zone is described by a main polygon, a time stamp, a layer and a net name.
|
||||
* others polygons inside this main polygon are holes.
|
||||
/**
|
||||
* Class ZONE_CONTAINER
|
||||
* handles a list of polygons defining a copper zone.
|
||||
* A zone is described by a main polygon, a time stamp, a layer, and a net name.
|
||||
* Other polygons inside the main polygon are holes in the zone.
|
||||
*/
|
||||
|
||||
class ZONE_CONTAINER : public BOARD_CONNECTED_ITEM
|
||||
{
|
||||
public:
|
||||
wxString m_Netname; // Net Name
|
||||
CPolyLine* m_Poly; // outlines
|
||||
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
|
||||
|
||||
// For corner moving, corner index to drag, or -1 if no selection.
|
||||
int m_CornerSelection;
|
||||
int m_ZoneClearance; // clearance value
|
||||
int m_ZoneMinThickness; // Min thickness value in filled areas
|
||||
int m_FillMode; // How to fill areas: 0 = use filled polygons, != 0 fill with segments
|
||||
int m_ArcToSegmentsCount; // number of segments to convert a circle to a polygon
|
||||
// (uses ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
|
||||
int m_PadOption; //
|
||||
int m_ThermalReliefGapValue; // thickness of the gap in thermal reliefs
|
||||
int m_ThermalReliefCopperBridgeValue; // thickness of the copper bridge in thermal reliefs
|
||||
|
||||
// How to fill areas: 0 = use filled polygons, != 0 fill with segments.
|
||||
int m_FillMode;
|
||||
|
||||
// number of segments to convert a circle to a polygon (uses
|
||||
//ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
|
||||
int m_ArcToSegmentsCount;
|
||||
|
||||
int m_PadOption;
|
||||
|
||||
// thickness of the gap in thermal reliefs.
|
||||
int m_ThermalReliefGapValue;
|
||||
|
||||
// thickness of the copper bridge in thermal reliefs
|
||||
int m_ThermalReliefCopperBridgeValue;
|
||||
int utility, utility2; // flags used in polygon calculations
|
||||
bool m_IsFilled; // true when a zone was filled, false after deleting the filled areas
|
||||
std::vector <CPolyPt> m_FilledPolysList; /* set of filled polygons used to draw a zone as a filled area.
|
||||
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole (they are all in one piece)
|
||||
* In very simple cases m_FilledPolysList is same as m_Poly
|
||||
* In less simple cases (when m_Poly has holes) m_FilledPolysList is a polygon equivalent to m_Poly, without holes
|
||||
* but with extra outline segment connecting "holes" with external main outline
|
||||
* In complex cases an outline described by m_Poly can have many filled areas
|
||||
*/
|
||||
std::vector <SEGMENT> m_FillSegmList; /* set of segments used to fill area, when fill zone by segment is used.
|
||||
* ( m_FillMode == 1 )
|
||||
* in this case segments have m_ZoneMinThickness width
|
||||
*/
|
||||
|
||||
// true when a zone was filled, false after deleting the filled areas
|
||||
bool m_IsFilled;
|
||||
|
||||
/* set of filled polygons used to draw a zone as a filled area.
|
||||
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
|
||||
* (they are* all in one piece) In very simple cases m_FilledPolysList is same
|
||||
* as m_Poly. In less simple cases (when m_Poly has holes) m_FilledPolysList is
|
||||
* a polygon equivalent to m_Poly, without holes but with extra outline segment
|
||||
* connecting "holes" with external main outline. In complex cases an outline
|
||||
* described by m_Poly can have many filled areas
|
||||
*/
|
||||
std::vector <CPolyPt> m_FilledPolysList;
|
||||
|
||||
/* set of segments used to fill area, when fill zone by segment is used.
|
||||
* ( m_FillMode == 1 )
|
||||
* in this case segments have m_ZoneMinThickness width
|
||||
*/
|
||||
std::vector <SEGMENT> m_FillSegmList;
|
||||
|
||||
private:
|
||||
CPolyLine* smoothedPoly; // Corner-smoothed version of m_Poly
|
||||
int cornerSmoothingType;
|
||||
unsigned int cornerRadius;
|
||||
|
||||
public:
|
||||
ZONE_CONTAINER( BOARD* parent );
|
||||
|
||||
~ZONE_CONTAINER();
|
||||
|
||||
bool Save( FILE* aFile ) const;
|
||||
bool Save( FILE* aFile ) const;
|
||||
|
||||
/**
|
||||
* Function ReadDescr
|
||||
|
@ -92,22 +111,22 @@ public:
|
|||
* @param aReader is a pointer to a LINE_READER to read from.
|
||||
* @return int - 1 if success, 0 if not.
|
||||
*/
|
||||
int ReadDescr( LINE_READER* aReader );
|
||||
int ReadDescr( LINE_READER* aReader );
|
||||
|
||||
/** virtual function GetPosition
|
||||
/**
|
||||
* Function GetPosition
|
||||
* @return a wxPoint, position of the first point of the outline
|
||||
*/
|
||||
wxPoint& GetPosition();
|
||||
|
||||
|
||||
/**
|
||||
* Function copy
|
||||
* copy useful data from the source.
|
||||
* flags and linked list pointers are NOT copied
|
||||
*/
|
||||
void Copy( ZONE_CONTAINER* src );
|
||||
void Copy( ZONE_CONTAINER* src );
|
||||
|
||||
void DisplayInfo( EDA_DRAW_FRAME* frame );
|
||||
void DisplayInfo( EDA_DRAW_FRAME* frame );
|
||||
|
||||
/**
|
||||
* Function Draw
|
||||
|
@ -117,10 +136,10 @@ public:
|
|||
* @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
|
||||
* @param offset = Draw offset (usually wxPoint(0,0))
|
||||
*/
|
||||
void Draw( EDA_DRAW_PANEL* panel,
|
||||
wxDC* DC,
|
||||
int aDrawMode,
|
||||
const wxPoint& offset = ZeroOffset );
|
||||
void Draw( EDA_DRAW_PANEL* panel,
|
||||
wxDC* DC,
|
||||
int aDrawMode,
|
||||
const wxPoint& offset = ZeroOffset );
|
||||
|
||||
/**
|
||||
* Function DrawDrawFilledArea
|
||||
|
@ -137,14 +156,14 @@ public:
|
|||
|
||||
/**
|
||||
* Function DrawWhileCreateOutline
|
||||
* Draws the zone outline when ir is created.
|
||||
* The moving edges are in XOR graphic mode, old segment in draw_mode graphic mode (usually GR_OR)
|
||||
* The closing edge has its own shape
|
||||
* Draws the zone outline when it is created.
|
||||
* The moving edges are in XOR graphic mode, old segment in draw_mode graphic mode
|
||||
* (usually GR_OR). The closing edge has its own shape.
|
||||
* @param panel = current Draw Panel
|
||||
* @param DC = current Device Context
|
||||
* @param draw_mode = draw mode: OR, XOR ..
|
||||
*/
|
||||
void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode = GR_OR );
|
||||
void DrawWhileCreateOutline( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode = GR_OR );
|
||||
|
||||
|
||||
/* Function GetBoundingBox
|
||||
|
@ -159,14 +178,16 @@ public:
|
|||
* Remove insulated copper islands found in m_FilledPolysList.
|
||||
* @param aPcb = the board to analyze
|
||||
*/
|
||||
void Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD* aPcb );
|
||||
void Test_For_Copper_Island_And_Remove_Insulated_Islands( BOARD* aPcb );
|
||||
|
||||
/**
|
||||
* Function CalculateSubAreaBoundaryBox
|
||||
* Calculates the bounding box of a a filled area ( list of CPolyPt )
|
||||
* use m_FilledPolysList as list of CPolyPt (that are the corners of one or more polygons or filled areas )
|
||||
* use m_FilledPolysList as list of CPolyPt (that are the corners of one or more
|
||||
* polygons or filled areas )
|
||||
* @return an EDA_RECT as bounding box
|
||||
* @param aIndexStart = index of the first corner of a polygon (filled area) in m_FilledPolysList
|
||||
* @param aIndexStart = index of the first corner of a polygon (filled area)
|
||||
* in m_FilledPolysList
|
||||
* @param aIndexEnd = index of the last corner of a polygon in m_FilledPolysList
|
||||
*/
|
||||
EDA_RECT CalculateSubAreaBoundaryBox( int aIndexStart, int aIndexEnd );
|
||||
|
@ -223,7 +244,7 @@ public:
|
|||
* This function does not add holes for pads and tracks but calls
|
||||
* AddClearanceAreasPolygonsToPolysList() to do that for copper layers
|
||||
*/
|
||||
int BuildFilledPolysListData( BOARD* aPcb );
|
||||
int BuildFilledPolysListData( BOARD* aPcb );
|
||||
|
||||
/**
|
||||
* Function AddClearanceAreasPolygonsToPolysList
|
||||
|
@ -244,7 +265,7 @@ public:
|
|||
* @param aBoolengine = the kbool engine used in Do_Operation
|
||||
* @return the corner count
|
||||
*/
|
||||
int CopyPolygonsFromBoolengineToFilledPolysList( Bool_Engine* aBoolengine );
|
||||
int CopyPolygonsFromBoolengineToFilledPolysList( Bool_Engine* aBoolengine );
|
||||
|
||||
/**
|
||||
* Function CopyPolygonsFromFilledPolysListToBoolengine
|
||||
|
@ -253,8 +274,8 @@ public:
|
|||
* @param aGroup = group in kbool engine (GROUP_A or GROUP_B only)
|
||||
* @return the corner count
|
||||
*/
|
||||
int CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aBoolengine,
|
||||
GroupType aGroup = GROUP_A );
|
||||
int CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aBoolengine,
|
||||
GroupType aGroup = GROUP_A );
|
||||
|
||||
/**
|
||||
* Function HitTestForCorner
|
||||
|
@ -263,7 +284,7 @@ public:
|
|||
* @return true if found
|
||||
* @param refPos : A wxPoint to test
|
||||
*/
|
||||
bool HitTestForCorner( const wxPoint& refPos );
|
||||
bool HitTestForCorner( const wxPoint& refPos );
|
||||
|
||||
/**
|
||||
* Function HitTestForEdge
|
||||
|
@ -272,10 +293,10 @@ public:
|
|||
* @return true if found
|
||||
* @param refPos : A wxPoint to test
|
||||
*/
|
||||
bool HitTestForEdge( const wxPoint& refPos );
|
||||
bool HitTestForEdge( const wxPoint& refPos );
|
||||
|
||||
/**
|
||||
* Function HitTest (overlayed)
|
||||
* Function HitTest (overloaded)
|
||||
* tests if the given EDA_RECT contains the bounds of this object.
|
||||
* @param refArea : the given EDA_RECT
|
||||
* @return bool - true if a hit, else false
|
||||
|
@ -293,7 +314,7 @@ public:
|
|||
* @param verbose = true to show error messages
|
||||
* @return error level (0 = no error)
|
||||
*/
|
||||
int Fill_Zone( PCB_EDIT_FRAME* frame, wxDC* DC, bool verbose = true );
|
||||
int Fill_Zone( PCB_EDIT_FRAME* frame, wxDC* DC, bool verbose = true );
|
||||
|
||||
/**
|
||||
* Function Fill_Zone_Areas_With_Segments
|
||||
|
@ -303,7 +324,7 @@ public:
|
|||
* a list of SEGZONE items is built, line per line
|
||||
* @return number of segments created
|
||||
*/
|
||||
int Fill_Zone_Areas_With_Segments();
|
||||
int Fill_Zone_Areas_With_Segments();
|
||||
|
||||
/**
|
||||
* Function UnFill
|
||||
|
@ -311,7 +332,7 @@ public:
|
|||
* @return true if a previous filling is removed, false if no change
|
||||
* (when no filling found)
|
||||
*/
|
||||
bool UnFill();
|
||||
bool UnFill();
|
||||
|
||||
/* Geometric transformations: */
|
||||
|
||||
|
@ -320,14 +341,14 @@ public:
|
|||
* Move the outlines
|
||||
* @param offset = moving vector
|
||||
*/
|
||||
void Move( const wxPoint& offset );
|
||||
void Move( const wxPoint& offset );
|
||||
|
||||
/**
|
||||
* Function MoveEdge
|
||||
* Move the outline Edge. m_CornerSelection is the start point of the outline edge
|
||||
* @param offset = moving vector
|
||||
*/
|
||||
void MoveEdge( const wxPoint& offset );
|
||||
void MoveEdge( const wxPoint& offset );
|
||||
|
||||
/**
|
||||
* Function Rotate
|
||||
|
@ -335,7 +356,7 @@ public:
|
|||
* @param centre = rot centre
|
||||
* @param angle = in 0.1 degree
|
||||
*/
|
||||
void Rotate( const wxPoint& centre, int angle );
|
||||
void Rotate( const wxPoint& centre, int angle );
|
||||
|
||||
/**
|
||||
* Function Flip
|
||||
|
@ -351,7 +372,7 @@ public:
|
|||
* the layer is not changed
|
||||
* @param mirror_ref = vertical axis position
|
||||
*/
|
||||
void Mirror( const wxPoint& mirror_ref );
|
||||
void Mirror( const wxPoint& mirror_ref );
|
||||
|
||||
/**
|
||||
* Function GetClass
|
||||
|
@ -427,6 +448,7 @@ public:
|
|||
};
|
||||
|
||||
void SetCornerSmoothingType( int aType ) { cornerSmoothingType = aType; };
|
||||
|
||||
int GetCornerSmoothingType() const { return cornerSmoothingType; };
|
||||
|
||||
void SetCornerRadius( unsigned int aRadius )
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* @file dimension.cpp
|
||||
* @brief Dialog and code for editing a deminsion object.
|
||||
* @brief Dialog and code for editing a dimension object.
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
|
@ -13,15 +13,14 @@
|
|||
#include "dialog_helpers.h"
|
||||
|
||||
/* Local functions */
|
||||
static void Exit_EditDimension( EDA_DRAW_PANEL* Panel, wxDC* DC );
|
||||
static void Montre_Position_New_Dimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||
const wxPoint& aPosition, bool aErase );
|
||||
static void MoveDimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||
const wxPoint& aPosition, bool aErase );
|
||||
|
||||
/* Local variables : */
|
||||
static int status_dimension; /* Used in cimension creation:
|
||||
static int status_dimension; /* Used in dimension creation:
|
||||
* = 0 : initial value: no dimension in progress
|
||||
* = 1 : First point created
|
||||
* = 2 : Secont point created, the text must be placed */
|
||||
* = 1 : First point created
|
||||
* = 2 : Second point created, the text must be placed */
|
||||
|
||||
/*
|
||||
* A dimension has this shape:
|
||||
|
@ -54,15 +53,15 @@ private:
|
|||
public:
|
||||
|
||||
// Constructor and destructor
|
||||
DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent, DIMENSION* Dimension, wxDC* DC );
|
||||
DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* aParent, DIMENSION* aDimension, wxDC* aDC );
|
||||
~DIMENSION_EDITOR_DIALOG()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void OnCancelClick( wxCommandEvent& event );
|
||||
void OnOkClick( wxCommandEvent& event );
|
||||
void OnCancelClick( wxCommandEvent& event );
|
||||
void OnOkClick( wxCommandEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
@ -73,18 +72,17 @@ BEGIN_EVENT_TABLE( DIMENSION_EDITOR_DIALOG, wxDialog )
|
|||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent,
|
||||
DIMENSION* Dimension, wxDC* DC
|
||||
) :
|
||||
wxDialog( parent, -1, wxString( _( "Dimension properties" ) ) )
|
||||
DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* aParent,
|
||||
DIMENSION* aDimension, wxDC* aDC ) :
|
||||
wxDialog( aParent, -1, _( "Dimension Properties" ) )
|
||||
{
|
||||
wxButton* Button;
|
||||
|
||||
m_Parent = parent;
|
||||
m_DC = DC;
|
||||
m_Parent = aParent;
|
||||
m_DC = aDC;
|
||||
Centre();
|
||||
|
||||
CurrentDimension = Dimension;
|
||||
CurrentDimension = aDimension;
|
||||
|
||||
wxBoxSizer* MainBoxSizer = new wxBoxSizer( wxHORIZONTAL );
|
||||
SetSizer( MainBoxSizer );
|
||||
|
@ -93,7 +91,7 @@ DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent,
|
|||
MainBoxSizer->Add( LeftBoxSizer, 0, wxGROW | wxALL, 5 );
|
||||
MainBoxSizer->Add( RightBoxSizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
|
||||
|
||||
/* Creation des boutons de commande */
|
||||
/* Create command buttons. */
|
||||
Button = new wxButton( this, wxID_OK, _( "OK" ) );
|
||||
RightBoxSizer->Add( Button, 0, wxGROW | wxALL, 5 );
|
||||
|
||||
|
@ -105,7 +103,7 @@ DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent,
|
|||
wxDefaultPosition, wxSize( -1, -1 ), 2, display_msg,
|
||||
1, wxRA_SPECIFY_COLS );
|
||||
|
||||
if( Dimension->m_Text->m_Mirror )
|
||||
if( aDimension->m_Text->m_Mirror )
|
||||
m_Mirror->SetSelection( 1 );
|
||||
|
||||
RightBoxSizer->Add( m_Mirror, 0, wxGROW | wxALL, 5 );
|
||||
|
@ -113,7 +111,7 @@ DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent,
|
|||
LeftBoxSizer->Add( new wxStaticText( this, -1, _( "Text:" ) ),
|
||||
0, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxADJUST_MINSIZE, 5 );
|
||||
|
||||
m_Name = new wxTextCtrl( this, -1, Dimension->m_Text->m_Text,
|
||||
m_Name = new wxTextCtrl( this, -1, aDimension->m_Text->m_Text,
|
||||
wxDefaultPosition, wxSize( 200, -1 ) );
|
||||
|
||||
m_Name->SetInsertionPoint( 1 );
|
||||
|
@ -123,12 +121,10 @@ DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent,
|
|||
wxGROW | wxALIGN_CENTER_VERTICAL | wxLEFT | wxRIGHT | wxBOTTOM,
|
||||
5 );
|
||||
|
||||
m_TxtSizeCtrl = new EDA_SIZE_CTRL( this, _( "Size" ),
|
||||
Dimension->m_Text->m_Size,
|
||||
m_TxtSizeCtrl = new EDA_SIZE_CTRL( this, _( "Size" ), aDimension->m_Text->m_Size,
|
||||
g_UserUnit, LeftBoxSizer, m_Parent->m_InternalUnits );
|
||||
|
||||
m_TxtWidthCtrl = new EDA_VALUE_CTRL( this, _( "Width" ),
|
||||
Dimension->m_Width,
|
||||
m_TxtWidthCtrl = new EDA_VALUE_CTRL( this, _( "Width" ), aDimension->m_Width,
|
||||
g_UserUnit, LeftBoxSizer, m_Parent->m_InternalUnits );
|
||||
|
||||
wxStaticText* text = new wxStaticText( this, -1, _( "Layer:" ) );
|
||||
|
@ -140,10 +136,10 @@ DIMENSION_EDITOR_DIALOG::DIMENSION_EDITOR_DIALOG( PCB_EDIT_FRAME* parent,
|
|||
|
||||
for( int layer = FIRST_NO_COPPER_LAYER; layer<NB_LAYERS; layer++ )
|
||||
{
|
||||
m_SelLayerBox->Append( parent->GetBoard()->GetLayerName( layer ) );
|
||||
m_SelLayerBox->Append( aParent->GetBoard()->GetLayerName( layer ) );
|
||||
}
|
||||
|
||||
m_SelLayerBox->SetSelection( Dimension->GetLayer() - FIRST_NO_COPPER_LAYER );
|
||||
m_SelLayerBox->SetSelection( aDimension->GetLayer() - FIRST_NO_COPPER_LAYER );
|
||||
|
||||
GetSizer()->Fit( this );
|
||||
GetSizer()->SetSizeHints( this );
|
||||
|
@ -200,7 +196,7 @@ void DIMENSION_EDITOR_DIALOG::OnOkClick( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
|
||||
static void Exit_EditDimension( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
||||
static void AbortMoveDimension( EDA_DRAW_PANEL* Panel, wxDC* aDC )
|
||||
{
|
||||
DIMENSION* Dimension = (DIMENSION*) Panel->GetScreen()->GetCurItem();
|
||||
|
||||
|
@ -208,12 +204,12 @@ static void Exit_EditDimension( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
|||
{
|
||||
if( Dimension->IsNew() )
|
||||
{
|
||||
Dimension->Draw( Panel, DC, GR_XOR );
|
||||
Dimension->Draw( Panel, aDC, GR_XOR );
|
||||
Dimension->DeleteStructure();
|
||||
}
|
||||
else
|
||||
{
|
||||
Dimension->Draw( Panel, DC, GR_OR );
|
||||
Dimension->Draw( Panel, aDC, GR_OR );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -222,75 +218,75 @@ static void Exit_EditDimension( EDA_DRAW_PANEL* Panel, wxDC* DC )
|
|||
}
|
||||
|
||||
|
||||
DIMENSION* PCB_EDIT_FRAME::Begin_Dimension( DIMENSION* Dimension, wxDC* DC )
|
||||
DIMENSION* PCB_EDIT_FRAME::EditDimension( DIMENSION* aDimension, wxDC* aDC )
|
||||
{
|
||||
wxPoint pos;
|
||||
|
||||
if( Dimension == NULL ) /* debut reel du trace */
|
||||
if( aDimension == NULL )
|
||||
{
|
||||
status_dimension = 1;
|
||||
pos = GetScreen()->GetCrossHairPosition();
|
||||
|
||||
Dimension = new DIMENSION( GetBoard() );
|
||||
Dimension->m_Flags = IS_NEW;
|
||||
aDimension = new DIMENSION( GetBoard() );
|
||||
aDimension->m_Flags = IS_NEW;
|
||||
|
||||
Dimension->SetLayer( getActiveLayer() );
|
||||
aDimension->SetLayer( getActiveLayer() );
|
||||
|
||||
Dimension->Barre_ox = Dimension->Barre_fx = pos.x;
|
||||
Dimension->Barre_oy = Dimension->Barre_fy = pos.y;
|
||||
aDimension->m_crossBarOx = aDimension->m_crossBarFx = pos.x;
|
||||
aDimension->m_crossBarOy = aDimension->m_crossBarFy = pos.y;
|
||||
|
||||
Dimension->TraitD_ox = Dimension->TraitD_fx = pos.x;
|
||||
Dimension->TraitD_oy = Dimension->TraitD_fy = pos.y;
|
||||
aDimension->m_featureLineDOx = aDimension->m_featureLineDFx = pos.x;
|
||||
aDimension->m_featureLineDOy = aDimension->m_featureLineDFy = pos.y;
|
||||
|
||||
Dimension->TraitG_ox = Dimension->TraitG_fx = pos.x;
|
||||
Dimension->TraitG_oy = Dimension->TraitG_fy = pos.y;
|
||||
aDimension->m_featureLineGOx = aDimension->m_featureLineGFx = pos.x;
|
||||
aDimension->m_featureLineGOy = aDimension->m_featureLineGFy = pos.y;
|
||||
|
||||
Dimension->FlecheG1_ox = Dimension->FlecheG1_fx = pos.x;
|
||||
Dimension->FlecheG1_oy = Dimension->FlecheG1_fy = pos.y;
|
||||
aDimension->m_arrowG1Ox = aDimension->m_arrowG1Fx = pos.x;
|
||||
aDimension->m_arrowG1Oy = aDimension->m_arrowG1Fy = pos.y;
|
||||
|
||||
Dimension->FlecheG2_ox = Dimension->FlecheG2_fx = pos.x;
|
||||
Dimension->FlecheG2_oy = Dimension->FlecheG2_fy = pos.y;
|
||||
aDimension->m_arrowG2Ox = aDimension->m_arrowG2Fx = pos.x;
|
||||
aDimension->m_arrowG2Oy = aDimension->m_arrowG2Fy = pos.y;
|
||||
|
||||
Dimension->FlecheD1_ox = Dimension->FlecheD1_fx = pos.x;
|
||||
Dimension->FlecheD1_oy = Dimension->FlecheD1_fy = pos.y;
|
||||
aDimension->m_arrowD1Ox = aDimension->m_arrowD1Fx = pos.x;
|
||||
aDimension->m_arrowD1Oy = aDimension->m_arrowD1Fy = pos.y;
|
||||
|
||||
Dimension->FlecheD2_ox = Dimension->FlecheD2_fx = pos.x;
|
||||
Dimension->FlecheD2_oy = Dimension->FlecheD2_fy = pos.y;
|
||||
aDimension->m_arrowD2Ox = aDimension->m_arrowD2Fx = pos.x;
|
||||
aDimension->m_arrowD2Oy = aDimension->m_arrowD2Fy = pos.y;
|
||||
|
||||
Dimension->m_Text->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize;
|
||||
aDimension->m_Text->m_Size = GetBoard()->GetBoardDesignSettings()->m_PcbTextSize;
|
||||
int width = GetBoard()->GetBoardDesignSettings()->m_PcbTextWidth;
|
||||
int maxthickness = Clamp_Text_PenSize(width, Dimension->m_Text->m_Size );
|
||||
int maxthickness = Clamp_Text_PenSize(width, aDimension->m_Text->m_Size );
|
||||
|
||||
if( width > maxthickness )
|
||||
{
|
||||
width = maxthickness;
|
||||
}
|
||||
|
||||
Dimension->m_Text->m_Thickness = Dimension->m_Width = width ;
|
||||
aDimension->m_Text->m_Thickness = aDimension->m_Width = width ;
|
||||
|
||||
Dimension->AdjustDimensionDetails( );
|
||||
aDimension->AdjustDimensionDetails( );
|
||||
|
||||
Dimension->Draw( DrawPanel, DC, GR_XOR );
|
||||
aDimension->Draw( DrawPanel, aDC, GR_XOR );
|
||||
|
||||
DrawPanel->SetMouseCapture( Montre_Position_New_Dimension, Exit_EditDimension );
|
||||
return Dimension;
|
||||
DrawPanel->SetMouseCapture( MoveDimension, AbortMoveDimension );
|
||||
return aDimension;
|
||||
}
|
||||
|
||||
// Dimension != NULL
|
||||
if( status_dimension == 1 )
|
||||
{
|
||||
status_dimension = 2;
|
||||
return Dimension;
|
||||
return aDimension;
|
||||
}
|
||||
|
||||
Dimension->Draw( DrawPanel, DC, GR_OR );
|
||||
Dimension->m_Flags = 0;
|
||||
aDimension->Draw( DrawPanel, aDC, GR_OR );
|
||||
aDimension->m_Flags = 0;
|
||||
|
||||
/* ADD this new item in list */
|
||||
GetBoard()->Add( Dimension );
|
||||
GetBoard()->Add( aDimension );
|
||||
|
||||
// Add store it in undo/redo list
|
||||
SaveCopyInUndoList( Dimension, UR_NEW );
|
||||
SaveCopyInUndoList( aDimension, UR_NEW );
|
||||
|
||||
OnModify();
|
||||
DrawPanel->SetMouseCapture( NULL, NULL );
|
||||
|
@ -299,8 +295,8 @@ DIMENSION* PCB_EDIT_FRAME::Begin_Dimension( DIMENSION* Dimension, wxDC* DC )
|
|||
}
|
||||
|
||||
|
||||
static void Montre_Position_New_Dimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||
const wxPoint& aPosition, bool aErase )
|
||||
static void MoveDimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
||||
const wxPoint& aPosition, bool aErase )
|
||||
{
|
||||
PCB_SCREEN* screen = (PCB_SCREEN*) aPanel->GetScreen();
|
||||
DIMENSION* Dimension = (DIMENSION*) screen->GetCurItem();
|
||||
|
@ -319,31 +315,31 @@ static void Montre_Position_New_Dimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
|
||||
if( status_dimension == 1 )
|
||||
{
|
||||
Dimension->TraitD_ox = pos.x;
|
||||
Dimension->TraitD_oy = pos.y;
|
||||
Dimension->Barre_fx = Dimension->TraitD_ox;
|
||||
Dimension->Barre_fy = Dimension->TraitD_oy;
|
||||
Dimension->m_featureLineDOx = pos.x;
|
||||
Dimension->m_featureLineDOy = pos.y;
|
||||
Dimension->m_crossBarFx = Dimension->m_featureLineDOx;
|
||||
Dimension->m_crossBarFy = Dimension->m_featureLineDOy;
|
||||
Dimension->AdjustDimensionDetails( );
|
||||
}
|
||||
else
|
||||
{
|
||||
int deltax, deltay, dx, dy;
|
||||
float angle, depl;
|
||||
deltax = Dimension->TraitD_ox - Dimension->TraitG_ox;
|
||||
deltay = Dimension->TraitD_oy - Dimension->TraitG_oy;
|
||||
deltax = Dimension->m_featureLineDOx - Dimension->m_featureLineGOx;
|
||||
deltay = Dimension->m_featureLineDOy - Dimension->m_featureLineGOy;
|
||||
|
||||
/* Calculating the direction of travel perpendicular to the selected axis. */
|
||||
angle = atan2( (double)deltay, (double)deltax ) + (M_PI / 2);
|
||||
|
||||
deltax = pos.x - Dimension->TraitD_ox;
|
||||
deltay = pos.y - Dimension->TraitD_oy;
|
||||
deltax = pos.x - Dimension->m_featureLineDOx;
|
||||
deltay = pos.y - Dimension->m_featureLineDOy;
|
||||
depl = ( deltax * cos( angle ) ) + ( deltay * sin( angle ) );
|
||||
dx = (int) ( depl * cos( angle ) );
|
||||
dy = (int) ( depl * sin( angle ) );
|
||||
Dimension->Barre_ox = Dimension->TraitG_ox + dx;
|
||||
Dimension->Barre_oy = Dimension->TraitG_oy + dy;
|
||||
Dimension->Barre_fx = Dimension->TraitD_ox + dx;
|
||||
Dimension->Barre_fy = Dimension->TraitD_oy + dy;
|
||||
Dimension->m_crossBarOx = Dimension->m_featureLineGOx + dx;
|
||||
Dimension->m_crossBarOy = Dimension->m_featureLineGOy + dy;
|
||||
Dimension->m_crossBarFx = Dimension->m_featureLineDOx + dx;
|
||||
Dimension->m_crossBarFy = Dimension->m_featureLineDOy + dy;
|
||||
|
||||
Dimension->AdjustDimensionDetails( );
|
||||
}
|
||||
|
@ -352,26 +348,26 @@ static void Montre_Position_New_Dimension( EDA_DRAW_PANEL* aPanel, wxDC* aDC,
|
|||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::Install_Edit_Dimension( DIMENSION* Dimension, wxDC* DC )
|
||||
void PCB_EDIT_FRAME::ShowDimensionPropertyDialog( DIMENSION* aDimension, wxDC* aDC )
|
||||
{
|
||||
if( Dimension == NULL )
|
||||
if( aDimension == NULL )
|
||||
return;
|
||||
|
||||
DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, Dimension, DC );
|
||||
DIMENSION_EDITOR_DIALOG* frame = new DIMENSION_EDITOR_DIALOG( this, aDimension, aDC );
|
||||
frame->ShowModal();
|
||||
frame->Destroy();
|
||||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::Delete_Dimension( DIMENSION* Dimension, wxDC* DC )
|
||||
void PCB_EDIT_FRAME::DeleteDimension( DIMENSION* aDimension, wxDC* aDC )
|
||||
{
|
||||
if( Dimension == NULL )
|
||||
if( aDimension == NULL )
|
||||
return;
|
||||
|
||||
if( DC )
|
||||
Dimension->Draw( DrawPanel, DC, GR_XOR );
|
||||
if( aDC )
|
||||
aDimension->Draw( DrawPanel, aDC, GR_XOR );
|
||||
|
||||
SaveCopyInUndoList(Dimension, UR_DELETED);
|
||||
Dimension->UnLink();
|
||||
SaveCopyInUndoList( aDimension, UR_DELETED );
|
||||
aDimension->UnLink();
|
||||
OnModify();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/**************************************/
|
||||
/* edit.cpp: edit PCB implementation. */
|
||||
/**************************************/
|
||||
/**
|
||||
* @file edit.cpp
|
||||
* @brief Edit PCB implementation.
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "appl_wxstruct.h"
|
||||
|
@ -897,12 +898,12 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
case ID_POPUP_PCB_DELETE_DIMENSION:
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
Delete_Dimension( (DIMENSION*) GetCurItem(), &dc );
|
||||
DeleteDimension( (DIMENSION*) GetCurItem(), &dc );
|
||||
SetCurItem( NULL );
|
||||
break;
|
||||
|
||||
case ID_POPUP_PCB_EDIT_DIMENSION:
|
||||
Install_Edit_Dimension( (DIMENSION*) GetCurItem(), &dc );
|
||||
ShowDimensionPropertyDialog( (DIMENSION*) GetCurItem(), &dc );
|
||||
DrawPanel->MoveCursorToCrossHair();
|
||||
break;
|
||||
|
||||
|
@ -1092,7 +1093,7 @@ void PCB_EDIT_FRAME::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
|
|||
break;
|
||||
|
||||
case TYPE_DIMENSION:
|
||||
Delete_Dimension( (DIMENSION*) Item, DC );
|
||||
DeleteDimension( (DIMENSION*) Item, DC );
|
||||
break;
|
||||
|
||||
case PCB_TARGET_T:
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/**************************************************************/
|
||||
/* onleftclick.cpp: */
|
||||
/* function called when the left button is clicked (released) */
|
||||
/* function called when the left button is double clicked */
|
||||
/**************************************************************/
|
||||
/**
|
||||
* @file pcbnew/onleftclick.cpp
|
||||
* @brief Functions called when the left button is clicked or double clicked.
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "class_drawpanel.h"
|
||||
|
@ -13,7 +12,7 @@
|
|||
#include "pcbnew_id.h"
|
||||
|
||||
|
||||
/* Handle the left buttom mouse click, when a tool is active
|
||||
/* Handle the left button mouse click, when a tool is active
|
||||
*/
|
||||
void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
||||
{
|
||||
|
@ -286,7 +285,7 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
}
|
||||
}
|
||||
else if( DrawStruct && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) && DrawStruct->IsNew() )
|
||||
{ // Add a new corner to the current outline beeing created:
|
||||
{ // Add a new corner to the current outline being created:
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
Begin_Zone( aDC );
|
||||
DrawStruct = GetBoard()->m_CurrentZoneContour;
|
||||
|
@ -349,13 +348,13 @@ void PCB_EDIT_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
|
|||
|
||||
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
|
||||
{
|
||||
DrawStruct = Begin_Dimension( NULL, aDC );
|
||||
DrawStruct = EditDimension( NULL, aDC );
|
||||
SetCurItem( DrawStruct );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
}
|
||||
else if( DrawStruct && (DrawStruct->Type() == TYPE_DIMENSION) && DrawStruct->IsNew() )
|
||||
{
|
||||
DrawStruct = Begin_Dimension( (DIMENSION*) DrawStruct, aDC );
|
||||
DrawStruct = EditDimension( (DIMENSION*) DrawStruct, aDC );
|
||||
SetCurItem( DrawStruct );
|
||||
DrawPanel->m_AutoPAN_Request = true;
|
||||
}
|
||||
|
@ -535,7 +534,7 @@ void PCB_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
|
|||
break;
|
||||
|
||||
case TYPE_DIMENSION:
|
||||
Install_Edit_Dimension( (DIMENSION*) aItem, aDC );
|
||||
ShowDimensionPropertyDialog( (DIMENSION*) aItem, aDC );
|
||||
break;
|
||||
|
||||
case TYPE_TEXTE_MODULE:
|
||||
|
@ -554,4 +553,3 @@ void PCB_EDIT_FRAME::OnEditItemRequest( wxDC* aDC, BOARD_ITEM* aItem )
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*************************/
|
||||
/* Common plot routines. */
|
||||
/*************************/
|
||||
/**
|
||||
* @file plot_rtn.cpp
|
||||
* @brief Common plot routines.
|
||||
*/
|
||||
|
||||
#include "fctsys.h"
|
||||
#include "common.h"
|
||||
|
@ -22,9 +23,7 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte,
|
|||
|
||||
/* Creates the plot for silkscreen layers
|
||||
*/
|
||||
void PCB_BASE_FRAME::Plot_Serigraphie( PLOTTER* plotter,
|
||||
int aLayerMask,
|
||||
GRTraceMode trace_mode )
|
||||
void PCB_BASE_FRAME::PlotSilkScreen( PLOTTER* plotter, int aLayerMask, GRTraceMode trace_mode )
|
||||
{
|
||||
bool trace_val, trace_ref;
|
||||
TEXTE_MODULE* pt_texte;
|
||||
|
@ -56,7 +55,7 @@ void PCB_BASE_FRAME::Plot_Serigraphie( PLOTTER* plotter,
|
|||
break;
|
||||
|
||||
default:
|
||||
DisplayError( this, wxT( "Plot_Serigraphie() error: unexpected Type()" ) );
|
||||
DisplayError( this, wxT( "PlotSilkScreen() error: unexpected Type()" ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -256,7 +255,7 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, GRTraceMod
|
|||
|
||||
|
||||
void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int aLayerMask,
|
||||
GRTraceMode trace_mode )
|
||||
GRTraceMode trace_mode )
|
||||
{
|
||||
DRAWSEGMENT* DrawTmp;
|
||||
|
||||
|
@ -270,46 +269,46 @@ void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int aLayerMask,
|
|||
|
||||
PlotTextePcb( plotter, Dimension->m_Text, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->Barre_ox;
|
||||
DrawTmp->m_Start.y = Dimension->Barre_oy;
|
||||
DrawTmp->m_End.x = Dimension->Barre_fx;
|
||||
DrawTmp->m_End.y = Dimension->Barre_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_crossBarOx;
|
||||
DrawTmp->m_Start.y = Dimension->m_crossBarOy;
|
||||
DrawTmp->m_End.x = Dimension->m_crossBarFx;
|
||||
DrawTmp->m_End.y = Dimension->m_crossBarFy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->TraitG_ox;
|
||||
DrawTmp->m_Start.y = Dimension->TraitG_oy;
|
||||
DrawTmp->m_End.x = Dimension->TraitG_fx;
|
||||
DrawTmp->m_End.y = Dimension->TraitG_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_featureLineGOx;
|
||||
DrawTmp->m_Start.y = Dimension->m_featureLineGOy;
|
||||
DrawTmp->m_End.x = Dimension->m_featureLineGFx;
|
||||
DrawTmp->m_End.y = Dimension->m_featureLineGFy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->TraitD_ox;
|
||||
DrawTmp->m_Start.y = Dimension->TraitD_oy;
|
||||
DrawTmp->m_End.x = Dimension->TraitD_fx;
|
||||
DrawTmp->m_End.y = Dimension->TraitD_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_featureLineDOx;
|
||||
DrawTmp->m_Start.y = Dimension->m_featureLineDOy;
|
||||
DrawTmp->m_End.x = Dimension->m_featureLineDFx;
|
||||
DrawTmp->m_End.y = Dimension->m_featureLineDFy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->FlecheD1_ox;
|
||||
DrawTmp->m_Start.y = Dimension->FlecheD1_oy;
|
||||
DrawTmp->m_End.x = Dimension->FlecheD1_fx;
|
||||
DrawTmp->m_End.y = Dimension->FlecheD1_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_arrowD1Ox;
|
||||
DrawTmp->m_Start.y = Dimension->m_arrowD1Oy;
|
||||
DrawTmp->m_End.x = Dimension->m_arrowD1Fx;
|
||||
DrawTmp->m_End.y = Dimension->m_arrowD1Fy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->FlecheD2_ox;
|
||||
DrawTmp->m_Start.y = Dimension->FlecheD2_oy;
|
||||
DrawTmp->m_End.x = Dimension->FlecheD2_fx;
|
||||
DrawTmp->m_End.y = Dimension->FlecheD2_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_arrowD2Ox;
|
||||
DrawTmp->m_Start.y = Dimension->m_arrowD2Oy;
|
||||
DrawTmp->m_End.x = Dimension->m_arrowD2Fx;
|
||||
DrawTmp->m_End.y = Dimension->m_arrowD2Fy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->FlecheG1_ox;
|
||||
DrawTmp->m_Start.y = Dimension->FlecheG1_oy;
|
||||
DrawTmp->m_End.x = Dimension->FlecheG1_fx;
|
||||
DrawTmp->m_End.y = Dimension->FlecheG1_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_arrowG1Ox;
|
||||
DrawTmp->m_Start.y = Dimension->m_arrowG1Oy;
|
||||
DrawTmp->m_End.x = Dimension->m_arrowG1Fx;
|
||||
DrawTmp->m_End.y = Dimension->m_arrowG1Fy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
DrawTmp->m_Start.x = Dimension->FlecheG2_ox;
|
||||
DrawTmp->m_Start.y = Dimension->FlecheG2_oy;
|
||||
DrawTmp->m_End.x = Dimension->FlecheG2_fx;
|
||||
DrawTmp->m_End.y = Dimension->FlecheG2_fy;
|
||||
DrawTmp->m_Start.x = Dimension->m_arrowG2Ox;
|
||||
DrawTmp->m_Start.y = Dimension->m_arrowG2Oy;
|
||||
DrawTmp->m_End.x = Dimension->m_arrowG2Fx;
|
||||
DrawTmp->m_End.y = Dimension->m_arrowG2Fy;
|
||||
PlotDrawSegment( plotter, DrawTmp, aLayerMask, trace_mode );
|
||||
|
||||
delete DrawTmp;
|
||||
|
@ -367,8 +366,7 @@ void PlotPcbTarget( PLOTTER* plotter, PCB_TARGET* Mire, int aLayerMask, GRTraceM
|
|||
|
||||
|
||||
/* Plot footprints graphic items (outlines) */
|
||||
void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask,
|
||||
GRTraceMode trace_mode )
|
||||
void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask, GRTraceMode trace_mode )
|
||||
{
|
||||
for( MODULE* module = pcb->m_Modules; module; module = module->Next() )
|
||||
{
|
||||
|
@ -389,8 +387,7 @@ void Plot_Edges_Modules( PLOTTER* plotter, BOARD* pcb, int aLayerMask,
|
|||
|
||||
|
||||
/* Plot a graphic item (outline) relative to a footprint */
|
||||
void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge,
|
||||
GRTraceMode trace_mode )
|
||||
void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge, GRTraceMode trace_mode )
|
||||
{
|
||||
int type_trace; /* Type of item to plot. */
|
||||
int thickness; /* Segment thickness. */
|
||||
|
@ -467,8 +464,7 @@ void Plot_1_EdgeModule( PLOTTER* plotter, EDGE_MODULE* PtEdge,
|
|||
|
||||
|
||||
/* Plot a PCB Text, i;e. a text found on a copper or technical layer */
|
||||
void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int aLayerMask,
|
||||
GRTraceMode trace_mode )
|
||||
void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int aLayerMask, GRTraceMode trace_mode )
|
||||
{
|
||||
int orient, thickness;
|
||||
wxPoint pos;
|
||||
|
@ -686,7 +682,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_
|
|||
case LAYER_N_15:
|
||||
case LAST_COPPER_LAYER:
|
||||
Plot_Standard_Layer( plotter, layer_mask, true, trace_mode,
|
||||
g_PcbPlotOptions.m_SkipNPTH_Pads );
|
||||
g_PcbPlotOptions.m_SkipNPTH_Pads );
|
||||
|
||||
// Adding drill marks, if required and if the plotter is able to plot them:
|
||||
if( g_PcbPlotOptions.m_DrillShapeOpt != PCB_PLOT_PARAMS::NO_DRILL_SHAPE )
|
||||
|
@ -711,7 +707,7 @@ void PCB_BASE_FRAME::Plot_Layer( PLOTTER* plotter, int Layer, GRTraceMode trace_
|
|||
break;
|
||||
|
||||
default:
|
||||
Plot_Serigraphie( plotter, layer_mask, trace_mode );
|
||||
PlotSilkScreen( plotter, layer_mask, trace_mode );
|
||||
|
||||
// Gerber: Subtract soldermask from silkscreen if enabled
|
||||
if( plotter->GetPlotterType() == PLOT_FORMAT_GERBER
|
||||
|
|
Loading…
Reference in New Issue