Merge branch 'bzr/master'
This commit is contained in:
commit
1112681a77
|
@ -84,7 +84,6 @@ void S3D_MASTER::ObjectCoordsTo3DUnits( std::vector< S3D_VERTEX >& aVertices )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
|
/* adjust offset position (offset is given in UNIT 3D (0.1 inch) */
|
||||||
#define SCALE_3D_CONV ((IU_PER_MILS * 1000) / UNITS3D_TO_UNITSPCB)
|
|
||||||
aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV;
|
aVertices[ii].x += m_MatPosition.x * SCALE_3D_CONV;
|
||||||
aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
|
aVertices[ii].y += m_MatPosition.y * SCALE_3D_CONV;
|
||||||
aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
|
aVertices[ii].z += m_MatPosition.z * SCALE_3D_CONV;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
|
* Copyright (C) 2014 Mario Luzeiro <mrluzeiro@gmail.com>
|
||||||
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -59,6 +59,7 @@ S3D_MESH::~S3D_MESH()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void S3D_MESH::openGL_RenderAllChilds()
|
void S3D_MESH::openGL_RenderAllChilds()
|
||||||
{
|
{
|
||||||
//DBG( printf( "openGL_RenderAllChilds") );
|
//DBG( printf( "openGL_RenderAllChilds") );
|
||||||
|
@ -82,7 +83,6 @@ void S3D_MESH::openGL_RenderAllChilds()
|
||||||
SetOpenGlDefaultMaterial();
|
SetOpenGlDefaultMaterial();
|
||||||
|
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,15 +94,10 @@ void S3D_MESH::openGL_Render()
|
||||||
&& g_Parm_3D_Visu.GetFlag( FL_RENDER_SMOOTH );
|
&& g_Parm_3D_Visu.GetFlag( FL_RENDER_SMOOTH );
|
||||||
|
|
||||||
if( m_Materials )
|
if( m_Materials )
|
||||||
{
|
|
||||||
m_Materials->SetOpenGLMaterial( 0, useMaterial );
|
m_Materials->SetOpenGLMaterial( 0, useMaterial );
|
||||||
}
|
|
||||||
|
|
||||||
if( m_CoordIndex.size() == 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
if( m_CoordIndex.size() == 0 )
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef( m_translation.x, m_translation.y, m_translation.z );
|
glTranslatef( m_translation.x, m_translation.y, m_translation.z );
|
||||||
|
@ -117,27 +112,29 @@ void S3D_MESH::openGL_Render()
|
||||||
if( m_PerVertexNormalsNormalized.size() == 0 )
|
if( m_PerVertexNormalsNormalized.size() == 0 )
|
||||||
{
|
{
|
||||||
if( smoothShapes )
|
if( smoothShapes )
|
||||||
{
|
|
||||||
calcPerPointNormals();
|
calcPerPointNormals();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ )
|
for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ )
|
||||||
{
|
{
|
||||||
if( m_MaterialIndex.size() > 1 )
|
if( m_MaterialIndex.size() > 1 )
|
||||||
{
|
{
|
||||||
if( m_Materials )
|
if( m_Materials )
|
||||||
{
|
|
||||||
m_Materials->SetOpenGLMaterial( m_MaterialIndex[idx], useMaterial );
|
m_Materials->SetOpenGLMaterial( m_MaterialIndex[idx], useMaterial );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
switch( m_CoordIndex[idx].size() )
|
switch( m_CoordIndex[idx].size() )
|
||||||
{
|
{
|
||||||
case 3: glBegin( GL_TRIANGLES );break;
|
case 3:
|
||||||
case 4: glBegin( GL_QUADS ); break;
|
glBegin( GL_TRIANGLES );
|
||||||
default: glBegin( GL_POLYGON ); break;
|
break;
|
||||||
|
case 4:
|
||||||
|
glBegin( GL_QUADS );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
glBegin( GL_POLYGON );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,34 +184,36 @@ void S3D_MESH::openGL_Render()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void S3D_MESH::calcPointNormalized ()
|
void S3D_MESH::calcPointNormalized()
|
||||||
{
|
{
|
||||||
//DBG( printf( "calcPointNormalized\n" ) );
|
//DBG( printf( "calcPointNormalized\n" ) );
|
||||||
|
|
||||||
if( isPointNormalizedComputed == true )
|
if( isPointNormalizedComputed == true )
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
isPointNormalizedComputed = true;
|
isPointNormalizedComputed = true;
|
||||||
|
|
||||||
if( m_PerVertexNormalsNormalized.size() > 0 )
|
if( m_PerVertexNormalsNormalized.size() > 0 )
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
m_PointNormalized.clear();
|
m_PointNormalized.clear();
|
||||||
|
|
||||||
float biggerPoint = 0.0f;
|
float biggerPoint = 0.0f;
|
||||||
for( unsigned int i = 0; i< m_Point.size(); i++ )
|
for( unsigned int i = 0; i< m_Point.size(); i++ )
|
||||||
{
|
{
|
||||||
if( fabs( m_Point[i].x ) > biggerPoint) biggerPoint = fabs( m_Point[i].x );
|
if( fabs( m_Point[i].x ) > biggerPoint )
|
||||||
if( fabs( m_Point[i].y ) > biggerPoint) biggerPoint = fabs( m_Point[i].y );
|
biggerPoint = fabs( m_Point[i].x );
|
||||||
if( fabs( m_Point[i].z ) > biggerPoint) biggerPoint = fabs( m_Point[i].z );
|
|
||||||
|
if( fabs( m_Point[i].y ) > biggerPoint )
|
||||||
|
biggerPoint = fabs( m_Point[i].y );
|
||||||
|
|
||||||
|
if( fabs( m_Point[i].z ) > biggerPoint )
|
||||||
|
biggerPoint = fabs( m_Point[i].z );
|
||||||
}
|
}
|
||||||
|
|
||||||
biggerPoint = 1.0 / biggerPoint;
|
biggerPoint = 1.0 / biggerPoint;
|
||||||
|
|
||||||
for( unsigned int i= 0; i< m_Point.size(); i++ )
|
for( unsigned int i = 0; i < m_Point.size(); i++ )
|
||||||
{
|
{
|
||||||
glm::vec3 p;
|
glm::vec3 p;
|
||||||
p = m_Point[i] * biggerPoint;
|
p = m_Point[i] * biggerPoint;
|
||||||
|
@ -237,30 +236,22 @@ bool IsClockwise( glm::vec3 v0, glm::vec3 v1, glm::vec3 v2 )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void S3D_MESH::calcPerFaceNormals ()
|
void S3D_MESH::calcPerFaceNormals()
|
||||||
{
|
{
|
||||||
//DBG( printf( "calcPerFaceNormals" ) );
|
//DBG( printf( "calcPerFaceNormals" ) );
|
||||||
|
|
||||||
if( isPerFaceNormalsComputed == true )
|
if( isPerFaceNormalsComputed == true )
|
||||||
{
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
isPerFaceNormalsComputed = true;
|
isPerFaceNormalsComputed = true;
|
||||||
|
|
||||||
|
|
||||||
if( m_PerVertexNormalsNormalized.size() > 0 )
|
if( m_PerVertexNormalsNormalized.size() > 0 )
|
||||||
{
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
bool haveAlreadyNormals_from_model_file = false;
|
bool haveAlreadyNormals_from_model_file = false;
|
||||||
|
|
||||||
if( m_PerFaceNormalsNormalized.size() > 0 )
|
if( m_PerFaceNormalsNormalized.size() > 0 )
|
||||||
{
|
|
||||||
haveAlreadyNormals_from_model_file = true;
|
haveAlreadyNormals_from_model_file = true;
|
||||||
}
|
|
||||||
|
|
||||||
m_PerFaceNormalsRaw.clear();
|
m_PerFaceNormalsRaw.clear();
|
||||||
m_PerFaceSquaredArea.clear();
|
m_PerFaceSquaredArea.clear();
|
||||||
|
@ -268,9 +259,15 @@ void S3D_MESH::calcPerFaceNormals ()
|
||||||
//DBG( printf("m_CoordIndex.size %u\n", m_CoordIndex.size()) );
|
//DBG( printf("m_CoordIndex.size %u\n", m_CoordIndex.size()) );
|
||||||
//DBG( printf("m_PointNormalized.size %u\n", m_PointNormalized.size()) );
|
//DBG( printf("m_PointNormalized.size %u\n", m_PointNormalized.size()) );
|
||||||
|
|
||||||
|
// There are no points defined for the coordIndex
|
||||||
|
if( m_PointNormalized.size() == 0 )
|
||||||
|
{
|
||||||
|
m_CoordIndex.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ )
|
for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ )
|
||||||
{
|
{
|
||||||
|
|
||||||
// User normalized and multiply to get better resolution
|
// User normalized and multiply to get better resolution
|
||||||
glm::vec3 v0 = m_PointNormalized[m_CoordIndex[idx][0]];
|
glm::vec3 v0 = m_PointNormalized[m_CoordIndex[idx][0]];
|
||||||
glm::vec3 v1 = m_PointNormalized[m_CoordIndex[idx][1]];
|
glm::vec3 v1 = m_PointNormalized[m_CoordIndex[idx][1]];
|
||||||
|
@ -300,14 +297,10 @@ void S3D_MESH::calcPerFaceNormals ()
|
||||||
float area = glm::dot( cross_prod, cross_prod );
|
float area = glm::dot( cross_prod, cross_prod );
|
||||||
|
|
||||||
if( cross_prod[2] < 0.0 )
|
if( cross_prod[2] < 0.0 )
|
||||||
{
|
|
||||||
area = -area;
|
area = -area;
|
||||||
}
|
|
||||||
|
|
||||||
if( area < FLT_EPSILON )
|
if( area < FLT_EPSILON )
|
||||||
{
|
|
||||||
area = FLT_EPSILON * 2.0f;
|
area = FLT_EPSILON * 2.0f;
|
||||||
}
|
|
||||||
|
|
||||||
m_PerFaceSquaredArea.push_back( area );
|
m_PerFaceSquaredArea.push_back( area );
|
||||||
|
|
||||||
|
@ -315,7 +308,6 @@ void S3D_MESH::calcPerFaceNormals ()
|
||||||
|
|
||||||
if( haveAlreadyNormals_from_model_file == false )
|
if( haveAlreadyNormals_from_model_file == false )
|
||||||
{
|
{
|
||||||
|
|
||||||
// normalize vertex normal
|
// normalize vertex normal
|
||||||
float l = glm::length( cross_prod );
|
float l = glm::length( cross_prod );
|
||||||
|
|
||||||
|
@ -328,39 +320,43 @@ void S3D_MESH::calcPerFaceNormals ()
|
||||||
// Cannot calc normal
|
// Cannot calc normal
|
||||||
if( ( cross_prod.x > cross_prod.y ) && ( cross_prod.x > cross_prod.z ) )
|
if( ( cross_prod.x > cross_prod.y ) && ( cross_prod.x > cross_prod.z ) )
|
||||||
{
|
{
|
||||||
cross_prod.x = 1.0; cross_prod.y = 0.0; cross_prod.z = 0.0;
|
cross_prod.x = 1.0;
|
||||||
} else if( ( cross_prod.y > cross_prod.x ) && ( cross_prod.y > cross_prod.z ))
|
cross_prod.y = 0.0;
|
||||||
|
cross_prod.z = 0.0;
|
||||||
|
}
|
||||||
|
else if( ( cross_prod.y > cross_prod.x ) && ( cross_prod.y > cross_prod.z ) )
|
||||||
{
|
{
|
||||||
cross_prod.x = 0.0; cross_prod.y = 1.0; cross_prod.z = 0.0;
|
cross_prod.x = 0.0;
|
||||||
} else
|
cross_prod.y = 1.0;
|
||||||
|
cross_prod.z = 0.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
cross_prod.x = 0.0; cross_prod.y = 1.0; cross_prod.z = 0.0;
|
cross_prod.x = 0.0;
|
||||||
|
cross_prod.y = 0.0;
|
||||||
|
cross_prod.z = 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_PerFaceNormalsNormalized.push_back( cross_prod );
|
m_PerFaceNormalsNormalized.push_back( cross_prod );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// http://www.bytehazard.com/code/vertnorm.html
|
// http://www.bytehazard.com/code/vertnorm.html
|
||||||
// http://www.emeyex.com/site/tuts/VertexNormals.pdf
|
// http://www.emeyex.com/site/tuts/VertexNormals.pdf
|
||||||
void S3D_MESH::calcPerPointNormals ()
|
void S3D_MESH::calcPerPointNormals()
|
||||||
{
|
{
|
||||||
//DBG( printf( "calcPerPointNormals" ) );
|
//DBG( printf( "calcPerPointNormals" ) );
|
||||||
|
|
||||||
if( isPerPointNormalsComputed == true )
|
if( isPerPointNormalsComputed == true )
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
isPerPointNormalsComputed = true;
|
isPerPointNormalsComputed = true;
|
||||||
|
|
||||||
if( m_PerVertexNormalsNormalized.size() > 0 )
|
if( m_PerVertexNormalsNormalized.size() > 0 )
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
m_PerFaceVertexNormals.clear();
|
m_PerFaceVertexNormals.clear();
|
||||||
|
|
||||||
|
@ -371,6 +367,7 @@ void S3D_MESH::calcPerPointNormals ()
|
||||||
#ifdef USE_OPENMP
|
#ifdef USE_OPENMP
|
||||||
#pragma omp parallel for
|
#pragma omp parallel for
|
||||||
#endif /* USE_OPENMP */
|
#endif /* USE_OPENMP */
|
||||||
|
|
||||||
for( unsigned int each_face_A_idx = 0; each_face_A_idx < m_CoordIndex.size(); each_face_A_idx++ )
|
for( unsigned int each_face_A_idx = 0; each_face_A_idx < m_CoordIndex.size(); each_face_A_idx++ )
|
||||||
{
|
{
|
||||||
// n = face A facet normal
|
// n = face A facet normal
|
||||||
|
@ -390,15 +387,16 @@ void S3D_MESH::calcPerPointNormals ()
|
||||||
for( unsigned int each_face_B_idx = 0; each_face_B_idx < m_CoordIndex.size(); each_face_B_idx++ )
|
for( unsigned int each_face_B_idx = 0; each_face_B_idx < m_CoordIndex.size(); each_face_B_idx++ )
|
||||||
{
|
{
|
||||||
//if A != B { // ignore self
|
//if A != B { // ignore self
|
||||||
if ( each_face_A_idx != each_face_B_idx)
|
if( each_face_A_idx != each_face_B_idx )
|
||||||
{
|
{
|
||||||
if( (m_CoordIndex[each_face_B_idx][0] == vertexIndex) ||
|
if( (m_CoordIndex[each_face_B_idx][0] == vertexIndex)
|
||||||
(m_CoordIndex[each_face_B_idx][1] == vertexIndex) ||
|
|| (m_CoordIndex[each_face_B_idx][1] == vertexIndex)
|
||||||
(m_CoordIndex[each_face_B_idx][2] == vertexIndex) )
|
|| (m_CoordIndex[each_face_B_idx][2] == vertexIndex) )
|
||||||
{
|
{
|
||||||
glm::vec3 vector_face_B = m_PerFaceNormalsNormalized[each_face_B_idx];
|
glm::vec3 vector_face_B = m_PerFaceNormalsNormalized[each_face_B_idx];
|
||||||
|
|
||||||
float dot_prod = glm::dot(vector_face_A, vector_face_B);
|
float dot_prod = glm::dot( vector_face_A, vector_face_B );
|
||||||
|
|
||||||
if( dot_prod > 0.05f )
|
if( dot_prod > 0.05f )
|
||||||
{
|
{
|
||||||
face_A_normals[each_vert_A_idx] += m_PerFaceNormalsRaw[each_face_B_idx] * (m_PerFaceSquaredArea[each_face_B_idx] * dot_prod);
|
face_A_normals[each_vert_A_idx] += m_PerFaceNormalsRaw[each_face_B_idx] * (m_PerFaceSquaredArea[each_face_B_idx] * dot_prod);
|
||||||
|
@ -411,10 +409,7 @@ void S3D_MESH::calcPerPointNormals ()
|
||||||
float l = glm::length( face_A_normals[each_vert_A_idx] );
|
float l = glm::length( face_A_normals[each_vert_A_idx] );
|
||||||
|
|
||||||
if( l > FLT_EPSILON ) // avoid division by zero
|
if( l > FLT_EPSILON ) // avoid division by zero
|
||||||
{
|
|
||||||
face_A_normals[each_vert_A_idx] /= l;
|
face_A_normals[each_vert_A_idx] /= l;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,14 @@
|
||||||
*/
|
*/
|
||||||
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
|
#define UNITS3D_TO_UNITSPCB (IU_PER_MILS * 100)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* scaling factor for 3D shape offset ( S3D_MASTER::m_MatPosition member )
|
||||||
|
* Was in inches in legacy version, and, due to a mistake, still in inches
|
||||||
|
* in .kicad_pcb files (which are using mm)
|
||||||
|
* so this scaling convert file units (inch) to 3D units (0.1 inch), only
|
||||||
|
* for S3D_MASTER::m_MatPosition parameter
|
||||||
|
*/
|
||||||
|
#define SCALE_3D_CONV 10
|
||||||
|
|
||||||
class S3D_MASTER;
|
class S3D_MASTER;
|
||||||
class STRUCT_3D_SHAPE;
|
class STRUCT_3D_SHAPE;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
||||||
* Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -45,7 +45,7 @@ class X3D_MODEL_PARSER;
|
||||||
class S3D_MODEL_PARSER
|
class S3D_MODEL_PARSER
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
S3D_MODEL_PARSER(S3D_MASTER* aMaster) :
|
S3D_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
||||||
master( aMaster )
|
master( aMaster )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -126,8 +126,8 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxString m_Filename;
|
wxString m_Filename;
|
||||||
S3D_MESH *m_model;
|
S3D_MESH* m_model;
|
||||||
std::vector<S3D_MESH *> childs;
|
std::vector< S3D_MESH* > childs;
|
||||||
|
|
||||||
std::vector< wxString > vrml_materials;
|
std::vector< wxString > vrml_materials;
|
||||||
std::vector< wxString > vrml_points;
|
std::vector< wxString > vrml_points;
|
||||||
|
@ -142,6 +142,7 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef std::map< std::string, std::vector< glm::vec3 > > VRML2_COORDINATE_MAP;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* class VRML2_MODEL_PARSER
|
* class VRML2_MODEL_PARSER
|
||||||
|
@ -165,25 +166,30 @@ public:
|
||||||
private:
|
private:
|
||||||
int read_Transform();
|
int read_Transform();
|
||||||
int read_DEF();
|
int read_DEF();
|
||||||
|
int read_DEF_Coordinate();
|
||||||
int read_Shape();
|
int read_Shape();
|
||||||
int read_Appearance();
|
int read_Appearance();
|
||||||
int read_material();
|
int read_material();
|
||||||
int read_Material();
|
int read_Material();
|
||||||
int read_IndexedFaceSet();
|
int read_IndexedFaceSet();
|
||||||
|
int read_IndexedLineSet();
|
||||||
int read_Coordinate();
|
int read_Coordinate();
|
||||||
|
int read_CoordinateDef();
|
||||||
int read_Normal();
|
int read_Normal();
|
||||||
int read_NormalIndex();
|
int read_NormalIndex();
|
||||||
int read_Color();
|
int read_Color();
|
||||||
int read_coordIndex();
|
int read_coordIndex();
|
||||||
int read_colorIndex();
|
int read_colorIndex();
|
||||||
|
int read_USE();
|
||||||
|
|
||||||
bool m_normalPerVertex;
|
bool m_normalPerVertex;
|
||||||
bool colorPerVertex;
|
bool colorPerVertex;
|
||||||
S3D_MESH *m_model;
|
S3D_MESH* m_model;
|
||||||
std::vector<S3D_MESH *> childs;
|
std::vector< S3D_MESH* > childs;
|
||||||
FILE *m_file;
|
FILE* m_file;
|
||||||
S3D_MATERIAL *m_Materials;
|
S3D_MATERIAL* m_Materials;
|
||||||
wxString m_Filename;
|
wxString m_Filename;
|
||||||
|
VRML2_COORDINATE_MAP m_defCoordinateMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -226,10 +232,10 @@ private:
|
||||||
|
|
||||||
bool m_normalPerVertex;
|
bool m_normalPerVertex;
|
||||||
bool colorPerVertex;
|
bool colorPerVertex;
|
||||||
S3D_MESH *m_model;
|
S3D_MESH* m_model;
|
||||||
std::vector<S3D_MESH *> childs;
|
std::vector< S3D_MESH* > childs;
|
||||||
S3D_MATERIAL *m_Materials;
|
S3D_MATERIAL* m_Materials;
|
||||||
FILE *m_file;
|
FILE* m_file;
|
||||||
wxString m_Filename;
|
wxString m_Filename;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -246,8 +252,8 @@ public:
|
||||||
void Load( const wxString& aFilename, double aVrmlunits_to_3Dunits );
|
void Load( const wxString& aFilename, double aVrmlunits_to_3Dunits );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VRML1_MODEL_PARSER *vrml1_parser;
|
VRML1_MODEL_PARSER* vrml1_parser;
|
||||||
VRML2_MODEL_PARSER *vrml2_parser;
|
VRML2_MODEL_PARSER* vrml2_parser;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -75,9 +75,6 @@ void VRML1_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
||||||
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
||||||
GetMaster()->m_MatPosition.z );
|
GetMaster()->m_MatPosition.z );
|
||||||
|
|
||||||
|
|
||||||
#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )
|
|
||||||
|
|
||||||
// glPushMatrix();
|
// glPushMatrix();
|
||||||
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
* Copyright (C) 2013 Tuomas Vaherkoski <tuomasvaherkoski@gmail.com>
|
||||||
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
|
||||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||||
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -39,6 +39,16 @@
|
||||||
#include "modelparsers.h"
|
#include "modelparsers.h"
|
||||||
#include "vrml_aux.h"
|
#include "vrml_aux.h"
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Trace mask used to enable or disable the trace output of the VRML V2 parser code.
|
||||||
|
* The debug output can be turned on by setting the WXTRACE environment variable to
|
||||||
|
* "KI_TRACE_VRML_V2_PARSER". See the wxWidgets documentation on wxLogTrace for
|
||||||
|
* more information.
|
||||||
|
*/
|
||||||
|
static const wxChar* traceVrmlV2Parser = wxT( "KI_TRACE_VRML_V2_PARSER" );
|
||||||
|
|
||||||
|
|
||||||
VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MASTER* aMaster ) :
|
||||||
S3D_MODEL_PARSER( aMaster )
|
S3D_MODEL_PARSER( aMaster )
|
||||||
{
|
{
|
||||||
|
@ -59,7 +69,7 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( "Load %s\n", GetChars(aFilename) ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( "Load %s" ), GetChars( aFilename ) );
|
||||||
m_file = wxFopen( aFilename, wxT( "rt" ) );
|
m_file = wxFopen( aFilename, wxT( "rt" ) );
|
||||||
|
|
||||||
if( m_file == NULL )
|
if( m_file == NULL )
|
||||||
|
@ -77,9 +87,6 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
||||||
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
||||||
GetMaster()->m_MatPosition.z );
|
GetMaster()->m_MatPosition.z );
|
||||||
|
|
||||||
|
|
||||||
#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )
|
|
||||||
|
|
||||||
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
||||||
|
|
||||||
glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
|
glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
|
||||||
|
@ -117,9 +124,6 @@ void VRML2_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3
|
||||||
|
|
||||||
fclose( m_file );
|
fclose( m_file );
|
||||||
|
|
||||||
|
|
||||||
// DBG( printf( "chils size:%lu\n", childs.size() ) );
|
|
||||||
|
|
||||||
if( GetMaster()->IsOpenGlAllowed() )
|
if( GetMaster()->IsOpenGlAllowed() )
|
||||||
{
|
{
|
||||||
for( unsigned int idx = 0; idx < childs.size(); idx++ )
|
for( unsigned int idx = 0; idx < childs.size(); idx++ )
|
||||||
|
@ -134,8 +138,6 @@ int VRML2_MODEL_PARSER::read_Transform()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( "Transform\n" ) );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -145,7 +147,6 @@ int VRML2_MODEL_PARSER::read_Transform()
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " } Exit Transform\n" ) );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +240,7 @@ int VRML2_MODEL_PARSER::read_Transform()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// DBG( printf( " %s NotImplemented\n", text ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " %s NotImplemented" ), text );
|
||||||
read_NotImplemented( m_file, '}' );
|
read_NotImplemented( m_file, '}' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,24 +249,56 @@ int VRML2_MODEL_PARSER::read_Transform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the DEF for a Coordinate
|
||||||
|
*/
|
||||||
|
int VRML2_MODEL_PARSER::read_DEF_Coordinate()
|
||||||
|
{
|
||||||
|
char text[128];
|
||||||
|
|
||||||
|
// Get the name of the definition.
|
||||||
|
GetNextTag( m_file, text );
|
||||||
|
std::string coordinateName = text;
|
||||||
|
|
||||||
|
while( GetNextTag( m_file, text ) )
|
||||||
|
{
|
||||||
|
if( ( text == NULL ) || ( *text == ']' ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( ( *text == '}' ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( strcmp( text, "Coordinate" ) == 0 )
|
||||||
|
{
|
||||||
|
int retVal = read_CoordinateDef();
|
||||||
|
|
||||||
|
if( retVal == 0 )
|
||||||
|
m_defCoordinateMap.insert( std::make_pair( coordinateName, m_model->m_Point ) );
|
||||||
|
|
||||||
|
return retVal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int VRML2_MODEL_PARSER::read_DEF()
|
int VRML2_MODEL_PARSER::read_DEF()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
GetNextTag( m_file, text );
|
GetNextTag( m_file, text );
|
||||||
// DBG( printf( "DEF %s ", text ) );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " skiping %c\n", *text) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " skipping %c" ), *text );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " } Exit DEF\n") );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,17 +334,40 @@ int VRML2_MODEL_PARSER::read_DEF()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " DEF failed\n" ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " DEF failed" ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int VRML2_MODEL_PARSER::read_USE()
|
||||||
|
{
|
||||||
|
char text[128];
|
||||||
|
|
||||||
|
// Get the name of the definition.
|
||||||
|
GetNextTag( m_file, text );
|
||||||
|
std::string coordinateName = text;
|
||||||
|
|
||||||
|
// Look for it in our coordinate map.
|
||||||
|
VRML2_COORDINATE_MAP::iterator coordinate;
|
||||||
|
coordinate = m_defCoordinateMap.find( coordinateName );
|
||||||
|
|
||||||
|
// Not previously defined.
|
||||||
|
if( coordinate == m_defCoordinateMap.end() )
|
||||||
|
{
|
||||||
|
wxLogTrace( traceVrmlV2Parser, wxT( "USE: coordinate %s not previously defined "
|
||||||
|
"in a DEF section." ), text );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_model->m_Point = coordinate->second;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int VRML2_MODEL_PARSER::read_Shape()
|
int VRML2_MODEL_PARSER::read_Shape()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " Shape\n") );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -321,12 +377,12 @@ int VRML2_MODEL_PARSER::read_Shape()
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " } Exit Shape\n") );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( strcmp( text, "appearance" ) == 0 )
|
if( strcmp( text, "appearance" ) == 0 )
|
||||||
{
|
{
|
||||||
|
wxLogTrace( traceVrmlV2Parser, wxT( "\"appearance\" key word not supported." ) );
|
||||||
// skip
|
// skip
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "Appearance" ) == 0 )
|
else if( strcmp( text, "Appearance" ) == 0 )
|
||||||
|
@ -335,20 +391,25 @@ int VRML2_MODEL_PARSER::read_Shape()
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "geometry" ) == 0 )
|
else if( strcmp( text, "geometry" ) == 0 )
|
||||||
{
|
{
|
||||||
|
wxLogTrace( traceVrmlV2Parser, wxT( "\"geometry\" key word not supported." ) );
|
||||||
// skip
|
// skip
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "IndexedFaceSet" ) == 0 )
|
else if( strcmp( text, "IndexedFaceSet" ) == 0 )
|
||||||
{
|
{
|
||||||
read_IndexedFaceSet();
|
read_IndexedFaceSet();
|
||||||
}
|
}
|
||||||
|
else if( strcmp( text, "IndexedLineSet" ) == 0 )
|
||||||
|
{
|
||||||
|
read_IndexedLineSet();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// DBG( printf( " %s NotImplemented\n", text ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " %s NotImplemented" ), text );
|
||||||
read_NotImplemented( m_file, '}' );
|
read_NotImplemented( m_file, '}' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " Shape failed\n" ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " Shape failed" ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,8 +418,6 @@ int VRML2_MODEL_PARSER::read_Appearance()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " Appearance\n") );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -377,7 +436,7 @@ int VRML2_MODEL_PARSER::read_Appearance()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " Appearance failed\n" ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " Appearance failed" ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -387,8 +446,6 @@ int VRML2_MODEL_PARSER::read_material()
|
||||||
S3D_MATERIAL* material = NULL;
|
S3D_MATERIAL* material = NULL;
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " material ") );
|
|
||||||
|
|
||||||
if( GetNextTag( m_file, text ) )
|
if( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( strcmp( text, "Material" ) == 0 )
|
if( strcmp( text, "Material" ) == 0 )
|
||||||
|
@ -405,12 +462,8 @@ int VRML2_MODEL_PARSER::read_material()
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "DEF" ) == 0 )
|
else if( strcmp( text, "DEF" ) == 0 )
|
||||||
{
|
{
|
||||||
// DBG( printf( "DEF") );
|
|
||||||
|
|
||||||
if( GetNextTag( m_file, text ) )
|
if( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
// DBG( printf( "%s", text ) );
|
|
||||||
|
|
||||||
wxString mat_name;
|
wxString mat_name;
|
||||||
mat_name = FROM_UTF8( text );
|
mat_name = FROM_UTF8( text );
|
||||||
|
|
||||||
|
@ -429,12 +482,8 @@ int VRML2_MODEL_PARSER::read_material()
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "USE" ) == 0 )
|
else if( strcmp( text, "USE" ) == 0 )
|
||||||
{
|
{
|
||||||
// DBG( printf( "USE") );
|
|
||||||
|
|
||||||
if( GetNextTag( m_file, text ) )
|
if( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
// DBG( printf( "%s\n", text ) );
|
|
||||||
|
|
||||||
wxString mat_name;
|
wxString mat_name;
|
||||||
mat_name = FROM_UTF8( text );
|
mat_name = FROM_UTF8( text );
|
||||||
|
|
||||||
|
@ -447,12 +496,12 @@ int VRML2_MODEL_PARSER::read_material()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DBG( printf( " read_material error: material not found\n" ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " read_material error: material not found" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " failed material\n" ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " failed material" ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,8 +511,6 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
char text[128];
|
char text[128];
|
||||||
glm::vec3 vertex;
|
glm::vec3 vertex;
|
||||||
|
|
||||||
// DBG( printf( " Material\n") );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -478,17 +525,13 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
|
|
||||||
if( strcmp( text, "diffuseColor" ) == 0 )
|
if( strcmp( text, "diffuseColor" ) == 0 )
|
||||||
{
|
{
|
||||||
// DBG( printf( " diffuseColor") );
|
|
||||||
parseVertex( m_file, vertex );
|
parseVertex( m_file, vertex );
|
||||||
// DBG( printf( "\n") );
|
|
||||||
m_model->m_Materials->m_DiffuseColor.push_back( vertex );
|
m_model->m_Materials->m_DiffuseColor.push_back( vertex );
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "emissiveColor" ) == 0 )
|
else if( strcmp( text, "emissiveColor" ) == 0 )
|
||||||
{
|
{
|
||||||
// DBG( printf( " emissiveColor") );
|
|
||||||
parseVertex( m_file, vertex );
|
parseVertex( m_file, vertex );
|
||||||
|
|
||||||
// DBG( printf( "\n") );
|
|
||||||
if( GetMaster()->m_use_modelfile_emissiveColor == true )
|
if( GetMaster()->m_use_modelfile_emissiveColor == true )
|
||||||
{
|
{
|
||||||
m_model->m_Materials->m_EmissiveColor.push_back( vertex );
|
m_model->m_Materials->m_EmissiveColor.push_back( vertex );
|
||||||
|
@ -496,9 +539,7 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
}
|
}
|
||||||
else if( strcmp( text, "specularColor" ) == 0 )
|
else if( strcmp( text, "specularColor" ) == 0 )
|
||||||
{
|
{
|
||||||
// DBG( printf( " specularColor") );
|
|
||||||
parseVertex( m_file, vertex );
|
parseVertex( m_file, vertex );
|
||||||
// DBG( printf( "\n") );
|
|
||||||
|
|
||||||
if( GetMaster()->m_use_modelfile_specularColor == true )
|
if( GetMaster()->m_use_modelfile_specularColor == true )
|
||||||
{
|
{
|
||||||
|
@ -509,7 +550,6 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
{
|
{
|
||||||
float ambientIntensity;
|
float ambientIntensity;
|
||||||
parseFloat( m_file, &ambientIntensity );
|
parseFloat( m_file, &ambientIntensity );
|
||||||
// DBG( printf( " ambientIntensity %f\n", ambientIntensity) );
|
|
||||||
|
|
||||||
if( GetMaster()->m_use_modelfile_ambientIntensity == true )
|
if( GetMaster()->m_use_modelfile_ambientIntensity == true )
|
||||||
{
|
{
|
||||||
|
@ -521,7 +561,6 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
{
|
{
|
||||||
float transparency;
|
float transparency;
|
||||||
parseFloat( m_file, &transparency );
|
parseFloat( m_file, &transparency );
|
||||||
// DBG( printf( " transparency %f\n", transparency) );
|
|
||||||
|
|
||||||
if( GetMaster()->m_use_modelfile_transparency == true )
|
if( GetMaster()->m_use_modelfile_transparency == true )
|
||||||
{
|
{
|
||||||
|
@ -533,7 +572,6 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
float shininess;
|
float shininess;
|
||||||
parseFloat( m_file, &shininess );
|
parseFloat( m_file, &shininess );
|
||||||
|
|
||||||
// DBG( printf( " shininess %f\n", shininess) );
|
|
||||||
// VRML value is normalized and openGL expects a value 0 - 128
|
// VRML value is normalized and openGL expects a value 0 - 128
|
||||||
if( GetMaster()->m_use_modelfile_shininess == true )
|
if( GetMaster()->m_use_modelfile_shininess == true )
|
||||||
{
|
{
|
||||||
|
@ -543,7 +581,7 @@ int VRML2_MODEL_PARSER::read_Material()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " Material failed\n" ) );
|
wxLogTrace( traceVrmlV2Parser, wxT( " Material failed\n" ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,8 +590,6 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " IndexedFaceSet\n") );
|
|
||||||
|
|
||||||
m_normalPerVertex = false;
|
m_normalPerVertex = false;
|
||||||
colorPerVertex = false;
|
colorPerVertex = false;
|
||||||
|
|
||||||
|
@ -566,7 +602,6 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " } Exit IndexedFaceSet\n") );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,7 +611,6 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
||||||
{
|
{
|
||||||
if( strcmp( text, "TRUE" ) == 0 )
|
if( strcmp( text, "TRUE" ) == 0 )
|
||||||
{
|
{
|
||||||
// DBG( printf( " m_normalPerVertex TRUE\n") );
|
|
||||||
m_normalPerVertex = true;
|
m_normalPerVertex = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -587,7 +621,6 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
||||||
|
|
||||||
if( strcmp( text, "TRUE" ) )
|
if( strcmp( text, "TRUE" ) )
|
||||||
{
|
{
|
||||||
// DBG( printf( " colorPerVertex = true\n") );
|
|
||||||
colorPerVertex = true;
|
colorPerVertex = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -619,17 +652,43 @@ int VRML2_MODEL_PARSER::read_IndexedFaceSet()
|
||||||
{
|
{
|
||||||
read_colorIndex();
|
read_colorIndex();
|
||||||
}
|
}
|
||||||
|
else if( strcmp( text, "USE" ) == 0 )
|
||||||
|
{
|
||||||
|
read_USE();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxLogTrace( traceVrmlV2Parser, wxT( " IndexedFaceSet failed %s" ), text );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int VRML2_MODEL_PARSER::read_IndexedLineSet()
|
||||||
|
{
|
||||||
|
char text[128];
|
||||||
|
|
||||||
|
while( GetNextTag( m_file, text ) )
|
||||||
|
{
|
||||||
|
if( ( text == NULL ) || ( *text == ']' ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( ( *text == '}' ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( strcmp( text, "Coordinate" ) == 0 )
|
||||||
|
read_Coordinate();
|
||||||
|
else if( strcmp( text, "coordIndex" ) == 0 )
|
||||||
|
read_coordIndex();
|
||||||
|
else if( strcmp( text, "DEF" ) == 0 )
|
||||||
|
read_DEF_Coordinate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " IndexedFaceSet failed %s\n", text ) );
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int VRML2_MODEL_PARSER::read_colorIndex()
|
int VRML2_MODEL_PARSER::read_colorIndex()
|
||||||
{
|
{
|
||||||
// DBG( printf( " read_colorIndex\n" ) );
|
|
||||||
|
|
||||||
m_model->m_MaterialIndex.clear();
|
m_model->m_MaterialIndex.clear();
|
||||||
|
|
||||||
if( colorPerVertex == true )
|
if( colorPerVertex == true )
|
||||||
|
@ -660,16 +719,12 @@ int VRML2_MODEL_PARSER::read_colorIndex()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " m_MaterialIndex.size: %ld\n", m_model->m_MaterialIndex.size() ) );
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int VRML2_MODEL_PARSER::read_NormalIndex()
|
int VRML2_MODEL_PARSER::read_NormalIndex()
|
||||||
{
|
{
|
||||||
// DBG( printf( " read_NormalIndex\n" ) );
|
|
||||||
|
|
||||||
m_model->m_NormalIndex.clear();
|
m_model->m_NormalIndex.clear();
|
||||||
|
|
||||||
glm::ivec3 coord;
|
glm::ivec3 coord;
|
||||||
|
@ -684,26 +739,20 @@ int VRML2_MODEL_PARSER::read_NormalIndex()
|
||||||
if( dummy == -1 )
|
if( dummy == -1 )
|
||||||
{
|
{
|
||||||
m_model->m_NormalIndex.push_back( coord_list );
|
m_model->m_NormalIndex.push_back( coord_list );
|
||||||
// DBG( printf( " size: %lu ", coord_list.size()) );
|
|
||||||
coord_list.clear();
|
coord_list.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
coord_list.push_back( dummy );
|
coord_list.push_back( dummy );
|
||||||
// DBG( printf( "%d ", dummy) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " m_NormalIndex.size: %ld\n", m_model->m_NormalIndex.size() ) );
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int VRML2_MODEL_PARSER::read_coordIndex()
|
int VRML2_MODEL_PARSER::read_coordIndex()
|
||||||
{
|
{
|
||||||
// DBG( printf( " read_coordIndex\n" ) );
|
|
||||||
|
|
||||||
m_model->m_CoordIndex.clear();
|
m_model->m_CoordIndex.clear();
|
||||||
|
|
||||||
glm::ivec3 coord;
|
glm::ivec3 coord;
|
||||||
|
@ -718,18 +767,14 @@ int VRML2_MODEL_PARSER::read_coordIndex()
|
||||||
if( dummy == -1 )
|
if( dummy == -1 )
|
||||||
{
|
{
|
||||||
m_model->m_CoordIndex.push_back( coord_list );
|
m_model->m_CoordIndex.push_back( coord_list );
|
||||||
// DBG( printf( " size: %lu ", coord_list.size()) );
|
|
||||||
coord_list.clear();
|
coord_list.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
coord_list.push_back( dummy );
|
coord_list.push_back( dummy );
|
||||||
// DBG( printf( "%d ", dummy) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " m_CoordIndex.size: %ld\n", m_model->m_CoordIndex.size() ) );
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -738,8 +783,6 @@ int VRML2_MODEL_PARSER::read_Color()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " read_Color\n") );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -749,7 +792,6 @@ int VRML2_MODEL_PARSER::read_Color()
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " m_DiffuseColor.size: %ld\n", m_model->m_Materials->m_DiffuseColor.size() ) );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -759,7 +801,7 @@ int VRML2_MODEL_PARSER::read_Color()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DBG( printf( " read_Color failed\n") );
|
wxLogTrace( traceVrmlV2Parser, wxT( " read_Color failed" ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -768,8 +810,6 @@ int VRML2_MODEL_PARSER::read_Normal()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " Normal\n") );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -779,7 +819,6 @@ int VRML2_MODEL_PARSER::read_Normal()
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " m_PerFaceNormalsNormalized.size: %lu\n", m_model->m_PerFaceNormalsNormalized.size() ) );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,8 +831,6 @@ int VRML2_MODEL_PARSER::read_Normal()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
parseVertexList( m_file, m_model->m_PerVertexNormalsNormalized );
|
parseVertexList( m_file, m_model->m_PerVertexNormalsNormalized );
|
||||||
|
|
||||||
// DBG( printf( " m_PerVertexNormalsNormalized.size: %lu\n", m_model->m_PerVertexNormalsNormalized.size() ) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -806,8 +843,6 @@ int VRML2_MODEL_PARSER::read_Coordinate()
|
||||||
{
|
{
|
||||||
char text[128];
|
char text[128];
|
||||||
|
|
||||||
// DBG( printf( " Coordinate\n") );
|
|
||||||
|
|
||||||
while( GetNextTag( m_file, text ) )
|
while( GetNextTag( m_file, text ) )
|
||||||
{
|
{
|
||||||
if( *text == ']' )
|
if( *text == ']' )
|
||||||
|
@ -817,7 +852,6 @@ int VRML2_MODEL_PARSER::read_Coordinate()
|
||||||
|
|
||||||
if( *text == '}' )
|
if( *text == '}' )
|
||||||
{
|
{
|
||||||
// DBG( printf( " m_Point.size: %lu\n", m_model->m_Point.size() ) );
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,3 +863,26 @@ int VRML2_MODEL_PARSER::read_Coordinate()
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the point of the Coordinate for a DEF
|
||||||
|
*/
|
||||||
|
int VRML2_MODEL_PARSER::read_CoordinateDef()
|
||||||
|
{
|
||||||
|
char text[128];
|
||||||
|
|
||||||
|
while( GetNextTag( m_file, text ) )
|
||||||
|
{
|
||||||
|
if( ( text == NULL ) || ( *text == ']' ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if( ( *text == '}' ) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if( strcmp( text, "point" ) == 0 )
|
||||||
|
parseVertexList( m_file, m_model->m_Point );
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
|
@ -79,10 +79,6 @@ void X3D_MODEL_PARSER::Load( const wxString& aFilename, double aVrmlunits_to_3Du
|
||||||
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
glm::vec3 matPos( GetMaster()->m_MatPosition.x, GetMaster()->m_MatPosition.y,
|
||||||
GetMaster()->m_MatPosition.z );
|
GetMaster()->m_MatPosition.z );
|
||||||
|
|
||||||
|
|
||||||
#define SCALE_3D_CONV ( (IU_PER_MILS * 1000.0f) / UNITS3D_TO_UNITSPCB )
|
|
||||||
|
|
||||||
|
|
||||||
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
glTranslatef( matPos.x * SCALE_3D_CONV, matPos.y * SCALE_3D_CONV, matPos.z * SCALE_3D_CONV );
|
||||||
|
|
||||||
glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
|
glRotatef( -matRot.z, 0.0f, 0.0f, 1.0f );
|
||||||
|
|
|
@ -635,7 +635,6 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
||||||
# FindPythonInterp unless the user specifically defined a custom path.
|
# FindPythonInterp unless the user specifically defined a custom path.
|
||||||
if( NOT PYTHON_SITE_PACKAGE_PATH )
|
if( NOT PYTHON_SITE_PACKAGE_PATH )
|
||||||
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print\"%s\"%distutils.sysconfig.get_python_lib(plat_specific=0, standard_lib=0, prefix='')"
|
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print\"%s\"%distutils.sysconfig.get_python_lib(plat_specific=0, standard_lib=0, prefix='')"
|
||||||
# execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig;print\"%s\"%distutils.sysconfig.get_python_lib()"
|
|
||||||
OUTPUT_VARIABLE PYTHON_SITE_PACKAGE_PATH
|
OUTPUT_VARIABLE PYTHON_SITE_PACKAGE_PATH
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
|
@ -662,6 +661,33 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES )
|
||||||
|
|
||||||
find_package( PythonLibs 2.6 )
|
find_package( PythonLibs 2.6 )
|
||||||
|
|
||||||
|
if( KICAD_SCRIPTING_WXPYTHON )
|
||||||
|
# Check to see if the correct version of wxPython is installed based on the version of
|
||||||
|
# wxWidgets found. At least the major an minor version should match.
|
||||||
|
set( _wxpy_version "${wxWidgets_VERSION_MAJOR}.${wxWidgets_VERSION_MINOR}" )
|
||||||
|
set( _py_cmd "import wxversion;print wxversion.checkInstalled('${_wxpy_version}')" )
|
||||||
|
execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "${_py_cmd}"
|
||||||
|
RESULT_VARIABLE WXPYTHON_VERSION_RESULT
|
||||||
|
OUTPUT_VARIABLE WXPYTHON_VERSION_FOUND
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
# message( STATUS "WXPYTHON_VERSION_FOUND: ${WXPYTHON_VERSION_FOUND}" )
|
||||||
|
# message( STATUS "WXPYTHON_VERSION_RESULT: ${WXPYTHON_VERSION_RESULT}" )
|
||||||
|
|
||||||
|
# Check to see if any version of wxPython is installed on the system.
|
||||||
|
if( WXPYTHON_VERSION_RESULT GREATER 0 )
|
||||||
|
message( FATAL_ERROR "wxPython does not appear to be installed on the system." )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( NOT WXPYTHON_VERSION_FOUND STREQUAL "True" )
|
||||||
|
message( FATAL_ERROR "wxPython version ${_wxpy_version} does not appear to be installed on the system." )
|
||||||
|
else()
|
||||||
|
set( WXPYTHON_VERSION_FOUND "${_wxpy_version}"
|
||||||
|
CACHE STRING "wxPython version found." )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
#message( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" )
|
#message( STATUS "PYTHON_INCLUDE_DIRS:${PYTHON_INCLUDE_DIRS}" )
|
||||||
|
|
||||||
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
|
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
|
||||||
|
|
|
@ -70,6 +70,11 @@
|
||||||
#define KICAD_DATA_PATH "@CMAKE_INSTALL_PREFIX@/@KICAD_DATA@"
|
#define KICAD_DATA_PATH "@CMAKE_INSTALL_PREFIX@/@KICAD_DATA@"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/// The wxPython version found during configuration.
|
||||||
|
#if defined( KICAD_SCRIPTING_WXPYTHON )
|
||||||
|
#define WXPYTHON_VERSION "@WXPYTHON_VERSION_FOUND@"
|
||||||
|
#endif
|
||||||
|
|
||||||
/// When defined, build the GITHUB_PLUGIN for pcbnew.
|
/// When defined, build the GITHUB_PLUGIN for pcbnew.
|
||||||
#cmakedefine BUILD_GITHUB_PLUGIN
|
#cmakedefine BUILD_GITHUB_PLUGIN
|
||||||
|
|
||||||
|
|
|
@ -489,9 +489,7 @@ void HPGL_PLOTTER::FlashPadCircle( const wxPoint& pos, int diametre,
|
||||||
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
DPOINT pos_dev = userToDeviceCoordinates( pos );
|
||||||
|
|
||||||
int delta = KiROUND( penDiameter - penOverlap );
|
int delta = KiROUND( penDiameter - penOverlap );
|
||||||
int radius = diametre / 2;
|
int radius = ( diametre - KiROUND( penDiameter ) ) / 2;
|
||||||
|
|
||||||
radius = ( diametre - KiROUND( penDiameter ) ) / 2;
|
|
||||||
|
|
||||||
if( radius < 0 )
|
if( radius < 0 )
|
||||||
radius = 0;
|
radius = 0;
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2014 CERN
|
* Copyright (C) 2013-2015 CERN
|
||||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||||
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -28,6 +29,7 @@
|
||||||
#include <wx/event.h>
|
#include <wx/event.h>
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
|
#include <confirm.h>
|
||||||
|
|
||||||
#include <class_draw_panel_gal.h>
|
#include <class_draw_panel_gal.h>
|
||||||
#include <view/view.h>
|
#include <view/view.h>
|
||||||
|
@ -116,8 +118,9 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||||
m_pendingRefresh = false;
|
m_pendingRefresh = false;
|
||||||
m_lastRefresh = wxGetLocalTimeMillis();
|
m_lastRefresh = wxGetLocalTimeMillis();
|
||||||
|
|
||||||
if( !m_drawing )
|
if( m_drawing )
|
||||||
{
|
return;
|
||||||
|
|
||||||
m_drawing = true;
|
m_drawing = true;
|
||||||
|
|
||||||
m_view->UpdateItems();
|
m_view->UpdateItems();
|
||||||
|
@ -139,7 +142,6 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||||
m_gal->EndDrawing();
|
m_gal->EndDrawing();
|
||||||
|
|
||||||
m_drawing = false;
|
m_drawing = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -233,7 +235,8 @@ void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher )
|
||||||
|
|
||||||
void EDA_DRAW_PANEL_GAL::StartDrawing()
|
void EDA_DRAW_PANEL_GAL::StartDrawing()
|
||||||
{
|
{
|
||||||
m_pendingRefresh = false;
|
m_drawing = false;
|
||||||
|
m_pendingRefresh = true;
|
||||||
Connect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
|
Connect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
|
||||||
|
|
||||||
wxPaintEvent redrawEvent;
|
wxPaintEvent redrawEvent;
|
||||||
|
@ -243,7 +246,8 @@ void EDA_DRAW_PANEL_GAL::StartDrawing()
|
||||||
|
|
||||||
void EDA_DRAW_PANEL_GAL::StopDrawing()
|
void EDA_DRAW_PANEL_GAL::StopDrawing()
|
||||||
{
|
{
|
||||||
m_pendingRefresh = true;
|
m_pendingRefresh = false;
|
||||||
|
m_drawing = true;
|
||||||
m_refreshTimer.Stop();
|
m_refreshTimer.Stop();
|
||||||
Disconnect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
|
Disconnect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), NULL, this );
|
||||||
}
|
}
|
||||||
|
@ -271,31 +275,36 @@ void EDA_DRAW_PANEL_GAL::SetTopLayer( LAYER_ID aLayer )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
|
bool EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
|
||||||
{
|
{
|
||||||
// Do not do anything if the currently used GAL is correct
|
// Do not do anything if the currently used GAL is correct
|
||||||
if( aGalType == m_backend && m_gal != NULL )
|
if( aGalType == m_backend && m_gal != NULL )
|
||||||
return;
|
return true;
|
||||||
|
|
||||||
// Prevent refreshing canvas during backend switch
|
// Prevent refreshing canvas during backend switch
|
||||||
StopDrawing();
|
StopDrawing();
|
||||||
|
|
||||||
delete m_gal;
|
KIGFX::GAL* new_gal = NULL;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
switch( aGalType )
|
switch( aGalType )
|
||||||
{
|
{
|
||||||
case GAL_TYPE_OPENGL:
|
case GAL_TYPE_OPENGL:
|
||||||
m_gal = new KIGFX::OPENGL_GAL( this, this, this );
|
new_gal = new KIGFX::OPENGL_GAL( this, this, this );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GAL_TYPE_CAIRO:
|
case GAL_TYPE_CAIRO:
|
||||||
m_gal = new KIGFX::CAIRO_GAL( this, this, this );
|
new_gal = new KIGFX::CAIRO_GAL( this, this, this );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GAL_TYPE_NONE:
|
case GAL_TYPE_NONE:
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete m_gal;
|
||||||
|
m_gal = new_gal;
|
||||||
|
|
||||||
wxSize size = GetClientSize();
|
wxSize size = GetClientSize();
|
||||||
m_gal->ResizeScreen( size.GetX(), size.GetY() );
|
m_gal->ResizeScreen( size.GetX(), size.GetY() );
|
||||||
|
|
||||||
|
@ -306,6 +315,14 @@ void EDA_DRAW_PANEL_GAL::SwitchBackend( GalType aGalType )
|
||||||
m_view->SetGAL( m_gal );
|
m_view->SetGAL( m_gal );
|
||||||
|
|
||||||
m_backend = aGalType;
|
m_backend = aGalType;
|
||||||
|
}
|
||||||
|
catch (std::runtime_error& err)
|
||||||
|
{
|
||||||
|
DisplayError( m_parent, wxString( err.what() ) );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -391,7 +391,7 @@ void FP_LIB_TABLE::Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
||||||
|
|
||||||
|
|
||||||
void FP_LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
void FP_LIB_TABLE::ROW::Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
||||||
throw( IO_ERROR )
|
throw( IO_ERROR, boost::interprocess::lock_exception )
|
||||||
{
|
{
|
||||||
out->Print( nestLevel, "(lib (name %s)(type %s)(uri %s)(options %s)(descr %s))\n",
|
out->Print( nestLevel, "(lib (name %s)(type %s)(uri %s)(options %s)(descr %s))\n",
|
||||||
out->Quotew( GetNickName() ).c_str(),
|
out->Quotew( GetNickName() ).c_str(),
|
||||||
|
@ -665,7 +665,7 @@ bool FP_LIB_TABLE::IsEmpty( bool aIncludeFallback )
|
||||||
|
|
||||||
|
|
||||||
MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const FPID& aFootprintId )
|
MODULE* FP_LIB_TABLE::FootprintLoadWithOptionalNickname( const FPID& aFootprintId )
|
||||||
throw( IO_ERROR, PARSE_ERROR )
|
throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception )
|
||||||
{
|
{
|
||||||
wxString nickname = aFootprintId.GetLibNickname();
|
wxString nickname = aFootprintId.GetLibNickname();
|
||||||
wxString fpname = aFootprintId.GetFootprintName();
|
wxString fpname = aFootprintId.GetFootprintName();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 CERN
|
* Copyright (C) 2013-2015 CERN
|
||||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -24,13 +24,14 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file opengl_compositor.cpp
|
* @file opengl_compositor.cpp
|
||||||
* @brief Class that handles multitarget rendering (ie. to different textures/surfaces) and
|
* @brief Class that handles multitarget rendering (i.e. to different textures/surfaces) and
|
||||||
* later compositing into a single image (OpenGL flavour).
|
* later compositing into a single image (OpenGL flavour).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gal/opengl/opengl_compositor.h>
|
#include <gal/opengl/opengl_compositor.h>
|
||||||
#include <wx/msgdlg.h>
|
|
||||||
#include <confirm.h>
|
#include <stdexcept>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
using namespace KIGFX;
|
using namespace KIGFX;
|
||||||
|
|
||||||
|
@ -89,7 +90,7 @@ void OPENGL_COMPOSITOR::Resize( unsigned int aWidth, unsigned int aHeight )
|
||||||
|
|
||||||
unsigned int OPENGL_COMPOSITOR::CreateBuffer()
|
unsigned int OPENGL_COMPOSITOR::CreateBuffer()
|
||||||
{
|
{
|
||||||
wxASSERT( m_initialized );
|
assert( m_initialized );
|
||||||
|
|
||||||
unsigned int maxBuffers;
|
unsigned int maxBuffers;
|
||||||
|
|
||||||
|
@ -98,10 +99,9 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer()
|
||||||
|
|
||||||
if( usedBuffers() >= maxBuffers )
|
if( usedBuffers() >= maxBuffers )
|
||||||
{
|
{
|
||||||
DisplayError( NULL, wxT( "Cannot create more framebuffers. OpenGL rendering "
|
throw std::runtime_error("Cannot create more framebuffers. OpenGL rendering "
|
||||||
"backend requires at least 3 framebuffers. You may try to update/change "
|
"backend requires at least 3 framebuffers. You may try to update/change "
|
||||||
"your graphic drivers." ) );
|
"your graphic drivers.");
|
||||||
return 0; // Unfortunately we have no more free buffers left
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GL_COLOR_ATTACHMENTn are consecutive integers
|
// GL_COLOR_ATTACHMENTn are consecutive integers
|
||||||
|
@ -133,38 +133,38 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer()
|
||||||
switch( status )
|
switch( status )
|
||||||
{
|
{
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
|
||||||
DisplayError( NULL,wxT( "Cannot create the framebuffer." ) );
|
throw std::runtime_error( "Cannot create the framebuffer." );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
|
||||||
DisplayError( NULL, wxT( "The framebuffer attachment points are incomplete." ) );
|
throw std::runtime_error( "The framebuffer attachment points are incomplete." );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
|
||||||
DisplayError( NULL, wxT( "The framebuffer does not have at least "
|
throw std::runtime_error( "The framebuffer does not have at least one "
|
||||||
"one image attached to it." ) );
|
"image attached to it." );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
|
||||||
DisplayError( NULL, wxT( "The framebuffer read buffer is incomplete." ) );
|
throw std::runtime_error( "The framebuffer read buffer is incomplete." );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
|
||||||
DisplayError( NULL, wxT( "The combination of internal formats of the attached images "
|
throw std::runtime_error( "The combination of internal formats of the attached "
|
||||||
"violates an implementation-dependent set of restrictions." ) );
|
"images violates an implementation-dependent set of restrictions." );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
|
||||||
DisplayError( NULL, wxT( "GL_RENDERBUFFER_SAMPLES is not the same "
|
throw std::runtime_error( "GL_RENDERBUFFER_SAMPLES is not the same for "
|
||||||
"for all attached renderbuffers" ) );
|
"all attached renderbuffers" );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT:
|
case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT:
|
||||||
DisplayError( NULL, wxT( "Framebuffer incomplete layer targets errors." ) );
|
throw std::runtime_error( "Framebuffer incomplete layer targets errors." );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DisplayError( NULL, wxT( "Cannot create the framebuffer." ) );
|
throw std::runtime_error( "Cannot create the framebuffer." );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ void OPENGL_COMPOSITOR::SetBuffer( unsigned int aBufferHandle )
|
||||||
|
|
||||||
void OPENGL_COMPOSITOR::ClearBuffer()
|
void OPENGL_COMPOSITOR::ClearBuffer()
|
||||||
{
|
{
|
||||||
wxASSERT( m_initialized );
|
assert( m_initialized );
|
||||||
|
|
||||||
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
|
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
|
||||||
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
|
||||||
|
@ -220,8 +220,8 @@ void OPENGL_COMPOSITOR::ClearBuffer()
|
||||||
|
|
||||||
void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aBufferHandle )
|
void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aBufferHandle )
|
||||||
{
|
{
|
||||||
wxASSERT( m_initialized );
|
assert( m_initialized );
|
||||||
wxASSERT( aBufferHandle != 0 && aBufferHandle <= usedBuffers() );
|
assert( aBufferHandle != 0 && aBufferHandle <= usedBuffers() );
|
||||||
|
|
||||||
// Switch to the main framebuffer and blit the scene
|
// Switch to the main framebuffer and blit the scene
|
||||||
glBindFramebufferEXT( GL_FRAMEBUFFER, DIRECT_RENDERING );
|
glBindFramebufferEXT( GL_FRAMEBUFFER, DIRECT_RENDERING );
|
||||||
|
@ -267,7 +267,7 @@ void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aBufferHandle )
|
||||||
|
|
||||||
void OPENGL_COMPOSITOR::clean()
|
void OPENGL_COMPOSITOR::clean()
|
||||||
{
|
{
|
||||||
wxASSERT( m_initialized );
|
assert( m_initialized );
|
||||||
|
|
||||||
glBindFramebufferEXT( GL_FRAMEBUFFER, DIRECT_RENDERING );
|
glBindFramebufferEXT( GL_FRAMEBUFFER, DIRECT_RENDERING );
|
||||||
m_currentFbo = DIRECT_RENDERING;
|
m_currentFbo = DIRECT_RENDERING;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
* Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
|
||||||
* Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
|
* Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
|
||||||
* Copyright (C) 2013 CERN
|
* Copyright (C) 2013-2015 CERN
|
||||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||||
*
|
*
|
||||||
* Graphics Abstraction Layer (GAL) for OpenGL
|
* Graphics Abstraction Layer (GAL) for OpenGL
|
||||||
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
#include <confirm.h>
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
#include <profile.h>
|
#include <profile.h>
|
||||||
#endif /* __WXDEBUG__ */
|
#endif /* __WXDEBUG__ */
|
||||||
|
@ -51,6 +50,9 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
||||||
wxEvtHandler* aPaintListener, const wxString& aName ) :
|
wxEvtHandler* aPaintListener, const wxString& aName ) :
|
||||||
wxGLCanvas( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize,
|
wxGLCanvas( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize,
|
||||||
wxEXPAND, aName ),
|
wxEXPAND, aName ),
|
||||||
|
parentWindow( aParent ),
|
||||||
|
mouseListener( aMouseListener ),
|
||||||
|
paintListener( aPaintListener ),
|
||||||
cachedManager( true ),
|
cachedManager( true ),
|
||||||
nonCachedManager( false ),
|
nonCachedManager( false ),
|
||||||
overlayManager( false )
|
overlayManager( false )
|
||||||
|
@ -59,14 +61,29 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
||||||
if( glContext == NULL )
|
if( glContext == NULL )
|
||||||
glContext = new wxGLContext( this );
|
glContext = new wxGLContext( this );
|
||||||
|
|
||||||
parentWindow = aParent;
|
aParent->Show(); // wxWidgets require the window to be visible to set its GL context
|
||||||
mouseListener = aMouseListener;
|
|
||||||
paintListener = aPaintListener;
|
// Initialize GLEW, FBOs & VBOs
|
||||||
|
SetCurrent( *glContext );
|
||||||
|
initGlew();
|
||||||
|
|
||||||
|
// Prepare shaders
|
||||||
|
if( !shader.LoadBuiltinShader( 0, SHADER_TYPE_VERTEX ) )
|
||||||
|
throw std::runtime_error( "Cannot compile vertex shader!" );
|
||||||
|
|
||||||
|
if( !shader.LoadBuiltinShader( 1, SHADER_TYPE_FRAGMENT ) )
|
||||||
|
throw std::runtime_error( "Cannot compile fragment shader!" );
|
||||||
|
|
||||||
|
if( !shader.Link() )
|
||||||
|
throw std::runtime_error( "Cannot link the shaders!" );
|
||||||
|
|
||||||
|
// Make VBOs use shaders
|
||||||
|
cachedManager.SetShader( shader );
|
||||||
|
nonCachedManager.SetShader( shader );
|
||||||
|
overlayManager.SetShader( shader );
|
||||||
|
|
||||||
// Initialize the flags
|
// Initialize the flags
|
||||||
isGlewInitialized = false;
|
|
||||||
isFramebufferInitialized = false;
|
isFramebufferInitialized = false;
|
||||||
isShaderInitialized = false;
|
|
||||||
isGrouping = false;
|
isGrouping = false;
|
||||||
groupCounter = 0;
|
groupCounter = 0;
|
||||||
|
|
||||||
|
@ -100,10 +117,7 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
||||||
InitTesselatorCallbacks( tesselator );
|
InitTesselatorCallbacks( tesselator );
|
||||||
|
|
||||||
if( tesselator == NULL )
|
if( tesselator == NULL )
|
||||||
{
|
throw std::runtime_error( "Could not create the tesselator" );
|
||||||
DisplayError( parentWindow, wxT( "Could not create the tesselator" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
gluTessProperty( tesselator, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE );
|
gluTessProperty( tesselator, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE );
|
||||||
|
|
||||||
|
@ -123,13 +137,8 @@ OPENGL_GAL::~OPENGL_GAL()
|
||||||
void OPENGL_GAL::BeginDrawing()
|
void OPENGL_GAL::BeginDrawing()
|
||||||
{
|
{
|
||||||
SetCurrent( *glContext );
|
SetCurrent( *glContext );
|
||||||
|
|
||||||
clientDC = new wxClientDC( this );
|
clientDC = new wxClientDC( this );
|
||||||
|
|
||||||
// Initialize GLEW, FBOs & VBOs
|
|
||||||
if( !isGlewInitialized )
|
|
||||||
initGlew();
|
|
||||||
|
|
||||||
// Set up the view port
|
// Set up the view port
|
||||||
glMatrixMode( GL_PROJECTION );
|
glMatrixMode( GL_PROJECTION );
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
|
@ -148,35 +157,6 @@ void OPENGL_GAL::BeginDrawing()
|
||||||
isFramebufferInitialized = true;
|
isFramebufferInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile the shaders
|
|
||||||
if( !isShaderInitialized )
|
|
||||||
{
|
|
||||||
if( !shader.LoadBuiltinShader( 0, SHADER_TYPE_VERTEX ) )
|
|
||||||
{
|
|
||||||
DisplayError( parentWindow, wxT( "Cannot compile vertex shader!" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !shader.LoadBuiltinShader( 1, SHADER_TYPE_FRAGMENT ) )
|
|
||||||
{
|
|
||||||
DisplayError( parentWindow, wxT( "Cannot compile fragment shader!" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !shader.Link() )
|
|
||||||
{
|
|
||||||
DisplayError( parentWindow, wxT( "Cannot link the shaders!" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make VBOs use shaders
|
|
||||||
cachedManager.SetShader( shader );
|
|
||||||
nonCachedManager.SetShader( shader );
|
|
||||||
overlayManager.SetShader( shader );
|
|
||||||
|
|
||||||
isShaderInitialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable 2D Textures
|
// Disable 2D Textures
|
||||||
glDisable( GL_TEXTURE_2D );
|
glDisable( GL_TEXTURE_2D );
|
||||||
|
|
||||||
|
@ -509,7 +489,7 @@ void OPENGL_GAL::DrawPolygon( const std::deque<VECTOR2D>& aPointList )
|
||||||
|
|
||||||
boost::shared_array<GLdouble> points( new GLdouble[3 * aPointList.size()] );
|
boost::shared_array<GLdouble> points( new GLdouble[3 * aPointList.size()] );
|
||||||
int v = 0;
|
int v = 0;
|
||||||
for( std::deque<VECTOR2D>::const_iterator it = aPointList.begin(); it != aPointList.end(); it++ )
|
for( std::deque<VECTOR2D>::const_iterator it = aPointList.begin(); it != aPointList.end(); ++it )
|
||||||
{
|
{
|
||||||
points[v] = it->x;
|
points[v] = it->x;
|
||||||
points[v + 1] = it->y;
|
points[v + 1] = it->y;
|
||||||
|
@ -941,8 +921,7 @@ void OPENGL_GAL::initGlew()
|
||||||
|
|
||||||
if( GLEW_OK != err )
|
if( GLEW_OK != err )
|
||||||
{
|
{
|
||||||
DisplayError( parentWindow, wxString::FromUTF8( (char*) glewGetErrorString( err ) ) );
|
throw std::runtime_error( (const char*) glewGetErrorString( err ) );
|
||||||
exit( 1 );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -952,30 +931,17 @@ void OPENGL_GAL::initGlew()
|
||||||
|
|
||||||
// Check the OpenGL version (minimum 2.1 is required)
|
// Check the OpenGL version (minimum 2.1 is required)
|
||||||
if( GLEW_VERSION_2_1 )
|
if( GLEW_VERSION_2_1 )
|
||||||
{
|
|
||||||
wxLogInfo( wxT( "OpenGL 2.1 supported." ) );
|
wxLogInfo( wxT( "OpenGL 2.1 supported." ) );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
throw std::runtime_error( "OpenGL 2.1 or higher is required!" );
|
||||||
DisplayError( parentWindow, wxT( "OpenGL 2.1 or higher is required!" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Framebuffers have to be supported
|
// Framebuffers have to be supported
|
||||||
if( !GLEW_EXT_framebuffer_object )
|
if( !GLEW_EXT_framebuffer_object )
|
||||||
{
|
throw std::runtime_error( "Framebuffer objects are not supported!" );
|
||||||
DisplayError( parentWindow, wxT( "Framebuffer objects are not supported!" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vertex buffer has to be supported
|
// Vertex buffer has to be supported
|
||||||
if( !GLEW_ARB_vertex_buffer_object )
|
if( !GLEW_ARB_vertex_buffer_object )
|
||||||
{
|
throw std::runtime_error( "Vertex buffer objects are not supported!" );
|
||||||
DisplayError( parentWindow, wxT( "Vertex buffer objects are not supported!" ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
isGlewInitialized = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1058,12 +1024,8 @@ void CALLBACK EdgeCallback( GLboolean aEdgeFlag )
|
||||||
|
|
||||||
void CALLBACK ErrorCallback( GLenum aErrorCode )
|
void CALLBACK ErrorCallback( GLenum aErrorCode )
|
||||||
{
|
{
|
||||||
const GLubyte* eString = gluErrorString( aErrorCode );
|
//throw std::runtime_error( std::string( "Tessellation error: " ) +
|
||||||
|
//std::string( (const char*) gluErrorString( aErrorCode ) );
|
||||||
DisplayError( NULL, wxT( "Tessellation error: " ) +
|
|
||||||
wxString( (const char*)( eString ), wxConvUTF8 ) );
|
|
||||||
|
|
||||||
exit( 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <wx/log.h>
|
#include <cstring>
|
||||||
#include <wx/gdicmn.h>
|
#include <cassert>
|
||||||
#include <confirm.h>
|
|
||||||
|
|
||||||
#include <gal/opengl/shader.h>
|
#include <gal/opengl/shader.h>
|
||||||
#include "shader_src.h"
|
#include "shader_src.h"
|
||||||
|
@ -55,7 +55,7 @@ SHADER::~SHADER()
|
||||||
{
|
{
|
||||||
// Delete the shaders and the program
|
// Delete the shaders and the program
|
||||||
for( std::deque<GLuint>::iterator it = shaderNumbers.begin(); it != shaderNumbers.end();
|
for( std::deque<GLuint>::iterator it = shaderNumbers.begin(); it != shaderNumbers.end();
|
||||||
it++ )
|
++it )
|
||||||
{
|
{
|
||||||
glDeleteShader( *it );
|
glDeleteShader( *it );
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,7 @@ bool SHADER::Link()
|
||||||
glGetObjectParameterivARB( programNumber, GL_OBJECT_LINK_STATUS_ARB,
|
glGetObjectParameterivARB( programNumber, GL_OBJECT_LINK_STATUS_ARB,
|
||||||
(GLint*) &isShaderLinked );
|
(GLint*) &isShaderLinked );
|
||||||
|
|
||||||
#ifdef __WXDEBUG__
|
#ifdef DEBUG
|
||||||
|
|
||||||
if( !isShaderLinked )
|
if( !isShaderLinked )
|
||||||
{
|
{
|
||||||
int maxLength;
|
int maxLength;
|
||||||
|
@ -115,8 +114,7 @@ bool SHADER::Link()
|
||||||
std::cerr << linkInfoLog;
|
std::cerr << linkInfoLog;
|
||||||
delete[] linkInfoLog;
|
delete[] linkInfoLog;
|
||||||
}
|
}
|
||||||
|
#endif /* DEBUG */
|
||||||
#endif /* __WXDEBUG__ */
|
|
||||||
|
|
||||||
return isShaderLinked;
|
return isShaderLinked;
|
||||||
}
|
}
|
||||||
|
@ -127,9 +125,7 @@ int SHADER::AddParameter( const std::string& aParameterName )
|
||||||
GLint location = glGetUniformLocation( programNumber, aParameterName.c_str() );
|
GLint location = glGetUniformLocation( programNumber, aParameterName.c_str() );
|
||||||
|
|
||||||
if( location != -1 )
|
if( location != -1 )
|
||||||
{
|
|
||||||
parameterLocation.push_back( location );
|
parameterLocation.push_back( location );
|
||||||
}
|
|
||||||
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
@ -167,7 +163,7 @@ void SHADER::programInfo( GLuint aProgram )
|
||||||
GLchar* glInfoLog = new GLchar[glInfoLogLength];
|
GLchar* glInfoLog = new GLchar[glInfoLogLength];
|
||||||
glGetProgramInfoLog( aProgram, glInfoLogLength, &writtenChars, glInfoLog );
|
glGetProgramInfoLog( aProgram, glInfoLogLength, &writtenChars, glInfoLog );
|
||||||
|
|
||||||
wxLogInfo( wxString::FromUTF8( (char*) glInfoLog ) );
|
std::cerr << glInfoLog << std::endl;
|
||||||
|
|
||||||
delete[] glInfoLog;
|
delete[] glInfoLog;
|
||||||
}
|
}
|
||||||
|
@ -188,7 +184,7 @@ void SHADER::shaderInfo( GLuint aShader )
|
||||||
GLchar* glInfoLog = new GLchar[glInfoLogLength];
|
GLchar* glInfoLog = new GLchar[glInfoLogLength];
|
||||||
glGetShaderInfoLog( aShader, glInfoLogLength, &writtenChars, glInfoLog );
|
glGetShaderInfoLog( aShader, glInfoLogLength, &writtenChars, glInfoLog );
|
||||||
|
|
||||||
wxLogInfo( wxString::FromUTF8( (char*) glInfoLog ) );
|
std::cerr << glInfoLog << std::endl;
|
||||||
|
|
||||||
delete[] glInfoLog;
|
delete[] glInfoLog;
|
||||||
}
|
}
|
||||||
|
@ -202,11 +198,7 @@ std::string SHADER::readSource( std::string aShaderSourceName )
|
||||||
std::string shaderSource;
|
std::string shaderSource;
|
||||||
|
|
||||||
if( !inputFile )
|
if( !inputFile )
|
||||||
{
|
throw std::runtime_error( "Can't read the shader source: " + aShaderSourceName );
|
||||||
DisplayError( NULL, wxString::FromUTF8( "Can't read the shader source: " ) +
|
|
||||||
wxString( aShaderSourceName.c_str(), wxConvUTF8 ) );
|
|
||||||
exit( 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string shaderSourceLine;
|
std::string shaderSourceLine;
|
||||||
|
|
||||||
|
@ -223,10 +215,7 @@ std::string SHADER::readSource( std::string aShaderSourceName )
|
||||||
|
|
||||||
bool SHADER::addSource( const std::string& aShaderSource, SHADER_TYPE aShaderType )
|
bool SHADER::addSource( const std::string& aShaderSource, SHADER_TYPE aShaderType )
|
||||||
{
|
{
|
||||||
if( isShaderLinked )
|
assert( !isShaderLinked );
|
||||||
{
|
|
||||||
wxLogDebug( wxT( "Shader is already linked!" ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create the program
|
// Create the program
|
||||||
if( !isProgramCreated )
|
if( !isProgramCreated )
|
||||||
|
@ -244,7 +233,7 @@ bool SHADER::addSource( const std::string& aShaderSource, SHADER_TYPE aShaderTyp
|
||||||
|
|
||||||
// Copy to char array
|
// Copy to char array
|
||||||
char* source = new char[aShaderSource.size() + 1];
|
char* source = new char[aShaderSource.size() + 1];
|
||||||
strcpy( source, aShaderSource.c_str() );
|
strncpy( source, aShaderSource.c_str(), aShaderSource.size() + 1 );
|
||||||
const char** source_ = (const char**) ( &source );
|
const char** source_ = (const char**) ( &source );
|
||||||
|
|
||||||
// Attach the source
|
// Attach the source
|
||||||
|
@ -261,11 +250,8 @@ bool SHADER::addSource( const std::string& aShaderSource, SHADER_TYPE aShaderTyp
|
||||||
|
|
||||||
if( status != GL_TRUE )
|
if( status != GL_TRUE )
|
||||||
{
|
{
|
||||||
DisplayError( NULL, wxT( "Shader compilation error" ) );
|
|
||||||
|
|
||||||
shaderInfo( shaderNumber );
|
shaderInfo( shaderNumber );
|
||||||
|
throw std::runtime_error( "Shader compilation error" );
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glAttachShader( programNumber, shaderNumber );
|
glAttachShader( programNumber, shaderNumber );
|
||||||
|
|
|
@ -231,13 +231,13 @@ int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength,
|
||||||
while( isdigit( *str1 ) )
|
while( isdigit( *str1 ) )
|
||||||
{
|
{
|
||||||
nb1 = nb1 * 10 + (int) *str1 - '0';
|
nb1 = nb1 * 10 + (int) *str1 - '0';
|
||||||
str1++;
|
++str1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while( isdigit( *str2 ) )
|
while( isdigit( *str2 ) )
|
||||||
{
|
{
|
||||||
nb2 = nb2 * 10 + (int) *str2 - '0';
|
nb2 = nb2 * 10 + (int) *str2 - '0';
|
||||||
str2++;
|
++str2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nb1 < nb2 )
|
if( nb1 < nb2 )
|
||||||
|
@ -270,8 +270,8 @@ int StrNumCmp( const wxString& aString1, const wxString& aString2, int aLength,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
str1++;
|
++str1;
|
||||||
str2++;
|
++str2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -222,22 +222,20 @@ void CONTEXT_MENU::onMenuEvent( wxMenuEvent& aEvent )
|
||||||
// Under Linux, every submenu can have a separate event handler, under
|
// Under Linux, every submenu can have a separate event handler, under
|
||||||
// Windows all submenus are handled by the main menu.
|
// Windows all submenus are handled by the main menu.
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
if( !evt ) {
|
if( !evt )
|
||||||
|
{
|
||||||
// Try to find the submenu which holds the selected item
|
// Try to find the submenu which holds the selected item
|
||||||
wxMenu*menu = NULL;
|
wxMenu* menu = NULL;
|
||||||
FindItem( m_selected, &menu );
|
FindItem( m_selected, &menu );
|
||||||
|
|
||||||
if( menu )
|
if( menu && menu != this )
|
||||||
{
|
{
|
||||||
menu->ProcessEvent( aEvent );
|
menu->ProcessEvent( aEvent );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert( false ); // The event should be handled above
|
|
||||||
}
|
}
|
||||||
#else
|
#endif
|
||||||
evt = m_customHandler( aEvent );
|
evt = m_customHandler( aEvent );
|
||||||
#endif /* else __WINDOWS__ */
|
|
||||||
|
|
||||||
// Handling non-action menu entries (e.g. items in clarification list)
|
// Handling non-action menu entries (e.g. items in clarification list)
|
||||||
if( !evt )
|
if( !evt )
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct TOOL_MANAGER::TOOL_STATE
|
||||||
CONTEXT_MENU_TRIGGER contextMenuTrigger;
|
CONTEXT_MENU_TRIGGER contextMenuTrigger;
|
||||||
|
|
||||||
/// Tool execution context
|
/// Tool execution context
|
||||||
COROUTINE<int, TOOL_EVENT&>* cofunc;
|
COROUTINE<int, const TOOL_EVENT&>* cofunc;
|
||||||
|
|
||||||
/// The event that triggered the execution/wakeup of the tool after Wait() call
|
/// The event that triggered the execution/wakeup of the tool after Wait() call
|
||||||
TOOL_EVENT wakeupEvent;
|
TOOL_EVENT wakeupEvent;
|
||||||
|
@ -464,7 +464,7 @@ optional<TOOL_EVENT> TOOL_MANAGER::ScheduleWait( TOOL_BASE* aTool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent )
|
void TOOL_MANAGER::dispatchInternal( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// iterate over all registered tools
|
// iterate over all registered tools
|
||||||
BOOST_FOREACH( TOOL_ID toolId, m_activeTools )
|
BOOST_FOREACH( TOOL_ID toolId, m_activeTools )
|
||||||
|
@ -512,7 +512,7 @@ void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent )
|
||||||
// as the state changes, the transition table has to be set up again
|
// as the state changes, the transition table has to be set up again
|
||||||
st->transitions.clear();
|
st->transitions.clear();
|
||||||
|
|
||||||
st->cofunc = new COROUTINE<int, TOOL_EVENT&>( tr.second );
|
st->cofunc = new COROUTINE<int, const TOOL_EVENT&>( tr.second );
|
||||||
|
|
||||||
// got match? Run the handler.
|
// got match? Run the handler.
|
||||||
st->cofunc->Call( aEvent );
|
st->cofunc->Call( aEvent );
|
||||||
|
@ -529,7 +529,7 @@ void TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TOOL_MANAGER::dispatchStandardEvents( TOOL_EVENT& aEvent )
|
bool TOOL_MANAGER::dispatchStandardEvents( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( aEvent.Action() == TA_KEY_PRESSED )
|
if( aEvent.Action() == TA_KEY_PRESSED )
|
||||||
{
|
{
|
||||||
|
@ -542,7 +542,7 @@ bool TOOL_MANAGER::dispatchStandardEvents( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TOOL_MANAGER::dispatchActivation( TOOL_EVENT& aEvent )
|
bool TOOL_MANAGER::dispatchActivation( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( aEvent.IsActivate() )
|
if( aEvent.IsActivate() )
|
||||||
{
|
{
|
||||||
|
@ -559,7 +559,7 @@ bool TOOL_MANAGER::dispatchActivation( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TOOL_MANAGER::dispatchContextMenu( TOOL_EVENT& aEvent )
|
void TOOL_MANAGER::dispatchContextMenu( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOOST_FOREACH( TOOL_ID toolId, m_activeTools )
|
BOOST_FOREACH( TOOL_ID toolId, m_activeTools )
|
||||||
{
|
{
|
||||||
|
@ -614,7 +614,7 @@ void TOOL_MANAGER::finishTool( TOOL_STATE* aState )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TOOL_MANAGER::ProcessEvent( TOOL_EVENT& aEvent )
|
bool TOOL_MANAGER::ProcessEvent( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// Early dispatch of events destined for the TOOL_MANAGER
|
// Early dispatch of events destined for the TOOL_MANAGER
|
||||||
if( !dispatchStandardEvents( aEvent ) )
|
if( !dispatchStandardEvents( aEvent ) )
|
||||||
|
|
|
@ -179,7 +179,6 @@ class COMPONENTS_LISTBOX : public ITEMS_LISTBOX_BASE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxArrayString m_ComponentList;
|
wxArrayString m_ComponentList;
|
||||||
CVPCB_MAINFRAME* m_Parent;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -756,7 +756,7 @@ bool PART_LIB::SaveHeader( OUTPUTFORMATTER& aFormatter )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName ) throw( IO_ERROR )
|
PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
std::auto_ptr<PART_LIB> lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) );
|
std::auto_ptr<PART_LIB> lib( new PART_LIB( LIBRARY_TYPE_EESCHEMA, aFileName ) );
|
||||||
|
|
||||||
|
@ -784,7 +784,7 @@ PART_LIB* PART_LIB::LoadLibrary( const wxString& aFileName ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PART_LIB* PART_LIBS::AddLibrary( const wxString& aFileName ) throw( IO_ERROR )
|
PART_LIB* PART_LIBS::AddLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
PART_LIB* lib;
|
PART_LIB* lib;
|
||||||
|
|
||||||
|
@ -979,7 +979,8 @@ void PART_LIBS::RemoveCacheLibrary()
|
||||||
|
|
||||||
|
|
||||||
void PART_LIBS::LibNamesAndPaths( PROJECT* aProject, bool doSave,
|
void PART_LIBS::LibNamesAndPaths( PROJECT* aProject, bool doSave,
|
||||||
wxString* aPaths, wxArrayString* aNames ) throw( IO_ERROR )
|
wxString* aPaths, wxArrayString* aNames )
|
||||||
|
throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
wxString pro = aProject->GetProjectFullName();
|
wxString pro = aProject->GetProjectFullName();
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ public:
|
||||||
* @param aFileName - File name object of part library.
|
* @param aFileName - File name object of part library.
|
||||||
* @throw IO_ERROR if there's any problem loading.
|
* @throw IO_ERROR if there's any problem loading.
|
||||||
*/
|
*/
|
||||||
PART_LIB* AddLibrary( const wxString& aFileName ) throw( IO_ERROR );
|
PART_LIB* AddLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function AddLibrary
|
* Function AddLibrary
|
||||||
|
@ -160,7 +160,8 @@ public:
|
||||||
* (without paths).
|
* (without paths).
|
||||||
*/
|
*/
|
||||||
static void LibNamesAndPaths( PROJECT* aProject, bool doSave,
|
static void LibNamesAndPaths( PROJECT* aProject, bool doSave,
|
||||||
wxString* aPaths, wxArrayString* aNames=NULL ) throw( IO_ERROR );
|
wxString* aPaths, wxArrayString* aNames=NULL )
|
||||||
|
throw( IO_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function cacheName
|
* Function cacheName
|
||||||
|
@ -545,7 +546,7 @@ public:
|
||||||
* the caller.
|
* the caller.
|
||||||
* @throw IO_ERROR if there's any problem loading the library.
|
* @throw IO_ERROR if there's any problem loading the library.
|
||||||
*/
|
*/
|
||||||
static PART_LIB* LoadLibrary( const wxString& aFileName ) throw( IO_ERROR );
|
static PART_LIB* LoadLibrary( const wxString& aFileName ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,16 @@ void DIALOG_CHOOSE_COMPONENT::OnSearchBoxChange( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
m_search_container->UpdateSearchTerm( m_searchBox->GetLineText( 0 ) );
|
m_search_container->UpdateSearchTerm( m_searchBox->GetLineText( 0 ) );
|
||||||
updateSelection();
|
updateSelection();
|
||||||
|
|
||||||
|
// On Windows, but not on Linux, the focus is given to
|
||||||
|
// the m_libraryComponentTree, after modificatuons.
|
||||||
|
// We want the focus for m_searchBox.
|
||||||
|
//
|
||||||
|
// We cannot call SetFocus on Linux because it changes the current text selection
|
||||||
|
// and the text edit cursor position.
|
||||||
|
#ifdef __WINDOWS__
|
||||||
m_searchBox->SetFocus();
|
m_searchBox->SetFocus();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ private:
|
||||||
friend class SCH_EDIT_FRAME;
|
friend class SCH_EDIT_FRAME;
|
||||||
|
|
||||||
SCH_EDIT_FRAME* m_Parent;
|
SCH_EDIT_FRAME* m_Parent;
|
||||||
SCH_COMPONENT* m_Cmp;
|
SCH_COMPONENT* m_cmp;
|
||||||
LIB_PART* m_part;
|
LIB_PART* m_part;
|
||||||
bool m_skipCopyFromPanel;
|
bool m_skipCopyFromPanel;
|
||||||
|
|
||||||
|
@ -169,6 +169,7 @@ DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::DIALOG_EDIT_COMPONENT_IN_SCHEMATIC( wxWindow
|
||||||
{
|
{
|
||||||
m_Parent = (SCH_EDIT_FRAME*) parent;
|
m_Parent = (SCH_EDIT_FRAME*) parent;
|
||||||
|
|
||||||
|
m_cmp = NULL;
|
||||||
m_part = NULL;
|
m_part = NULL;
|
||||||
m_skipCopyFromPanel = false;
|
m_skipCopyFromPanel = false;
|
||||||
|
|
||||||
|
@ -301,7 +302,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
|
||||||
wxString newname = chipnameTextCtrl->GetValue();
|
wxString newname = chipnameTextCtrl->GetValue();
|
||||||
|
|
||||||
// Save current flags which could be modified by next change settings
|
// Save current flags which could be modified by next change settings
|
||||||
STATUS_FLAGS flags = m_Cmp->GetFlags();
|
STATUS_FLAGS flags = m_cmp->GetFlags();
|
||||||
|
|
||||||
newname.Replace( wxT( " " ), wxT( "_" ) );
|
newname.Replace( wxT( " " ), wxT( "_" ) );
|
||||||
|
|
||||||
|
@ -309,7 +310,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
|
||||||
{
|
{
|
||||||
DisplayError( NULL, _( "No Component Name!" ) );
|
DisplayError( NULL, _( "No Component Name!" ) );
|
||||||
}
|
}
|
||||||
else if( Cmp_KEEPCASE( newname, m_Cmp->m_part_name ) )
|
else if( Cmp_KEEPCASE( newname, m_cmp->m_part_name ) )
|
||||||
{
|
{
|
||||||
PART_LIBS* libs = Prj().SchLibs();
|
PART_LIBS* libs = Prj().SchLibs();
|
||||||
|
|
||||||
|
@ -321,41 +322,41 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
|
||||||
}
|
}
|
||||||
else // Change component from lib!
|
else // Change component from lib!
|
||||||
{
|
{
|
||||||
m_Cmp->SetPartName( newname, libs );
|
m_cmp->SetPartName( newname, libs );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For components with multiple shapes (De Morgan representation) Set the selected shape:
|
// For components with multiple shapes (De Morgan representation) Set the selected shape:
|
||||||
if( convertCheckBox->IsEnabled() )
|
if( convertCheckBox->IsEnabled() )
|
||||||
{
|
{
|
||||||
m_Cmp->SetConvert( convertCheckBox->GetValue() ? 2 : 1 );
|
m_cmp->SetConvert( convertCheckBox->GetValue() ? 2 : 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set the part selection in multiple part per package
|
//Set the part selection in multiple part per package
|
||||||
if( m_Cmp->GetUnit() )
|
if( m_cmp->GetUnit() )
|
||||||
{
|
{
|
||||||
int unit_selection = unitChoice->GetCurrentSelection() + 1;
|
int unit_selection = unitChoice->GetCurrentSelection() + 1;
|
||||||
|
|
||||||
m_Cmp->SetUnitSelection( &m_Parent->GetCurrentSheet(), unit_selection );
|
m_cmp->SetUnitSelection( &m_Parent->GetCurrentSheet(), unit_selection );
|
||||||
m_Cmp->SetUnit( unit_selection );
|
m_cmp->SetUnit( unit_selection );
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( orientationRadioBox->GetSelection() )
|
switch( orientationRadioBox->GetSelection() )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
m_Cmp->SetOrientation( CMP_ORIENT_0 );
|
m_cmp->SetOrientation( CMP_ORIENT_0 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
m_Cmp->SetOrientation( CMP_ORIENT_90 );
|
m_cmp->SetOrientation( CMP_ORIENT_90 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
m_Cmp->SetOrientation( CMP_ORIENT_180 );
|
m_cmp->SetOrientation( CMP_ORIENT_180 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
m_Cmp->SetOrientation( CMP_ORIENT_270 );
|
m_cmp->SetOrientation( CMP_ORIENT_270 );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,17 +368,17 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyPanelToOptions()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
m_Cmp->SetOrientation( CMP_MIRROR_X );
|
m_cmp->SetOrientation( CMP_MIRROR_X );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
m_Cmp->SetOrientation( CMP_MIRROR_Y );
|
m_cmp->SetOrientation( CMP_MIRROR_Y );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore m_Flag modified by SetUnit() and other change settings
|
// Restore m_Flag modified by SetUnit() and other change settings
|
||||||
m_Cmp->ClearFlags();
|
m_cmp->ClearFlags();
|
||||||
m_Cmp->SetFlags( flags );
|
m_cmp->SetFlags( flags );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -396,9 +397,9 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
|
||||||
|
|
||||||
// save old cmp in undo list if not already in edit, or moving ...
|
// save old cmp in undo list if not already in edit, or moving ...
|
||||||
// or the component to be edited is part of a block
|
// or the component to be edited is part of a block
|
||||||
if( m_Cmp->m_Flags == 0 ||
|
if( m_cmp->m_Flags == 0
|
||||||
m_Parent->GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK )
|
|| m_Parent->GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK )
|
||||||
m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED );
|
m_Parent->SaveCopyInUndoList( m_cmp, UR_CHANGED );
|
||||||
|
|
||||||
copyPanelToOptions();
|
copyPanelToOptions();
|
||||||
|
|
||||||
|
@ -441,21 +442,21 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::OnOKButtonClick( wxCommandEvent& event
|
||||||
// change all field positions from relative to absolute
|
// change all field positions from relative to absolute
|
||||||
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
||||||
{
|
{
|
||||||
m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() + m_Cmp->m_Pos );
|
m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() + m_cmp->m_Pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
LIB_PART* entry = Prj().SchLibs()->FindLibPart( m_Cmp->m_part_name );
|
LIB_PART* entry = Prj().SchLibs()->FindLibPart( m_cmp->m_part_name );
|
||||||
|
|
||||||
if( entry && entry->IsPower() )
|
if( entry && entry->IsPower() )
|
||||||
m_FieldsBuf[VALUE].SetText( m_Cmp->m_part_name );
|
m_FieldsBuf[VALUE].SetText( m_cmp->m_part_name );
|
||||||
|
|
||||||
// copy all the fields back, and change the length of m_Fields.
|
// copy all the fields back, and change the length of m_Fields.
|
||||||
m_Cmp->SetFields( m_FieldsBuf );
|
m_cmp->SetFields( m_FieldsBuf );
|
||||||
|
|
||||||
// Reference has a specific initialization, depending on the current active sheet
|
// Reference has a specific initialization, depending on the current active sheet
|
||||||
// because for a given component, in a complex hierarchy, there are more than one
|
// because for a given component, in a complex hierarchy, there are more than one
|
||||||
// reference.
|
// reference.
|
||||||
m_Cmp->SetRef( &m_Parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].GetText() );
|
m_cmp->SetRef( &m_Parent->GetCurrentSheet(), m_FieldsBuf[REFERENCE].GetText() );
|
||||||
|
|
||||||
m_Parent->OnModify();
|
m_Parent->OnModify();
|
||||||
m_Parent->GetScreen()->TestDanglingEnds();
|
m_Parent->GetScreen()->TestDanglingEnds();
|
||||||
|
@ -474,7 +475,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::addFieldButtonHandler( wxCommandEvent&
|
||||||
|
|
||||||
unsigned fieldNdx = m_FieldsBuf.size();
|
unsigned fieldNdx = m_FieldsBuf.size();
|
||||||
|
|
||||||
SCH_FIELD blank( wxPoint(), fieldNdx, m_Cmp );
|
SCH_FIELD blank( wxPoint(), fieldNdx, m_cmp );
|
||||||
|
|
||||||
blank.SetOrientation( m_FieldsBuf[REFERENCE].GetOrientation() );
|
blank.SetOrientation( m_FieldsBuf[REFERENCE].GetOrientation() );
|
||||||
|
|
||||||
|
@ -621,7 +622,7 @@ SCH_FIELD* DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::findField( const wxString& aField
|
||||||
|
|
||||||
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent )
|
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent )
|
||||||
{
|
{
|
||||||
m_Cmp = aComponent;
|
m_cmp = aComponent;
|
||||||
|
|
||||||
/* We have 3 component related field lists to be aware of: 1) UI
|
/* We have 3 component related field lists to be aware of: 1) UI
|
||||||
presentation, 2) fields in component ram copy, and 3) fields recorded
|
presentation, 2) fields in component ram copy, and 3) fields recorded
|
||||||
|
@ -635,7 +636,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
which came from the component.
|
which came from the component.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
m_part = Prj().SchLibs()->FindLibPart( m_Cmp->m_part_name );
|
m_part = Prj().SchLibs()->FindLibPart( m_cmp->m_part_name );
|
||||||
|
|
||||||
#if 0 && defined(DEBUG)
|
#if 0 && defined(DEBUG)
|
||||||
for( int i = 0; i<aComponent->GetFieldCount(); ++i )
|
for( int i = 0; i<aComponent->GetFieldCount(); ++i )
|
||||||
|
@ -658,7 +659,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
m_FieldsBuf.push_back( aComponent->m_Fields[i] );
|
m_FieldsBuf.push_back( aComponent->m_Fields[i] );
|
||||||
|
|
||||||
// make the editable field position relative to the component
|
// make the editable field position relative to the component
|
||||||
m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() - m_Cmp->m_Pos );
|
m_FieldsBuf[i].SetTextPosition( m_FieldsBuf[i].GetTextPosition() - m_cmp->m_Pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add template fieldnames:
|
// Add template fieldnames:
|
||||||
|
@ -669,7 +670,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
for( TEMPLATE_FIELDNAMES::const_iterator it = tfnames.begin(); it!=tfnames.end(); ++it )
|
for( TEMPLATE_FIELDNAMES::const_iterator it = tfnames.begin(); it!=tfnames.end(); ++it )
|
||||||
{
|
{
|
||||||
// add a new field unconditionally to the UI only
|
// add a new field unconditionally to the UI only
|
||||||
SCH_FIELD fld( wxPoint(0,0), -1 /* id is a relic */, m_Cmp, it->m_Name );
|
SCH_FIELD fld( wxPoint(0,0), -1 /* id is a relic */, m_cmp, it->m_Name );
|
||||||
|
|
||||||
// See if field by same name already exists in component.
|
// See if field by same name already exists in component.
|
||||||
SCH_FIELD* schField = aComponent->FindField( it->m_Name );
|
SCH_FIELD* schField = aComponent->FindField( it->m_Name );
|
||||||
|
@ -691,7 +692,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
fld = *schField;
|
fld = *schField;
|
||||||
|
|
||||||
// make the editable field position relative to the component
|
// make the editable field position relative to the component
|
||||||
fld.SetTextPosition( fld.GetTextPosition() - m_Cmp->m_Pos );
|
fld.SetTextPosition( fld.GetTextPosition() - m_cmp->m_Pos );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_FieldsBuf.push_back( fld );
|
m_FieldsBuf.push_back( fld );
|
||||||
|
@ -711,7 +712,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
|
|
||||||
// make the editable field position relative to the component
|
// make the editable field position relative to the component
|
||||||
m_FieldsBuf[newNdx].SetTextPosition( m_FieldsBuf[newNdx].GetTextPosition() -
|
m_FieldsBuf[newNdx].SetTextPosition( m_FieldsBuf[newNdx].GetTextPosition() -
|
||||||
m_Cmp->m_Pos );
|
m_cmp->m_Pos );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -724,7 +725,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_FieldsBuf[REFERENCE].SetText( m_Cmp->GetRef( &m_Parent->GetCurrentSheet() ) );
|
m_FieldsBuf[REFERENCE].SetText( m_cmp->GetRef( &m_Parent->GetCurrentSheet() ) );
|
||||||
|
|
||||||
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
for( unsigned i = 0; i<m_FieldsBuf.size(); ++i )
|
||||||
{
|
{
|
||||||
|
@ -744,7 +745,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::InitBuffers( SCH_COMPONENT* aComponent
|
||||||
|
|
||||||
// disable some options inside the edit dialog
|
// disable some options inside the edit dialog
|
||||||
// which can cause problems while dragging
|
// which can cause problems while dragging
|
||||||
if( m_Cmp->IsDragging() )
|
if( m_cmp->IsDragging() )
|
||||||
{
|
{
|
||||||
orientationRadioBox->Disable();
|
orientationRadioBox->Disable();
|
||||||
mirrorRadioBox->Disable();
|
mirrorRadioBox->Disable();
|
||||||
|
@ -855,7 +856,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copySelectedFieldToPanel()
|
||||||
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) );
|
textSizeTextCtrl->SetValue( EDA_GRAPHIC_TEXT_CTRL::FormatSize( g_UserUnit, field.GetSize().x ) );
|
||||||
|
|
||||||
wxPoint coord = field.GetTextPosition();
|
wxPoint coord = field.GetTextPosition();
|
||||||
wxPoint zero = -m_Cmp->m_Pos; // relative zero
|
wxPoint zero = -m_cmp->m_Pos; // relative zero
|
||||||
|
|
||||||
// If the field value is empty and the position is at relative zero, we
|
// If the field value is empty and the position is at relative zero, we
|
||||||
// set the initial position as a small offset from the ref field, and
|
// set the initial position as a small offset from the ref field, and
|
||||||
|
@ -965,11 +966,11 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
// For components with multiple parts per package, set the unit selection
|
// For components with multiple parts per package, set the unit selection
|
||||||
if( m_Cmp->GetUnit() <= (int)unitChoice->GetCount() )
|
if( m_cmp->GetUnit() <= (int)unitChoice->GetCount() )
|
||||||
unitChoice->SetSelection( m_Cmp->GetUnit() - 1 );
|
unitChoice->SetSelection( m_cmp->GetUnit() - 1 );
|
||||||
|
|
||||||
// Disable unit selection if only one unit exists:
|
// Disable unit selection if only one unit exists:
|
||||||
if( m_Cmp->GetUnit() <= 1 )
|
if( m_cmp->GetUnit() <= 1 )
|
||||||
{
|
{
|
||||||
unitChoice->Enable( false );
|
unitChoice->Enable( false );
|
||||||
unitsInterchageableLabel->Show( false );
|
unitsInterchageableLabel->Show( false );
|
||||||
|
@ -984,7 +985,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
|
||||||
unitsInterchageableLabel->SetLabel( _( "No" ) );
|
unitsInterchageableLabel->SetLabel( _( "No" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
int orientation = m_Cmp->GetOrientation() & ~( CMP_MIRROR_X | CMP_MIRROR_Y );
|
int orientation = m_cmp->GetOrientation() & ~( CMP_MIRROR_X | CMP_MIRROR_Y );
|
||||||
|
|
||||||
if( orientation == CMP_ORIENT_90 )
|
if( orientation == CMP_ORIENT_90 )
|
||||||
orientationRadioBox->SetSelection( 1 );
|
orientationRadioBox->SetSelection( 1 );
|
||||||
|
@ -995,7 +996,7 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
|
||||||
else
|
else
|
||||||
orientationRadioBox->SetSelection( 0 );
|
orientationRadioBox->SetSelection( 0 );
|
||||||
|
|
||||||
int mirror = m_Cmp->GetOrientation() & ( CMP_MIRROR_X | CMP_MIRROR_Y );
|
int mirror = m_cmp->GetOrientation() & ( CMP_MIRROR_X | CMP_MIRROR_Y );
|
||||||
|
|
||||||
if( mirror == CMP_MIRROR_X )
|
if( mirror == CMP_MIRROR_X )
|
||||||
{
|
{
|
||||||
|
@ -1012,38 +1013,37 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::copyOptionsToPanel()
|
||||||
|
|
||||||
// Activate/Desactivate the normal/convert option ? (activated only if
|
// Activate/Desactivate the normal/convert option ? (activated only if
|
||||||
// the component has more than one shape)
|
// the component has more than one shape)
|
||||||
if( m_Cmp->GetConvert() > 1 )
|
if( m_cmp->GetConvert() > 1 )
|
||||||
convertCheckBox->SetValue( true );
|
convertCheckBox->SetValue( true );
|
||||||
|
|
||||||
if( m_part == NULL || !m_part->HasConversion() )
|
if( m_part == NULL || !m_part->HasConversion() )
|
||||||
convertCheckBox->Enable( false );
|
convertCheckBox->Enable( false );
|
||||||
|
|
||||||
// Set the component's library name.
|
// Set the component's library name.
|
||||||
chipnameTextCtrl->SetValue( m_Cmp->m_part_name );
|
chipnameTextCtrl->SetValue( m_cmp->m_part_name );
|
||||||
|
|
||||||
// Set the component's unique ID time stamp.
|
// Set the component's unique ID time stamp.
|
||||||
m_textCtrlTimeStamp->SetValue( wxString::Format( wxT( "%8.8lX" ),
|
m_textCtrlTimeStamp->SetValue( wxString::Format( wxT( "%8.8lX" ),
|
||||||
(unsigned long) m_Cmp->GetTimeStamp() ) );
|
(unsigned long) m_cmp->GetTimeStamp() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include <kicad_device_context.h>
|
#include <kicad_device_context.h>
|
||||||
|
|
||||||
/* reinitialize components parameters to default values found in lib
|
|
||||||
*/
|
|
||||||
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
if( !m_Cmp )
|
if( !m_cmp )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( LIB_PART* part = Prj().SchLibs()->FindLibPart( m_Cmp->m_part_name ) )
|
if( LIB_PART* part = Prj().SchLibs()->FindLibPart( m_cmp->m_part_name ) )
|
||||||
{
|
{
|
||||||
// save old cmp in undo list if not already in edit, or moving ...
|
// save old cmp in undo list if not already in edit, or moving ...
|
||||||
if( m_Cmp->m_Flags == 0 )
|
if( m_cmp->m_Flags == 0 )
|
||||||
m_Parent->SaveCopyInUndoList( m_Cmp, UR_CHANGED );
|
m_Parent->SaveCopyInUndoList( m_cmp, UR_CHANGED );
|
||||||
|
|
||||||
INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() );
|
INSTALL_UNBUFFERED_DC( dc, m_Parent->GetCanvas() );
|
||||||
m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode );
|
m_cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), g_XorMode );
|
||||||
|
|
||||||
// Initialize fixed field values to default values found in library
|
// Initialize fixed field values to default values found in library
|
||||||
// Note: the field texts are not modified because they are set in schematic,
|
// Note: the field texts are not modified because they are set in schematic,
|
||||||
|
@ -1051,35 +1051,35 @@ void DIALOG_EDIT_COMPONENT_IN_SCHEMATIC::SetInitCmp( wxCommandEvent& event )
|
||||||
// Only VALUE, REFERENCE , FOOTPRINT and DATASHEET are re-initialized
|
// Only VALUE, REFERENCE , FOOTPRINT and DATASHEET are re-initialized
|
||||||
LIB_FIELD& refField = part->GetReferenceField();
|
LIB_FIELD& refField = part->GetReferenceField();
|
||||||
|
|
||||||
m_Cmp->GetField( REFERENCE )->SetTextPosition( refField.GetTextPosition() + m_Cmp->m_Pos );
|
m_cmp->GetField( REFERENCE )->SetTextPosition( refField.GetTextPosition() + m_cmp->m_Pos );
|
||||||
m_Cmp->GetField( REFERENCE )->ImportValues( refField );
|
m_cmp->GetField( REFERENCE )->ImportValues( refField );
|
||||||
|
|
||||||
LIB_FIELD& valField = part->GetValueField();
|
LIB_FIELD& valField = part->GetValueField();
|
||||||
|
|
||||||
m_Cmp->GetField( VALUE )->SetTextPosition( valField.GetTextPosition() + m_Cmp->m_Pos );
|
m_cmp->GetField( VALUE )->SetTextPosition( valField.GetTextPosition() + m_cmp->m_Pos );
|
||||||
m_Cmp->GetField( VALUE )->ImportValues( valField );
|
m_cmp->GetField( VALUE )->ImportValues( valField );
|
||||||
|
|
||||||
LIB_FIELD* field = part->GetField(FOOTPRINT);
|
LIB_FIELD* field = part->GetField(FOOTPRINT);
|
||||||
|
|
||||||
if( field && m_Cmp->GetField( FOOTPRINT ) )
|
if( field && m_cmp->GetField( FOOTPRINT ) )
|
||||||
{
|
{
|
||||||
m_Cmp->GetField( FOOTPRINT )->SetTextPosition( field->GetTextPosition() + m_Cmp->m_Pos );
|
m_cmp->GetField( FOOTPRINT )->SetTextPosition( field->GetTextPosition() + m_cmp->m_Pos );
|
||||||
m_Cmp->GetField( FOOTPRINT )->ImportValues( *field );
|
m_cmp->GetField( FOOTPRINT )->ImportValues( *field );
|
||||||
}
|
}
|
||||||
|
|
||||||
field = part->GetField(DATASHEET);
|
field = part->GetField(DATASHEET);
|
||||||
|
|
||||||
if( field && m_Cmp->GetField( DATASHEET ) )
|
if( field && m_cmp->GetField( DATASHEET ) )
|
||||||
{
|
{
|
||||||
m_Cmp->GetField( DATASHEET )->SetTextPosition( field->GetTextPosition() + m_Cmp->m_Pos );
|
m_cmp->GetField( DATASHEET )->SetTextPosition( field->GetTextPosition() + m_cmp->m_Pos );
|
||||||
m_Cmp->GetField( DATASHEET )->ImportValues( *field );
|
m_cmp->GetField( DATASHEET )->ImportValues( *field );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Cmp->SetOrientation( CMP_NORMAL );
|
m_cmp->SetOrientation( CMP_NORMAL );
|
||||||
|
|
||||||
m_Parent->OnModify();
|
m_Parent->OnModify();
|
||||||
|
|
||||||
m_Cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
m_cmp->Draw( m_Parent->GetCanvas(), &dc, wxPoint( 0, 0 ), GR_DEFAULT_DRAWMODE );
|
||||||
|
|
||||||
EndQuasiModal( wxID_OK );
|
EndQuasiModal( wxID_OK );
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,8 @@ GBR_TO_PCB_EXPORTER::GBR_TO_PCB_EXPORTER( GERBVIEW_FRAME* aFrame, const wxString
|
||||||
{
|
{
|
||||||
m_gerbview_frame = aFrame;
|
m_gerbview_frame = aFrame;
|
||||||
m_pcb_file_name = aFileName;
|
m_pcb_file_name = aFileName;
|
||||||
|
m_fp = NULL;
|
||||||
|
m_pcbCopperLayersCount = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public:
|
||||||
* Switches method of rendering graphics.
|
* Switches method of rendering graphics.
|
||||||
* @param aGalType is a type of rendering engine that you want to use.
|
* @param aGalType is a type of rendering engine that you want to use.
|
||||||
*/
|
*/
|
||||||
void SwitchBackend( GalType aGalType );
|
bool SwitchBackend( GalType aGalType );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetBackend
|
* Function GetBackend
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <io_mgr.h>
|
#include <io_mgr.h>
|
||||||
#include <project.h>
|
#include <project.h>
|
||||||
|
#include <boost/interprocess/exceptions.hpp>
|
||||||
|
|
||||||
#define FP_LATE_ENVVAR 1 ///< late=1/early=0 environment variable expansion
|
#define FP_LATE_ENVVAR 1 ///< late=1/early=0 environment variable expansion
|
||||||
|
|
||||||
|
@ -221,7 +222,7 @@ public:
|
||||||
* Actual indentation will be 2 spaces for each nestLevel.
|
* Actual indentation will be 2 spaces for each nestLevel.
|
||||||
*/
|
*/
|
||||||
void Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
void Format( OUTPUTFORMATTER* out, int nestLevel ) const
|
||||||
throw( IO_ERROR );
|
throw( IO_ERROR, boost::interprocess::lock_exception );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -468,7 +469,7 @@ public:
|
||||||
* @throw PARSE_ERROR if @a aFootprintId is not parsed OK.
|
* @throw PARSE_ERROR if @a aFootprintId is not parsed OK.
|
||||||
*/
|
*/
|
||||||
MODULE* FootprintLoadWithOptionalNickname( const FPID& aFootprintId )
|
MODULE* FootprintLoadWithOptionalNickname( const FPID& aFootprintId )
|
||||||
throw( IO_ERROR, PARSE_ERROR );
|
throw( IO_ERROR, PARSE_ERROR, boost::interprocess::lock_exception );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetDescription
|
* Function GetDescription
|
||||||
|
|
|
@ -277,9 +277,7 @@ private:
|
||||||
SHADER shader; ///< There is only one shader used for different objects
|
SHADER shader; ///< There is only one shader used for different objects
|
||||||
|
|
||||||
// Internal flags
|
// Internal flags
|
||||||
bool isGlewInitialized; ///< Is GLEW initialized?
|
|
||||||
bool isFramebufferInitialized; ///< Are the framebuffers initialized?
|
bool isFramebufferInitialized; ///< Are the framebuffers initialized?
|
||||||
bool isShaderInitialized; ///< Was the shader initialized?
|
|
||||||
bool isGrouping; ///< Was a group started?
|
bool isGrouping; ///< Was a group started?
|
||||||
|
|
||||||
// Polygon tesselation
|
// Polygon tesselation
|
||||||
|
|
|
@ -71,7 +71,8 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MSG_PANEL_ITEM()
|
MSG_PANEL_ITEM() :
|
||||||
|
m_Pad( MSG_PANEL_DEFAULT_PAD )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ enum TOOL_TYPE
|
||||||
|
|
||||||
/// Unique identifier for tools
|
/// Unique identifier for tools
|
||||||
typedef int TOOL_ID;
|
typedef int TOOL_ID;
|
||||||
typedef DELEGATE<int, TOOL_EVENT&> TOOL_STATE_FUNC;
|
typedef DELEGATE<int, const TOOL_EVENT&> TOOL_STATE_FUNC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TOOL_BASE
|
* Class TOOL_BASE
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
* No conditions means any event.
|
* No conditions means any event.
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
void Go( int (T::* aStateFunc)( TOOL_EVENT& ),
|
void Go( int (T::* aStateFunc)( const TOOL_EVENT& ),
|
||||||
const TOOL_EVENT_LIST& aConditions = TOOL_EVENT( TC_ANY, TA_ANY ) );
|
const TOOL_EVENT_LIST& aConditions = TOOL_EVENT( TC_ANY, TA_ANY ) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -110,7 +110,7 @@ private:
|
||||||
|
|
||||||
// hide TOOL_MANAGER implementation
|
// hide TOOL_MANAGER implementation
|
||||||
template <class T>
|
template <class T>
|
||||||
void TOOL_INTERACTIVE::Go( int (T::* aStateFunc)( TOOL_EVENT& ),
|
void TOOL_INTERACTIVE::Go( int (T::* aStateFunc)( const TOOL_EVENT& ),
|
||||||
const TOOL_EVENT_LIST& aConditions )
|
const TOOL_EVENT_LIST& aConditions )
|
||||||
{
|
{
|
||||||
TOOL_STATE_FUNC sptr( static_cast<T*>( this ), aStateFunc );
|
TOOL_STATE_FUNC sptr( static_cast<T*>( this ), aStateFunc );
|
||||||
|
|
|
@ -169,7 +169,7 @@ public:
|
||||||
* Propagates an event to tools that requested events of matching type(s).
|
* Propagates an event to tools that requested events of matching type(s).
|
||||||
* @param aEvent is the event to be processed.
|
* @param aEvent is the event to be processed.
|
||||||
*/
|
*/
|
||||||
bool ProcessEvent( TOOL_EVENT& aEvent );
|
bool ProcessEvent( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Puts an event to the event queue to be processed at the end of event processing cycle.
|
* Puts an event to the event queue to be processed at the end of event processing cycle.
|
||||||
|
@ -309,7 +309,7 @@ private:
|
||||||
* Function dispatchInternal
|
* Function dispatchInternal
|
||||||
* Passes an event at first to the active tools, then to all others.
|
* Passes an event at first to the active tools, then to all others.
|
||||||
*/
|
*/
|
||||||
void dispatchInternal( TOOL_EVENT& aEvent );
|
void dispatchInternal( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function dispatchStandardEvents()
|
* Function dispatchStandardEvents()
|
||||||
|
@ -317,7 +317,7 @@ private:
|
||||||
* @param aEvent is the event to be processed.
|
* @param aEvent is the event to be processed.
|
||||||
* @return False if the event was processed and should not go any further.
|
* @return False if the event was processed and should not go any further.
|
||||||
*/
|
*/
|
||||||
bool dispatchStandardEvents( TOOL_EVENT& aEvent );
|
bool dispatchStandardEvents( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function dispatchActivation()
|
* Function dispatchActivation()
|
||||||
|
@ -325,13 +325,13 @@ private:
|
||||||
* @param aEvent is an event to be tested.
|
* @param aEvent is an event to be tested.
|
||||||
* @return True if a tool was invoked, false otherwise.
|
* @return True if a tool was invoked, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool dispatchActivation( TOOL_EVENT& aEvent );
|
bool dispatchActivation( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function dispatchContextMenu()
|
* Function dispatchContextMenu()
|
||||||
* Handles context menu related events.
|
* Handles context menu related events.
|
||||||
*/
|
*/
|
||||||
void dispatchContextMenu( TOOL_EVENT& aEvent );
|
void dispatchContextMenu( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function invokeTool()
|
* Function invokeTool()
|
||||||
|
|
|
@ -492,8 +492,15 @@ public:
|
||||||
{
|
{
|
||||||
wxASSERT( aLayer < (int) m_layers.size() );
|
wxASSERT( aLayer < (int) m_layers.size() );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
return m_layers.at( aLayer ).target == TARGET_CACHED;
|
return m_layers.at( aLayer ).target == TARGET_CACHED;
|
||||||
}
|
}
|
||||||
|
catch( std::out_of_range )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function MarkDirty()
|
* Function MarkDirty()
|
||||||
|
|
|
@ -848,12 +848,14 @@ public:
|
||||||
/**
|
/**
|
||||||
* Function AppendBoardFile
|
* Function AppendBoardFile
|
||||||
* appends a board file onto the current one, creating God knows what.
|
* appends a board file onto the current one, creating God knows what.
|
||||||
|
* the main purpose is only to allow panelizing boards.
|
||||||
*/
|
*/
|
||||||
bool AppendBoardFile( const wxString& aFullFileName, int aCtl );
|
bool AppendBoardFile( const wxString& aFullFileName, int aCtl );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SavePcbFile
|
* Function SavePcbFile
|
||||||
* writes the board data structures to \a a aFileName
|
* writes the board data structures to \a a aFileName
|
||||||
|
* Creates backup when requested and update flags (modified and saved flgs)
|
||||||
*
|
*
|
||||||
* @param aFileName The file name to write or wxEmptyString to prompt user for
|
* @param aFileName The file name to write or wxEmptyString to prompt user for
|
||||||
* file name.
|
* file name.
|
||||||
|
@ -864,8 +866,18 @@ public:
|
||||||
*/
|
*/
|
||||||
bool SavePcbFile( const wxString& aFileName, bool aCreateBackupFile = CREATE_BACKUP_FILE );
|
bool SavePcbFile( const wxString& aFileName, bool aCreateBackupFile = CREATE_BACKUP_FILE );
|
||||||
|
|
||||||
int SavePcbFormatAscii( FILE* File );
|
/**
|
||||||
bool WriteGeneralDescrPcb( FILE* File );
|
* Function SavePcbCopy
|
||||||
|
* writes the board data structures to \a a aFileName
|
||||||
|
* but unlike SavePcbFile, does not make anything else
|
||||||
|
* (no backup, borad fliename change, no flag changes ...)
|
||||||
|
* Used under a project mgr to save under a new name the current board
|
||||||
|
*
|
||||||
|
* When not under a project mgr, the full SavePcbFile is used.
|
||||||
|
* @param aFileName The file name to write.
|
||||||
|
* @return True if file was saved successfully.
|
||||||
|
*/
|
||||||
|
bool SavePcbCopy( const wxString& aFileName );
|
||||||
|
|
||||||
// BOARD handling
|
// BOARD handling
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
SaveCopyInUndoList();
|
SaveCopyInUndoList();
|
||||||
idx = m_treePagelayout->GetSelectedItemIndex();
|
idx = m_treePagelayout->GetSelectedItemIndex();
|
||||||
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_SEGMENT, idx );
|
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_SEGMENT, idx );
|
||||||
|
|
||||||
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
|
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
|
||||||
{
|
{
|
||||||
RemoveLastCommandInUndoList();
|
RemoveLastCommandInUndoList();
|
||||||
|
@ -199,6 +200,7 @@ void PL_EDITOR_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
SaveCopyInUndoList();
|
SaveCopyInUndoList();
|
||||||
idx = m_treePagelayout->GetSelectedItemIndex();
|
idx = m_treePagelayout->GetSelectedItemIndex();
|
||||||
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_RECT, idx );
|
item = AddPageLayoutItem( WORKSHEET_DATAITEM::WS_RECT, idx );
|
||||||
|
|
||||||
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
|
if( InvokeDialogNewItem( this, item ) == wxID_CANCEL )
|
||||||
{
|
{
|
||||||
RemoveLastCommandInUndoList();
|
RemoveLastCommandInUndoList();
|
||||||
|
@ -353,10 +355,11 @@ static void moveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPositio
|
||||||
// (does not happen each time the mouse is moved, because the
|
// (does not happen each time the mouse is moved, because the
|
||||||
// item is placed on grid)
|
// item is placed on grid)
|
||||||
// to avoid useless computation time.
|
// to avoid useless computation time.
|
||||||
if( aPanel && ( previous_position != position ) )
|
if( previous_position != position )
|
||||||
aPanel->Refresh();
|
aPanel->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Function abortMoveItem: called when an item is currently moving,
|
* Function abortMoveItem: called when an item is currently moving,
|
||||||
* and when the user aborts the move command.
|
* and when the user aborts the move command.
|
||||||
|
@ -367,7 +370,7 @@ static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
|
||||||
PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen();
|
PL_EDITOR_SCREEN* screen = (PL_EDITOR_SCREEN*) aPanel->GetScreen();
|
||||||
WORKSHEET_DATAITEM *item = screen->GetCurItem();
|
WORKSHEET_DATAITEM *item = screen->GetCurItem();
|
||||||
|
|
||||||
if( (item->GetFlags() & NEW_ITEM ) )
|
if( item->GetFlags() & NEW_ITEM )
|
||||||
{
|
{
|
||||||
PL_EDITOR_FRAME* plframe = (PL_EDITOR_FRAME*) aPanel->GetParent();
|
PL_EDITOR_FRAME* plframe = (PL_EDITOR_FRAME*) aPanel->GetParent();
|
||||||
plframe->RemoveLastCommandInUndoList();
|
plframe->RemoveLastCommandInUndoList();
|
||||||
|
@ -394,6 +397,7 @@ static void abortMoveItem( EDA_DRAW_PANEL* aPanel, wxDC* aDC )
|
||||||
aPanel->Refresh();
|
aPanel->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem )
|
void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( aItem != NULL, wxT( "Cannot move NULL item" ) );
|
wxCHECK_RET( aItem != NULL, wxT( "Cannot move NULL item" ) );
|
||||||
|
@ -411,6 +415,7 @@ void PL_EDITOR_FRAME::MoveItem( WORKSHEET_DATAITEM* aItem )
|
||||||
{
|
{
|
||||||
SetCrossHairPosition( initialPositionUi, false );
|
SetCrossHairPosition( initialPositionUi, false );
|
||||||
initialCursorPosition = GetCrossHairPosition();
|
initialCursorPosition = GetCrossHairPosition();
|
||||||
|
|
||||||
if( m_canvas->IsPointOnDisplay( initialCursorPosition ) )
|
if( m_canvas->IsPointOnDisplay( initialCursorPosition ) )
|
||||||
{
|
{
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
|
@ -443,7 +448,7 @@ void PL_EDITOR_FRAME::PlaceItem( WORKSHEET_DATAITEM* aItem )
|
||||||
{
|
{
|
||||||
aItem->MoveStartPointTo( initialPosition );
|
aItem->MoveStartPointTo( initialPosition );
|
||||||
}
|
}
|
||||||
else if( (aItem->GetFlags() & LOCATE_ENDPOINT) )
|
else if( aItem->GetFlags() & LOCATE_ENDPOINT )
|
||||||
{
|
{
|
||||||
aItem->MoveEndPointTo( initialPosition );
|
aItem->MoveEndPointTo( initialPosition );
|
||||||
}
|
}
|
||||||
|
@ -471,12 +476,14 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode( wxCommandEvent& event )
|
void PL_EDITOR_FRAME::OnSelectTitleBlockDisplayMode( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
WORKSHEET_DATAITEM::m_SpecialMode = (event.GetId() == ID_SHOW_PL_EDITOR_MODE);
|
WORKSHEET_DATAITEM::m_SpecialMode = (event.GetId() == ID_SHOW_PL_EDITOR_MODE);
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::OnQuit( wxCommandEvent& event )
|
void PL_EDITOR_FRAME::OnQuit( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
Close( true );
|
Close( true );
|
||||||
|
@ -485,7 +492,7 @@ void PL_EDITOR_FRAME::OnQuit( wxCommandEvent& event )
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::ToPlotter(wxCommandEvent& event)
|
void PL_EDITOR_FRAME::ToPlotter(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxMessageBox( wxT("Not yet available"));
|
wxMessageBox( wxT( "Not yet available" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -533,6 +540,7 @@ void PL_EDITOR_FRAME::ToPrinter(wxCommandEvent& event)
|
||||||
InvokeDialogPrint( this, s_PrintData, s_pageSetupData );
|
InvokeDialogPrint( this, s_PrintData, s_pageSetupData );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::OnTreeSelection( wxTreeEvent& event )
|
void PL_EDITOR_FRAME::OnTreeSelection( wxTreeEvent& event )
|
||||||
{
|
{
|
||||||
WORKSHEET_DATAITEM* item = GetSelectedItem();
|
WORKSHEET_DATAITEM* item = GetSelectedItem();
|
||||||
|
@ -543,11 +551,15 @@ void PL_EDITOR_FRAME::OnTreeSelection( wxTreeEvent& event )
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event )
|
void PL_EDITOR_FRAME::OnTreeMiddleClick( wxTreeEvent& event )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern void AddNewItemsCommand( wxMenu* aMainMenu );
|
extern void AddNewItemsCommand( wxMenu* aMainMenu );
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::OnTreeRightClick( wxTreeEvent& event )
|
void PL_EDITOR_FRAME::OnTreeRightClick( wxTreeEvent& event )
|
||||||
{
|
{
|
||||||
m_treePagelayout->SelectCell( event.GetItem() );
|
m_treePagelayout->SelectCell( event.GetItem() );
|
||||||
|
@ -568,6 +580,7 @@ void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplayNormalMode( wxUpdateUIEvent& even
|
||||||
event.Check( WORKSHEET_DATAITEM::m_SpecialMode == false );
|
event.Check( WORKSHEET_DATAITEM::m_SpecialMode == false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode( wxUpdateUIEvent& event )
|
void PL_EDITOR_FRAME::OnUpdateTitleBlockDisplaySpecialMode( wxUpdateUIEvent& event )
|
||||||
{
|
{
|
||||||
event.Check( WORKSHEET_DATAITEM::m_SpecialMode == true );
|
event.Check( WORKSHEET_DATAITEM::m_SpecialMode == true );
|
||||||
|
|
|
@ -358,7 +358,7 @@ void RECTWAVEGUIDE::show_results()
|
||||||
continue;
|
continue;
|
||||||
if( f >= ( fc( m, n ) ) )
|
if( f >= ( fc( m, n ) ) )
|
||||||
{
|
{
|
||||||
sprintf( txt, "H(%u,%u) ", m, n );
|
sprintf( txt, "H(%d,%d) ", m, n );
|
||||||
if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN )
|
if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN )
|
||||||
strcat( text, txt );
|
strcat( text, txt );
|
||||||
else
|
else
|
||||||
|
@ -384,7 +384,7 @@ void RECTWAVEGUIDE::show_results()
|
||||||
{
|
{
|
||||||
if( f >= fc( m, n ) )
|
if( f >= fc( m, n ) )
|
||||||
{
|
{
|
||||||
sprintf( txt, "E(%u,%u) ", m, n );
|
sprintf( txt, "E(%d,%d) ", m, n );
|
||||||
if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN )
|
if( (strlen( text ) + strlen( txt ) + 5) < MAXSTRLEN )
|
||||||
strcat( text, txt );
|
strcat( text, txt );
|
||||||
else
|
else
|
||||||
|
|
|
@ -314,6 +314,32 @@ bool BOARD::SetLayerDescr( LAYER_ID aIndex, const LAYER& aLayer )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
const LAYER_ID BOARD::GetLayerID(wxString aLayerName) const
|
||||||
|
{
|
||||||
|
|
||||||
|
// Look for the BOARD specific copper layer names
|
||||||
|
for( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer )
|
||||||
|
{
|
||||||
|
if ( IsCopperLayer( layer ) &&
|
||||||
|
( m_Layer[ layer ].m_name == aLayerName) )
|
||||||
|
{
|
||||||
|
return ToLAYER_ID( layer );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise fall back to the system standard layer names
|
||||||
|
for ( LAYER_NUM layer = 0; layer < LAYER_ID_COUNT; ++layer )
|
||||||
|
{
|
||||||
|
if ( GetStandardLayerName( ToLAYER_ID( layer ) ) == aLayerName )
|
||||||
|
{
|
||||||
|
return ToLAYER_ID( layer );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return UNDEFINED_LAYER;
|
||||||
|
}
|
||||||
|
|
||||||
const wxString BOARD::GetLayerName( LAYER_ID aLayer ) const
|
const wxString BOARD::GetLayerName( LAYER_ID aLayer ) const
|
||||||
{
|
{
|
||||||
|
@ -331,7 +357,6 @@ const wxString BOARD::GetLayerName( LAYER_ID aLayer ) const
|
||||||
return GetStandardLayerName( aLayer );
|
return GetStandardLayerName( aLayer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool BOARD::SetLayerName( LAYER_ID aLayer, const wxString& aLayerName )
|
bool BOARD::SetLayerName( LAYER_ID aLayer, const wxString& aLayerName )
|
||||||
{
|
{
|
||||||
if( !IsCopperLayer( aLayer ) )
|
if( !IsCopperLayer( aLayer ) )
|
||||||
|
@ -2179,7 +2204,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
||||||
wxString msg;
|
wxString msg;
|
||||||
D_PAD* pad;
|
D_PAD* pad;
|
||||||
MODULE* footprint;
|
MODULE* footprint;
|
||||||
COMPONENT_NET net;
|
|
||||||
|
|
||||||
if( !IsEmpty() )
|
if( !IsEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -2375,13 +2399,11 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
||||||
// At this point, the component footprint is updated. Now update the nets.
|
// At this point, the component footprint is updated. Now update the nets.
|
||||||
for( pad = footprint->Pads(); pad; pad = pad->Next() )
|
for( pad = footprint->Pads(); pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
net = component->GetNet( pad->GetPadName() );
|
COMPONENT_NET net = component->GetNet( pad->GetPadName() );
|
||||||
|
|
||||||
if( !net.IsValid() ) // Footprint pad had no net.
|
if( !net.IsValid() ) // Footprint pad had no net.
|
||||||
{
|
{
|
||||||
if( !pad->GetNetname().IsEmpty() )
|
if( aReporter && aReporter->ReportAll() && !pad->GetNetname().IsEmpty() )
|
||||||
{
|
|
||||||
if( aReporter && aReporter->ReportAll() )
|
|
||||||
{
|
{
|
||||||
msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
|
msg.Printf( _( "Clearing component \"%s:%s\" pin \"%s\" net name.\n" ),
|
||||||
GetChars( footprint->GetReference() ),
|
GetChars( footprint->GetReference() ),
|
||||||
|
@ -2393,7 +2415,6 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
||||||
if( !aNetlist.IsDryRun() )
|
if( !aNetlist.IsDryRun() )
|
||||||
pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else // Footprint pad has a net.
|
else // Footprint pad has a net.
|
||||||
{
|
{
|
||||||
if( net.GetNetName() != pad->GetNetname() )
|
if( net.GetNetName() != pad->GetNetname() )
|
||||||
|
@ -2559,7 +2580,7 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
|
||||||
// Explore all pins/pads in component
|
// Explore all pins/pads in component
|
||||||
for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
|
for( unsigned jj = 0; jj < component->GetNetCount(); jj++ )
|
||||||
{
|
{
|
||||||
net = component->GetNet( jj );
|
COMPONENT_NET net = component->GetNet( jj );
|
||||||
padname = net.GetPinName();
|
padname = net.GetPinName();
|
||||||
|
|
||||||
if( footprint->FindPadByName( padname ) )
|
if( footprint->FindPadByName( padname ) )
|
||||||
|
|
|
@ -621,6 +621,18 @@ public:
|
||||||
*/
|
*/
|
||||||
void ConvertBrdLayerToPolygonalContours( LAYER_ID aLayer, CPOLYGONS_LIST& aOutlines );
|
void ConvertBrdLayerToPolygonalContours( LAYER_ID aLayer, CPOLYGONS_LIST& aOutlines );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function GetLayerID
|
||||||
|
* returns the ID of a layer given by aLayerName. Copper layers may
|
||||||
|
* have custom names.
|
||||||
|
*
|
||||||
|
* @param aLayerName = A layer name, like wxT("B.Cu"), etc.
|
||||||
|
*
|
||||||
|
* @return LAYER_ID - the layer id, which for copper layers may
|
||||||
|
* be custom, else standard.
|
||||||
|
*/
|
||||||
|
const LAYER_ID GetLayerID( wxString aLayerName ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetLayerName
|
* Function GetLayerName
|
||||||
* returns the name of a layer given by aLayer. Copper layers may
|
* returns the name of a layer given by aLayer. Copper layers may
|
||||||
|
|
|
@ -50,7 +50,10 @@ BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& aItem )
|
||||||
|
|
||||||
void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode )
|
void BOARD_CONNECTED_ITEM::SetNetCode( int aNetCode )
|
||||||
{
|
{
|
||||||
// assert( aNetCode >= 0 );
|
// if aNetCode < 0 ( typically NETINFO_LIST::FORCE_ORPHANED )
|
||||||
|
// or no parent board,
|
||||||
|
// set the m_netinfo to the dummy NETINFO_LIST::ORPHANED
|
||||||
|
|
||||||
BOARD* board = GetBoard();
|
BOARD* board = GetBoard();
|
||||||
|
|
||||||
if( ( aNetCode >= 0 ) && board )
|
if( ( aNetCode >= 0 ) && board )
|
||||||
|
|
|
@ -82,6 +82,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
|
||||||
m_PcbTextSize = wxSize( DEFAULT_TEXT_PCB_SIZE,
|
m_PcbTextSize = wxSize( DEFAULT_TEXT_PCB_SIZE,
|
||||||
DEFAULT_TEXT_PCB_SIZE ); // current Pcb (not module) Text size
|
DEFAULT_TEXT_PCB_SIZE ); // current Pcb (not module) Text size
|
||||||
|
|
||||||
|
m_useCustomTrackVia = false;
|
||||||
|
m_customTrackWidth = DMils2iu( 100 );
|
||||||
m_TrackMinWidth = DMils2iu( 100 ); // track min value for width (min copper size value)
|
m_TrackMinWidth = DMils2iu( 100 ); // track min value for width (min copper size value)
|
||||||
m_ViasMinSize = DMils2iu( 350 ); // vias (not micro vias) min diameter
|
m_ViasMinSize = DMils2iu( 350 ); // vias (not micro vias) min diameter
|
||||||
m_ViasMinDrill = DMils2iu( 200 ); // vias (not micro vias) min drill diameter
|
m_ViasMinDrill = DMils2iu( 200 ); // vias (not micro vias) min drill diameter
|
||||||
|
|
|
@ -529,8 +529,11 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case S_POLYGON: // not yet handled
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxASSERT( 0 );
|
wxASSERT_MSG( 0, wxString::Format( "unknown DRAWSEGMENT shape: %d", m_Shape ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,9 +585,15 @@ bool DRAWSEGMENT::HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case S_CURVE:
|
||||||
|
case S_POLYGON: // not yet handled
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
;
|
wxASSERT_MSG( 0, wxString::Format( "unknown DRAWSEGMENT shape: %d", m_Shape ) );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,8 +112,6 @@ MODULE::MODULE( const MODULE& aModule ) :
|
||||||
m_Value->SetParent( this );
|
m_Value->SetParent( this );
|
||||||
|
|
||||||
// Copy auxiliary data: Pads
|
// Copy auxiliary data: Pads
|
||||||
// m_Pads.DeleteAll();
|
|
||||||
|
|
||||||
for( D_PAD* pad = aModule.m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = aModule.m_Pads; pad; pad = pad->Next() )
|
||||||
{
|
{
|
||||||
D_PAD* newpad = new D_PAD( *pad );
|
D_PAD* newpad = new D_PAD( *pad );
|
||||||
|
@ -800,6 +798,8 @@ EDA_ITEM* MODULE::Clone() const
|
||||||
|
|
||||||
void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
|
void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
|
||||||
aFunction( static_cast<BOARD_ITEM*>( pad ) );
|
aFunction( static_cast<BOARD_ITEM*>( pad ) );
|
||||||
|
|
||||||
|
@ -808,6 +808,11 @@ void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
|
||||||
|
|
||||||
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
|
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
|
||||||
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
|
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
|
||||||
|
}
|
||||||
|
catch( boost::bad_function_call& e )
|
||||||
|
{
|
||||||
|
DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -320,9 +320,14 @@ public:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
///> Constant that holds the unconnected net number (typically 0)
|
///> Constant that holds the "unconnected net" number (typically 0)
|
||||||
|
///> all items "connected" to this net are actually not connected items
|
||||||
static const int UNCONNECTED;
|
static const int UNCONNECTED;
|
||||||
|
|
||||||
|
///> Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED
|
||||||
|
///> (typically -1) when calling SetNetCode od board connected items
|
||||||
|
static const int FORCE_ORPHANED;
|
||||||
|
|
||||||
///> NETINFO_ITEM meaning that there was no net assigned for an item, as there was no
|
///> NETINFO_ITEM meaning that there was no net assigned for an item, as there was no
|
||||||
///> board storing net list available.
|
///> board storing net list available.
|
||||||
static NETINFO_ITEM ORPHANED;
|
static NETINFO_ITEM ORPHANED;
|
||||||
|
|
|
@ -292,4 +292,6 @@ NETINFO_ITEM* NETINFO_MAPPING::iterator::operator->() const
|
||||||
|
|
||||||
|
|
||||||
const int NETINFO_LIST::UNCONNECTED = 0;
|
const int NETINFO_LIST::UNCONNECTED = 0;
|
||||||
|
const int NETINFO_LIST::FORCE_ORPHANED = -1;
|
||||||
|
|
||||||
NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString, NETINFO_LIST::UNCONNECTED );
|
NETINFO_ITEM NETINFO_LIST::ORPHANED = NETINFO_ITEM( NULL, wxEmptyString, NETINFO_LIST::UNCONNECTED );
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include <collectors.h>
|
#include <collectors.h>
|
||||||
#include <pcbnew.h>
|
#include <pcbnew.h>
|
||||||
|
|
||||||
|
#include <tools/common_actions.h>
|
||||||
|
#include <pcb_draw_panel_gal.h>
|
||||||
|
|
||||||
/* Execute a remote command send by Eeschema via a socket,
|
/* Execute a remote command send by Eeschema via a socket,
|
||||||
* port KICAD_PCB_PORT_SERVICE_NUMBER
|
* port KICAD_PCB_PORT_SERVICE_NUMBER
|
||||||
|
@ -126,10 +128,19 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
||||||
}
|
}
|
||||||
|
|
||||||
if( module ) // if found, center the module on screen, and redraw the screen.
|
if( module ) // if found, center the module on screen, and redraw the screen.
|
||||||
|
{
|
||||||
|
if( IsGalCanvasActive() )
|
||||||
|
{
|
||||||
|
GetGalCanvas()->GetView()->SetCenter( VECTOR2D( module->GetPosition() ) );
|
||||||
|
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
|
||||||
|
m_toolManager->RunAction( COMMON_ACTIONS::selectItem, true, module );
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetCrossHairPosition( pos );
|
SetCrossHairPosition( pos );
|
||||||
RedrawScreen( pos, false );
|
RedrawScreen( pos, false );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
DIALOG_ENUM_PADS::DIALOG_ENUM_PADS( wxWindow* aParent ) :
|
DIALOG_ENUM_PADS::DIALOG_ENUM_PADS( wxWindow* aParent ) :
|
||||||
DIALOG_ENUM_PADS_BASE( aParent )
|
DIALOG_ENUM_PADS_BASE( aParent )
|
||||||
{
|
{
|
||||||
|
// Calling SetSizeHints after all widgets are built is mandatory
|
||||||
|
// to set the correct size of the dialog
|
||||||
|
GetSizer()->SetSizeHints( this );
|
||||||
|
Center();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Apr 30 2013)
|
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -9,43 +9,46 @@
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
|
DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
|
||||||
{
|
{
|
||||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||||
|
|
||||||
wxBoxSizer* bMainSizer;
|
wxBoxSizer* bMainSizer;
|
||||||
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
bMainSizer = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
wxBoxSizer* bPrefixSizer;
|
m_lblInfo = new wxStaticText( this, wxID_ANY, _("Pad names are restricted to 4 characters (including number)."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bPrefixSizer = new wxBoxSizer( wxHORIZONTAL );
|
m_lblInfo->Wrap( -1 );
|
||||||
|
bMainSizer->Add( m_lblInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
|
||||||
|
|
||||||
|
|
||||||
|
bMainSizer->Add( 0, 0, 0, wxTOP|wxBOTTOM, 5 );
|
||||||
|
|
||||||
|
wxFlexGridSizer* fgSizer;
|
||||||
|
fgSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
|
||||||
|
fgSizer->AddGrowableCol( 1 );
|
||||||
|
fgSizer->SetFlexibleDirection( wxBOTH );
|
||||||
|
fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
||||||
|
|
||||||
m_lblPadPrefix = new wxStaticText( this, wxID_ANY, _("Pad name prefix:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_lblPadPrefix = new wxStaticText( this, wxID_ANY, _("Pad name prefix:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_lblPadPrefix->Wrap( -1 );
|
m_lblPadPrefix->Wrap( -1 );
|
||||||
bPrefixSizer->Add( m_lblPadPrefix, 1, wxALL, 5 );
|
fgSizer->Add( m_lblPadPrefix, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
m_padPrefix = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
m_padPrefix = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_padPrefix->SetMaxLength( 4 );
|
m_padPrefix->SetMaxLength( 4 );
|
||||||
bPrefixSizer->Add( m_padPrefix, 0, wxALL, 5 );
|
fgSizer->Add( m_padPrefix, 0, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
|
|
||||||
bMainSizer->Add( bPrefixSizer, 1, wxEXPAND, 5 );
|
|
||||||
|
|
||||||
wxBoxSizer* bPadNumSizer;
|
|
||||||
bPadNumSizer = new wxBoxSizer( wxHORIZONTAL );
|
|
||||||
|
|
||||||
m_lblPadStartNum = new wxStaticText( this, wxID_ANY, _("First pad number:"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_lblPadStartNum = new wxStaticText( this, wxID_ANY, _("First pad number:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
m_lblPadStartNum->Wrap( -1 );
|
m_lblPadStartNum->Wrap( -1 );
|
||||||
bPadNumSizer->Add( m_lblPadStartNum, 1, wxALL, 5 );
|
fgSizer->Add( m_lblPadStartNum, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
|
|
||||||
m_padStartNum = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999, 1 );
|
m_padStartNum = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 999, 1 );
|
||||||
bPadNumSizer->Add( m_padStartNum, 0, wxALL, 5 );
|
fgSizer->Add( m_padStartNum, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
||||||
bMainSizer->Add( bPadNumSizer, 1, wxEXPAND, 5 );
|
bMainSizer->Add( fgSizer, 1, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
m_lblInfo = new wxStaticText( this, wxID_ANY, _("Pad names are restricted to 4 characters (including number)."), wxDefaultPosition, wxDefaultSize, 0 );
|
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||||
m_lblInfo->Wrap( 320 );
|
bMainSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||||
bMainSizer->Add( m_lblInfo, 0, wxALL, 5 );
|
|
||||||
|
|
||||||
m_stdButtons = new wxStdDialogButtonSizer();
|
m_stdButtons = new wxStdDialogButtonSizer();
|
||||||
m_stdButtonsOK = new wxButton( this, wxID_OK );
|
m_stdButtonsOK = new wxButton( this, wxID_OK );
|
||||||
|
@ -54,7 +57,7 @@ DIALOG_ENUM_PADS_BASE::DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id, c
|
||||||
m_stdButtons->AddButton( m_stdButtonsCancel );
|
m_stdButtons->AddButton( m_stdButtonsCancel );
|
||||||
m_stdButtons->Realize();
|
m_stdButtons->Realize();
|
||||||
|
|
||||||
bMainSizer->Add( m_stdButtons, 2, wxEXPAND, 5 );
|
bMainSizer->Add( m_stdButtons, 0, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
this->SetSizer( bMainSizer );
|
this->SetSizer( bMainSizer );
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
<wxFormBuilder_Project>
|
<wxFormBuilder_Project>
|
||||||
<FileVersion major="1" minor="11" />
|
<FileVersion major="1" minor="13" />
|
||||||
<object class="Project" expanded="1">
|
<object class="Project" expanded="1">
|
||||||
<property name="class_decoration"></property>
|
<property name="class_decoration"></property>
|
||||||
<property name="code_generation">C++</property>
|
<property name="code_generation">C++</property>
|
||||||
|
@ -20,8 +20,10 @@
|
||||||
<property name="path">.</property>
|
<property name="path">.</property>
|
||||||
<property name="precompiled_header"></property>
|
<property name="precompiled_header"></property>
|
||||||
<property name="relative_path">1</property>
|
<property name="relative_path">1</property>
|
||||||
|
<property name="skip_lua_events">1</property>
|
||||||
<property name="skip_php_events">1</property>
|
<property name="skip_php_events">1</property>
|
||||||
<property name="skip_python_events">1</property>
|
<property name="skip_python_events">1</property>
|
||||||
|
<property name="ui_table">UI</property>
|
||||||
<property name="use_enum">0</property>
|
<property name="use_enum">0</property>
|
||||||
<property name="use_microsoft_bom">0</property>
|
<property name="use_microsoft_bom">0</property>
|
||||||
<object class="Dialog" expanded="1">
|
<object class="Dialog" expanded="1">
|
||||||
|
@ -42,9 +44,9 @@
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">DIALOG_ENUM_PADS_BASE</property>
|
<property name="name">DIALOG_ENUM_PADS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">340,240</property>
|
<property name="size">340,187</property>
|
||||||
<property name="style">wxDEFAULT_DIALOG_STYLE</property>
|
<property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||||
<property name="title">Pad enumeration settings</property>
|
<property name="title">Pad enumeration settings</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
|
@ -93,17 +95,117 @@
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxALL|wxALIGN_CENTER_HORIZONTAL</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxBoxSizer" expanded="0">
|
<object class="wxStaticText" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="label">Pad names are restricted to 4 characters (including number).</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">bPrefixSizer</property>
|
<property name="moveable">1</property>
|
||||||
<property name="orient">wxHORIZONTAL</property>
|
<property name="name">m_lblInfo</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style"></property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<property name="wrap">-1</property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxTOP|wxBOTTOM</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="spacer" expanded="1">
|
||||||
|
<property name="height">0</property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="width">0</property>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND|wxALL</property>
|
||||||
|
<property name="proportion">1</property>
|
||||||
|
<object class="wxFlexGridSizer" expanded="1">
|
||||||
|
<property name="cols">2</property>
|
||||||
|
<property name="flexible_direction">wxBOTH</property>
|
||||||
|
<property name="growablecols">1</property>
|
||||||
|
<property name="growablerows"></property>
|
||||||
|
<property name="hgap">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="name">fgSizer</property>
|
||||||
|
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
|
||||||
<property name="permission">none</property>
|
<property name="permission">none</property>
|
||||||
|
<property name="rows">0</property>
|
||||||
|
<property name="vgap">0</property>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="0">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL</property>
|
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="0">
|
<object class="wxStaticText" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
|
@ -185,7 +287,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="0">
|
<object class="sizeritem" expanded="0">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL</property>
|
<property name="flag">wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxTextCtrl" expanded="0">
|
<object class="wxTextCtrl" expanded="0">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
@ -274,21 +376,10 @@
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
|
||||||
</object>
|
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
|
||||||
<property name="proportion">1</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxBoxSizer" expanded="1">
|
|
||||||
<property name="minimum_size"></property>
|
|
||||||
<property name="name">bPadNumSizer</property>
|
|
||||||
<property name="orient">wxHORIZONTAL</property>
|
|
||||||
<property name="permission">none</property>
|
|
||||||
<object class="sizeritem" expanded="1">
|
|
||||||
<property name="border">5</property>
|
|
||||||
<property name="flag">wxALL</property>
|
|
||||||
<property name="proportion">1</property>
|
|
||||||
<object class="wxStaticText" expanded="1">
|
<object class="wxStaticText" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
|
@ -370,7 +461,7 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL</property>
|
<property name="flag">wxALL|wxEXPAND</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxSpinCtrl" expanded="1">
|
<object class="wxSpinCtrl" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
|
@ -452,6 +543,7 @@
|
||||||
<event name="OnSize"></event>
|
<event name="OnSize"></event>
|
||||||
<event name="OnSpinCtrl"></event>
|
<event name="OnSpinCtrl"></event>
|
||||||
<event name="OnSpinCtrlText"></event>
|
<event name="OnSpinCtrlText"></event>
|
||||||
|
<event name="OnTextEnter"></event>
|
||||||
<event name="OnUpdateUI"></event>
|
<event name="OnUpdateUI"></event>
|
||||||
</object>
|
</object>
|
||||||
</object>
|
</object>
|
||||||
|
@ -459,9 +551,9 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxALL</property>
|
<property name="flag">wxEXPAND | wxALL</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStaticText" expanded="1">
|
<object class="wxStaticLine" expanded="1">
|
||||||
<property name="BottomDockable">1</property>
|
<property name="BottomDockable">1</property>
|
||||||
<property name="LeftDockable">1</property>
|
<property name="LeftDockable">1</property>
|
||||||
<property name="RightDockable">1</property>
|
<property name="RightDockable">1</property>
|
||||||
|
@ -489,7 +581,6 @@
|
||||||
<property name="gripper">0</property>
|
<property name="gripper">0</property>
|
||||||
<property name="hidden">0</property>
|
<property name="hidden">0</property>
|
||||||
<property name="id">wxID_ANY</property>
|
<property name="id">wxID_ANY</property>
|
||||||
<property name="label">Pad names are restricted to 4 characters (including number).</property>
|
|
||||||
<property name="max_size"></property>
|
<property name="max_size"></property>
|
||||||
<property name="maximize_button">0</property>
|
<property name="maximize_button">0</property>
|
||||||
<property name="maximum_size"></property>
|
<property name="maximum_size"></property>
|
||||||
|
@ -497,7 +588,7 @@
|
||||||
<property name="minimize_button">0</property>
|
<property name="minimize_button">0</property>
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="moveable">1</property>
|
<property name="moveable">1</property>
|
||||||
<property name="name">m_lblInfo</property>
|
<property name="name">m_staticline1</property>
|
||||||
<property name="pane_border">1</property>
|
<property name="pane_border">1</property>
|
||||||
<property name="pane_position"></property>
|
<property name="pane_position"></property>
|
||||||
<property name="pane_size"></property>
|
<property name="pane_size"></property>
|
||||||
|
@ -507,14 +598,13 @@
|
||||||
<property name="resize">Resizable</property>
|
<property name="resize">Resizable</property>
|
||||||
<property name="show">1</property>
|
<property name="show">1</property>
|
||||||
<property name="size"></property>
|
<property name="size"></property>
|
||||||
<property name="style"></property>
|
<property name="style">wxLI_HORIZONTAL</property>
|
||||||
<property name="subclass"></property>
|
<property name="subclass"></property>
|
||||||
<property name="toolbar_pane">0</property>
|
<property name="toolbar_pane">0</property>
|
||||||
<property name="tooltip"></property>
|
<property name="tooltip"></property>
|
||||||
<property name="window_extra_style"></property>
|
<property name="window_extra_style"></property>
|
||||||
<property name="window_name"></property>
|
<property name="window_name"></property>
|
||||||
<property name="window_style"></property>
|
<property name="window_style"></property>
|
||||||
<property name="wrap">320</property>
|
|
||||||
<event name="OnChar"></event>
|
<event name="OnChar"></event>
|
||||||
<event name="OnEnterWindow"></event>
|
<event name="OnEnterWindow"></event>
|
||||||
<event name="OnEraseBackground"></event>
|
<event name="OnEraseBackground"></event>
|
||||||
|
@ -542,8 +632,8 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxEXPAND|wxALL</property>
|
||||||
<property name="proportion">2</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||||
<property name="Apply">0</property>
|
<property name="Apply">0</property>
|
||||||
<property name="Cancel">1</property>
|
<property name="Cancel">1</property>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Apr 30 2013)
|
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -11,6 +11,9 @@
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
|
class DIALOG_SHIM;
|
||||||
|
|
||||||
|
#include "dialog_shim.h"
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
@ -18,8 +21,9 @@
|
||||||
#include <wx/colour.h>
|
#include <wx/colour.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
#include <wx/sizer.h>
|
|
||||||
#include <wx/spinctrl.h>
|
#include <wx/spinctrl.h>
|
||||||
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/statline.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
|
||||||
|
@ -29,23 +33,24 @@
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Class DIALOG_ENUM_PADS_BASE
|
/// Class DIALOG_ENUM_PADS_BASE
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
class DIALOG_ENUM_PADS_BASE : public wxDialog
|
class DIALOG_ENUM_PADS_BASE : public DIALOG_SHIM
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
wxStaticText* m_lblInfo;
|
||||||
wxStaticText* m_lblPadPrefix;
|
wxStaticText* m_lblPadPrefix;
|
||||||
wxTextCtrl* m_padPrefix;
|
wxTextCtrl* m_padPrefix;
|
||||||
wxStaticText* m_lblPadStartNum;
|
wxStaticText* m_lblPadStartNum;
|
||||||
wxSpinCtrl* m_padStartNum;
|
wxSpinCtrl* m_padStartNum;
|
||||||
wxStaticText* m_lblInfo;
|
wxStaticLine* m_staticline1;
|
||||||
wxStdDialogButtonSizer* m_stdButtons;
|
wxStdDialogButtonSizer* m_stdButtons;
|
||||||
wxButton* m_stdButtonsOK;
|
wxButton* m_stdButtonsOK;
|
||||||
wxButton* m_stdButtonsCancel;
|
wxButton* m_stdButtonsCancel;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad enumeration settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,240 ), long style = wxDEFAULT_DIALOG_STYLE );
|
DIALOG_ENUM_PADS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pad enumeration settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 340,187 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
|
||||||
~DIALOG_ENUM_PADS_BASE();
|
~DIALOG_ENUM_PADS_BASE();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
<wxFormBuilder_Project>
|
<wxFormBuilder_Project>
|
||||||
<FileVersion major="1" minor="11" />
|
<FileVersion major="1" minor="13" />
|
||||||
<object class="Project" expanded="1">
|
<object class="Project" expanded="1">
|
||||||
<property name="class_decoration"></property>
|
<property name="class_decoration"></property>
|
||||||
<property name="code_generation">C++</property>
|
<property name="code_generation">C++</property>
|
||||||
|
@ -20,8 +20,10 @@
|
||||||
<property name="path">.</property>
|
<property name="path">.</property>
|
||||||
<property name="precompiled_header"></property>
|
<property name="precompiled_header"></property>
|
||||||
<property name="relative_path">1</property>
|
<property name="relative_path">1</property>
|
||||||
|
<property name="skip_lua_events">1</property>
|
||||||
<property name="skip_php_events">1</property>
|
<property name="skip_php_events">1</property>
|
||||||
<property name="skip_python_events">1</property>
|
<property name="skip_python_events">1</property>
|
||||||
|
<property name="ui_table">UI</property>
|
||||||
<property name="use_enum">0</property>
|
<property name="use_enum">0</property>
|
||||||
<property name="use_microsoft_bom">0</property>
|
<property name="use_microsoft_bom">0</property>
|
||||||
<object class="Dialog" expanded="1">
|
<object class="Dialog" expanded="1">
|
||||||
|
@ -236,7 +238,88 @@
|
||||||
</object>
|
</object>
|
||||||
<object class="sizeritem" expanded="1">
|
<object class="sizeritem" expanded="1">
|
||||||
<property name="border">5</property>
|
<property name="border">5</property>
|
||||||
<property name="flag">wxEXPAND</property>
|
<property name="flag">wxEXPAND | wxALL</property>
|
||||||
|
<property name="proportion">0</property>
|
||||||
|
<object class="wxStaticLine" expanded="1">
|
||||||
|
<property name="BottomDockable">1</property>
|
||||||
|
<property name="LeftDockable">1</property>
|
||||||
|
<property name="RightDockable">1</property>
|
||||||
|
<property name="TopDockable">1</property>
|
||||||
|
<property name="aui_layer"></property>
|
||||||
|
<property name="aui_name"></property>
|
||||||
|
<property name="aui_position"></property>
|
||||||
|
<property name="aui_row"></property>
|
||||||
|
<property name="best_size"></property>
|
||||||
|
<property name="bg"></property>
|
||||||
|
<property name="caption"></property>
|
||||||
|
<property name="caption_visible">1</property>
|
||||||
|
<property name="center_pane">0</property>
|
||||||
|
<property name="close_button">1</property>
|
||||||
|
<property name="context_help"></property>
|
||||||
|
<property name="context_menu">1</property>
|
||||||
|
<property name="default_pane">0</property>
|
||||||
|
<property name="dock">Dock</property>
|
||||||
|
<property name="dock_fixed">0</property>
|
||||||
|
<property name="docking">Left</property>
|
||||||
|
<property name="enabled">1</property>
|
||||||
|
<property name="fg"></property>
|
||||||
|
<property name="floatable">1</property>
|
||||||
|
<property name="font"></property>
|
||||||
|
<property name="gripper">0</property>
|
||||||
|
<property name="hidden">0</property>
|
||||||
|
<property name="id">wxID_ANY</property>
|
||||||
|
<property name="max_size"></property>
|
||||||
|
<property name="maximize_button">0</property>
|
||||||
|
<property name="maximum_size"></property>
|
||||||
|
<property name="min_size"></property>
|
||||||
|
<property name="minimize_button">0</property>
|
||||||
|
<property name="minimum_size"></property>
|
||||||
|
<property name="moveable">1</property>
|
||||||
|
<property name="name">m_staticline1</property>
|
||||||
|
<property name="pane_border">1</property>
|
||||||
|
<property name="pane_position"></property>
|
||||||
|
<property name="pane_size"></property>
|
||||||
|
<property name="permission">protected</property>
|
||||||
|
<property name="pin_button">1</property>
|
||||||
|
<property name="pos"></property>
|
||||||
|
<property name="resize">Resizable</property>
|
||||||
|
<property name="show">1</property>
|
||||||
|
<property name="size"></property>
|
||||||
|
<property name="style">wxLI_HORIZONTAL</property>
|
||||||
|
<property name="subclass"></property>
|
||||||
|
<property name="toolbar_pane">0</property>
|
||||||
|
<property name="tooltip"></property>
|
||||||
|
<property name="window_extra_style"></property>
|
||||||
|
<property name="window_name"></property>
|
||||||
|
<property name="window_style"></property>
|
||||||
|
<event name="OnChar"></event>
|
||||||
|
<event name="OnEnterWindow"></event>
|
||||||
|
<event name="OnEraseBackground"></event>
|
||||||
|
<event name="OnKeyDown"></event>
|
||||||
|
<event name="OnKeyUp"></event>
|
||||||
|
<event name="OnKillFocus"></event>
|
||||||
|
<event name="OnLeaveWindow"></event>
|
||||||
|
<event name="OnLeftDClick"></event>
|
||||||
|
<event name="OnLeftDown"></event>
|
||||||
|
<event name="OnLeftUp"></event>
|
||||||
|
<event name="OnMiddleDClick"></event>
|
||||||
|
<event name="OnMiddleDown"></event>
|
||||||
|
<event name="OnMiddleUp"></event>
|
||||||
|
<event name="OnMotion"></event>
|
||||||
|
<event name="OnMouseEvents"></event>
|
||||||
|
<event name="OnMouseWheel"></event>
|
||||||
|
<event name="OnPaint"></event>
|
||||||
|
<event name="OnRightDClick"></event>
|
||||||
|
<event name="OnRightDown"></event>
|
||||||
|
<event name="OnRightUp"></event>
|
||||||
|
<event name="OnSetFocus"></event>
|
||||||
|
<event name="OnSize"></event>
|
||||||
|
<event name="OnUpdateUI"></event>
|
||||||
|
</object>
|
||||||
|
</object>
|
||||||
|
<object class="sizeritem" expanded="1">
|
||||||
|
<property name="border">5</property>
|
||||||
|
<property name="flag">wxEXPAND|wxALL</property>
|
||||||
<property name="proportion">0</property>
|
<property name="proportion">0</property>
|
||||||
<object class="wxStdDialogButtonSizer" expanded="1">
|
<object class="wxStdDialogButtonSizer" expanded="1">
|
||||||
<property name="Apply">0</property>
|
<property name="Apply">0</property>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Oct 8 2012)
|
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -51,6 +51,9 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow*
|
||||||
|
|
||||||
bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 );
|
bSizerMain->Add( m_footprintWizardsGrid, 1, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||||
|
bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||||
|
|
||||||
m_sdbSizer = new wxStdDialogButtonSizer();
|
m_sdbSizer = new wxStdDialogButtonSizer();
|
||||||
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
m_sdbSizerOK = new wxButton( this, wxID_OK );
|
||||||
m_sdbSizer->AddButton( m_sdbSizerOK );
|
m_sdbSizer->AddButton( m_sdbSizerOK );
|
||||||
|
@ -58,7 +61,7 @@ DIALOG_FOOTPRINT_WIZARD_LIST_BASE::DIALOG_FOOTPRINT_WIZARD_LIST_BASE( wxWindow*
|
||||||
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
m_sdbSizer->AddButton( m_sdbSizerCancel );
|
||||||
m_sdbSizer->Realize();
|
m_sdbSizer->Realize();
|
||||||
|
|
||||||
bSizerMain->Add( m_sdbSizer, 0, wxEXPAND, 5 );
|
bSizerMain->Add( m_sdbSizer, 0, wxEXPAND|wxALL, 5 );
|
||||||
|
|
||||||
|
|
||||||
this->SetSizer( bSizerMain );
|
this->SetSizer( bSizerMain );
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Oct 8 2012)
|
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||||
|
@ -20,6 +20,7 @@ class DIALOG_SHIM;
|
||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/grid.h>
|
#include <wx/grid.h>
|
||||||
#include <wx/gdicmn.h>
|
#include <wx/gdicmn.h>
|
||||||
|
#include <wx/statline.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
|
@ -36,6 +37,7 @@ class DIALOG_FOOTPRINT_WIZARD_LIST_BASE : public DIALOG_SHIM
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxGrid* m_footprintWizardsGrid;
|
wxGrid* m_footprintWizardsGrid;
|
||||||
|
wxStaticLine* m_staticline1;
|
||||||
wxStdDialogButtonSizer* m_sdbSizer;
|
wxStdDialogButtonSizer* m_sdbSizer;
|
||||||
wxButton* m_sdbSizerOK;
|
wxButton* m_sdbSizerOK;
|
||||||
wxButton* m_sdbSizerCancel;
|
wxButton* m_sdbSizerCancel;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||||
<wxFormBuilder_Project>
|
<wxFormBuilder_Project>
|
||||||
<FileVersion major="1" minor="11" />
|
<FileVersion major="1" minor="13" />
|
||||||
<object class="Project" expanded="1">
|
<object class="Project" expanded="1">
|
||||||
<property name="class_decoration"></property>
|
<property name="class_decoration"></property>
|
||||||
<property name="code_generation">C++</property>
|
<property name="code_generation">C++</property>
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
<property name="minimum_size"></property>
|
<property name="minimum_size"></property>
|
||||||
<property name="name">DIALOG_FP_PLUGIN_OPTIONS_BASE</property>
|
<property name="name">DIALOG_FP_PLUGIN_OPTIONS_BASE</property>
|
||||||
<property name="pos"></property>
|
<property name="pos"></property>
|
||||||
<property name="size">-1,-1</property>
|
<property name="size">678,342</property>
|
||||||
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER</property>
|
<property name="style">wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER</property>
|
||||||
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
<property name="subclass">DIALOG_SHIM; dialog_shim.h</property>
|
||||||
<property name="title"></property>
|
<property name="title"></property>
|
||||||
|
|
|
@ -185,7 +185,11 @@ public:
|
||||||
colors[ VRML_COLOR_TIN ] = VRML_COLOR( .749, .756, .761, .749, .756, .761,
|
colors[ VRML_COLOR_TIN ] = VRML_COLOR( .749, .756, .761, .749, .756, .761,
|
||||||
0, 0, 0, 0.8, 0, 0.8 );
|
0, 0, 0, 0.8, 0, 0.8 );
|
||||||
|
|
||||||
precision = 5;
|
plainPCB = false;
|
||||||
|
SetScale( 1.0 );
|
||||||
|
SetOffset( 0.0, 0.0 );
|
||||||
|
s_text_layer = F_Cu;
|
||||||
|
s_text_width = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VRML_COLOR& GetColor( VRML_COLOR_INDEX aIndex )
|
VRML_COLOR& GetColor( VRML_COLOR_INDEX aIndex )
|
||||||
|
@ -889,11 +893,11 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb )
|
||||||
const CPOLYGONS_LIST& poly = zone->GetFilledPolysList();
|
const CPOLYGONS_LIST& poly = zone->GetFilledPolysList();
|
||||||
int nvert = poly.GetCornersCount();
|
int nvert = poly.GetCornersCount();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
bool cutout = false;
|
||||||
|
|
||||||
while( i < nvert )
|
while( i < nvert )
|
||||||
{
|
{
|
||||||
int seg = vl->NewContour();
|
int seg = vl->NewContour();
|
||||||
bool first = true;
|
|
||||||
|
|
||||||
if( seg < 0 )
|
if( seg < 0 )
|
||||||
break;
|
break;
|
||||||
|
@ -914,10 +918,10 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb )
|
||||||
|
|
||||||
// KiCad ensures that the first polygon is the outline
|
// KiCad ensures that the first polygon is the outline
|
||||||
// and all others are holes
|
// and all others are holes
|
||||||
vl->EnsureWinding( seg, first ? false : true );
|
vl->EnsureWinding( seg, cutout );
|
||||||
|
|
||||||
if( first )
|
if( !cutout )
|
||||||
first = false;
|
cutout = true;
|
||||||
|
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,6 +327,7 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Fall through
|
// Fall through
|
||||||
|
case ID_COPY_BOARD_AS:
|
||||||
case ID_SAVE_BOARD_AS:
|
case ID_SAVE_BOARD_AS:
|
||||||
{
|
{
|
||||||
wxString pro_dir = wxPathOnly( Prj().GetProjectFullName() );
|
wxString pro_dir = wxPathOnly( Prj().GetProjectFullName() );
|
||||||
|
@ -334,7 +335,12 @@ void PCB_EDIT_FRAME::Files_io( wxCommandEvent& event )
|
||||||
wxString filename = fn.GetFullPath();
|
wxString filename = fn.GetFullPath();
|
||||||
|
|
||||||
if( AskSaveBoardFileName( this, &filename ) )
|
if( AskSaveBoardFileName( this, &filename ) )
|
||||||
SavePcbFile( filename, true );
|
{
|
||||||
|
if( id == ID_COPY_BOARD_AS )
|
||||||
|
SavePcbCopy( filename );
|
||||||
|
else
|
||||||
|
SavePcbFile( filename, NO_BACKUP_FILE );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -412,7 +418,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
||||||
if( response == wxID_CANCEL )
|
if( response == wxID_CANCEL )
|
||||||
return false;
|
return false;
|
||||||
else if( response == wxID_YES )
|
else if( response == wxID_YES )
|
||||||
SavePcbFile( GetBoard()->GetFileName(), true );
|
SavePcbFile( GetBoard()->GetFileName(), CREATE_BACKUP_FILE );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// response == wxID_NO, fall thru
|
// response == wxID_NO, fall thru
|
||||||
|
@ -660,6 +666,8 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
|
|
||||||
wxString backupFileName;
|
wxString backupFileName;
|
||||||
|
|
||||||
|
// aCreateBackupFile == false is mainly used to write autosave files
|
||||||
|
// or new files in save as... command
|
||||||
if( aCreateBackupFile )
|
if( aCreateBackupFile )
|
||||||
{
|
{
|
||||||
backupFileName = create_backup_file( aFileName );
|
backupFileName = create_backup_file( aFileName );
|
||||||
|
@ -733,6 +741,58 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool PCB_EDIT_FRAME::SavePcbCopy( const wxString& aFileName )
|
||||||
|
{
|
||||||
|
wxFileName pcbFileName = aFileName;
|
||||||
|
|
||||||
|
// Ensure the file ext is the right ext:
|
||||||
|
pcbFileName.SetExt( KiCadPcbFileExtension );
|
||||||
|
|
||||||
|
if( !IsWritable( pcbFileName ) )
|
||||||
|
{
|
||||||
|
wxString msg = wxString::Format( _(
|
||||||
|
"No access rights to write to file '%s'" ),
|
||||||
|
GetChars( pcbFileName.GetFullPath() )
|
||||||
|
);
|
||||||
|
|
||||||
|
DisplayError( this, msg );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetBoard()->m_Status_Pcb &= ~CONNEXION_OK;
|
||||||
|
GetBoard()->SynchronizeNetsAndNetClasses();
|
||||||
|
|
||||||
|
// Select default Netclass before writing file.
|
||||||
|
// Useful to save default values in headers
|
||||||
|
SetCurrentNetClass( NETCLASS::Default );
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PLUGIN::RELEASER pi( IO_MGR::PluginFind( IO_MGR::KICAD ) );
|
||||||
|
|
||||||
|
wxASSERT( pcbFileName.IsAbsolute() );
|
||||||
|
|
||||||
|
pi->Save( pcbFileName.GetFullPath(), GetBoard(), NULL );
|
||||||
|
}
|
||||||
|
catch( const IO_ERROR& ioe )
|
||||||
|
{
|
||||||
|
wxString msg = wxString::Format( _(
|
||||||
|
"Error saving board file '%s'.\n%s" ),
|
||||||
|
GetChars( pcbFileName.GetFullPath() ),
|
||||||
|
GetChars( ioe.errorText )
|
||||||
|
);
|
||||||
|
DisplayError( this, msg );
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DisplayInfoMessage( this, wxString::Format( _( "Board copied to:\n'%s'" ),
|
||||||
|
GetChars( pcbFileName.GetFullPath() ) ) );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PCB_EDIT_FRAME::doAutoSave()
|
bool PCB_EDIT_FRAME::doAutoSave()
|
||||||
{
|
{
|
||||||
wxFileName tmpFileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
|
wxFileName tmpFileName = Prj().AbsolutePath( GetBoard()->GetFileName() );
|
||||||
|
|
|
@ -110,8 +110,7 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
|
||||||
if( module )
|
if( module )
|
||||||
{
|
{
|
||||||
// Add the object to board
|
// Add the object to board
|
||||||
module->SetParent( (EDA_ITEM*) GetBoard() );
|
GetBoard()->Add( module, ADD_APPEND );
|
||||||
GetBoard()->m_Modules.Append( module );
|
|
||||||
module->SetPosition( wxPoint( 0, 0 ) );
|
module->SetPosition( wxPoint( 0, 0 ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -379,7 +379,7 @@ void GITHUB_PLUGIN::FootprintLibOptions( PROPERTIES* aListToAppendTo ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aProperties ) throw( IO_ERROR )
|
void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aProperties )
|
||||||
{
|
{
|
||||||
// This is edge triggered based on a change in 'aLibraryPath',
|
// This is edge triggered based on a change in 'aLibraryPath',
|
||||||
// usually it does nothing. When the edge fires, m_pretty_dir is set
|
// usually it does nothing. When the edge fires, m_pretty_dir is set
|
||||||
|
|
|
@ -200,7 +200,7 @@ protected:
|
||||||
|
|
||||||
void init( const PROPERTIES* aProperties );
|
void init( const PROPERTIES* aProperties );
|
||||||
|
|
||||||
void cacheLib( const wxString& aLibraryPath, const PROPERTIES* aProperties ) throw( IO_ERROR );
|
void cacheLib( const wxString& aLibraryPath, const PROPERTIES* aProperties );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function repoURL_zipURL
|
* Function repoURL_zipURL
|
||||||
|
|
|
@ -88,7 +88,6 @@ void filterNetClass( const BOARD& aBoard, NETCLASS& aNetClass )
|
||||||
class FP_CACHE_ITEM
|
class FP_CACHE_ITEM
|
||||||
{
|
{
|
||||||
wxFileName m_file_name; ///< The the full file name and path of the footprint to cache.
|
wxFileName m_file_name; ///< The the full file name and path of the footprint to cache.
|
||||||
bool m_writable; ///< Writability status of the footprint file.
|
|
||||||
wxDateTime m_mod_time; ///< The last file modified time stamp.
|
wxDateTime m_mod_time; ///< The last file modified time stamp.
|
||||||
std::auto_ptr<MODULE> m_module;
|
std::auto_ptr<MODULE> m_module;
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,8 @@ void LEGACY_NETLIST_READER::LoadNetlist() throw ( IO_ERROR, PARSE_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText ) throw( PARSE_ERROR )
|
COMPONENT* LEGACY_NETLIST_READER::loadComponent( char* aText )
|
||||||
|
throw( PARSE_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
char* text;
|
char* text;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
|
@ -96,12 +96,13 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
|
||||||
|
|
||||||
newModule->ClearFlags();
|
newModule->ClearFlags();
|
||||||
|
|
||||||
// Clear references to net info, because the footprint editor
|
// Clear references to any net info, because the footprint editor
|
||||||
// does know any thing about nets handled by the current edited board.
|
// does know any thing about nets handled by the current edited board.
|
||||||
// Morever the main board can change or the net info relative to this main board
|
// Morever we do not want to save any reference to an unknown net when
|
||||||
// can change while editing this footprint in the footprint editor
|
// saving the footprint in lib cache
|
||||||
|
// so we force the ORPHANED dummy net info for all pads
|
||||||
for( D_PAD* pad = newModule->Pads(); pad; pad = pad->Next() )
|
for( D_PAD* pad = newModule->Pads(); pad; pad = pad->Next() )
|
||||||
pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED );
|
||||||
|
|
||||||
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
||||||
PlaceModule( newModule, NULL );
|
PlaceModule( newModule, NULL );
|
||||||
|
@ -269,6 +270,7 @@ MODULE* PCB_BASE_FRAME::LoadModuleFromLibrary( const wxString& aLibrary,
|
||||||
if( module )
|
if( module )
|
||||||
{
|
{
|
||||||
GetBoard()->Add( module, ADD_APPEND );
|
GetBoard()->Add( module, ADD_APPEND );
|
||||||
|
|
||||||
lastComponentName = moduleName;
|
lastComponentName = moduleName;
|
||||||
AddHistoryComponentName( HistoryList, moduleName );
|
AddHistoryComponentName( HistoryList, moduleName );
|
||||||
|
|
||||||
|
@ -328,7 +330,16 @@ MODULE* PCB_BASE_FRAME::loadFootprint( const FPID& aFootprintId )
|
||||||
|
|
||||||
wxCHECK_MSG( fptbl, NULL, wxT( "Cannot look up FPID in NULL FP_LIB_TABLE." ) );
|
wxCHECK_MSG( fptbl, NULL, wxT( "Cannot look up FPID in NULL FP_LIB_TABLE." ) );
|
||||||
|
|
||||||
return fptbl->FootprintLoadWithOptionalNickname( aFootprintId );
|
MODULE* module = fptbl->FootprintLoadWithOptionalNickname( aFootprintId );
|
||||||
|
|
||||||
|
// Clear all references to any net info, to be sure there is no broken links
|
||||||
|
// to any netinfo list (should be not needed, but...)
|
||||||
|
#if 0 // FIXME : currently crashes Pcbnew. should not.
|
||||||
|
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
|
||||||
|
pad->SetNetCode( NETINFO_LIST::FORCE_ORPHANED );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -111,14 +111,29 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
||||||
_( "Save current board" ),
|
_( "Save current board" ),
|
||||||
KiBitmap( save_xpm ) );
|
KiBitmap( save_xpm ) );
|
||||||
|
|
||||||
if( Kiface().IsSingle() ) // not when under a project mgr
|
// Save as menu:
|
||||||
|
// under a project mgr we do not want to modify the board filename
|
||||||
|
// to keep consistency with the project mgr which expects files names same as prj name
|
||||||
|
// for main files
|
||||||
|
// when not under a project mgr, we are free to change filenames, cwd ...
|
||||||
|
if( Kiface().IsSingle() ) // not when under a project mgr (pcbnew is run as stand alone)
|
||||||
{
|
{
|
||||||
text = AddHotkeyName( _( "Sa&ve As..." ), g_Board_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
|
text = AddHotkeyName( _( "Sa&ve As..." ), g_Board_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
|
||||||
AddMenuItem( filesMenu, ID_SAVE_BOARD_AS, text,
|
AddMenuItem( filesMenu, ID_SAVE_BOARD_AS, text,
|
||||||
_( "Save the current board as..." ),
|
_( "Save the current board as..." ),
|
||||||
KiBitmap( save_as_xpm ) );
|
KiBitmap( save_as_xpm ) );
|
||||||
filesMenu->AppendSeparator();
|
|
||||||
}
|
}
|
||||||
|
// under a project mgr, we can save a copy of the board,
|
||||||
|
// but do not change the current board file name
|
||||||
|
else
|
||||||
|
{
|
||||||
|
text = AddHotkeyName( _( "Sa&ve Copy As..." ), g_Board_Editor_Hokeys_Descr, HK_SAVE_BOARD_AS );
|
||||||
|
AddMenuItem( filesMenu, ID_COPY_BOARD_AS, text,
|
||||||
|
_( "Save a copy of the current board as..." ),
|
||||||
|
KiBitmap( save_as_xpm ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
filesMenu->AppendSeparator();
|
||||||
|
|
||||||
AddMenuItem( filesMenu, ID_MENU_READ_BOARD_BACKUP_FILE,
|
AddMenuItem( filesMenu, ID_MENU_READ_BOARD_BACKUP_FILE,
|
||||||
_( "Revert to Last" ),
|
_( "Revert to Last" ),
|
||||||
|
|
|
@ -120,8 +120,8 @@ BOARD_ITEM* FOOTPRINT_EDIT_FRAME::ModeditLocateAndDisplay( int aHotKeyCode )
|
||||||
{
|
{
|
||||||
wxMenu itemMenu;
|
wxMenu itemMenu;
|
||||||
|
|
||||||
// Give a title to the selection menu. This is also a cancel menu item *
|
// Give a title to the selection menu. It also allow to close the popup menu without any action
|
||||||
wxMenuItem* item_title = new wxMenuItem( &itemMenu, -1, _( "Selection Clarification" ) );
|
wxMenuItem* item_title = new wxMenuItem( &itemMenu, wxID_NONE, _( "Selection Clarification" ) );
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
wxFont bold_font( *wxNORMAL_FONT );
|
wxFont bold_font( *wxNORMAL_FONT );
|
||||||
|
@ -195,7 +195,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
bool redraw = false;
|
|
||||||
|
|
||||||
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
INSTALL_UNBUFFERED_DC( dc, m_canvas );
|
||||||
|
|
||||||
|
@ -308,7 +307,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
// module the defaults are used)
|
// module the defaults are used)
|
||||||
// This is mandatory to handle and draw pads
|
// This is mandatory to handle and draw pads
|
||||||
GetBoard()->BuildListOfNets();
|
GetBoard()->BuildListOfNets();
|
||||||
redraw = true;
|
|
||||||
module->SetPosition( wxPoint( 0, 0 ) );
|
module->SetPosition( wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
|
@ -317,8 +315,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( IsGalCanvasActive() )
|
|
||||||
updateView();
|
updateView();
|
||||||
|
m_canvas->Refresh();
|
||||||
|
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
}
|
}
|
||||||
|
@ -349,18 +347,18 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
// Add the new object to board
|
// Add the new object to board
|
||||||
module->SetParent( (EDA_ITEM*)GetBoard() );
|
GetBoard()->Add( module, ADD_APPEND );
|
||||||
GetBoard()->m_Modules.Append( module );
|
|
||||||
|
|
||||||
// Initialize data relative to nets and netclasses (for a new
|
// Initialize data relative to nets and netclasses (for a new
|
||||||
// module the defaults are used)
|
// module the defaults are used)
|
||||||
// This is mandatory to handle and draw pads
|
// This is mandatory to handle and draw pads
|
||||||
GetBoard()->BuildListOfNets();
|
GetBoard()->BuildListOfNets();
|
||||||
redraw = true;
|
|
||||||
module->SetPosition( wxPoint( 0, 0 ) );
|
module->SetPosition( wxPoint( 0, 0 ) );
|
||||||
module->ClearFlags();
|
module->ClearFlags();
|
||||||
|
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
|
updateView();
|
||||||
|
m_canvas->Refresh();
|
||||||
|
|
||||||
if( m_Draw3DFrame )
|
if( m_Draw3DFrame )
|
||||||
m_Draw3DFrame->NewDisplay();
|
m_Draw3DFrame->NewDisplay();
|
||||||
|
@ -492,13 +490,13 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
|
|
||||||
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
||||||
Import_Module();
|
Import_Module();
|
||||||
redraw = true;
|
|
||||||
|
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
GetBoard()->m_Modules->ClearFlags();
|
GetBoard()->m_Modules->ClearFlags();
|
||||||
|
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
|
m_canvas->Refresh();
|
||||||
|
|
||||||
if( m_Draw3DFrame )
|
if( m_Draw3DFrame )
|
||||||
m_Draw3DFrame->NewDisplay();
|
m_Draw3DFrame->NewDisplay();
|
||||||
|
@ -532,7 +530,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
SetCrossHairPosition( wxPoint( 0, 0 ) );
|
||||||
|
|
||||||
LoadModuleFromLibrary( GetCurrentLib(), Prj().PcbFootprintLibs(), true );
|
LoadModuleFromLibrary( GetCurrentLib(), Prj().PcbFootprintLibs(), true );
|
||||||
redraw = true;
|
|
||||||
|
|
||||||
if( GetBoard()->m_Modules )
|
if( GetBoard()->m_Modules )
|
||||||
GetBoard()->m_Modules->ClearFlags();
|
GetBoard()->m_Modules->ClearFlags();
|
||||||
|
@ -564,7 +561,9 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
m_Draw3DFrame->NewDisplay();
|
m_Draw3DFrame->NewDisplay();
|
||||||
|
|
||||||
GetScreen()->ClrModify();
|
GetScreen()->ClrModify();
|
||||||
|
|
||||||
updateView();
|
updateView();
|
||||||
|
m_canvas->Refresh();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -600,23 +599,21 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
|
case ID_POPUP_PCB_ROTATE_MODULE_COUNTERCLOCKWISE:
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), 900, true );
|
Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), 900, true );
|
||||||
redraw = true;
|
m_canvas->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
|
case ID_POPUP_PCB_ROTATE_MODULE_CLOCKWISE:
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), -900, true );
|
Rotate_Module( NULL, (MODULE*) GetScreen()->GetCurItem(), -900, true );
|
||||||
redraw = true;
|
m_canvas->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_POPUP_PCB_EDIT_MODULE_PRMS:
|
case ID_POPUP_PCB_EDIT_MODULE_PRMS:
|
||||||
{
|
{
|
||||||
DIALOG_MODULE_MODULE_EDITOR dialog( this, (MODULE*) GetScreen()->GetCurItem() );
|
DIALOG_MODULE_MODULE_EDITOR dialog( this, (MODULE*) GetScreen()->GetCurItem() );
|
||||||
int ret = dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
GetScreen()->GetCurItem()->ClearFlags();
|
GetScreen()->GetCurItem()->ClearFlags();
|
||||||
m_canvas->MoveCursorToCrossHair();
|
m_canvas->MoveCursorToCrossHair();
|
||||||
|
|
||||||
if( ret > 0 )
|
|
||||||
m_canvas->Refresh();
|
m_canvas->Refresh();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -696,6 +693,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH:
|
case ID_POPUP_MODEDIT_ENTER_EDGE_WIDTH:
|
||||||
{
|
{
|
||||||
EDGE_MODULE* edge = NULL;
|
EDGE_MODULE* edge = NULL;
|
||||||
|
|
||||||
if( GetScreen()->GetCurItem()
|
if( GetScreen()->GetCurItem()
|
||||||
&& ( GetScreen()->GetCurItem()->Type() == PCB_MODULE_EDGE_T ) )
|
&& ( GetScreen()->GetCurItem()->Type() == PCB_MODULE_EDGE_T ) )
|
||||||
{
|
{
|
||||||
|
@ -739,7 +737,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case ID_MODEDIT_MODULE_MIRROR:
|
case ID_MODEDIT_MODULE_MIRROR:
|
||||||
SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT );
|
SaveCopyInUndoList( GetBoard()->m_Modules, UR_MODEDIT );
|
||||||
Transform( (MODULE*) GetScreen()->GetCurItem(), id );
|
Transform( (MODULE*) GetScreen()->GetCurItem(), id );
|
||||||
redraw = true;
|
m_canvas->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_PCB_DRAWINGS_WIDTHS_SETUP:
|
case ID_PCB_DRAWINGS_WIDTHS_SETUP:
|
||||||
|
@ -811,9 +809,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
||||||
wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
|
wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( redraw )
|
|
||||||
m_canvas->Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -126,9 +126,9 @@ NETLIST_READER* NETLIST_READER::GetNetlistReader( NETLIST* aNetlist,
|
||||||
|
|
||||||
default: // Unrecognized format:
|
default: // Unrecognized format:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete cmpFileReader;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@ class LEGACY_NETLIST_READER : public NETLIST_READER
|
||||||
* @return the new component created by parsing \a aLine
|
* @return the new component created by parsing \a aLine
|
||||||
* @throw PARSE_ERROR when \a aLine is not a valid component description.
|
* @throw PARSE_ERROR when \a aLine is not a valid component description.
|
||||||
*/
|
*/
|
||||||
COMPONENT* loadComponent( char* aText ) throw( PARSE_ERROR );
|
COMPONENT* loadComponent( char* aText ) throw( PARSE_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function loadFootprintFilters
|
* Function loadFootprintFilters
|
||||||
|
|
|
@ -161,9 +161,10 @@ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw )
|
||||||
// Add the new pad to end of the module pad list.
|
// Add the new pad to end of the module pad list.
|
||||||
aModule->Pads().PushBack( pad );
|
aModule->Pads().PushBack( pad );
|
||||||
|
|
||||||
// Update the pad properties.
|
// Update the pad properties,
|
||||||
|
// and keep NETINFO_LIST::ORPHANED as net info
|
||||||
|
// which is the default when nets cannot be handled.
|
||||||
Import_Pad_Settings( pad, false );
|
Import_Pad_Settings( pad, false );
|
||||||
pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
|
|
||||||
|
|
||||||
pad->SetPosition( GetCrossHairPosition() );
|
pad->SetPosition( GetCrossHairPosition() );
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ void PCB_PARSER::parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
S3D_MASTER* PCB_PARSER::parse3DModel() throw( PARSE_ERROR )
|
S3D_MASTER* PCB_PARSER::parse3DModel() throw( PARSE_ERROR, IO_ERROR )
|
||||||
{
|
{
|
||||||
wxCHECK_MSG( CurTok() == T_model, NULL,
|
wxCHECK_MSG( CurTok() == T_model, NULL,
|
||||||
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as S3D_MASTER." ) );
|
wxT( "Cannot parse " ) + GetTokenString( CurTok() ) + wxT( " as S3D_MASTER." ) );
|
||||||
|
|
|
@ -185,7 +185,7 @@ class PCB_PARSER : public PCB_LEXER
|
||||||
*/
|
*/
|
||||||
void parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR );
|
void parseEDA_TEXT( EDA_TEXT* aText ) throw( PARSE_ERROR );
|
||||||
|
|
||||||
S3D_MASTER* parse3DModel() throw( PARSE_ERROR );
|
S3D_MASTER* parse3DModel() throw( PARSE_ERROR, IO_ERROR );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function parseDouble
|
* Function parseDouble
|
||||||
|
@ -219,7 +219,7 @@ class PCB_PARSER : public PCB_LEXER
|
||||||
return KiROUND( parseDouble() * IU_PER_MM );
|
return KiROUND( parseDouble() * IU_PER_MM );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int parseBoardUnits( const char* aExpected ) throw( PARSE_ERROR )
|
inline int parseBoardUnits( const char* aExpected ) throw( PARSE_ERROR, IO_ERROR )
|
||||||
{
|
{
|
||||||
// Use here KiROUND, not KIROUND (see comments about them)
|
// Use here KiROUND, not KIROUND (see comments about them)
|
||||||
// when having a function as argument, because it will be called twice
|
// when having a function as argument, because it will be called twice
|
||||||
|
|
|
@ -120,6 +120,7 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
|
||||||
|
|
||||||
EVT_MENU( ID_APPEND_FILE, PCB_EDIT_FRAME::Files_io )
|
EVT_MENU( ID_APPEND_FILE, PCB_EDIT_FRAME::Files_io )
|
||||||
EVT_MENU( ID_SAVE_BOARD_AS, PCB_EDIT_FRAME::Files_io )
|
EVT_MENU( ID_SAVE_BOARD_AS, PCB_EDIT_FRAME::Files_io )
|
||||||
|
EVT_MENU( ID_COPY_BOARD_AS, PCB_EDIT_FRAME::Files_io )
|
||||||
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PCB_EDIT_FRAME::OnFileHistory )
|
EVT_MENU_RANGE( wxID_FILE1, wxID_FILE9, PCB_EDIT_FRAME::OnFileHistory )
|
||||||
|
|
||||||
EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )
|
EVT_MENU( ID_GEN_PLOT, PCB_EDIT_FRAME::ToPlotter )
|
||||||
|
@ -693,24 +694,26 @@ void PCB_EDIT_FRAME::UseGalCanvas( bool aEnable )
|
||||||
void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
|
void PCB_EDIT_FRAME::SwitchCanvas( wxCommandEvent& aEvent )
|
||||||
{
|
{
|
||||||
int id = aEvent.GetId();
|
int id = aEvent.GetId();
|
||||||
|
bool use_gal = false;
|
||||||
|
|
||||||
switch( id )
|
switch( id )
|
||||||
{
|
{
|
||||||
case ID_MENU_CANVAS_DEFAULT:
|
case ID_MENU_CANVAS_DEFAULT:
|
||||||
Compile_Ratsnest( NULL, true );
|
|
||||||
UseGalCanvas( false );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MENU_CANVAS_CAIRO:
|
case ID_MENU_CANVAS_CAIRO:
|
||||||
GetGalCanvas()->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
|
use_gal = GetGalCanvas()->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
|
||||||
UseGalCanvas( true );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_MENU_CANVAS_OPENGL:
|
case ID_MENU_CANVAS_OPENGL:
|
||||||
GetGalCanvas()->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
|
use_gal = GetGalCanvas()->SwitchBackend( EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL );
|
||||||
UseGalCanvas( true );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !use_gal )
|
||||||
|
Compile_Ratsnest( NULL, true );
|
||||||
|
|
||||||
|
UseGalCanvas( use_gal );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -109,15 +109,16 @@ static struct IFACE : public KIFACE_I
|
||||||
|
|
||||||
wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 )
|
wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 )
|
||||||
{
|
{
|
||||||
|
wxWindow* frame = NULL;
|
||||||
|
|
||||||
switch( aClassId )
|
switch( aClassId )
|
||||||
{
|
{
|
||||||
case FRAME_PCB:
|
case FRAME_PCB:
|
||||||
{
|
frame = dynamic_cast< wxWindow* >( new PCB_EDIT_FRAME( aKiway, aParent ) );
|
||||||
PCB_EDIT_FRAME* frame = new PCB_EDIT_FRAME( aKiway, aParent );
|
|
||||||
|
|
||||||
#if defined(KICAD_SCRIPTING)
|
#if defined( KICAD_SCRIPTING )
|
||||||
// give the scripting helpers access to our frame
|
// give the scripting helpers access to our frame
|
||||||
ScriptingSetPcbEditFrame( frame );
|
ScriptingSetPcbEditFrame( (PCB_EDIT_FRAME*) frame );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( Kiface().IsSingle() )
|
if( Kiface().IsSingle() )
|
||||||
|
@ -125,41 +126,29 @@ static struct IFACE : public KIFACE_I
|
||||||
// only run this under single_top, not under a project manager.
|
// only run this under single_top, not under a project manager.
|
||||||
CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER );
|
CreateServer( frame, KICAD_PCB_PORT_SERVICE_NUMBER );
|
||||||
}
|
}
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FRAME_PCB_MODULE_EDITOR:
|
case FRAME_PCB_MODULE_EDITOR:
|
||||||
{
|
frame = dynamic_cast< wxWindow* >( new FOOTPRINT_EDIT_FRAME( aKiway, aParent ) );
|
||||||
FOOTPRINT_EDIT_FRAME* frame = new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FRAME_PCB_MODULE_VIEWER:
|
case FRAME_PCB_MODULE_VIEWER:
|
||||||
case FRAME_PCB_MODULE_VIEWER_MODAL:
|
case FRAME_PCB_MODULE_VIEWER_MODAL:
|
||||||
{
|
frame = dynamic_cast< wxWindow* >( new FOOTPRINT_VIEWER_FRAME( aKiway, aParent,
|
||||||
FOOTPRINT_VIEWER_FRAME* frame = new FOOTPRINT_VIEWER_FRAME(
|
FRAME_T( aClassId ) ) );
|
||||||
aKiway, aParent, FRAME_T( aClassId ) );
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FRAME_PCB_FOOTPRINT_WIZARD_MODAL:
|
case FRAME_PCB_FOOTPRINT_WIZARD_MODAL:
|
||||||
{
|
frame = dynamic_cast< wxWindow* >( new FOOTPRINT_WIZARD_FRAME( aKiway, aParent,
|
||||||
FOOTPRINT_WIZARD_FRAME* frame = new FOOTPRINT_WIZARD_FRAME(
|
FRAME_T( aClassId ) ) );
|
||||||
aKiway, aParent, FRAME_T( aClassId ) );
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,7 +188,7 @@ MY_API( KIFACE* ) KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BA
|
||||||
return &kiface;
|
return &kiface;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(BUILD_KIWAY_DLL)
|
#if defined( BUILD_KIWAY_DLL )
|
||||||
PGM_BASE& Pgm()
|
PGM_BASE& Pgm()
|
||||||
{
|
{
|
||||||
wxASSERT( process ); // KIFACE_GETTER has already been called.
|
wxASSERT( process ); // KIFACE_GETTER has already been called.
|
||||||
|
@ -208,7 +197,7 @@ PGM_BASE& Pgm()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(KICAD_SCRIPTING)
|
#if defined( KICAD_SCRIPTING )
|
||||||
static bool scriptingSetup()
|
static bool scriptingSetup()
|
||||||
{
|
{
|
||||||
wxString path_frag;
|
wxString path_frag;
|
||||||
|
@ -218,7 +207,7 @@ static bool scriptingSetup()
|
||||||
const wxString python_us( "python27_us" );
|
const wxString python_us( "python27_us" );
|
||||||
|
|
||||||
// Build our python path inside kicad
|
// Build our python path inside kicad
|
||||||
wxString kipython = FindKicadFile( python_us + wxT("/python.exe") );
|
wxString kipython = FindKicadFile( python_us + wxT( "/python.exe" ) );
|
||||||
|
|
||||||
//we need only the path:
|
//we need only the path:
|
||||||
wxFileName fn( kipython );
|
wxFileName fn( kipython );
|
||||||
|
@ -231,19 +220,20 @@ static bool scriptingSetup()
|
||||||
|
|
||||||
if( !wxGetEnv( wxT( "PYTHONPATH" ), &ppath ) || !ppath.Contains( python_us ) )
|
if( !wxGetEnv( wxT( "PYTHONPATH" ), &ppath ) || !ppath.Contains( python_us ) )
|
||||||
{
|
{
|
||||||
ppath << kipython << wxT("/pylib;");
|
ppath << kipython << wxT( "/pylib;" );
|
||||||
ppath << kipython << wxT("/lib;");
|
ppath << kipython << wxT( "/lib;" );
|
||||||
ppath << kipython << wxT("/dll");
|
ppath << kipython << wxT( "/dll" );
|
||||||
wxSetEnv( wxT( "PYTHONPATH" ), ppath );
|
wxSetEnv( wxT( "PYTHONPATH" ), ppath );
|
||||||
DBG( std::cout << "set PYTHONPATH to " << TO_UTF8(ppath) << "\n"; )
|
// DBG( std::cout << "set PYTHONPATH to " << TO_UTF8( ppath ) << "\n"; )
|
||||||
|
|
||||||
// Add python executable path:
|
// Add python executable path:
|
||||||
wxGetEnv( wxT( "PATH" ), &ppath );
|
wxGetEnv( wxT( "PATH" ), &ppath );
|
||||||
|
|
||||||
if( !ppath.Contains( python_us ) )
|
if( !ppath.Contains( python_us ) )
|
||||||
{
|
{
|
||||||
kipython << wxT(";") << ppath;
|
kipython << wxT( ";" ) << ppath;
|
||||||
wxSetEnv( wxT( "PATH" ), kipython );
|
wxSetEnv( wxT( "PATH" ), kipython );
|
||||||
DBG( std::cout << "set PATH to " << TO_UTF8(kipython) << "\n"; )
|
// DBG( std::cout << "set PATH to " << TO_UTF8( kipython ) << "\n"; )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,14 +253,20 @@ static bool scriptingSetup()
|
||||||
|
|
||||||
// Add default paths to PYTHONPATH
|
// Add default paths to PYTHONPATH
|
||||||
wxString pypath;
|
wxString pypath;
|
||||||
|
|
||||||
// User scripting folder (~/Library/Application Support/kicad/scripting/plugins)
|
// User scripting folder (~/Library/Application Support/kicad/scripting/plugins)
|
||||||
pypath = GetOSXKicadUserDataDir() + wxT( "/scripting/plugins" );
|
pypath = GetOSXKicadUserDataDir() + wxT( "/scripting/plugins" );
|
||||||
|
|
||||||
// Machine scripting folder (/Library/Application Support/kicad/scripting/plugins)
|
// Machine scripting folder (/Library/Application Support/kicad/scripting/plugins)
|
||||||
pypath += wxT( ":" ) + GetOSXKicadMachineDataDir() + wxT( "/scripting/plugins" );
|
pypath += wxT( ":" ) + GetOSXKicadMachineDataDir() + wxT( "/scripting/plugins" );
|
||||||
|
|
||||||
// Bundle scripting folder (<kicad.app>/Contents/SharedSupport/scripting/plugins)
|
// Bundle scripting folder (<kicad.app>/Contents/SharedSupport/scripting/plugins)
|
||||||
pypath += wxT( ":" ) + GetOSXKicadDataDir() + wxT( "/scripting/plugins" );
|
pypath += wxT( ":" ) + GetOSXKicadDataDir() + wxT( "/scripting/plugins" );
|
||||||
|
|
||||||
// Bundle wxPython folder (<kicad.app>/Contents/Frameworks/python/site-packages)
|
// Bundle wxPython folder (<kicad.app>/Contents/Frameworks/python/site-packages)
|
||||||
pypath += wxT( ":" ) + Pgm().GetExecutablePath() + wxT( "Contents/Frameworks/python/site-packages" );
|
pypath += wxT( ":" ) + Pgm().GetExecutablePath() +
|
||||||
|
wxT( "Contents/Frameworks/python/site-packages" );
|
||||||
|
|
||||||
// Original content of $PYTHONPATH
|
// Original content of $PYTHONPATH
|
||||||
if( wxGetenv("PYTHONPATH") != NULL )
|
if( wxGetenv("PYTHONPATH") != NULL )
|
||||||
{
|
{
|
||||||
|
@ -289,6 +285,7 @@ static bool scriptingSetup()
|
||||||
wxLogSysError( wxT( "pcbnewInitPythonScripting() failed." ) );
|
wxLogSysError( wxT( "pcbnewInitPythonScripting() failed." ) );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif // KICAD_SCRIPTING
|
#endif // KICAD_SCRIPTING
|
||||||
|
|
|
@ -21,6 +21,7 @@ enum pcbnew_ids
|
||||||
ID_OPEN_MODULE_VIEWER,
|
ID_OPEN_MODULE_VIEWER,
|
||||||
ID_READ_NETLIST,
|
ID_READ_NETLIST,
|
||||||
ID_SET_RELATIVE_OFFSET,
|
ID_SET_RELATIVE_OFFSET,
|
||||||
|
ID_COPY_BOARD_AS,
|
||||||
|
|
||||||
// Right vertical tool bar command IDs.
|
// Right vertical tool bar command IDs.
|
||||||
ID_PCB_HIGHLIGHT_BUTT,
|
ID_PCB_HIGHLIGHT_BUTT,
|
||||||
|
|
|
@ -725,7 +725,7 @@ void ROUTER_TOOL::performRouting()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ROUTER_TOOL::Main( TOOL_EVENT& aEvent )
|
int ROUTER_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
VIEW_CONTROLS* ctls = getViewControls();
|
VIEW_CONTROLS* ctls = getViewControls();
|
||||||
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
|
PCB_EDIT_FRAME* frame = getEditFrame<PCB_EDIT_FRAME>();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public:
|
||||||
~ROUTER_TOOL();
|
~ROUTER_TOOL();
|
||||||
|
|
||||||
void Reset( RESET_REASON aReason );
|
void Reset( RESET_REASON aReason );
|
||||||
int Main( TOOL_EVENT& aEvent );
|
int Main( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PNS_ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1 );
|
PNS_ITEM* pickSingleItem( const VECTOR2I& aWhere, int aNet = -1, int aLayer = -1 );
|
||||||
|
|
|
@ -294,7 +294,7 @@ void SPECCTRA_DB::LoadSESSION( const wxString& filename ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doPCB( PCB* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doPCB( PCB* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -602,7 +602,8 @@ void SPECCTRA_DB::doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth )
|
||||||
|
throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -755,7 +756,7 @@ L_place:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
<structure_out_descriptor >::=
|
<structure_out_descriptor >::=
|
||||||
|
@ -798,7 +799,7 @@ void SPECCTRA_DB::doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -974,7 +975,7 @@ void SPECCTRA_DB::doWINDOW( WINDOW* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -1196,7 +1197,7 @@ void SPECCTRA_DB::doVIA( VIA* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doCONTROL( CONTROL* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -1520,7 +1521,7 @@ void SPECCTRA_DB::doPLACE_RULE( PLACE_RULE* growth, bool expect_object_type ) th
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -1589,7 +1590,7 @@ void SPECCTRA_DB::doREGION( REGION* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -1862,7 +1863,7 @@ void SPECCTRA_DB::doPLACE( PLACE* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -1892,7 +1893,7 @@ void SPECCTRA_DB::doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -1947,7 +1948,7 @@ void SPECCTRA_DB::doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -2047,7 +2048,7 @@ void SPECCTRA_DB::doPADSTACK( PADSTACK* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doSHAPE( SHAPE* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doSHAPE( SHAPE* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2130,7 +2131,7 @@ L_done_that:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doIMAGE( IMAGE* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doIMAGE( IMAGE* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
|
|
||||||
|
@ -2273,7 +2274,7 @@ void SPECCTRA_DB::doPIN( PIN* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2327,7 +2328,7 @@ void SPECCTRA_DB::doLIBRARY( LIBRARY* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doNET( NET* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doNET( NET* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok = NextTok();
|
T tok = NextTok();
|
||||||
PIN_REFS* pin_refs;
|
PIN_REFS* pin_refs;
|
||||||
|
@ -2467,7 +2468,7 @@ L_pins:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2505,7 +2506,7 @@ void SPECCTRA_DB::doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2615,7 +2616,7 @@ void SPECCTRA_DB::doCLASS( CLASS* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doNETWORK( NETWORK* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doNETWORK( NETWORK* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2678,7 +2679,7 @@ void SPECCTRA_DB::doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2764,7 +2765,7 @@ void SPECCTRA_DB::doFROMTO( FROMTO* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doWIRE( WIRE* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -2989,7 +2990,7 @@ void SPECCTRA_DB::doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doWIRING( WIRING* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -3083,7 +3084,7 @@ void SPECCTRA_DB::doANCESTOR( ANCESTOR* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -3139,7 +3140,7 @@ void SPECCTRA_DB::doHISTORY( HISTORY* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doSESSION( SESSION* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -3257,7 +3258,7 @@ void SPECCTRA_DB::doWAS_IS( WAS_IS* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doROUTE( ROUTE* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doROUTE( ROUTE* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
@ -3340,7 +3341,7 @@ void SPECCTRA_DB::doROUTE( ROUTE* growth ) throw( IO_ERROR )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::doNET_OUT( NET_OUT* growth ) throw( IO_ERROR )
|
void SPECCTRA_DB::doNET_OUT( NET_OUT* growth ) throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
T tok;
|
T tok;
|
||||||
|
|
||||||
|
|
|
@ -3690,57 +3690,57 @@ class SPECCTRA_DB : public SPECCTRA_LEXER
|
||||||
*/
|
*/
|
||||||
void readTIME( time_t* time_stamp ) throw( IO_ERROR );
|
void readTIME( time_t* time_stamp ) throw( IO_ERROR );
|
||||||
|
|
||||||
void doPCB( PCB* growth ) throw( IO_ERROR );
|
void doPCB( PCB* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doPARSER( PARSER* growth ) throw( IO_ERROR );
|
void doPARSER( PARSER* growth ) throw( IO_ERROR );
|
||||||
void doRESOLUTION( UNIT_RES* growth ) throw( IO_ERROR );
|
void doRESOLUTION( UNIT_RES* growth ) throw( IO_ERROR );
|
||||||
void doUNIT( UNIT_RES* growth ) throw( IO_ERROR );
|
void doUNIT( UNIT_RES* growth ) throw( IO_ERROR );
|
||||||
void doSTRUCTURE( STRUCTURE* growth ) throw( IO_ERROR );
|
void doSTRUCTURE( STRUCTURE* growth ) throw( IO_ERROR );
|
||||||
void doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR );
|
void doSTRUCTURE_OUT( STRUCTURE_OUT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR );
|
void doLAYER_NOISE_WEIGHT( LAYER_NOISE_WEIGHT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR );
|
void doLAYER_PAIR( LAYER_PAIR* growth ) throw( IO_ERROR );
|
||||||
void doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR );
|
void doBOUNDARY( BOUNDARY* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR );
|
void doRECTANGLE( RECTANGLE* growth ) throw( IO_ERROR );
|
||||||
void doPATH( PATH* growth ) throw( IO_ERROR );
|
void doPATH( PATH* growth ) throw( IO_ERROR );
|
||||||
void doSTRINGPROP( STRINGPROP* growth ) throw( IO_ERROR );
|
void doSTRINGPROP( STRINGPROP* growth ) throw( IO_ERROR );
|
||||||
void doTOKPROP( TOKPROP* growth ) throw( IO_ERROR );
|
void doTOKPROP( TOKPROP* growth ) throw( IO_ERROR );
|
||||||
void doVIA( VIA* growth ) throw( IO_ERROR );
|
void doVIA( VIA* growth ) throw( IO_ERROR );
|
||||||
void doCONTROL( CONTROL* growth ) throw( IO_ERROR );
|
void doCONTROL( CONTROL* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doLAYER( LAYER* growth ) throw( IO_ERROR );
|
void doLAYER( LAYER* growth ) throw( IO_ERROR );
|
||||||
void doRULE( RULE* growth ) throw( IO_ERROR );
|
void doRULE( RULE* growth ) throw( IO_ERROR );
|
||||||
void doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR );
|
void doKEEPOUT( KEEPOUT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doCIRCLE( CIRCLE* growth ) throw( IO_ERROR );
|
void doCIRCLE( CIRCLE* growth ) throw( IO_ERROR );
|
||||||
void doQARC( QARC* growth ) throw( IO_ERROR );
|
void doQARC( QARC* growth ) throw( IO_ERROR );
|
||||||
void doWINDOW( WINDOW* growth ) throw( IO_ERROR );
|
void doWINDOW( WINDOW* growth ) throw( IO_ERROR );
|
||||||
void doCONNECT( CONNECT* growth ) throw( IO_ERROR );
|
void doCONNECT( CONNECT* growth ) throw( IO_ERROR );
|
||||||
void doREGION( REGION* growth ) throw( IO_ERROR );
|
void doREGION( REGION* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR );
|
void doCLASS_CLASS( CLASS_CLASS* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR );
|
void doLAYER_RULE( LAYER_RULE* growth ) throw( IO_ERROR );
|
||||||
void doCLASSES( CLASSES* growth ) throw( IO_ERROR );
|
void doCLASSES( CLASSES* growth ) throw( IO_ERROR );
|
||||||
void doGRID( GRID* growth ) throw( IO_ERROR );
|
void doGRID( GRID* growth ) throw( IO_ERROR );
|
||||||
void doPLACE( PLACE* growth ) throw( IO_ERROR );
|
void doPLACE( PLACE* growth ) throw( IO_ERROR );
|
||||||
void doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR );
|
void doCOMPONENT( COMPONENT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR );
|
void doPLACEMENT( PLACEMENT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR );
|
void doPROPERTIES( PROPERTIES* growth ) throw( IO_ERROR );
|
||||||
void doPADSTACK( PADSTACK* growth ) throw( IO_ERROR );
|
void doPADSTACK( PADSTACK* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doSHAPE( SHAPE* growth ) throw( IO_ERROR );
|
void doSHAPE( SHAPE* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doIMAGE( IMAGE* growth ) throw( IO_ERROR );
|
void doIMAGE( IMAGE* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doLIBRARY( LIBRARY* growth ) throw( IO_ERROR );
|
void doLIBRARY( LIBRARY* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doPIN( PIN* growth ) throw( IO_ERROR );
|
void doPIN( PIN* growth ) throw( IO_ERROR );
|
||||||
void doNET( NET* growth ) throw( IO_ERROR );
|
void doNET( NET* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doNETWORK( NETWORK* growth ) throw( IO_ERROR );
|
void doNETWORK( NETWORK* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doCLASS( CLASS* growth ) throw( IO_ERROR );
|
void doCLASS( CLASS* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR );
|
void doTOPOLOGY( TOPOLOGY* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doFROMTO( FROMTO* growth ) throw( IO_ERROR );
|
void doFROMTO( FROMTO* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR );
|
void doCOMP_ORDER( COMP_ORDER* growth ) throw( IO_ERROR );
|
||||||
void doWIRE( WIRE* growth ) throw( IO_ERROR );
|
void doWIRE( WIRE* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR );
|
void doWIRE_VIA( WIRE_VIA* growth ) throw( IO_ERROR );
|
||||||
void doWIRING( WIRING* growth ) throw( IO_ERROR );
|
void doWIRING( WIRING* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doSESSION( SESSION* growth ) throw( IO_ERROR );
|
void doSESSION( SESSION* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doANCESTOR( ANCESTOR* growth ) throw( IO_ERROR );
|
void doANCESTOR( ANCESTOR* growth ) throw( IO_ERROR );
|
||||||
void doHISTORY( HISTORY* growth ) throw( IO_ERROR );
|
void doHISTORY( HISTORY* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doROUTE( ROUTE* growth ) throw( IO_ERROR );
|
void doROUTE( ROUTE* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doWAS_IS( WAS_IS* growth ) throw( IO_ERROR );
|
void doWAS_IS( WAS_IS* growth ) throw( IO_ERROR );
|
||||||
void doNET_OUT( NET_OUT* growth ) throw( IO_ERROR );
|
void doNET_OUT( NET_OUT* growth ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
void doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IO_ERROR );
|
void doSUPPLY_PIN( SUPPLY_PIN* growth ) throw( IO_ERROR );
|
||||||
|
|
||||||
//-----<FromBOARD>-------------------------------------------------------
|
//-----<FromBOARD>-------------------------------------------------------
|
||||||
|
@ -3752,7 +3752,7 @@ class SPECCTRA_DB : public SPECCTRA_LEXER
|
||||||
* @param aBoard The BOARD to get information from in order to make the BOUNDARY.
|
* @param aBoard The BOARD to get information from in order to make the BOUNDARY.
|
||||||
* @param aBoundary The empty BOUNDARY to fill in.
|
* @param aBoundary The empty BOUNDARY to fill in.
|
||||||
*/
|
*/
|
||||||
void fillBOUNDARY( BOARD* aBoard, BOUNDARY* aBoundary ) throw( IO_ERROR );
|
void fillBOUNDARY( BOARD* aBoard, BOUNDARY* aBoundary ) throw( IO_ERROR, boost::bad_pointer );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function makeIMAGE
|
* Function makeIMAGE
|
||||||
|
@ -3933,7 +3933,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param aBoard The BOARD to convert to a PCB.
|
* @param aBoard The BOARD to convert to a PCB.
|
||||||
*/
|
*/
|
||||||
void FromBOARD( BOARD* aBoard ) throw( IO_ERROR );
|
void FromBOARD( BOARD* aBoard ) throw( IO_ERROR, boost::bad_ptr_container_operation );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function FromSESSION
|
* Function FromSESSION
|
||||||
|
|
|
@ -889,7 +889,8 @@ static void makeCircle( PATH* aPath, DRAWSEGMENT* aGraphic )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IO_ERROR )
|
void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary )
|
||||||
|
throw( IO_ERROR, boost::bad_pointer )
|
||||||
{
|
{
|
||||||
PCB_TYPE_COLLECTOR items;
|
PCB_TYPE_COLLECTOR items;
|
||||||
|
|
||||||
|
@ -1369,7 +1370,8 @@ typedef std::set<std::string> STRINGSET;
|
||||||
typedef std::pair<STRINGSET::iterator, bool> STRINGSET_PAIR;
|
typedef std::pair<STRINGSET::iterator, bool> STRINGSET_PAIR;
|
||||||
|
|
||||||
|
|
||||||
void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IO_ERROR )
|
void SPECCTRA_DB::FromBOARD( BOARD* aBoard )
|
||||||
|
throw( IO_ERROR, boost::bad_ptr_container_operation )
|
||||||
{
|
{
|
||||||
PCB_TYPE_COLLECTOR items;
|
PCB_TYPE_COLLECTOR items;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,8 @@
|
||||||
#include <class_module.h>
|
#include <class_module.h>
|
||||||
|
|
||||||
DRAWING_TOOL::DRAWING_TOOL() :
|
DRAWING_TOOL::DRAWING_TOOL() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.InteractiveDrawing" ), m_editModules( false )
|
TOOL_INTERACTIVE( "pcbnew.InteractiveDrawing" ), m_view( NULL ),
|
||||||
|
m_controls( NULL ), m_board( NULL ), m_frame( NULL ), m_editModules( false ), m_lineWidth( 1 )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ void DRAWING_TOOL::Reset( RESET_REASON aReason )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::DrawLine( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
boost::optional<VECTOR2D> startingPoint;
|
boost::optional<VECTOR2D> startingPoint;
|
||||||
|
|
||||||
|
@ -135,7 +136,7 @@ int DRAWING_TOOL::DrawLine( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::DrawCircle( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( m_editModules )
|
if( m_editModules )
|
||||||
{
|
{
|
||||||
|
@ -184,7 +185,7 @@ int DRAWING_TOOL::DrawCircle( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( m_editModules )
|
if( m_editModules )
|
||||||
{
|
{
|
||||||
|
@ -233,7 +234,7 @@ int DRAWING_TOOL::DrawArc( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::PlaceText( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( m_editModules )
|
if( m_editModules )
|
||||||
return placeTextModule();
|
return placeTextModule();
|
||||||
|
@ -242,7 +243,7 @@ int DRAWING_TOOL::PlaceText( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
DIMENSION* dimension = NULL;
|
DIMENSION* dimension = NULL;
|
||||||
int width, maxThickness;
|
int width, maxThickness;
|
||||||
|
@ -421,7 +422,7 @@ int DRAWING_TOOL::DrawDimension( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::DrawZone( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetToolID( ID_PCB_ZONES_BUTT, wxCURSOR_PENCIL, _( "Add zones" ) );
|
m_frame->SetToolID( ID_PCB_ZONES_BUTT, wxCURSOR_PENCIL, _( "Add zones" ) );
|
||||||
|
|
||||||
|
@ -429,7 +430,7 @@ int DRAWING_TOOL::DrawZone( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::DrawKeepout( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::DrawKeepout( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetToolID( ID_PCB_KEEPOUT_AREA_BUTT, wxCURSOR_PENCIL, _( "Add keepout" ) );
|
m_frame->SetToolID( ID_PCB_KEEPOUT_AREA_BUTT, wxCURSOR_PENCIL, _( "Add keepout" ) );
|
||||||
|
|
||||||
|
@ -437,7 +438,7 @@ int DRAWING_TOOL::DrawKeepout( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::PlaceTarget( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
PCB_TARGET* target = new PCB_TARGET( m_board );
|
PCB_TARGET* target = new PCB_TARGET( m_board );
|
||||||
|
|
||||||
|
@ -525,7 +526,7 @@ int DRAWING_TOOL::PlaceTarget( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::PlaceModule( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
MODULE* module = NULL;
|
MODULE* module = NULL;
|
||||||
|
|
||||||
|
@ -635,7 +636,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::PlaceDXF( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::PlaceDXF( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
DIALOG_DXF_IMPORT dlg( m_frame );
|
DIALOG_DXF_IMPORT dlg( m_frame );
|
||||||
int dlgResult = dlg.ShowModal();
|
int dlgResult = dlg.ShowModal();
|
||||||
|
@ -825,7 +826,7 @@ int DRAWING_TOOL::PlaceDXF( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int DRAWING_TOOL::SetAnchor( TOOL_EVENT& aEvent )
|
int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
assert( m_editModules );
|
assert( m_editModules );
|
||||||
|
|
||||||
|
@ -901,7 +902,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
|
||||||
|
|
||||||
// Init the new item attributes
|
// Init the new item attributes
|
||||||
aGraphic->SetShape( (STROKE_T) aShape );
|
aGraphic->SetShape( (STROKE_T) aShape );
|
||||||
aGraphic->SetWidth( lineWidth );
|
aGraphic->SetWidth( m_lineWidth );
|
||||||
aGraphic->SetStart( wxPoint( aStartingPoint->x, aStartingPoint->y ) );
|
aGraphic->SetStart( wxPoint( aStartingPoint->x, aStartingPoint->y ) );
|
||||||
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
|
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
|
||||||
aGraphic->SetLayer( layer );
|
aGraphic->SetLayer( layer );
|
||||||
|
@ -963,8 +964,8 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
|
||||||
{
|
{
|
||||||
// Init the new item attributes
|
// Init the new item attributes
|
||||||
aGraphic->SetShape( (STROKE_T) aShape );
|
aGraphic->SetShape( (STROKE_T) aShape );
|
||||||
lineWidth = getSegmentWidth( layer );
|
m_lineWidth = getSegmentWidth( layer );
|
||||||
aGraphic->SetWidth( lineWidth );
|
aGraphic->SetWidth( m_lineWidth );
|
||||||
aGraphic->SetStart( wxPoint( cursorPos.x, cursorPos.y ) );
|
aGraphic->SetStart( wxPoint( cursorPos.x, cursorPos.y ) );
|
||||||
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
|
aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) );
|
||||||
aGraphic->SetLayer( layer );
|
aGraphic->SetLayer( layer );
|
||||||
|
@ -1012,17 +1013,17 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic,
|
||||||
|
|
||||||
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) )
|
else if( evt->IsAction( &COMMON_ACTIONS::incWidth ) )
|
||||||
{
|
{
|
||||||
lineWidth += WIDTH_STEP;
|
m_lineWidth += WIDTH_STEP;
|
||||||
aGraphic->SetWidth( lineWidth );
|
aGraphic->SetWidth( m_lineWidth );
|
||||||
updatePreview = true;
|
updatePreview = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) )
|
else if( evt->IsAction( &COMMON_ACTIONS::decWidth ) )
|
||||||
{
|
{
|
||||||
if( lineWidth > (unsigned) WIDTH_STEP )
|
if( m_lineWidth > (unsigned) WIDTH_STEP )
|
||||||
{
|
{
|
||||||
lineWidth -= WIDTH_STEP;
|
m_lineWidth -= WIDTH_STEP;
|
||||||
aGraphic->SetWidth( lineWidth );
|
aGraphic->SetWidth( m_lineWidth );
|
||||||
updatePreview = true;
|
updatePreview = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public:
|
||||||
* to click at least two times to determine the origin and the end for a line. If there are
|
* to click at least two times to determine the origin and the end for a line. If there are
|
||||||
* more clicks, the line is drawn as a continous polyline.
|
* more clicks, the line is drawn as a continous polyline.
|
||||||
*/
|
*/
|
||||||
int DrawLine( TOOL_EVENT& aEvent );
|
int DrawLine( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DrawCircle()
|
* Function DrawCircle()
|
||||||
|
@ -66,7 +66,7 @@ public:
|
||||||
* to first click on a point that is going to be used as the center of the circle. The second
|
* to first click on a point that is going to be used as the center of the circle. The second
|
||||||
* click determines the circle radius.
|
* click determines the circle radius.
|
||||||
*/
|
*/
|
||||||
int DrawCircle( TOOL_EVENT& aEvent );
|
int DrawCircle( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DrawArc()
|
* Function DrawArc()
|
||||||
|
@ -74,14 +74,14 @@ public:
|
||||||
* to first click on a point that is going to be used as the center of the arc. The second
|
* to first click on a point that is going to be used as the center of the arc. The second
|
||||||
* click determines the origin and radius, the third one - the angle.
|
* click determines the origin and radius, the third one - the angle.
|
||||||
*/
|
*/
|
||||||
int DrawArc( TOOL_EVENT& aEvent );
|
int DrawArc( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PlaceText()
|
* Function PlaceText()
|
||||||
* Displays a dialog that allows to input text and its settings and then lets the user decide
|
* Displays a dialog that allows to input text and its settings and then lets the user decide
|
||||||
* where to place the text in editor.
|
* where to place the text in editor.
|
||||||
*/
|
*/
|
||||||
int PlaceText( TOOL_EVENT& aEvent );
|
int PlaceText( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DrawDimension()
|
* Function DrawDimension()
|
||||||
|
@ -89,7 +89,7 @@ public:
|
||||||
* to first click on a point that is going to be used as the origin of the dimension.
|
* to first click on a point that is going to be used as the origin of the dimension.
|
||||||
* The second click determines the end and the third click modifies its height.
|
* The second click determines the end and the third click modifies its height.
|
||||||
*/
|
*/
|
||||||
int DrawDimension( TOOL_EVENT& aEvent );
|
int DrawDimension( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DrawZone()
|
* Function DrawZone()
|
||||||
|
@ -98,7 +98,7 @@ public:
|
||||||
* as a boundary polygon of the zone. Double click or clicking on the origin of the boundary
|
* as a boundary polygon of the zone. Double click or clicking on the origin of the boundary
|
||||||
* polyline finishes the drawing.
|
* polyline finishes the drawing.
|
||||||
*/
|
*/
|
||||||
int DrawZone( TOOL_EVENT& aEvent );
|
int DrawZone( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function DrawKeepout()
|
* Function DrawKeepout()
|
||||||
|
@ -107,31 +107,31 @@ public:
|
||||||
* be used as a boundary polygon of the area. Double click or clicking on the origin of the
|
* be used as a boundary polygon of the area. Double click or clicking on the origin of the
|
||||||
* boundary polyline finishes the drawing.
|
* boundary polyline finishes the drawing.
|
||||||
*/
|
*/
|
||||||
int DrawKeepout( TOOL_EVENT& aEvent );
|
int DrawKeepout( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PlaceTarget()
|
* Function PlaceTarget()
|
||||||
* Allows user to place a layer alignment target.
|
* Allows user to place a layer alignment target.
|
||||||
*/
|
*/
|
||||||
int PlaceTarget( TOOL_EVENT& aEvent );
|
int PlaceTarget( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PlaceModule()
|
* Function PlaceModule()
|
||||||
* Displays a dialog to select a module to be added and allows the user to set its position.
|
* Displays a dialog to select a module to be added and allows the user to set its position.
|
||||||
*/
|
*/
|
||||||
int PlaceModule( TOOL_EVENT& aEvent );
|
int PlaceModule( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PlaceDXF()
|
* Function PlaceDXF()
|
||||||
* Places a drawing imported from a DXF file in module editor.
|
* Places a drawing imported from a DXF file in module editor.
|
||||||
*/
|
*/
|
||||||
int PlaceDXF( TOOL_EVENT& aEvent );
|
int PlaceDXF( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function SetAnchor()
|
* Function SetAnchor()
|
||||||
* Places the footprint anchor (only in module editor).
|
* Places the footprint anchor (only in module editor).
|
||||||
*/
|
*/
|
||||||
int SetAnchor( TOOL_EVENT& aEvent );
|
int SetAnchor( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function EditModules()
|
* Function EditModules()
|
||||||
|
@ -203,7 +203,7 @@ private:
|
||||||
bool m_editModules;
|
bool m_editModules;
|
||||||
|
|
||||||
/// Stores the current line width for multisegment drawing.
|
/// Stores the current line width for multisegment drawing.
|
||||||
unsigned int lineWidth;
|
unsigned int m_lineWidth;
|
||||||
|
|
||||||
// How does line width change after one -/+ key press.
|
// How does line width change after one -/+ key press.
|
||||||
static const int WIDTH_STEP = 100000;
|
static const int WIDTH_STEP = 100000;
|
||||||
|
|
|
@ -43,7 +43,8 @@
|
||||||
#include "edit_tool.h"
|
#include "edit_tool.h"
|
||||||
|
|
||||||
EDIT_TOOL::EDIT_TOOL() :
|
EDIT_TOOL::EDIT_TOOL() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ), m_editModules( false )
|
TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ),
|
||||||
|
m_dragging( false ), m_editModules( false ), m_updateFlag( KIGFX::VIEW_ITEM::NONE )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,6 +52,7 @@ EDIT_TOOL::EDIT_TOOL() :
|
||||||
void EDIT_TOOL::Reset( RESET_REASON aReason )
|
void EDIT_TOOL::Reset( RESET_REASON aReason )
|
||||||
{
|
{
|
||||||
m_dragging = false;
|
m_dragging = false;
|
||||||
|
m_updateFlag = KIGFX::VIEW_ITEM::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,7 +83,7 @@ bool EDIT_TOOL::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
|
int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -238,7 +240,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
|
int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
||||||
|
@ -307,7 +309,7 @@ int EDIT_TOOL::Properties( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent )
|
int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
|
||||||
|
@ -361,7 +363,7 @@ int EDIT_TOOL::Rotate( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EDIT_TOOL::Flip( TOOL_EVENT& aEvent )
|
int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
|
PCB_BASE_FRAME* editFrame = getEditFrame<PCB_BASE_FRAME>();
|
||||||
|
@ -415,7 +417,7 @@ int EDIT_TOOL::Flip( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int EDIT_TOOL::Remove( TOOL_EVENT& aEvent )
|
int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
|
|
@ -61,35 +61,35 @@ public:
|
||||||
* Main loop in which events are handled.
|
* Main loop in which events are handled.
|
||||||
* @param aEvent is the handled event.
|
* @param aEvent is the handled event.
|
||||||
*/
|
*/
|
||||||
int Main( TOOL_EVENT& aEvent );
|
int Main( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Edit()
|
* Function Edit()
|
||||||
*
|
*
|
||||||
* Displays properties window for the selected object.
|
* Displays properties window for the selected object.
|
||||||
*/
|
*/
|
||||||
int Properties( TOOL_EVENT& aEvent );
|
int Properties( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Rotate()
|
* Function Rotate()
|
||||||
*
|
*
|
||||||
* Rotates currently selected items.
|
* Rotates currently selected items.
|
||||||
*/
|
*/
|
||||||
int Rotate( TOOL_EVENT& aEvent );
|
int Rotate( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Flip()
|
* Function Flip()
|
||||||
*
|
*
|
||||||
* Rotates currently selected items. The rotation point is the current cursor position.
|
* Rotates currently selected items. The rotation point is the current cursor position.
|
||||||
*/
|
*/
|
||||||
int Flip( TOOL_EVENT& aEvent );
|
int Flip( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Remove()
|
* Function Remove()
|
||||||
*
|
*
|
||||||
* Deletes currently selected items. The rotation point is the current cursor position.
|
* Deletes currently selected items. The rotation point is the current cursor position.
|
||||||
*/
|
*/
|
||||||
int Remove( TOOL_EVENT& aEvent );
|
int Remove( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function EditModules()
|
* Function EditModules()
|
||||||
|
|
|
@ -47,7 +47,8 @@
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
|
|
||||||
MODULE_TOOLS::MODULE_TOOLS() :
|
MODULE_TOOLS::MODULE_TOOLS() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.ModuleEditor" )
|
TOOL_INTERACTIVE( "pcbnew.ModuleEditor" ), m_view( NULL ), m_controls( NULL ),
|
||||||
|
m_board( NULL ), m_frame( NULL )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +120,7 @@ static wxString getNextPadName( MODULE* aModule )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MODULE_TOOLS::PlacePad( TOOL_EVENT& aEvent )
|
int MODULE_TOOLS::PlacePad( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetToolID( ID_MODEDIT_PAD_TOOL, wxCURSOR_PENCIL, _( "Add pads" ) );
|
m_frame->SetToolID( ID_MODEDIT_PAD_TOOL, wxCURSOR_PENCIL, _( "Add pads" ) );
|
||||||
|
|
||||||
|
@ -222,7 +223,7 @@ int MODULE_TOOLS::PlacePad( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MODULE_TOOLS::EnumeratePads( TOOL_EVENT& aEvent )
|
int MODULE_TOOLS::EnumeratePads( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
std::list<D_PAD*> pads;
|
std::list<D_PAD*> pads;
|
||||||
std::set<D_PAD*> allPads;
|
std::set<D_PAD*> allPads;
|
||||||
|
@ -329,7 +330,7 @@ int MODULE_TOOLS::EnumeratePads( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MODULE_TOOLS::CopyItems( TOOL_EVENT& aEvent )
|
int MODULE_TOOLS::CopyItems( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection();
|
const SELECTION& selection = m_toolMgr->GetTool<SELECTION_TOOL>()->GetSelection();
|
||||||
|
|
||||||
|
@ -401,7 +402,7 @@ int MODULE_TOOLS::CopyItems( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MODULE_TOOLS::PasteItems( TOOL_EVENT& aEvent )
|
int MODULE_TOOLS::PasteItems( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// Parse clipboard
|
// Parse clipboard
|
||||||
PCB_IO io( CTL_FOR_CLIPBOARD );
|
PCB_IO io( CTL_FOR_CLIPBOARD );
|
||||||
|
@ -533,7 +534,7 @@ int MODULE_TOOLS::PasteItems( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MODULE_TOOLS::ModuleTextOutlines( TOOL_EVENT& aEvent )
|
int MODULE_TOOLS::ModuleTextOutlines( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -570,7 +571,7 @@ int MODULE_TOOLS::ModuleTextOutlines( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int MODULE_TOOLS::ModuleEdgeOutlines( TOOL_EVENT& aEvent )
|
int MODULE_TOOLS::ModuleEdgeOutlines( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
|
|
@ -55,41 +55,41 @@ public:
|
||||||
* Function PlacePad()
|
* Function PlacePad()
|
||||||
* Places a pad in module editor.
|
* Places a pad in module editor.
|
||||||
*/
|
*/
|
||||||
int PlacePad( TOOL_EVENT& aEvent );
|
int PlacePad( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function EnumeratePads()
|
* Function EnumeratePads()
|
||||||
* Tool for quick pad enumeration.
|
* Tool for quick pad enumeration.
|
||||||
*/
|
*/
|
||||||
int EnumeratePads( TOOL_EVENT& aEvent );
|
int EnumeratePads( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function CopyItems()
|
* Function CopyItems()
|
||||||
*
|
*
|
||||||
* Copies selected items to the clipboard. Works only in "edit modules" mode.
|
* Copies selected items to the clipboard. Works only in "edit modules" mode.
|
||||||
*/
|
*/
|
||||||
int CopyItems( TOOL_EVENT& aEvent );
|
int CopyItems( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function PastePad()
|
* Function PastePad()
|
||||||
*
|
*
|
||||||
* Pastes items from the clipboard. Works only in "edit modules" mode.
|
* Pastes items from the clipboard. Works only in "edit modules" mode.
|
||||||
*/
|
*/
|
||||||
int PasteItems( TOOL_EVENT& aEvent );
|
int PasteItems( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ModuleTextOutlines()
|
* Function ModuleTextOutlines()
|
||||||
*
|
*
|
||||||
* Toggles display mode for module texts (outline/filled).
|
* Toggles display mode for module texts (outline/filled).
|
||||||
*/
|
*/
|
||||||
int ModuleTextOutlines( TOOL_EVENT& aEvent );
|
int ModuleTextOutlines( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function ModuleEdgeOutlines()
|
* Function ModuleEdgeOutlines()
|
||||||
*
|
*
|
||||||
* Toggles display mode for module edges (outline/filled).
|
* Toggles display mode for module edges (outline/filled).
|
||||||
*/
|
*/
|
||||||
int ModuleEdgeOutlines( TOOL_EVENT& aEvent );
|
int ModuleEdgeOutlines( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///> Sets up handlers for various events.
|
///> Sets up handlers for various events.
|
||||||
|
|
|
@ -47,7 +47,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
PCB_EDITOR_CONTROL::PCB_EDITOR_CONTROL() :
|
PCB_EDITOR_CONTROL::PCB_EDITOR_CONTROL() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.EditorControl" )
|
TOOL_INTERACTIVE( "pcbnew.EditorControl" ), m_frame( NULL )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ bool PCB_EDITOR_CONTROL::Init()
|
||||||
|
|
||||||
|
|
||||||
// Track & via size control
|
// Track & via size control
|
||||||
int PCB_EDITOR_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOARD* board = getModel<BOARD>();
|
BOARD* board = getModel<BOARD>();
|
||||||
int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() + 1;
|
int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() + 1;
|
||||||
|
@ -96,7 +96,7 @@ int PCB_EDITOR_CONTROL::TrackWidthInc( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCB_EDITOR_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOARD* board = getModel<BOARD>();
|
BOARD* board = getModel<BOARD>();
|
||||||
int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() - 1;
|
int widthIndex = board->GetDesignSettings().GetTrackWidthIndex() - 1;
|
||||||
|
@ -117,7 +117,7 @@ int PCB_EDITOR_CONTROL::TrackWidthDec( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCB_EDITOR_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOARD* board = getModel<BOARD>();
|
BOARD* board = getModel<BOARD>();
|
||||||
int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() + 1;
|
int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() + 1;
|
||||||
|
@ -138,7 +138,7 @@ int PCB_EDITOR_CONTROL::ViaSizeInc( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCB_EDITOR_CONTROL::ViaSizeDec( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOARD* board = getModel<BOARD>();
|
BOARD* board = getModel<BOARD>();
|
||||||
int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() - 1;
|
int sizeIndex = board->GetDesignSettings().GetViaSizeIndex() - 1;
|
||||||
|
@ -160,7 +160,7 @@ int PCB_EDITOR_CONTROL::ViaSizeDec( TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
|
|
||||||
// Zone actions
|
// Zone actions
|
||||||
int PCB_EDITOR_CONTROL::ZoneFill( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::ZoneFill( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
||||||
const SELECTION& selection = selTool->GetSelection();
|
const SELECTION& selection = selTool->GetSelection();
|
||||||
|
@ -181,7 +181,7 @@ int PCB_EDITOR_CONTROL::ZoneFill( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCB_EDITOR_CONTROL::ZoneFillAll( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::ZoneFillAll( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOARD* board = getModel<BOARD>();
|
BOARD* board = getModel<BOARD>();
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ int PCB_EDITOR_CONTROL::ZoneFillAll( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCB_EDITOR_CONTROL::ZoneUnfill( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::ZoneUnfill( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
||||||
const SELECTION& selection = selTool->GetSelection();
|
const SELECTION& selection = selTool->GetSelection();
|
||||||
|
@ -220,7 +220,7 @@ int PCB_EDITOR_CONTROL::ZoneUnfill( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCB_EDITOR_CONTROL::ZoneUnfillAll( TOOL_EVENT& aEvent )
|
int PCB_EDITOR_CONTROL::ZoneUnfillAll( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
BOARD* board = getModel<BOARD>();
|
BOARD* board = getModel<BOARD>();
|
||||||
|
|
||||||
|
@ -238,6 +238,20 @@ int PCB_EDITOR_CONTROL::ZoneUnfillAll( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int PCB_EDITOR_CONTROL::SelectionCrossProbe( const TOOL_EVENT& aEvent )
|
||||||
|
{
|
||||||
|
SELECTION_TOOL* selTool = m_toolMgr->GetTool<SELECTION_TOOL>();
|
||||||
|
const SELECTION& selection = selTool->GetSelection();
|
||||||
|
|
||||||
|
if( selection.Size() == 1 )
|
||||||
|
m_frame->SendMessageToEESCHEMA( selection.Item<BOARD_ITEM>( 0 ) );
|
||||||
|
|
||||||
|
setTransitions();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_EDITOR_CONTROL::setTransitions()
|
void PCB_EDITOR_CONTROL::setTransitions()
|
||||||
{
|
{
|
||||||
// Track & via size control
|
// Track & via size control
|
||||||
|
@ -251,4 +265,6 @@ void PCB_EDITOR_CONTROL::setTransitions()
|
||||||
Go( &PCB_EDITOR_CONTROL::ZoneFillAll, COMMON_ACTIONS::zoneFillAll.MakeEvent() );
|
Go( &PCB_EDITOR_CONTROL::ZoneFillAll, COMMON_ACTIONS::zoneFillAll.MakeEvent() );
|
||||||
Go( &PCB_EDITOR_CONTROL::ZoneUnfill, COMMON_ACTIONS::zoneUnfill.MakeEvent() );
|
Go( &PCB_EDITOR_CONTROL::ZoneUnfill, COMMON_ACTIONS::zoneUnfill.MakeEvent() );
|
||||||
Go( &PCB_EDITOR_CONTROL::ZoneUnfillAll, COMMON_ACTIONS::zoneUnfillAll.MakeEvent() );
|
Go( &PCB_EDITOR_CONTROL::ZoneUnfillAll, COMMON_ACTIONS::zoneUnfillAll.MakeEvent() );
|
||||||
|
|
||||||
|
Go( &PCB_EDITOR_CONTROL::SelectionCrossProbe, SELECTION_TOOL::SelectedEvent );
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,16 +46,19 @@ public:
|
||||||
bool Init();
|
bool Init();
|
||||||
|
|
||||||
// Track & via size control
|
// Track & via size control
|
||||||
int TrackWidthInc( TOOL_EVENT& aEvent );
|
int TrackWidthInc( const TOOL_EVENT& aEvent );
|
||||||
int TrackWidthDec( TOOL_EVENT& aEvent );
|
int TrackWidthDec( const TOOL_EVENT& aEvent );
|
||||||
int ViaSizeInc( TOOL_EVENT& aEvent );
|
int ViaSizeInc( const TOOL_EVENT& aEvent );
|
||||||
int ViaSizeDec( TOOL_EVENT& aEvent );
|
int ViaSizeDec( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
// Zone actions
|
// Zone actions
|
||||||
int ZoneFill( TOOL_EVENT& aEvent );
|
int ZoneFill( const TOOL_EVENT& aEvent );
|
||||||
int ZoneFillAll( TOOL_EVENT& aEvent );
|
int ZoneFillAll( const TOOL_EVENT& aEvent );
|
||||||
int ZoneUnfill( TOOL_EVENT& aEvent );
|
int ZoneUnfill( const TOOL_EVENT& aEvent );
|
||||||
int ZoneUnfillAll( TOOL_EVENT& aEvent );
|
int ZoneUnfillAll( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
|
///> Notifies eeschema about the selected item.
|
||||||
|
int SelectionCrossProbe( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///> Sets up handlers for various events.
|
///> Sets up handlers for various events.
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
|
|
||||||
PCBNEW_CONTROL::PCBNEW_CONTROL() :
|
PCBNEW_CONTROL::PCBNEW_CONTROL() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.Control" )
|
TOOL_INTERACTIVE( "pcbnew.Control" ), m_frame( NULL )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ bool PCBNEW_CONTROL::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ZoomInOut( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ZoomInOut( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||||
double zoomScale = 1.0;
|
double zoomScale = 1.0;
|
||||||
|
@ -77,7 +77,7 @@ int PCBNEW_CONTROL::ZoomInOut( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ZoomInOutCenter( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ZoomInOutCenter( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||||
double zoomScale = 1.0;
|
double zoomScale = 1.0;
|
||||||
|
@ -94,7 +94,7 @@ int PCBNEW_CONTROL::ZoomInOutCenter( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ZoomCenter( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ZoomCenter( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||||
view->SetCenter( getViewControls()->GetCursorPosition() );
|
view->SetCenter( getViewControls()->GetCursorPosition() );
|
||||||
|
@ -104,7 +104,7 @@ int PCBNEW_CONTROL::ZoomCenter( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ZoomFitScreen( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ZoomFitScreen( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||||
KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL();
|
KIGFX::GAL* gal = m_frame->GetGalCanvas()->GetGAL();
|
||||||
|
@ -140,7 +140,7 @@ int PCBNEW_CONTROL::ZoomFitScreen( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::TrackDisplayMode( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -165,7 +165,7 @@ int PCBNEW_CONTROL::TrackDisplayMode( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::PadDisplayMode( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::PadDisplayMode( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -190,7 +190,7 @@ int PCBNEW_CONTROL::PadDisplayMode( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ViaDisplayMode( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -215,7 +215,7 @@ int PCBNEW_CONTROL::ViaDisplayMode( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ZoneDisplayMode( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -246,7 +246,7 @@ int PCBNEW_CONTROL::ZoneDisplayMode( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::HighContrastMode( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -264,7 +264,7 @@ int PCBNEW_CONTROL::HighContrastMode( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::HighContrastInc( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::HighContrastInc( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
std::cout << __PRETTY_FUNCTION__ << std::endl;
|
std::cout << __PRETTY_FUNCTION__ << std::endl;
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -273,7 +273,7 @@ int PCBNEW_CONTROL::HighContrastInc( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::HighContrastDec( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::HighContrastDec( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
std::cout << __PRETTY_FUNCTION__ << std::endl;
|
std::cout << __PRETTY_FUNCTION__ << std::endl;
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -283,7 +283,7 @@ int PCBNEW_CONTROL::HighContrastDec( TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
|
|
||||||
// Layer control
|
// Layer control
|
||||||
int PCBNEW_CONTROL::LayerSwitch( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::LayerSwitch( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( aEvent.IsAction( &COMMON_ACTIONS::layerTop ) )
|
if( aEvent.IsAction( &COMMON_ACTIONS::layerTop ) )
|
||||||
m_frame->SwitchLayer( NULL, F_Cu );
|
m_frame->SwitchLayer( NULL, F_Cu );
|
||||||
|
@ -308,7 +308,7 @@ int PCBNEW_CONTROL::LayerSwitch( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::LayerNext( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::LayerNext( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME* editFrame = m_frame;
|
PCB_BASE_FRAME* editFrame = m_frame;
|
||||||
LAYER_NUM layer = editFrame->GetActiveLayer();
|
LAYER_NUM layer = editFrame->GetActiveLayer();
|
||||||
|
@ -336,7 +336,7 @@ int PCBNEW_CONTROL::LayerNext( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::LayerPrev( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::LayerPrev( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME* editFrame = m_frame;
|
PCB_BASE_FRAME* editFrame = m_frame;
|
||||||
LAYER_NUM layer = editFrame->GetActiveLayer();
|
LAYER_NUM layer = editFrame->GetActiveLayer();
|
||||||
|
@ -364,7 +364,7 @@ int PCBNEW_CONTROL::LayerPrev( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::LayerAlphaInc( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -387,7 +387,7 @@ int PCBNEW_CONTROL::LayerAlphaInc( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::LayerAlphaDec( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
KIGFX::PCB_PAINTER* painter =
|
KIGFX::PCB_PAINTER* painter =
|
||||||
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
static_cast<KIGFX::PCB_PAINTER*>( m_frame->GetGalCanvas()->GetView()->GetPainter() );
|
||||||
|
@ -411,7 +411,7 @@ int PCBNEW_CONTROL::LayerAlphaDec( TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
|
|
||||||
// Grid control
|
// Grid control
|
||||||
int PCBNEW_CONTROL::GridFast1( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::GridFast1( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetFastGrid1();
|
m_frame->SetFastGrid1();
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -420,7 +420,7 @@ int PCBNEW_CONTROL::GridFast1( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::GridFast2( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::GridFast2( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetFastGrid2();
|
m_frame->SetFastGrid2();
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -429,7 +429,7 @@ int PCBNEW_CONTROL::GridFast2( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::GridNext( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::GridNext( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetNextGrid();
|
m_frame->SetNextGrid();
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -438,7 +438,7 @@ int PCBNEW_CONTROL::GridNext( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::GridPrev( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::GridPrev( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
m_frame->SetPrevGrid();
|
m_frame->SetPrevGrid();
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -447,7 +447,7 @@ int PCBNEW_CONTROL::GridPrev( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::GridSetOrigin( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
Activate();
|
Activate();
|
||||||
m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL,
|
m_frame->SetToolID( ID_PCB_PLACE_GRID_COORD_BUTT, wxCURSOR_PENCIL,
|
||||||
|
@ -481,7 +481,7 @@ int PCBNEW_CONTROL::GridSetOrigin( TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
int PCBNEW_CONTROL::ResetCoords( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ResetCoords( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
|
VECTOR2I cursorPos = getViewControls()->GetCursorPosition();
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ int PCBNEW_CONTROL::ResetCoords( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::SwitchCursor( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::SwitchCursor( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const unsigned int BIG_CURSOR = 4000;
|
const unsigned int BIG_CURSOR = 4000;
|
||||||
const unsigned int SMALL_CURSOR = 80;
|
const unsigned int SMALL_CURSOR = 80;
|
||||||
|
@ -511,7 +511,7 @@ int PCBNEW_CONTROL::SwitchCursor( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::SwitchUnits( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::SwitchUnits( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// TODO should not it be refactored to pcb_frame member function?
|
// TODO should not it be refactored to pcb_frame member function?
|
||||||
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
|
wxCommandEvent evt( wxEVT_COMMAND_MENU_SELECTED );
|
||||||
|
@ -528,7 +528,7 @@ int PCBNEW_CONTROL::SwitchUnits( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ShowHelp( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ShowHelp( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
DisplayInfoMessage( m_frame, _( "Not implemented yet." ) );
|
DisplayInfoMessage( m_frame, _( "Not implemented yet." ) );
|
||||||
|
@ -538,7 +538,7 @@ int PCBNEW_CONTROL::ShowHelp( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PCBNEW_CONTROL::ToBeDone( TOOL_EVENT& aEvent )
|
int PCBNEW_CONTROL::ToBeDone( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
DisplayInfoMessage( m_frame, _( "Not implemented yet." ) );
|
DisplayInfoMessage( m_frame, _( "Not implemented yet." ) );
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
|
|
@ -47,40 +47,40 @@ public:
|
||||||
bool Init();
|
bool Init();
|
||||||
|
|
||||||
// View controls
|
// View controls
|
||||||
int ZoomInOut( TOOL_EVENT& aEvent );
|
int ZoomInOut( const TOOL_EVENT& aEvent );
|
||||||
int ZoomInOutCenter( TOOL_EVENT& aEvent );
|
int ZoomInOutCenter( const TOOL_EVENT& aEvent );
|
||||||
int ZoomCenter( TOOL_EVENT& aEvent );
|
int ZoomCenter( const TOOL_EVENT& aEvent );
|
||||||
int ZoomFitScreen( TOOL_EVENT& aEvent );
|
int ZoomFitScreen( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
// Display modes
|
// Display modes
|
||||||
int TrackDisplayMode( TOOL_EVENT& aEvent );
|
int TrackDisplayMode( const TOOL_EVENT& aEvent );
|
||||||
int PadDisplayMode( TOOL_EVENT& aEvent );
|
int PadDisplayMode( const TOOL_EVENT& aEvent );
|
||||||
int ViaDisplayMode( TOOL_EVENT& aEvent );
|
int ViaDisplayMode( const TOOL_EVENT& aEvent );
|
||||||
int ZoneDisplayMode( TOOL_EVENT& aEvent );
|
int ZoneDisplayMode( const TOOL_EVENT& aEvent );
|
||||||
int HighContrastMode( TOOL_EVENT& aEvent );
|
int HighContrastMode( const TOOL_EVENT& aEvent );
|
||||||
int HighContrastInc( TOOL_EVENT& aEvent );
|
int HighContrastInc( const TOOL_EVENT& aEvent );
|
||||||
int HighContrastDec( TOOL_EVENT& aEvent );
|
int HighContrastDec( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
// Layer control
|
// Layer control
|
||||||
int LayerSwitch( TOOL_EVENT& aEvent );
|
int LayerSwitch( const TOOL_EVENT& aEvent );
|
||||||
int LayerNext( TOOL_EVENT& aEvent );
|
int LayerNext( const TOOL_EVENT& aEvent );
|
||||||
int LayerPrev( TOOL_EVENT& aEvent );
|
int LayerPrev( const TOOL_EVENT& aEvent );
|
||||||
int LayerAlphaInc( TOOL_EVENT& aEvent );
|
int LayerAlphaInc( const TOOL_EVENT& aEvent );
|
||||||
int LayerAlphaDec( TOOL_EVENT& aEvent );
|
int LayerAlphaDec( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
// Grid control
|
// Grid control
|
||||||
int GridFast1( TOOL_EVENT& aEvent );
|
int GridFast1( const TOOL_EVENT& aEvent );
|
||||||
int GridFast2( TOOL_EVENT& aEvent );
|
int GridFast2( const TOOL_EVENT& aEvent );
|
||||||
int GridNext( TOOL_EVENT& aEvent );
|
int GridNext( const TOOL_EVENT& aEvent );
|
||||||
int GridPrev( TOOL_EVENT& aEvent );
|
int GridPrev( const TOOL_EVENT& aEvent );
|
||||||
int GridSetOrigin( TOOL_EVENT& aEvent );
|
int GridSetOrigin( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
int ResetCoords( TOOL_EVENT& aEvent );
|
int ResetCoords( const TOOL_EVENT& aEvent );
|
||||||
int SwitchCursor( TOOL_EVENT& aEvent );
|
int SwitchCursor( const TOOL_EVENT& aEvent );
|
||||||
int SwitchUnits( TOOL_EVENT& aEvent );
|
int SwitchUnits( const TOOL_EVENT& aEvent );
|
||||||
int ShowHelp( TOOL_EVENT& aEvent );
|
int ShowHelp( const TOOL_EVENT& aEvent );
|
||||||
int ToBeDone( TOOL_EVENT& aEvent );
|
int ToBeDone( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///> Sets up handlers for various events.
|
///> Sets up handlers for various events.
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
PLACEMENT_TOOL::PLACEMENT_TOOL() :
|
PLACEMENT_TOOL::PLACEMENT_TOOL() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.Placement" )
|
TOOL_INTERACTIVE( "pcbnew.Placement" ), m_selectionTool( NULL )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ bool PLACEMENT_TOOL::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PLACEMENT_TOOL::AlignTop( TOOL_EVENT& aEvent )
|
int PLACEMENT_TOOL::AlignTop( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ int PLACEMENT_TOOL::AlignTop( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PLACEMENT_TOOL::AlignBottom( TOOL_EVENT& aEvent )
|
int PLACEMENT_TOOL::AlignBottom( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ int PLACEMENT_TOOL::AlignBottom( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PLACEMENT_TOOL::AlignLeft( TOOL_EVENT& aEvent )
|
int PLACEMENT_TOOL::AlignLeft( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ int PLACEMENT_TOOL::AlignLeft( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PLACEMENT_TOOL::AlignRight( TOOL_EVENT& aEvent )
|
int PLACEMENT_TOOL::AlignRight( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ static bool compareY( const BOARD_ITEM* aA, const BOARD_ITEM* aB )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PLACEMENT_TOOL::DistributeHorizontally( TOOL_EVENT& aEvent )
|
int PLACEMENT_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ int PLACEMENT_TOOL::DistributeHorizontally( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int PLACEMENT_TOOL::DistributeVertically( TOOL_EVENT& aEvent )
|
int PLACEMENT_TOOL::DistributeVertically( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,6 @@
|
||||||
|
|
||||||
class SELECTION_TOOL;
|
class SELECTION_TOOL;
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO description
|
|
||||||
*/
|
|
||||||
|
|
||||||
class PLACEMENT_TOOL : public TOOL_INTERACTIVE
|
class PLACEMENT_TOOL : public TOOL_INTERACTIVE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -45,26 +41,44 @@ public:
|
||||||
/// @copydoc TOOL_INTERACTIVE::Init()
|
/// @copydoc TOOL_INTERACTIVE::Init()
|
||||||
bool Init();
|
bool Init();
|
||||||
|
|
||||||
/// TODO
|
/**
|
||||||
int AlignTop( TOOL_EVENT& aEvent );
|
* Function AlignTop()
|
||||||
|
* Sets Y coordinate of the selected items to the value of the top-most selected item Y coordinate.
|
||||||
|
*/
|
||||||
|
int AlignTop( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/// TODO
|
/**
|
||||||
int AlignBottom( TOOL_EVENT& aEvent );
|
* Function AlignBottom()
|
||||||
|
* Sets Y coordinate of the selected items to the value of the bottom-most selected item Y coordinate.
|
||||||
|
*/
|
||||||
|
int AlignBottom( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/// TODO
|
/**
|
||||||
int AlignLeft( TOOL_EVENT& aEvent );
|
* Function AlignLeft()
|
||||||
|
* Sets X coordinate of the selected items to the value of the left-most selected item X coordinate.
|
||||||
|
*/
|
||||||
|
int AlignLeft( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/// TODO
|
/**
|
||||||
int AlignRight( TOOL_EVENT& aEvent );
|
* Function AlignRight()
|
||||||
|
* Sets X coordinate of the selected items to the value of the right-most selected item X coordinate.
|
||||||
|
*/
|
||||||
|
int AlignRight( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/// TODO
|
/**
|
||||||
int DistributeHorizontally( TOOL_EVENT& aEvent );
|
* Function DistributeHorizontally()
|
||||||
|
* Distributes the selected items along the X axis.
|
||||||
|
*/
|
||||||
|
int DistributeHorizontally( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/// TODO
|
/**
|
||||||
int DistributeVertically( TOOL_EVENT& aEvent );
|
* Function DistributeVertically()
|
||||||
|
* Distributes the selected items along the Y axis.
|
||||||
|
*/
|
||||||
|
int DistributeVertically( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// TODO
|
///> Sets up handlers for various events.
|
||||||
void setTransitions();
|
void setTransitions();
|
||||||
|
|
||||||
SELECTION_TOOL* m_selectionTool;
|
SELECTION_TOOL* m_selectionTool;
|
||||||
|
|
|
@ -219,7 +219,7 @@ bool POINT_EDITOR::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
|
int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
const SELECTION& selection = m_selectionTool->GetSelection();
|
const SELECTION& selection = m_selectionTool->GetSelection();
|
||||||
|
|
||||||
|
@ -797,8 +797,8 @@ void POINT_EDITOR::breakOutline( const VECTOR2I& aBreakPoint )
|
||||||
|
|
||||||
void POINT_EDITOR::setTransitions()
|
void POINT_EDITOR::setTransitions()
|
||||||
{
|
{
|
||||||
Go( &POINT_EDITOR::OnSelectionChange, m_selectionTool->SelectedEvent );
|
Go( &POINT_EDITOR::OnSelectionChange, SELECTION_TOOL::SelectedEvent );
|
||||||
Go( &POINT_EDITOR::OnSelectionChange, m_selectionTool->UnselectedEvent );
|
Go( &POINT_EDITOR::OnSelectionChange, SELECTION_TOOL::UnselectedEvent );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
*
|
*
|
||||||
* Change selection event handler.
|
* Change selection event handler.
|
||||||
*/
|
*/
|
||||||
int OnSelectionChange( TOOL_EVENT& aEvent );
|
int OnSelectionChange( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///> Selection tool used for obtaining selected items
|
///> Selection tool used for obtaining selected items
|
||||||
|
|
|
@ -51,9 +51,6 @@
|
||||||
|
|
||||||
SELECTION_TOOL::SELECTION_TOOL() :
|
SELECTION_TOOL::SELECTION_TOOL() :
|
||||||
TOOL_INTERACTIVE( "pcbnew.InteractiveSelection" ),
|
TOOL_INTERACTIVE( "pcbnew.InteractiveSelection" ),
|
||||||
SelectedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.selected" ),
|
|
||||||
UnselectedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.unselected" ),
|
|
||||||
ClearedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.cleared" ),
|
|
||||||
m_frame( NULL ), m_additive( false ), m_multiple( false ),
|
m_frame( NULL ), m_additive( false ), m_multiple( false ),
|
||||||
m_editModules( false ), m_locked( true )
|
m_editModules( false ), m_locked( true )
|
||||||
{
|
{
|
||||||
|
@ -90,7 +87,7 @@ void SELECTION_TOOL::Reset( RESET_REASON aReason )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SELECTION_TOOL::Main( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// Main loop: keep receiving events
|
// Main loop: keep receiving events
|
||||||
while( OPT_TOOL_EVENT evt = Wait() )
|
while( OPT_TOOL_EVENT evt = Wait() )
|
||||||
|
@ -234,8 +231,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem )
|
||||||
unselect( aItem );
|
unselect( aItem );
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT unselectEvent( UnselectedEvent );
|
m_toolMgr->ProcessEvent( UnselectedEvent );
|
||||||
m_toolMgr->ProcessEvent( unselectEvent );
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -248,8 +244,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem )
|
||||||
select( aItem );
|
select( aItem );
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT selectEvent( SelectedEvent );
|
m_toolMgr->ProcessEvent( SelectedEvent );
|
||||||
m_toolMgr->ProcessEvent( selectEvent );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -384,8 +379,7 @@ bool SELECTION_TOOL::selectMultiple()
|
||||||
if( !m_selection.Empty() )
|
if( !m_selection.Empty() )
|
||||||
{
|
{
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT selectEvent( SelectedEvent );
|
m_toolMgr->ProcessEvent( SelectedEvent );
|
||||||
m_toolMgr->ProcessEvent( selectEvent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break; // Stop waiting for events
|
break; // Stop waiting for events
|
||||||
|
@ -456,7 +450,7 @@ bool SELECTION_TOOL::CheckLock()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SELECTION_TOOL::CursorSelection( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::CursorSelection( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ) );
|
selectCursor( getView()->ToWorld( getViewControls()->GetMousePosition() ) );
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -465,7 +459,7 @@ int SELECTION_TOOL::CursorSelection( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
clearSelection();
|
clearSelection();
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -473,7 +467,7 @@ int SELECTION_TOOL::ClearSelection( TOOL_EVENT& aEvent )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SELECTION_TOOL::SelectItem( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::SelectItem( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// Check if there is an item to be selected
|
// Check if there is an item to be selected
|
||||||
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( aEvent.Parameter() );
|
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( aEvent.Parameter() );
|
||||||
|
@ -483,8 +477,7 @@ int SELECTION_TOOL::SelectItem( TOOL_EVENT& aEvent )
|
||||||
select( item );
|
select( item );
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT select( SelectedEvent );
|
m_toolMgr->ProcessEvent( SelectedEvent );
|
||||||
m_toolMgr->ProcessEvent( select );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -492,7 +485,7 @@ int SELECTION_TOOL::SelectItem( TOOL_EVENT& aEvent )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SELECTION_TOOL::UnselectItem( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::UnselectItem( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
// Check if there is an item to be selected
|
// Check if there is an item to be selected
|
||||||
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( aEvent.Parameter() );
|
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( aEvent.Parameter() );
|
||||||
|
@ -502,8 +495,7 @@ int SELECTION_TOOL::UnselectItem( TOOL_EVENT& aEvent )
|
||||||
unselect( item );
|
unselect( item );
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT unselect( UnselectedEvent );
|
m_toolMgr->ProcessEvent( UnselectedEvent );
|
||||||
m_toolMgr->ProcessEvent( unselect );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setTransitions();
|
setTransitions();
|
||||||
|
@ -519,17 +511,17 @@ void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem )
|
||||||
{
|
{
|
||||||
clearSelection();
|
clearSelection();
|
||||||
select( aItem );
|
select( aItem );
|
||||||
|
getView()->SetCenter( VECTOR2D( aItem->GetPosition() ) );
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT selectEvent( SelectedEvent );
|
m_toolMgr->ProcessEvent( SelectedEvent );
|
||||||
m_toolMgr->ProcessEvent( selectEvent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_frame->GetGalCanvas()->ForceRefresh();
|
m_frame->GetGalCanvas()->ForceRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SELECTION_TOOL::find( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::find( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
DIALOG_FIND dlg( m_frame );
|
DIALOG_FIND dlg( m_frame );
|
||||||
dlg.EnableWarp( false );
|
dlg.EnableWarp( false );
|
||||||
|
@ -541,7 +533,7 @@ int SELECTION_TOOL::find( TOOL_EVENT& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int SELECTION_TOOL::findMove( TOOL_EVENT& aEvent )
|
int SELECTION_TOOL::findMove( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
MODULE* module = m_frame->GetModuleByName();
|
MODULE* module = m_frame->GetModuleByName();
|
||||||
|
|
||||||
|
@ -579,8 +571,7 @@ void SELECTION_TOOL::clearSelection()
|
||||||
m_locked = true;
|
m_locked = true;
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT clearEvent( ClearedEvent );
|
m_toolMgr->ProcessEvent( ClearedEvent );
|
||||||
m_toolMgr->ProcessEvent( clearEvent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -811,8 +802,7 @@ void SELECTION_TOOL::unselect( BOARD_ITEM* aItem )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inform other potentially interested tools
|
// Inform other potentially interested tools
|
||||||
TOOL_EVENT unselected( UnselectedEvent );
|
m_toolMgr->ProcessEvent( UnselectedEvent );
|
||||||
m_toolMgr->ProcessEvent( unselected );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -939,3 +929,8 @@ void SELECTION::clear()
|
||||||
items.ClearItemsList();
|
items.ClearItemsList();
|
||||||
group->Clear();
|
group->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const TOOL_EVENT SELECTION_TOOL::SelectedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.selected" );
|
||||||
|
const TOOL_EVENT SELECTION_TOOL::UnselectedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.unselected" );
|
||||||
|
const TOOL_EVENT SELECTION_TOOL::ClearedEvent( TC_MESSAGE, TA_ACTION, "pcbnew.InteractiveSelection.cleared" );
|
||||||
|
|
|
@ -103,7 +103,7 @@ public:
|
||||||
*
|
*
|
||||||
* The main loop.
|
* The main loop.
|
||||||
*/
|
*/
|
||||||
int Main( TOOL_EVENT& aEvent );
|
int Main( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetSelection()
|
* Function GetSelection()
|
||||||
|
@ -152,25 +152,25 @@ public:
|
||||||
bool CheckLock();
|
bool CheckLock();
|
||||||
|
|
||||||
///> Select a single item under cursor event handler.
|
///> Select a single item under cursor event handler.
|
||||||
int CursorSelection( TOOL_EVENT& aEvent );
|
int CursorSelection( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Clear current selection event handler.
|
///> Clear current selection event handler.
|
||||||
int ClearSelection( TOOL_EVENT& aEvent );
|
int ClearSelection( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Item selection event handler.
|
///> Item selection event handler.
|
||||||
int SelectItem( TOOL_EVENT& aEvent );
|
int SelectItem( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Item unselection event handler.
|
///> Item unselection event handler.
|
||||||
int UnselectItem( TOOL_EVENT& aEvent );
|
int UnselectItem( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Event sent after an item is selected.
|
///> Event sent after an item is selected.
|
||||||
const TOOL_EVENT SelectedEvent;
|
static const TOOL_EVENT SelectedEvent;
|
||||||
|
|
||||||
///> Event sent after an item is unselected.
|
///> Event sent after an item is unselected.
|
||||||
const TOOL_EVENT UnselectedEvent;
|
static const TOOL_EVENT UnselectedEvent;
|
||||||
|
|
||||||
///> Event sent after selection is cleared.
|
///> Event sent after selection is cleared.
|
||||||
const TOOL_EVENT ClearedEvent;
|
static const TOOL_EVENT ClearedEvent;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
@ -197,10 +197,10 @@ private:
|
||||||
void findCallback( BOARD_ITEM* aItem );
|
void findCallback( BOARD_ITEM* aItem );
|
||||||
|
|
||||||
///> Find an item.
|
///> Find an item.
|
||||||
int find( TOOL_EVENT& aEvent );
|
int find( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Find an item and start moving.
|
///> Find an item and start moving.
|
||||||
int findMove( TOOL_EVENT& aEvent );
|
int findMove( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
///> Sets up handlers for various events.
|
///> Sets up handlers for various events.
|
||||||
void setTransitions();
|
void setTransitions();
|
||||||
|
|
|
@ -8,6 +8,12 @@ import tempfile
|
||||||
|
|
||||||
from pcbnew import *
|
from pcbnew import *
|
||||||
|
|
||||||
|
|
||||||
|
BACK_COPPER = 'Back_Copper'
|
||||||
|
B_CU = 'B.Cu'
|
||||||
|
NEW_NAME = 'My_Fancy_Layer_Name'
|
||||||
|
|
||||||
|
|
||||||
class TestBoardClass(unittest.TestCase):
|
class TestBoardClass(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -97,6 +103,27 @@ class TestBoardClass(unittest.TestCase):
|
||||||
|
|
||||||
os.remove(self.FILENAME)
|
os.remove(self.FILENAME)
|
||||||
|
|
||||||
|
def test_pcb_layer_name_set_get(self):
|
||||||
|
pcb = BOARD()
|
||||||
|
pcb.SetLayerName(31, BACK_COPPER)
|
||||||
|
self.assertEqual(pcb.GetLayerName(31), BACK_COPPER)
|
||||||
|
|
||||||
|
def test_pcb_layer_name_set_get(self):
|
||||||
|
pcb = BOARD()
|
||||||
|
pcb.SetLayerName(31, BACK_COPPER)
|
||||||
|
self.assertEqual(pcb.GetLayerName(31), BACK_COPPER)
|
||||||
|
|
||||||
|
def test_pcb_layer_id_get(self):
|
||||||
|
pcb = BOARD()
|
||||||
|
b_cu_id = pcb.GetLayerID(B_CU)
|
||||||
|
pcb.SetLayerName(b_cu_id, NEW_NAME)
|
||||||
|
|
||||||
|
# ensure we can get the ID for the new name
|
||||||
|
self.assertEqual(pcb.GetLayerID(NEW_NAME), b_cu_id)
|
||||||
|
|
||||||
|
# ensure we can get to the ID via the STD name too
|
||||||
|
self.assertEqual(pcb.GetLayerID(B_CU), b_cu_id)
|
||||||
|
|
||||||
#def test_interactive(self):
|
#def test_interactive(self):
|
||||||
# code.interact(local=locals())
|
# code.interact(local=locals())
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo <miguelangel@nbee.es>
|
* Copyright (C) 2012 NBEE Embedded Systems, Miguel Angel Ajo <miguelangel@nbee.es>
|
||||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -68,7 +68,7 @@ static void swigAddModule( const char* name, void (* initfunc)() )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Add the builting python modules */
|
/* Add the builtin python modules */
|
||||||
|
|
||||||
static void swigAddBuiltin()
|
static void swigAddBuiltin()
|
||||||
{
|
{
|
||||||
|
@ -140,6 +140,13 @@ bool pcbnewInitPythonScripting( const char * aUserPluginsPath )
|
||||||
#ifdef KICAD_SCRIPTING_WXPYTHON
|
#ifdef KICAD_SCRIPTING_WXPYTHON
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
|
|
||||||
|
char cmd[1024];
|
||||||
|
// Make sure that that the correct version of wxPython is loaded. In systems where there
|
||||||
|
// are different versions of wxPython installed this can lead to select wrong wxPython
|
||||||
|
// version being selected.
|
||||||
|
snprintf( cmd, 1023, "import wxversion; wxversion.select('%s')", WXPYTHON_VERSION );
|
||||||
|
PyRun_SimpleString( cmd );
|
||||||
|
|
||||||
// Load the wxPython core API. Imports the wx._core_ module and sets a
|
// Load the wxPython core API. Imports the wx._core_ module and sets a
|
||||||
// local pointer to a function table located there. The pointer is used
|
// local pointer to a function table located there. The pointer is used
|
||||||
// internally by the rest of the API functions.
|
// internally by the rest of the API functions.
|
||||||
|
@ -181,7 +188,7 @@ void pcbnewFinishPythonScripting()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(KICAD_SCRIPTING_WXPYTHON)
|
#if defined( KICAD_SCRIPTING_WXPYTHON )
|
||||||
|
|
||||||
void RedirectStdio()
|
void RedirectStdio()
|
||||||
{
|
{
|
||||||
|
|
|
@ -950,7 +950,7 @@ void IDF3::GetOutline( std::list<IDF_SEGMENT*>& aLines,
|
||||||
PrintSeg( *bl );
|
PrintSeg( *bl );
|
||||||
#endif
|
#endif
|
||||||
aOutline.push( *bl );
|
aOutline.push( *bl );
|
||||||
aLines.erase( bl );
|
bl = aLines.erase( bl );
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
@ -982,7 +982,7 @@ void IDF3::GetOutline( std::list<IDF_SEGMENT*>& aLines,
|
||||||
printSeg( *bl );
|
printSeg( *bl );
|
||||||
#endif
|
#endif
|
||||||
aOutline.push( *bl );
|
aOutline.push( *bl );
|
||||||
aLines.erase( bl );
|
bl = aLines.erase( bl );
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -426,14 +426,13 @@ void make_vcyl( bool inch, bool axial, double dia, double length,
|
||||||
void make_hcyl( bool inch, bool axial, double dia, double length,
|
void make_hcyl( bool inch, bool axial, double dia, double length,
|
||||||
double z, double wireDia )
|
double z, double wireDia )
|
||||||
{
|
{
|
||||||
bool ok = false;
|
|
||||||
stringstream tstr;
|
stringstream tstr;
|
||||||
string line;
|
string line;
|
||||||
|
|
||||||
double pitch = 0.0;
|
double pitch = 0.0;
|
||||||
double lead = 0.0; // lead length for radial leads
|
double lead = 0.0; // lead length for radial leads
|
||||||
|
|
||||||
ok = false;
|
bool ok = false;
|
||||||
while( !ok )
|
while( !ok )
|
||||||
{
|
{
|
||||||
if( axial )
|
if( axial )
|
||||||
|
|
|
@ -377,7 +377,7 @@ void BOARD_OUTLINE::readOutlines( std::ifstream& aBoardFile, IDF3::IDF_VERSION a
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify winding of previous outline
|
// verify winding of previous outline
|
||||||
if( ( loopidx = 0 && !op->IsCCW() )
|
if( ( loopidx == 0 && !op->IsCCW() )
|
||||||
|| ( loopidx > 0 && op->IsCCW() ) )
|
|| ( loopidx > 0 && op->IsCCW() ) )
|
||||||
{
|
{
|
||||||
ostringstream ostr;
|
ostringstream ostr;
|
||||||
|
@ -2232,10 +2232,11 @@ PLACE_OUTLINE::PLACE_OUTLINE( IDF3_BOARD* aParent )
|
||||||
setParent( aParent );
|
setParent( aParent );
|
||||||
outlineType = OTLN_PLACE;
|
outlineType = OTLN_PLACE;
|
||||||
single = true;
|
single = true;
|
||||||
thickness = 0.0;
|
thickness = -1.0;
|
||||||
side = LYR_INVALID;
|
side = LYR_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PLACE_OUTLINE::SetSide( IDF3::IDF_LAYER aSide )
|
bool PLACE_OUTLINE::SetSide( IDF3::IDF_LAYER aSide )
|
||||||
{
|
{
|
||||||
#ifndef DISABLE_IDF_OWNERSHIP
|
#ifndef DISABLE_IDF_OWNERSHIP
|
||||||
|
@ -2424,22 +2425,13 @@ void PLACE_OUTLINE::readData( std::ifstream& aBoardFile, const std::string& aHea
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !GetIDFString( iline, token, quoted, idx ) )
|
if( GetIDFString( iline, token, quoted, idx ) )
|
||||||
{
|
{
|
||||||
ostringstream ostr;
|
|
||||||
|
|
||||||
ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n";
|
|
||||||
ostr << "* violation: no height specified\n";
|
|
||||||
ostr << "* line: '" << iline << "'\n";
|
|
||||||
ostr << "* file position: " << pos;
|
|
||||||
|
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
std::stringstream teststr;
|
std::stringstream teststr;
|
||||||
teststr << token;
|
teststr << token;
|
||||||
|
|
||||||
teststr >> thickness;
|
teststr >> thickness;
|
||||||
|
|
||||||
if( teststr.fail() )
|
if( teststr.fail() )
|
||||||
{
|
{
|
||||||
ostringstream ostr;
|
ostringstream ostr;
|
||||||
|
@ -2482,6 +2474,25 @@ void PLACE_OUTLINE::readData( std::ifstream& aBoardFile, const std::string& aHea
|
||||||
|
|
||||||
if( thickness < 0.0 )
|
if( thickness < 0.0 )
|
||||||
thickness = 0.0;
|
thickness = 0.0;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// for OTLN_PLACE, thickness may be omitted, but is required for OTLN_PLACE_KEEPOUT
|
||||||
|
if( outlineType == OTLN_PLACE_KEEPOUT )
|
||||||
|
{
|
||||||
|
ostringstream ostr;
|
||||||
|
|
||||||
|
ostr << "\n* invalid outline: " << GetOutlineTypeString( outlineType ) << "\n";
|
||||||
|
ostr << "* violation: missing thickness\n";
|
||||||
|
ostr << "* line: '" << iline << "'\n";
|
||||||
|
ostr << "* file position: " << pos;
|
||||||
|
|
||||||
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
thickness = -1.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2574,12 +2585,20 @@ void PLACE_OUTLINE::writeData( std::ofstream& aBoardFile )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// thickness is optional for OTLN_PLACE, but mandatory for OTLN_PLACE_KEEPOUT
|
||||||
|
if( thickness < 0.0 && outlineType == OTLN_PLACE_KEEPOUT)
|
||||||
|
{
|
||||||
|
aBoardFile << "\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
aBoardFile << " ";
|
aBoardFile << " ";
|
||||||
|
|
||||||
if( unit != UNIT_THOU )
|
if( unit != UNIT_THOU )
|
||||||
aBoardFile << setiosflags(ios::fixed) << setprecision(5) << thickness << "\n";
|
aBoardFile << setiosflags(ios::fixed) << setprecision(5) << thickness << "\n";
|
||||||
else
|
else
|
||||||
aBoardFile << setiosflags(ios::fixed) << setprecision(1) << (thickness / IDF_THOU_TO_MM) << "\n";
|
aBoardFile << setiosflags(ios::fixed) << setprecision(1) << (thickness / IDF_THOU_TO_MM) << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// write RECORD 3
|
// write RECORD 3
|
||||||
writeOutlines( aBoardFile );
|
writeOutlines( aBoardFile );
|
||||||
|
|
|
@ -498,7 +498,6 @@ private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
IDF3::IDF_LAYER side; // Board Side [TOP/BOTTOM/BOTH ONLY] (IDF spec)
|
IDF3::IDF_LAYER side; // Board Side [TOP/BOTTOM/BOTH ONLY] (IDF spec)
|
||||||
double height; // Max Height (IDF spec)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PLACE_OUTLINE( IDF3_BOARD* aParent );
|
PLACE_OUTLINE( IDF3_BOARD* aParent );
|
||||||
|
|
|
@ -1050,9 +1050,7 @@ bool IDF3_COMPONENT::DelDrill( double aDia, double aXpos, double aYpos )
|
||||||
{
|
{
|
||||||
val = true;
|
val = true;
|
||||||
delete *itS;
|
delete *itS;
|
||||||
drills.erase( itS );
|
itS = drills.erase( itS );
|
||||||
itS = drills.begin();
|
|
||||||
itE = drills.end();
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
++itS;
|
++itS;
|
||||||
|
@ -1341,6 +1339,7 @@ IDF3_BOARD::IDF3_BOARD( IDF3::CAD_TYPE aCadType )
|
||||||
brdFileVersion = 0;
|
brdFileVersion = 0;
|
||||||
libFileVersion = 0;
|
libFileVersion = 0;
|
||||||
iRefDes = 0;
|
iRefDes = 0;
|
||||||
|
unit = UNIT_MM;
|
||||||
|
|
||||||
// unlike other outlines which are created as necessary,
|
// unlike other outlines which are created as necessary,
|
||||||
// the board outline always exists and its parent must
|
// the board outline always exists and its parent must
|
||||||
|
@ -2002,14 +2001,13 @@ void IDF3_BOARD::readBrdSection( std::ifstream& aBoardFile, IDF3::FILE_STATE& aB
|
||||||
|
|
||||||
if( olnOther.insert( pair<string, OTHER_OUTLINE*>(op->GetOutlineIdentifier(), op) ).second == false )
|
if( olnOther.insert( pair<string, OTHER_OUTLINE*>(op->GetOutlineIdentifier(), op) ).second == false )
|
||||||
{
|
{
|
||||||
delete op;
|
|
||||||
|
|
||||||
ostringstream ostr;
|
ostringstream ostr;
|
||||||
ostr << "invalid IDF file\n";
|
ostr << "invalid IDF file\n";
|
||||||
ostr << "* Violation of specification. Non-unique ID in OTHER_OUTLINE '";
|
ostr << "* Violation of specification. Non-unique ID in OTHER_OUTLINE '";
|
||||||
ostr << op->GetOutlineIdentifier() << "'\n";
|
ostr << op->GetOutlineIdentifier() << "'\n";
|
||||||
ostr << "* line: '" << iline << "'\n";
|
ostr << "* line: '" << iline << "'\n";
|
||||||
ostr << "* pos: " << pos;
|
ostr << "* pos: " << pos;
|
||||||
|
delete op;
|
||||||
|
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
||||||
}
|
}
|
||||||
|
@ -2427,12 +2425,18 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib
|
||||||
while( !FetchIDFLine( aLibFile, iline, isComment, pos ) && aLibFile.good() );
|
while( !FetchIDFLine( aLibFile, iline, isComment, pos ) && aLibFile.good() );
|
||||||
|
|
||||||
if( !aLibFile.good() && !aLibFile.eof() )
|
if( !aLibFile.good() && !aLibFile.eof() )
|
||||||
|
{
|
||||||
|
delete pout;
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__,
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__,
|
||||||
"problems reading library section" ) );
|
"problems reading library section" ) );
|
||||||
|
}
|
||||||
|
|
||||||
// no data was read; this only happens at eof()
|
// no data was read; this only happens at eof()
|
||||||
if( iline.empty() )
|
if( iline.empty() )
|
||||||
|
{
|
||||||
|
delete pout;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( isComment )
|
if( isComment )
|
||||||
{
|
{
|
||||||
|
@ -2450,6 +2454,7 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib
|
||||||
ostr << "* Violation of specification: quoted string where .ELECTRICAL or .MECHANICAL expected\n";
|
ostr << "* Violation of specification: quoted string where .ELECTRICAL or .MECHANICAL expected\n";
|
||||||
ostr << "* line: '" << iline << "'\n";
|
ostr << "* line: '" << iline << "'\n";
|
||||||
ostr << "* pos: " << pos;
|
ostr << "* pos: " << pos;
|
||||||
|
delete pout;
|
||||||
|
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
||||||
}
|
}
|
||||||
|
@ -2491,6 +2496,7 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib
|
||||||
ostr << "* Violation of specification: multiple outlines have the same GEOM and PART name\n";
|
ostr << "* Violation of specification: multiple outlines have the same GEOM and PART name\n";
|
||||||
ostr << "* line: '" << iline << "'\n";
|
ostr << "* line: '" << iline << "'\n";
|
||||||
ostr << "* pos: " << pos;
|
ostr << "* pos: " << pos;
|
||||||
|
delete pout;
|
||||||
|
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
||||||
}
|
}
|
||||||
|
@ -2504,11 +2510,14 @@ void IDF3_BOARD::readLibSection( std::ifstream& aLibFile, IDF3::FILE_STATE& aLib
|
||||||
ostr << "* Expecting .ELECTRICAL or .MECHANICAL, got '" << token << "'\n";
|
ostr << "* Expecting .ELECTRICAL or .MECHANICAL, got '" << token << "'\n";
|
||||||
ostr << "* line: '" << iline << "'\n";
|
ostr << "* line: '" << iline << "'\n";
|
||||||
ostr << "* pos: " << pos;
|
ostr << "* pos: " << pos;
|
||||||
|
delete pout;
|
||||||
|
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__, ostr.str() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete pout;
|
||||||
|
|
||||||
if( !aLibFile.eof() )
|
if( !aLibFile.eof() )
|
||||||
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__,
|
throw( IDF_ERROR( __FILE__, __FUNCTION__, __LINE__,
|
||||||
"problems reading IDF library file" ) );
|
"problems reading IDF library file" ) );
|
||||||
|
@ -3429,10 +3438,6 @@ bool IDF3_BOARD::DelBoardDrill( double aDia, double aXpos, double aYpos )
|
||||||
|
|
||||||
switch( keyo )
|
switch( keyo )
|
||||||
{
|
{
|
||||||
case UNOWNED:
|
|
||||||
ostr << "UNOWNED";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ECAD:
|
case ECAD:
|
||||||
ostr << "ECAD";
|
ostr << "ECAD";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -178,6 +178,8 @@ VRML_LAYER::VRML_LAYER()
|
||||||
fix = false;
|
fix = false;
|
||||||
Fault = false;
|
Fault = false;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
|
hidx = 0;
|
||||||
|
eidx = 0;
|
||||||
ord = 0;
|
ord = 0;
|
||||||
glcmd = 0;
|
glcmd = 0;
|
||||||
pholes = NULL;
|
pholes = NULL;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue