Commit 5849675a authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: Fixed minor problems (bugs 568357 and 568356). Changed French word...

Pcbnew: Fixed minor problems (bugs 568357 and 568356). Changed French word COTATION to DIMENSION in class COTATION (now class DIMENSION)
parents 90f6219a 4787b38a
...@@ -4,6 +4,12 @@ KiCad ChangeLog 2010 ...@@ -4,6 +4,12 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2010-apr-23, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
Fixed minor problems.
Changed French word COTATION to DIMENSION in class COTATION (now class DIMENSION)
2010-apr-22, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> 2010-apr-22, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================ ================================================================================
++Pcbnew+Gerbview: ++Pcbnew+Gerbview:
......
...@@ -38,7 +38,7 @@ enum KICAD_T { ...@@ -38,7 +38,7 @@ enum KICAD_T {
TYPE_ZONE, // a segment used to fill a zone area (segment on a TYPE_ZONE, // a segment used to fill a zone area (segment on a
// copper layer) // copper layer)
TYPE_MARKER_PCB, // a marker used to show something TYPE_MARKER_PCB, // a marker used to show something
TYPE_COTATION, // a dimension (graphic item) TYPE_DIMENSION, // a dimension (graphic item)
TYPE_MIRE, // a target (graphic item) TYPE_MIRE, // a target (graphic item)
TYPE_ZONE_EDGE_CORNER, // in zone outline: a point to define an outline TYPE_ZONE_EDGE_CORNER, // in zone outline: a point to define an outline
TYPE_ZONE_CONTAINER, // a zone area TYPE_ZONE_CONTAINER, // a zone area
......
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
* Function SetLayer * Function SetLayer
* sets the layer this item is on. * sets the layer this item is on.
* @param aLayer The layer number. * @param aLayer The layer number.
* is virtual because some items (in fact: class COTATION) * is virtual because some items (in fact: class DIMENSION)
* have a slightly different initialisation * have a slightly different initialisation
*/ */
virtual void SetLayer( int aLayer ) { m_Layer = aLayer; } virtual void SetLayer( int aLayer ) { m_Layer = aLayer; }
......
...@@ -32,7 +32,7 @@ class SEGVIA; ...@@ -32,7 +32,7 @@ class SEGVIA;
class D_PAD; class D_PAD;
class TEXTE_MODULE; class TEXTE_MODULE;
class MIREPCB; class MIREPCB;
class COTATION; class DIMENSION;
class EDGE_MODULE; class EDGE_MODULE;
class WinEDA3D_DrawFrame; class WinEDA3D_DrawFrame;
class DRC; class DRC;
......
...@@ -27,7 +27,7 @@ class SEGVIA; ...@@ -27,7 +27,7 @@ class SEGVIA;
class D_PAD; class D_PAD;
class TEXTE_MODULE; class TEXTE_MODULE;
class MIREPCB; class MIREPCB;
class COTATION; class DIMENSION;
class EDGE_MODULE; class EDGE_MODULE;
class WinEDA3D_DrawFrame; class WinEDA3D_DrawFrame;
class DRC; class DRC;
...@@ -854,11 +854,11 @@ public: ...@@ -854,11 +854,11 @@ public:
void Delete_Drawings_All_Layer( int aLayer ); void Delete_Drawings_All_Layer( int aLayer );
// Dimension handling: // Dimension handling:
void Install_Edit_Cotation( COTATION* Cotation, void Install_Edit_Dimension( DIMENSION* Dimension,
wxDC* DC, wxDC* DC,
const wxPoint& pos ); const wxPoint& pos );
COTATION* Begin_Cotation( COTATION* Cotation, wxDC* DC ); DIMENSION* Begin_Dimension( DIMENSION* Dimension, wxDC* DC );
void Delete_Cotation( COTATION* Cotation, wxDC* DC ); void Delete_Dimension( DIMENSION* Dimension, wxDC* DC );
// netlist handling: // netlist handling:
......
...@@ -477,7 +477,7 @@ void WinEDA_PcbFrame::Block_SelectItems() ...@@ -477,7 +477,7 @@ void WinEDA_PcbFrame::Block_SelectItems()
select_me = true; // This item is in bloc: select it select_me = true; // This item is in bloc: select it
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
if( ( g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer ) == 0 ) if( ( g_TabOneLayerMask[PtStruct->GetLayer()] & masque_layer ) == 0 )
break; break;
if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) ) if( !PtStruct->HitTest( GetScreen()->m_BlockLocate ) )
...@@ -619,7 +619,7 @@ void WinEDA_PcbFrame::Block_Delete() ...@@ -619,7 +619,7 @@ void WinEDA_PcbFrame::Block_Delete()
case TYPE_TEXTE: // a text on a layer case TYPE_TEXTE: // a text on a layer
case TYPE_TRACK: // a track segment (segment on a copper layer) case TYPE_TRACK: // a track segment (segment on a copper layer)
case TYPE_VIA: // a via (like atrack segment on a copper layer) case TYPE_VIA: // a via (like atrack segment on a copper layer)
case TYPE_COTATION: // a dimension (graphic item) case TYPE_DIMENSION: // a dimension (graphic item)
case TYPE_MIRE: // a target (graphic item) case TYPE_MIRE: // a target (graphic item)
item->UnLink(); item->UnLink();
break; break;
...@@ -696,7 +696,7 @@ void WinEDA_PcbFrame::Block_Rotate() ...@@ -696,7 +696,7 @@ void WinEDA_PcbFrame::Block_Rotate()
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_MIRE: case TYPE_MIRE:
case TYPE_COTATION: case TYPE_DIMENSION:
break; break;
// This item is not put in undo list // This item is not put in undo list
...@@ -766,7 +766,7 @@ void WinEDA_PcbFrame::Block_Flip() ...@@ -766,7 +766,7 @@ void WinEDA_PcbFrame::Block_Flip()
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_MIRE: case TYPE_MIRE:
case TYPE_COTATION: case TYPE_DIMENSION:
break; break;
// This item is not put in undo list // This item is not put in undo list
...@@ -834,7 +834,7 @@ void WinEDA_PcbFrame::Block_Move() ...@@ -834,7 +834,7 @@ void WinEDA_PcbFrame::Block_Move()
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_MIRE: case TYPE_MIRE:
case TYPE_COTATION: case TYPE_DIMENSION:
break; break;
// This item is not put in undo list // This item is not put in undo list
...@@ -955,10 +955,10 @@ void WinEDA_PcbFrame::Block_Duplicate() ...@@ -955,10 +955,10 @@ void WinEDA_PcbFrame::Block_Duplicate()
} }
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
{ {
COTATION* new_cotation = new COTATION( m_Pcb ); DIMENSION* new_cotation = new DIMENSION( m_Pcb );
new_cotation->Copy( (COTATION*) item ); new_cotation->Copy( (DIMENSION*) item );
m_Pcb->Add( new_cotation ); m_Pcb->Add( new_cotation );
newitem = new_cotation; newitem = new_cotation;
} }
......
...@@ -209,14 +209,15 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage ) ...@@ -209,14 +209,15 @@ void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
EXCHG( ( (MIREPCB*) aItem )->m_Shape, ( (MIREPCB*) aImage )->m_Shape ); EXCHG( ( (MIREPCB*) aItem )->m_Shape, ( (MIREPCB*) aImage )->m_Shape );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
{ {
wxString txt = ( (COTATION*) aItem )->GetText(); wxString txt = ( (DIMENSION*) aItem )->GetText();
( (COTATION*) aItem )->SetText( ( (COTATION*) aImage )->GetText() ); ( (DIMENSION*) aItem )->SetText( ( (DIMENSION*) aImage )->GetText() );
( (COTATION*) aImage )->SetText( txt ); ( (DIMENSION*) aImage )->SetText( txt );
EXCHG( ( (COTATION*) aItem )->m_Text->m_Size, ( (COTATION*) aImage )->m_Text->m_Size ); EXCHG( ( (DIMENSION*) aItem )->m_Width, ( (DIMENSION*) aImage )->m_Width );
EXCHG( ( (COTATION*) aItem )->m_Text->m_Width, ( (COTATION*) aImage )->m_Text->m_Width ); EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Size, ( (DIMENSION*) aImage )->m_Text->m_Size );
EXCHG( ( (COTATION*) aItem )->m_Text->m_Mirror, ( (COTATION*) aImage )->m_Text->m_Mirror ); EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Width, ( (DIMENSION*) aImage )->m_Text->m_Width );
EXCHG( ( (DIMENSION*) aItem )->m_Text->m_Mirror, ( (DIMENSION*) aImage )->m_Text->m_Mirror );
} }
break; break;
...@@ -301,10 +302,10 @@ BOARD_ITEM* DuplicateStruct( BOARD_ITEM* aItem ) ...@@ -301,10 +302,10 @@ BOARD_ITEM* DuplicateStruct( BOARD_ITEM* aItem )
} }
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
{ {
COTATION* new_cotation = new COTATION( aItem->GetParent() ); DIMENSION* new_cotation = new DIMENSION( aItem->GetParent() );
new_cotation->Copy( (COTATION*) aItem ); new_cotation->Copy( (DIMENSION*) aItem );
return new_cotation; return new_cotation;
} }
break; break;
......
...@@ -599,7 +599,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl ) ...@@ -599,7 +599,7 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
m_Status_Pcb = 0; m_Status_Pcb = 0;
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
...@@ -672,7 +672,7 @@ BOARD_ITEM* BOARD::Remove( BOARD_ITEM* aBoardItem ) ...@@ -672,7 +672,7 @@ BOARD_ITEM* BOARD::Remove( BOARD_ITEM* aBoardItem )
m_Zone.Remove( (SEGZONE*) aBoardItem ); m_Zone.Remove( (SEGZONE*) aBoardItem );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_EDGE_MODULE: case TYPE_EDGE_MODULE:
...@@ -965,7 +965,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData, ...@@ -965,7 +965,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_MIRE: case TYPE_MIRE:
result = IterateForward( m_Drawings, inspector, testData, p ); result = IterateForward( m_Drawings, inspector, testData, p );
...@@ -976,7 +976,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData, ...@@ -976,7 +976,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR* inspector, const void* testData,
{ {
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_MIRE: case TYPE_MIRE:
continue; continue;
...@@ -1369,7 +1369,7 @@ bool BOARD::Save( FILE* aFile ) const ...@@ -1369,7 +1369,7 @@ bool BOARD::Save( FILE* aFile ) const
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_MIRE: case TYPE_MIRE:
case TYPE_COTATION: case TYPE_DIMENSION:
if( !item->Save( aFile ) ) if( !item->Save( aFile ) )
goto out; goto out;
break; break;
......
/*****************************************/ /******************************************/
/* class BOARD_ITEM: som basic functions */ /* class BOARD_ITEM: some basic functions */
/*****************************************/ /******************************************/
#include "fctsys.h" #include "fctsys.h"
#include "gr_basic.h" #include "gr_basic.h"
...@@ -217,8 +217,8 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -217,8 +217,8 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
<< wxT(",") << ((MARKER_PCB*)item)->GetPos().y << wxT(")"); << wxT(",") << ((MARKER_PCB*)item)->GetPos().y << wxT(")");
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
text << _( "Dimension" ) << wxT( " \"" ) << ( (COTATION*) item )->GetText() << wxT( "\"" ); text << _( "Dimension" ) << wxT( " \"" ) << ( (DIMENSION*) item )->GetText() << wxT( "\"" );
break; break;
case TYPE_MIRE: case TYPE_MIRE:
...@@ -291,7 +291,7 @@ const char** BOARD_ITEM::MenuIcon() const ...@@ -291,7 +291,7 @@ const char** BOARD_ITEM::MenuIcon() const
xpm = pad_xpm; // @todo: create and use marker xpm xpm = pad_xpm; // @todo: create and use marker xpm
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
xpm = add_dimension_xpm; xpm = add_dimension_xpm;
break; break;
......
/*****************************/ /*****************************/
/* COTATION class definition */ /* DIMENSION class definition */
/*****************************/ /*****************************/
#include "fctsys.h" #include "fctsys.h"
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include "kicad_string.h" #include "kicad_string.h"
#include "protos.h" #include "protos.h"
COTATION::COTATION( BOARD_ITEM* aParent ) : DIMENSION::DIMENSION( BOARD_ITEM* aParent ) :
BOARD_ITEM( aParent, TYPE_COTATION ) BOARD_ITEM( aParent, TYPE_DIMENSION )
{ {
m_Layer = DRAW_LAYER; m_Layer = DRAW_LAYER;
m_Width = 50; m_Width = 50;
...@@ -26,14 +26,14 @@ COTATION::COTATION( BOARD_ITEM* aParent ) : ...@@ -26,14 +26,14 @@ COTATION::COTATION( BOARD_ITEM* aParent ) :
} }
COTATION::~COTATION() DIMENSION::~DIMENSION()
{ {
delete m_Text; delete m_Text;
} }
/* Setup the dimension text */ /* Setup the dimension text */
void COTATION::SetText( const wxString& NewText ) void DIMENSION::SetText( const wxString& NewText )
{ {
m_Text->m_Text = NewText; m_Text->m_Text = NewText;
} }
...@@ -41,7 +41,7 @@ void COTATION::SetText( const wxString& NewText ) ...@@ -41,7 +41,7 @@ void COTATION::SetText( const wxString& NewText )
/* Return the dimension text /* Return the dimension text
*/ */
wxString COTATION::GetText( void ) wxString DIMENSION::GetText( void )
{ {
return m_Text->m_Text; return m_Text->m_Text;
} }
...@@ -51,14 +51,14 @@ wxString COTATION::GetText( void ) ...@@ -51,14 +51,14 @@ wxString COTATION::GetText( void )
* sets the layer this item is on. * sets the layer this item is on.
* @param aLayer The layer number. * @param aLayer The layer number.
*/ */
void COTATION::SetLayer( int aLayer ) void DIMENSION::SetLayer( int aLayer )
{ {
m_Layer = aLayer; m_Layer = aLayer;
m_Text->SetLayer( aLayer); m_Text->SetLayer( aLayer);
} }
void COTATION::Copy( COTATION* source ) void DIMENSION::Copy( DIMENSION* source )
{ {
m_Value = source->m_Value; m_Value = source->m_Value;
SetLayer( source->GetLayer() ); SetLayer( source->GetLayer() );
...@@ -100,13 +100,13 @@ void COTATION::Copy( COTATION* source ) ...@@ -100,13 +100,13 @@ void COTATION::Copy( COTATION* source )
} }
bool COTATION::ReadCotationDescr( FILE* File, int* LineNum ) bool DIMENSION::ReadDimensionDescr( FILE* File, int* LineNum )
{ {
char Line[2048], Text[2048]; char Line[2048], Text[2048];
while( GetLine( File, Line, LineNum ) != NULL ) while( GetLine( File, Line, LineNum ) != NULL )
{ {
if( strnicmp( Line, "$EndCOTATION", 4 ) == 0 ) if( strnicmp( Line, "$EndDIMENSION", 4 ) == 0 )
return TRUE; return TRUE;
if( Line[0] == 'V' ) if( Line[0] == 'V' )
...@@ -227,7 +227,7 @@ bool COTATION::ReadCotationDescr( FILE* File, int* LineNum ) ...@@ -227,7 +227,7 @@ bool COTATION::ReadCotationDescr( FILE* File, int* LineNum )
* Function Move * Function Move
* @param offset : moving vector * @param offset : moving vector
*/ */
void COTATION::Move(const wxPoint& offset) void DIMENSION::Move(const wxPoint& offset)
{ {
m_Pos += offset; m_Pos += offset;
m_Text->m_Pos += offset; m_Text->m_Pos += offset;
...@@ -267,7 +267,7 @@ void COTATION::Move(const wxPoint& offset) ...@@ -267,7 +267,7 @@ void COTATION::Move(const wxPoint& offset)
* @param center : Rotation point * @param center : Rotation point
* @param angle : Rotation angle in 0.1 degrees * @param angle : Rotation angle in 0.1 degrees
*/ */
void COTATION::Rotate(const wxPoint& centre, int angle) void DIMENSION::Rotate(const wxPoint& centre, int angle)
{ {
RotatePoint( &m_Pos, centre, angle ); RotatePoint( &m_Pos, centre, angle );
...@@ -300,7 +300,7 @@ void COTATION::Rotate(const wxPoint& centre, int angle) ...@@ -300,7 +300,7 @@ void COTATION::Rotate(const wxPoint& centre, int angle)
* Flip this object, i.e. change the board side for this object * Flip this object, i.e. change the board side for this object
* @param const wxPoint& aCentre - the rotation point. * @param const wxPoint& aCentre - the rotation point.
*/ */
void COTATION::Flip(const wxPoint& aCentre ) void DIMENSION::Flip(const wxPoint& aCentre )
{ {
Mirror( aCentre ); Mirror( aCentre );
SetLayer( ChangeSideNumLayer( GetLayer() ) ); SetLayer( ChangeSideNumLayer( GetLayer() ) );
...@@ -314,7 +314,7 @@ void COTATION::Flip(const wxPoint& aCentre ) ...@@ -314,7 +314,7 @@ void COTATION::Flip(const wxPoint& aCentre )
* the layer is not changed * the layer is not changed
* @param axis_pos : vertical axis position * @param axis_pos : vertical axis position
*/ */
void COTATION::Mirror(const wxPoint& axis_pos) void DIMENSION::Mirror(const wxPoint& axis_pos)
{ {
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y ) #define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
#define INVERT_ANGLE( phi ) (phi) = -(phi) #define INVERT_ANGLE( phi ) (phi) = -(phi)
...@@ -343,14 +343,18 @@ void COTATION::Mirror(const wxPoint& axis_pos) ...@@ -343,14 +343,18 @@ void COTATION::Mirror(const wxPoint& axis_pos)
} }
bool COTATION::Save( FILE* aFile ) const bool DIMENSION::Save( FILE* aFile ) const
{ {
if( GetState( DELETED ) ) if( GetState( DELETED ) )
return true; return true;
bool rc = false; bool rc = false;
// note: COTATION was the previous name of DIMENSION
// this old keyword is used here for compatibility
const char keyWordLine[] = "$COTATION\n";
const char keyWordLineEnd[] = "$endCOTATION\n";
if( fprintf( aFile, "$COTATION\n" ) != sizeof("$COTATION\n")-1 ) if( fprintf( aFile, keyWordLine ) != sizeof(keyWordLine)-1 )
goto out; goto out;
fprintf( aFile, "Ge %d %d %lX\n", m_Shape, m_Layer, m_TimeStamp ); fprintf( aFile, "Ge %d %d %lX\n", m_Shape, m_Layer, m_TimeStamp );
...@@ -397,7 +401,7 @@ bool COTATION::Save( FILE* aFile ) const ...@@ -397,7 +401,7 @@ bool COTATION::Save( FILE* aFile ) const
FlecheG2_ox, FlecheG2_oy, FlecheG2_ox, FlecheG2_oy,
FlecheG2_fx, FlecheG2_fy, m_Width ); FlecheG2_fx, FlecheG2_fy, m_Width );
if( fprintf( aFile, "$EndCOTATION\n" ) != sizeof("$EndCOTATION\n")-1 ) if( fprintf( aFile, keyWordLineEnd ) != sizeof(keyWordLineEnd)-1 )
goto out; goto out;
rc = true; rc = true;
...@@ -407,11 +411,123 @@ out: ...@@ -407,11 +411,123 @@ 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 */
float angle, angle_f;
wxString msg;
/* Init layer : */
m_Text->SetLayer( GetLayer() );
/* calculate the size of the cdimension
* (text + line above the text) */
ii = m_Text->m_Size.y +
m_Text->m_Width + (m_Width * 3);
deltax = TraitD_ox - TraitG_ox;
deltay = TraitD_oy - TraitG_oy;
/* Calculate dimension value */
mesure = wxRound(hypot( (double) deltax, (double) deltay ) );
if( deltax || deltay )
angle = atan2( (double) deltay, (double) deltax );
else
angle = 0.0;
/* Calcul des parametre dimensions X et Y des fleches et traits de cotes */
hx = hy = ii;
/* On tient compte de l'inclinaison de la cote */
if( mesure )
{
hx = (abs) ( (int) ( ( (double) deltay * hx ) / mesure ) );
hy = (abs) ( (int) ( ( (double) deltax * hy ) / mesure ) );
if( TraitG_ox > Barre_ox )
hx = -hx;
if( TraitG_ox == Barre_ox )
hx = 0;
if( TraitG_oy > Barre_oy )
hy = -hy;
if( TraitG_oy == Barre_oy )
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 ) );
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 ) );
}
FlecheG1_ox = Barre_ox;
FlecheG1_oy = Barre_oy;
FlecheG1_fx = Barre_ox + fleche_up_X;
FlecheG1_fy = Barre_oy + fleche_up_Y;
FlecheG2_ox = Barre_ox;
FlecheG2_oy = Barre_oy;
FlecheG2_fx = Barre_ox + fleche_dw_X;
FlecheG2_fy = Barre_oy + fleche_dw_Y;
/*la fleche de droite est symetrique a celle de gauche:
* / = -\ et \ = -/
*/
FlecheD1_ox = Barre_fx;
FlecheD1_oy = Barre_fy;
FlecheD1_fx = Barre_fx - fleche_dw_X;
FlecheD1_fy = Barre_fy - fleche_dw_Y;
FlecheD2_ox = Barre_fx;
FlecheD2_oy = Barre_fy;
FlecheD2_fx = Barre_fx - fleche_up_X;
FlecheD2_fy = Barre_fy - fleche_up_Y;
TraitG_fx = Barre_ox + hx;
TraitG_fy = Barre_oy + hy;
TraitD_fx = Barre_fx + hx;
TraitD_fy = Barre_fy + 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_Text->m_Orient = -(int) (angle * 1800 / M_PI);
if( m_Text->m_Orient < 0 )
m_Text->m_Orient += 3600;
if( m_Text->m_Orient >= 3600 )
m_Text->m_Orient -= 3600;
if( (m_Text->m_Orient > 900) && (m_Text->m_Orient <2700) )
m_Text->m_Orient -= 1800;
if( !aDoNotChangeText )
{
m_Value = mesure;
valeur_param( m_Value, msg );
SetText( msg );
}
}
/* Print 1 dimension: series of n + 1 segments text /* Print 1 dimension: segments and text
*/ */
void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void DIMENSION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int mode_color, const wxPoint& offset ) int mode_color, const wxPoint& offset )
{ {
int ox, oy, typeaff, width, gcolor; int ox, oy, typeaff, width, gcolor;
...@@ -502,9 +618,9 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -502,9 +618,9 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
// see class_cotation.h // see class_cotation.h
void COTATION::DisplayInfo( WinEDA_DrawFrame* frame ) void DIMENSION::DisplayInfo( WinEDA_DrawFrame* frame )
{ {
// for now, display only the text within the COTATION using class TEXTE_PCB. // for now, display only the text within the DIMENSION using class TEXTE_PCB.
m_Text->DisplayInfo( frame ); m_Text->DisplayInfo( frame );
} }
...@@ -515,7 +631,7 @@ void COTATION::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -515,7 +631,7 @@ void COTATION::DisplayInfo( WinEDA_DrawFrame* frame )
* @param ref_pos A wxPoint to test * @param ref_pos A wxPoint to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool COTATION::HitTest( const wxPoint& ref_pos ) bool DIMENSION::HitTest( const wxPoint& ref_pos )
{ {
int ux0, uy0; int ux0, uy0;
int dx, dy, spot_cX, spot_cY; int dx, dy, spot_cX, spot_cY;
...@@ -619,7 +735,7 @@ bool COTATION::HitTest( const wxPoint& ref_pos ) ...@@ -619,7 +735,7 @@ bool COTATION::HitTest( const wxPoint& ref_pos )
* @param EDA_Rect : the given EDA_Rect * @param EDA_Rect : the given EDA_Rect
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool COTATION::HitTest( EDA_Rect& refArea ) bool DIMENSION::HitTest( EDA_Rect& refArea )
{ {
if( refArea.Inside( m_Pos ) ) if( refArea.Inside( m_Pos ) )
return true; return true;
......
/*****************************/ /*****************************/
/* COTATION class definition */ /* DIMENSION class definition */
/*****************************/ /*****************************/
#ifndef DIMENSION_H #ifndef DIMENSION_H
#define DIMENSION_H #define DIMENSION_H
#include "base_struct.h" #include "base_struct.h"
class COTATION : public BOARD_ITEM class DIMENSION : public BOARD_ITEM
{ {
public: public:
int m_Width; int m_Width;
...@@ -25,8 +25,8 @@ public: ...@@ -25,8 +25,8 @@ public:
int FlecheG2_ox, FlecheG2_oy, FlecheG2_fx, FlecheG2_fy; int FlecheG2_ox, FlecheG2_oy, FlecheG2_fx, FlecheG2_fy;
public: public:
COTATION( BOARD_ITEM* aParent ); DIMENSION( BOARD_ITEM* aParent );
~COTATION(); ~DIMENSION();
wxPoint& GetPosition() wxPoint& GetPosition()
{ {
...@@ -40,7 +40,13 @@ public: ...@@ -40,7 +40,13 @@ public:
*/ */
void SetLayer( int aLayer ); void SetLayer( int aLayer );
bool ReadCotationDescr( FILE* File, int* LineNum ); /** function AdjustDimensionDetails
* Calculate coordinates of segments used to draw the dimension.
* @param aDoNotChangeText (bool) if false, the dimension text is initialized
*/
void AdjustDimensionDetails( bool aDoNotChangeText = false);
bool ReadDimensionDescr( FILE* File, int* LineNum );
/** /**
* Function Save * Function Save
...@@ -53,7 +59,7 @@ public: ...@@ -53,7 +59,7 @@ public:
void SetText( const wxString& NewText ); void SetText( const wxString& NewText );
wxString GetText( void ); wxString GetText( void );
void Copy( COTATION* source ); void Copy( DIMENSION* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aColorMode, const wxPoint& offset = ZeroOffset ); int aColorMode, const wxPoint& offset = ZeroOffset );
......
...@@ -218,7 +218,7 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -218,7 +218,7 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
wxASSERT( parent ); wxASSERT( parent );
if( parent->Type() == TYPE_COTATION ) if( parent->Type() == TYPE_DIMENSION )
board = (BOARD*) parent->GetParent(); board = (BOARD*) parent->GetParent();
else else
board = (BOARD*) parent; board = (BOARD*) parent;
...@@ -226,8 +226,8 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame ) ...@@ -226,8 +226,8 @@ void TEXTE_PCB::DisplayInfo( WinEDA_DrawFrame* frame )
frame->ClearMsgPanel(); frame->ClearMsgPanel();
if( m_Parent && m_Parent->Type() == TYPE_COTATION ) if( m_Parent && m_Parent->Type() == TYPE_DIMENSION )
frame->AppendMsgPanel( _( "COTATION" ), m_Text, DARKGREEN ); frame->AppendMsgPanel( _( "DIMENSION" ), m_Text, DARKGREEN );
else else
frame->AppendMsgPanel( _( "PCB Text" ), m_Text, DARKGREEN ); frame->AppendMsgPanel( _( "PCB Text" ), m_Text, DARKGREEN );
......
...@@ -39,7 +39,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { ...@@ -39,7 +39,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
TYPE_MARKER_PCB, // in m_markers TYPE_MARKER_PCB, // in m_markers
TYPE_TEXTE, // in m_Drawings TYPE_TEXTE, // in m_Drawings
TYPE_DRAWSEGMENT, // in m_Drawings TYPE_DRAWSEGMENT, // in m_Drawings
TYPE_COTATION, // in m_Drawings TYPE_DIMENSION, // in m_Drawings
TYPE_MIRE, // in m_Drawings TYPE_MIRE, // in m_Drawings
TYPE_VIA, // in m_Tracks TYPE_VIA, // in m_Tracks
TYPE_TRACK, // in m_Tracks TYPE_TRACK, // in m_Tracks
...@@ -56,7 +56,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { ...@@ -56,7 +56,7 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
* const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = { * const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
* TYPE_TEXTE, * TYPE_TEXTE,
* TYPE_DRAWSEGMENT, * TYPE_DRAWSEGMENT,
* TYPE_COTATION, * TYPE_DIMENSION,
* TYPE_VIA, * TYPE_VIA,
* TYPE_TRACK, * TYPE_TRACK,
* TYPE_MODULE, * TYPE_MODULE,
...@@ -69,7 +69,7 @@ const KICAD_T GENERAL_COLLECTOR::AllButZones[] = { ...@@ -69,7 +69,7 @@ const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
TYPE_MARKER_PCB, TYPE_MARKER_PCB,
TYPE_TEXTE, TYPE_TEXTE,
TYPE_DRAWSEGMENT, TYPE_DRAWSEGMENT,
TYPE_COTATION, TYPE_DIMENSION,
TYPE_MIRE, TYPE_MIRE,
TYPE_VIA, TYPE_VIA,
TYPE_TRACK, TYPE_TRACK,
...@@ -174,7 +174,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -174,7 +174,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
breakhere++; breakhere++;
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
breakhere++; breakhere++;
break; break;
...@@ -244,7 +244,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -244,7 +244,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
break; break;
case TYPE_MIRE: case TYPE_MIRE:
......
This diff is collapsed.
...@@ -264,7 +264,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -264,7 +264,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetToolID( id, wxCURSOR_HAND, _( "Add Modules" ) ); SetToolID( id, wxCURSOR_HAND, _( "Add Modules" ) );
break; break;
case ID_PCB_COTATION_BUTT: case ID_PCB_DIMENSION_BUTT:
SetToolID( id, wxCURSOR_PENCIL, _( "Add Dimension" ) ); SetToolID( id, wxCURSOR_PENCIL, _( "Add Dimension" ) );
break; break;
...@@ -803,14 +803,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -803,14 +803,14 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
SetCurItem( NULL ); SetCurItem( NULL );
break; break;
case ID_POPUP_PCB_DELETE_COTATION: case ID_POPUP_PCB_DELETE_DIMENSION:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
Delete_Cotation( (COTATION*) GetCurItem(), &dc ); Delete_Dimension( (DIMENSION*) GetCurItem(), &dc );
SetCurItem( NULL ); SetCurItem( NULL );
break; break;
case ID_POPUP_PCB_EDIT_COTATION: case ID_POPUP_PCB_EDIT_DIMENSION:
Install_Edit_Cotation( (COTATION*) GetCurItem(), &dc, pos ); Install_Edit_Dimension( (DIMENSION*) GetCurItem(), &dc, pos );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
...@@ -991,8 +991,8 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC ) ...@@ -991,8 +991,8 @@ void WinEDA_PcbFrame::RemoveStruct( BOARD_ITEM* Item, wxDC* DC )
Delete_Module( (MODULE*) Item, DC, true ); Delete_Module( (MODULE*) Item, DC, true );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
Delete_Cotation( (COTATION*) Item, DC ); Delete_Dimension( (DIMENSION*) Item, DC );
break; break;
case TYPE_MIRE: case TYPE_MIRE:
......
...@@ -139,7 +139,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer ) ...@@ -139,7 +139,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( int aLayer )
{ {
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_MIRE: case TYPE_MIRE:
if( item->GetLayer() == aLayer ) if( item->GetLayer() == aLayer )
{ {
......
...@@ -136,8 +136,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, ...@@ -136,8 +136,8 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName,
PlotTextePcb( plotter, (TEXTE_PCB*) PtStruct, EDGE_LAYER, FILLED ); PlotTextePcb( plotter, (TEXTE_PCB*) PtStruct, EDGE_LAYER, FILLED );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
PlotCotation( plotter, (COTATION*) PtStruct, EDGE_LAYER, FILLED ); PlotDimension( plotter, (DIMENSION*) PtStruct, EDGE_LAYER, FILLED );
break; break;
case TYPE_MIRE: case TYPE_MIRE:
......
...@@ -981,9 +981,9 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append ) ...@@ -981,9 +981,9 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
if( TESTLINE( "COTATION" ) ) if( TESTLINE( "COTATION" ) )
{ {
COTATION* Cotation = new COTATION( board ); DIMENSION* Dimension = new DIMENSION( board );
board->Add( Cotation, ADD_APPEND ); board->Add( Dimension, ADD_APPEND );
Cotation->ReadCotationDescr( File, &LineNum ); Dimension->ReadDimensionDescr( File, &LineNum );
continue; continue;
} }
......
...@@ -339,7 +339,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -339,7 +339,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
case TYPE_TRACK: case TYPE_TRACK:
case TYPE_ZONE: case TYPE_ZONE:
case TYPE_MARKER_PCB: case TYPE_MARKER_PCB:
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_MIRE: case TYPE_MIRE:
break; break;
......
...@@ -113,7 +113,7 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) ...@@ -113,7 +113,7 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame )
WinEDA_ModuleEditFrame::ToolOnRightClick ) WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT, EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick ) WinEDA_ModuleEditFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_COTATION_BUTT, EVT_TOOL_RCLICKED( ID_PCB_DIMENSION_BUTT,
WinEDA_ModuleEditFrame::ToolOnRightClick ) WinEDA_ModuleEditFrame::ToolOnRightClick )
// Options Toolbar // Options Toolbar
......
...@@ -88,7 +88,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -88,7 +88,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
} }
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
// see above. // see above.
break; break;
...@@ -331,23 +331,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -331,23 +331,23 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DisplayError( this, wxT( "Internal err: Struct not TYPE_MODULE" ) ); DisplayError( this, wxT( "Internal err: Struct not TYPE_MODULE" ) );
break; break;
case ID_PCB_COTATION_BUTT: case ID_PCB_DIMENSION_BUTT:
if( getActiveLayer() <= LAST_COPPER_LAYER ) if( getActiveLayer() <= LAST_COPPER_LAYER )
{ {
DisplayError( this, _( "Cotation not authorized on Copper layers" ) ); DisplayError( this, _( "Dimension not authorized on Copper layers" ) );
break; break;
} }
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
{ {
DrawStruct = Begin_Cotation( NULL, DC ); DrawStruct = Begin_Dimension( NULL, DC );
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true;
} }
else if( DrawStruct else if( DrawStruct
&& (DrawStruct->Type() == TYPE_COTATION) && (DrawStruct->Type() == TYPE_DIMENSION)
&& (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) )
{ {
DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC ); DrawStruct = Begin_Dimension( (DIMENSION*) DrawStruct, DC );
SetCurItem( DrawStruct ); SetCurItem( DrawStruct );
DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true;
} }
...@@ -444,8 +444,8 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -444,8 +444,8 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
Install_Edit_Cotation( (COTATION*) DrawStruct, DC, pos ); Install_Edit_Dimension( (DIMENSION*) DrawStruct, DC, pos );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
break; break;
......
...@@ -211,12 +211,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -211,12 +211,12 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu ); createPopUpMenuForMarkers( (MARKER_PCB*) item, aPopMenu );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
if( !flags ) if( !flags )
{ {
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_COTATION, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_EDIT_DIMENSION,
_( "Edit Dimension" ), edit_xpm ); _( "Edit Dimension" ), edit_xpm );
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_COTATION, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_DELETE_DIMENSION,
_( "Delete Dimension" ), delete_xpm ); _( "Delete Dimension" ), delete_xpm );
} }
break; break;
...@@ -302,7 +302,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu ) ...@@ -302,7 +302,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
case ID_PCB_ARC_BUTT: case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT:
case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_COTATION_BUTT: case ID_PCB_DIMENSION_BUTT:
ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER, ADD_MENUITEM( aPopMenu, ID_POPUP_PCB_SELECT_NO_CU_LAYER,
_( "Select Working Layer" ), select_w_layer_xpm ); _( "Select Working Layer" ), select_w_layer_xpm );
aPopMenu->AppendSeparator(); aPopMenu->AppendSeparator();
......
...@@ -209,7 +209,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -209,7 +209,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL( ID_PCB_CIRCLE_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_CIRCLE_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_COTATION_BUTT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_PCB_DIMENSION_BUTT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT, EVT_TOOL( ID_PCB_DELETE_ITEM_BUTT,
WinEDA_PcbFrame::Process_Special_Functions ) WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_PCB_SHOW_1_RATSNEST_BUTT, EVT_TOOL( ID_PCB_SHOW_1_RATSNEST_BUTT,
...@@ -225,7 +225,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -225,7 +225,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_ARC_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_ADD_TEXT_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_ADD_LINE_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_TOOL_RCLICKED( ID_PCB_COTATION_BUTT, WinEDA_PcbFrame::ToolOnRightClick ) EVT_TOOL_RCLICKED( ID_PCB_DIMENSION_BUTT, WinEDA_PcbFrame::ToolOnRightClick )
EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE, EVT_MENU_RANGE( ID_POPUP_PCB_AUTOPLACE_START_RANGE,
ID_POPUP_PCB_AUTOPLACE_END_RANGE, ID_POPUP_PCB_AUTOPLACE_END_RANGE,
......
...@@ -89,7 +89,7 @@ enum pcbnew_ids ...@@ -89,7 +89,7 @@ enum pcbnew_ids
ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE, ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_CURRENT_ZONE,
ID_POPUP_PCB_DELETE_MARKER, ID_POPUP_PCB_DELETE_MARKER,
ID_POPUP_PCB_DELETE_COTATION, ID_POPUP_PCB_DELETE_DIMENSION,
ID_POPUP_PCB_MOVE_MIRE_REQUEST, ID_POPUP_PCB_MOVE_MIRE_REQUEST,
ID_POPUP_PCB_DELETE_MIRE, ID_POPUP_PCB_DELETE_MIRE,
...@@ -97,7 +97,7 @@ enum pcbnew_ids ...@@ -97,7 +97,7 @@ enum pcbnew_ids
ID_POPUP_PCB_STOP_CURRENT_DRAWING, ID_POPUP_PCB_STOP_CURRENT_DRAWING,
ID_POPUP_PCB_EDIT_COTATION, ID_POPUP_PCB_EDIT_DIMENSION,
ID_POPUP_PCB_END_TRACK, ID_POPUP_PCB_END_TRACK,
ID_POPUP_PCB_PLACE_VIA, ID_POPUP_PCB_PLACE_VIA,
ID_POPUP_PCB_PLACE_MICROVIA, ID_POPUP_PCB_PLACE_MICROVIA,
...@@ -223,7 +223,7 @@ enum pcbnew_ids ...@@ -223,7 +223,7 @@ enum pcbnew_ids
ID_PCB_PAD_SETUP, ID_PCB_PAD_SETUP,
ID_PCB_COTATION_BUTT, ID_PCB_DIMENSION_BUTT,
ID_PCB_DRAWINGS_WIDTHS_SETUP, ID_PCB_DRAWINGS_WIDTHS_SETUP,
ID_PCB_GEN_CMP_FILE, ID_PCB_GEN_CMP_FILE,
......
...@@ -79,7 +79,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer, ...@@ -79,7 +79,7 @@ void PlotTextePcb( PLOTTER* plotter, TEXTE_PCB* pt_texte, int masque_layer,
void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer, void PlotDrawSegment( PLOTTER* plotter, DRAWSEGMENT* PtSegm, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer, void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int masque_layer,
GRTraceMode trace_mode ); GRTraceMode trace_mode );
void PlotMirePcb( PLOTTER* plotter, MIREPCB* PtMire, int masque_layer, void PlotMirePcb( PLOTTER* plotter, MIREPCB* PtMire, int masque_layer,
......
...@@ -55,9 +55,9 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter, ...@@ -55,9 +55,9 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
trace_mode ); trace_mode );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
PlotCotation( plotter, PlotDimension( plotter,
(COTATION*) PtStruct, (DIMENSION*) PtStruct,
masque_layer, masque_layer,
trace_mode ); trace_mode );
break; break;
...@@ -276,61 +276,61 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte, ...@@ -276,61 +276,61 @@ static void PlotTextModule( PLOTTER* plotter, TEXTE_MODULE* pt_texte,
} }
void PlotCotation( PLOTTER* plotter, COTATION* Cotation, int masque_layer, void PlotDimension( PLOTTER* plotter, DIMENSION* Dimension, int masque_layer,
GRTraceMode trace_mode ) GRTraceMode trace_mode )
{ {
DRAWSEGMENT* DrawTmp; DRAWSEGMENT* DrawTmp;
if( (g_TabOneLayerMask[Cotation->GetLayer()] & masque_layer) == 0 ) if( (g_TabOneLayerMask[Dimension->GetLayer()] & masque_layer) == 0 )
return; return;
DrawTmp = new DRAWSEGMENT( NULL ); DrawTmp = new DRAWSEGMENT( NULL );
DrawTmp->m_Width = (trace_mode==FILAIRE) ? -1 : Cotation->m_Width; DrawTmp->m_Width = (trace_mode==FILAIRE) ? -1 : Dimension->m_Width;
DrawTmp->SetLayer( Cotation->GetLayer() ); DrawTmp->SetLayer( Dimension->GetLayer() );
PlotTextePcb( plotter, Cotation->m_Text, masque_layer, trace_mode ); PlotTextePcb( plotter, Dimension->m_Text, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->Barre_ox; DrawTmp->m_Start.x = Dimension->Barre_ox;
DrawTmp->m_Start.y = Cotation->Barre_oy; DrawTmp->m_Start.y = Dimension->Barre_oy;
DrawTmp->m_End.x = Cotation->Barre_fx; DrawTmp->m_End.x = Dimension->Barre_fx;
DrawTmp->m_End.y = Cotation->Barre_fy; DrawTmp->m_End.y = Dimension->Barre_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->TraitG_ox; DrawTmp->m_Start.x = Dimension->TraitG_ox;
DrawTmp->m_Start.y = Cotation->TraitG_oy; DrawTmp->m_Start.y = Dimension->TraitG_oy;
DrawTmp->m_End.x = Cotation->TraitG_fx; DrawTmp->m_End.x = Dimension->TraitG_fx;
DrawTmp->m_End.y = Cotation->TraitG_fy; DrawTmp->m_End.y = Dimension->TraitG_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->TraitD_ox; DrawTmp->m_Start.x = Dimension->TraitD_ox;
DrawTmp->m_Start.y = Cotation->TraitD_oy; DrawTmp->m_Start.y = Dimension->TraitD_oy;
DrawTmp->m_End.x = Cotation->TraitD_fx; DrawTmp->m_End.x = Dimension->TraitD_fx;
DrawTmp->m_End.y = Cotation->TraitD_fy; DrawTmp->m_End.y = Dimension->TraitD_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->FlecheD1_ox; DrawTmp->m_Start.x = Dimension->FlecheD1_ox;
DrawTmp->m_Start.y = Cotation->FlecheD1_oy; DrawTmp->m_Start.y = Dimension->FlecheD1_oy;
DrawTmp->m_End.x = Cotation->FlecheD1_fx; DrawTmp->m_End.x = Dimension->FlecheD1_fx;
DrawTmp->m_End.y = Cotation->FlecheD1_fy; DrawTmp->m_End.y = Dimension->FlecheD1_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->FlecheD2_ox; DrawTmp->m_Start.x = Dimension->FlecheD2_ox;
DrawTmp->m_Start.y = Cotation->FlecheD2_oy; DrawTmp->m_Start.y = Dimension->FlecheD2_oy;
DrawTmp->m_End.x = Cotation->FlecheD2_fx; DrawTmp->m_End.x = Dimension->FlecheD2_fx;
DrawTmp->m_End.y = Cotation->FlecheD2_fy; DrawTmp->m_End.y = Dimension->FlecheD2_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->FlecheG1_ox; DrawTmp->m_Start.x = Dimension->FlecheG1_ox;
DrawTmp->m_Start.y = Cotation->FlecheG1_oy; DrawTmp->m_Start.y = Dimension->FlecheG1_oy;
DrawTmp->m_End.x = Cotation->FlecheG1_fx; DrawTmp->m_End.x = Dimension->FlecheG1_fx;
DrawTmp->m_End.y = Cotation->FlecheG1_fy; DrawTmp->m_End.y = Dimension->FlecheG1_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
DrawTmp->m_Start.x = Cotation->FlecheG2_ox; DrawTmp->m_Start.x = Dimension->FlecheG2_ox;
DrawTmp->m_Start.y = Cotation->FlecheG2_oy; DrawTmp->m_Start.y = Dimension->FlecheG2_oy;
DrawTmp->m_End.x = Cotation->FlecheG2_fx; DrawTmp->m_End.x = Dimension->FlecheG2_fx;
DrawTmp->m_End.y = Cotation->FlecheG2_fy; DrawTmp->m_End.y = Dimension->FlecheG2_fy;
PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode ); PlotDrawSegment( plotter, DrawTmp, masque_layer, trace_mode );
delete DrawTmp; delete DrawTmp;
...@@ -805,8 +805,8 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( PLOTTER* aPlotter, ...@@ -805,8 +805,8 @@ void WinEDA_BasePcbFrame::Plot_Standard_Layer( PLOTTER* aPlotter,
PlotTextePcb( aPlotter, (TEXTE_PCB*) item, aLayerMask, aPlotMode ); PlotTextePcb( aPlotter, (TEXTE_PCB*) item, aLayerMask, aPlotMode );
break; break;
case TYPE_COTATION: case TYPE_DIMENSION:
PlotCotation( aPlotter, (COTATION*) item, aLayerMask, aPlotMode ); PlotDimension( aPlotter, (DIMENSION*) item, aLayerMask, aPlotMode );
break; break;
case TYPE_MIRE: case TYPE_MIRE:
......
...@@ -203,7 +203,7 @@ void WinEDA_PcbFrame::PrintPage( wxDC* aDC, ...@@ -203,7 +203,7 @@ void WinEDA_PcbFrame::PrintPage( wxDC* aDC,
switch( item->Type() ) switch( item->Type() )
{ {
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_MIRE: case TYPE_MIRE:
if( ( ( 1 << item->GetLayer() ) & aPrintMaskLayer ) == 0 ) if( ( ( 1 << item->GetLayer() ) & aPrintMaskLayer ) == 0 )
......
...@@ -36,7 +36,7 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event ) ...@@ -36,7 +36,7 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event )
case ID_PCB_CIRCLE_BUTT: case ID_PCB_CIRCLE_BUTT:
case ID_PCB_ARC_BUTT: case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_COTATION_BUTT: case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT:
InstallPcbOptionsFrame( ID_PCB_DRAWINGS_WIDTHS_SETUP ); InstallPcbOptionsFrame( ID_PCB_DRAWINGS_WIDTHS_SETUP );
break; break;
...@@ -65,7 +65,7 @@ void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event ) ...@@ -65,7 +65,7 @@ void WinEDA_ModuleEditFrame::ToolOnRightClick( wxCommandEvent& event )
case ID_PCB_CIRCLE_BUTT: case ID_PCB_CIRCLE_BUTT:
case ID_PCB_ARC_BUTT: case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_LINE_BUTT: case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_COTATION_BUTT: case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT:
InstallOptionsFrame( pos ); InstallOptionsFrame( pos );
break; break;
......
...@@ -443,7 +443,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -443,7 +443,7 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
_( "Add text" ), wxITEM_CHECK ); _( "Add text" ), wxITEM_CHECK );
m_VToolBar->AddSeparator(); m_VToolBar->AddSeparator();
m_VToolBar->AddTool( ID_PCB_COTATION_BUTT, wxEmptyString, m_VToolBar->AddTool( ID_PCB_DIMENSION_BUTT, wxEmptyString,
wxBitmap( add_dimension_xpm ), wxBitmap( add_dimension_xpm ),
_( "Add dimension" ), wxITEM_CHECK ); _( "Add dimension" ), wxITEM_CHECK );
......
...@@ -129,7 +129,7 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC, ...@@ -129,7 +129,7 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
switch( item->Type() ) switch( item->Type() )
{ {
case TYPE_COTATION: case TYPE_DIMENSION:
case TYPE_TEXTE: case TYPE_TEXTE:
case TYPE_MIRE: case TYPE_MIRE:
case TYPE_DRAWSEGMENT: case TYPE_DRAWSEGMENT:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment