Commit d979a35d authored by jean-pierre charras's avatar jean-pierre charras

3D view: now displays polygons used in footprint shapes, like logos.

Removed useless messages in debug mode.
Fixed very minor issues (minor warnings in debug mode)
3D export: Added patch from Lorenzo Marcantonio.
Fixed issue in VRML export dialog.
parents 92d58ffe 3820154a
...@@ -45,10 +45,11 @@ static GLfloat Get3DLayerSide( int act_layer ); ...@@ -45,10 +45,11 @@ static GLfloat Get3DLayerSide( int act_layer );
#endif #endif
// CALLBACK functions for GLU_TESS // CALLBACK functions for GLU_TESS
void CALLBACK tessBeginCB( GLenum which ); static void CALLBACK tessBeginCB( GLenum which );
void CALLBACK tessEndCB(); static void CALLBACK tessEndCB();
void CALLBACK tessErrorCB( GLenum errorCode ); static void CALLBACK tessErrorCB( GLenum errorCode );
void CALLBACK tessVertexCB( const GLvoid* data ); static void CALLBACK tessCPolyPt2Vertex( const GLvoid* data );
static void CALLBACK tesswxPoint2Vertex( const GLvoid* data );
void Pcb3D_GLCanvas::Redraw( bool finish ) void Pcb3D_GLCanvas::Redraw( bool finish )
{ {
...@@ -241,7 +242,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -241,7 +242,8 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
{ {
ZONE_CONTAINER* curr_zone = pcb->GetArea( ii ); ZONE_CONTAINER* curr_zone = pcb->GetArea( ii );
if( curr_zone->m_FillMode == 0 ) if( curr_zone->m_FillMode == 0 )
{ // solid polygons only are used to fill areas {
// solid polygons only are used to fill areas
if( curr_zone->m_FilledPolysList.size() > 3 ) if( curr_zone->m_FilledPolysList.size() > 3 )
{ {
Draw3D_SolidPolygonsInZones( curr_zone ); Draw3D_SolidPolygonsInZones( curr_zone );
...@@ -249,7 +251,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -249,7 +251,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
} }
else else
{ {
// segments are used to fill ares // segments are used to fill areas
for( unsigned iseg = 0; iseg < curr_zone->m_FillSegmList.size(); iseg++ ) for( unsigned iseg = 0; iseg < curr_zone->m_FillSegmList.size(); iseg++ )
{ {
SEGZONE dummysegment( pcb ); SEGZONE dummysegment( pcb );
...@@ -363,7 +365,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track ) ...@@ -363,7 +365,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track )
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
return; return;
int color = g_ColorsSettings.GetLayerColor(layer); int color = g_ColorsSettings.GetLayerColor( layer );
if( layer == LAST_COPPER_LAYER ) if( layer == LAST_COPPER_LAYER )
layer = g_Parm_3D_Visu.m_Layers - 1; layer = g_Parm_3D_Visu.m_Layers - 1;
...@@ -384,7 +386,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track ) ...@@ -384,7 +386,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track )
/** Function Draw3D_SolidPolygonsInZones /** Function Draw3D_SolidPolygonsInZones
* draw all solid polygons used as filles areas in a zone * draw all solid polygons used as filles areas in a zone
* @param aZone_c = the zone to draw * @param aZone_c = the zone to draw
*/ */
void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c ) void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c )
{ {
double zpos; double zpos;
...@@ -393,7 +395,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c ) ...@@ -393,7 +395,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c )
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
return; return;
int color = g_ColorsSettings.GetLayerColor(layer); int color = g_ColorsSettings.GetLayerColor( layer );
if( layer == LAST_COPPER_LAYER ) if( layer == LAST_COPPER_LAYER )
layer = g_Parm_3D_Visu.m_Layers - 1; layer = g_Parm_3D_Visu.m_Layers - 1;
...@@ -408,26 +410,25 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c ) ...@@ -408,26 +410,25 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c )
gluTessCallback( tess, GLU_TESS_BEGIN, ( void (CALLBACK*)() )tessBeginCB ); gluTessCallback( tess, GLU_TESS_BEGIN, ( void (CALLBACK*)() )tessBeginCB );
gluTessCallback( tess, GLU_TESS_END, ( void (CALLBACK*)() )tessEndCB ); gluTessCallback( tess, GLU_TESS_END, ( void (CALLBACK*)() )tessEndCB );
gluTessCallback( tess, GLU_TESS_ERROR, ( void (CALLBACK*)() )tessErrorCB ); gluTessCallback( tess, GLU_TESS_ERROR, ( void (CALLBACK*)() )tessErrorCB );
gluTessCallback( tess, GLU_TESS_VERTEX, ( void (CALLBACK*)() )tessVertexCB ); gluTessCallback( tess, GLU_TESS_VERTEX, ( void (CALLBACK*)() )tessCPolyPt2Vertex );
GLdouble v_data[3]; GLdouble v_data[3];
v_data[2] = zpos;
//gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO); //gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO);
// Draw solid areas contained in this zone // Draw solid areas contained in this zone
int StartContour = 1; int StartContour = 1;
for( unsigned ii = 0; ii < zone_c->m_FilledPolysList.size(); ii++ ) for( unsigned ii = 0; ii < zone_c->m_FilledPolysList.size(); ii++ )
{ {
if( StartContour == 1 ) if( StartContour == 1 )
{ {
gluTessBeginPolygon( tess, 0 ); gluTessBeginPolygon( tess, NULL );
gluTessBeginContour( tess ); gluTessBeginContour( tess );
StartContour = 0; StartContour = 0;
} }
v_data[0] = zone_c->m_FilledPolysList[ii].x * g_Parm_3D_Visu.m_BoardScale; v_data[0] = zone_c->m_FilledPolysList[ii].x * g_Parm_3D_Visu.m_BoardScale;
v_data[1] = zone_c->m_FilledPolysList[ii].y * g_Parm_3D_Visu.m_BoardScale * -1; v_data[1] = -zone_c->m_FilledPolysList[ii].y * g_Parm_3D_Visu.m_BoardScale;
v_data[2] = zpos;
D( printf( "Tess gluTessVertex(%f,%f,%f)\n", v_data[0], v_data[1], v_data[2] ); )
gluTessVertex( tess, v_data, &zone_c->m_FilledPolysList[ii] ); gluTessVertex( tess, v_data, &zone_c->m_FilledPolysList[ii] );
if( zone_c->m_FilledPolysList[ii].end_contour == 1 ) if( zone_c->m_FilledPolysList[ii].end_contour == 1 )
...@@ -468,14 +469,14 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via ) ...@@ -468,14 +469,14 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
false ) false )
continue; continue;
color = g_ColorsSettings.GetLayerColor(layer); color = g_ColorsSettings.GetLayerColor( layer );
} }
else else
{ {
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) == if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) ==
false ) false )
continue; continue;
color = g_ColorsSettings.GetLayerColor(LAYER_N_FRONT); color = g_ColorsSettings.GetLayerColor( LAYER_N_FRONT );
} }
SetGLColor( color ); SetGLColor( color );
...@@ -492,7 +493,7 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via ) ...@@ -492,7 +493,7 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
} }
// Drawing hole: // Drawing hole:
color = g_ColorsSettings.GetItemColor(VIAS_VISIBLE + via->m_Shape); color = g_ColorsSettings.GetItemColor( VIAS_VISIBLE + via->m_Shape );
SetGLColor( color ); SetGLColor( color );
height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] - height = g_Parm_3D_Visu.m_LayerZcoord[top_layer] -
g_Parm_3D_Visu.m_LayerZcoord[bottom_layer]; g_Parm_3D_Visu.m_LayerZcoord[bottom_layer];
...@@ -511,7 +512,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment ) ...@@ -511,7 +512,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
return; return;
int color = g_ColorsSettings.GetLayerColor(layer); int color = g_ColorsSettings.GetLayerColor( layer );
SetGLColor( color ); SetGLColor( color );
w = segment->m_Width * g_Parm_3D_Visu.m_BoardScale; w = segment->m_Width * g_Parm_3D_Visu.m_BoardScale;
...@@ -597,7 +598,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text ) ...@@ -597,7 +598,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawText( TEXTE_PCB* text )
if( !Get3DLayerEnable( layer ) ) if( !Get3DLayerEnable( layer ) )
return; return;
int color = g_ColorsSettings.GetLayerColor(layer); int color = g_ColorsSettings.GetLayerColor( layer );
SetGLColor( color ); SetGLColor( color );
...@@ -643,19 +644,6 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -643,19 +644,6 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
{ {
D_PAD* pad = m_Pads; D_PAD* pad = m_Pads;
#if 0
if( !DisplayOpt.Show_Modules_Cmp )
{
if( m_Layer == LAYER_N_FRONT )
return;
}
if( !DisplayOpt.Show_Modules_Cu )
{
if( m_Layer == LAYER_N_BACK )
return;
}
#endif
/* Draw pads */ /* Draw pads */
glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
...@@ -726,17 +714,16 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -726,17 +714,16 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
{ {
wxString s; wxString s;
int dx, dy; int dx, dy;
double scale, x, y, fx, fy, w, zpos; double x, y, fx, fy, w, zpos;
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( m_Layer ) == false ) if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( m_Layer ) == false )
return; return;
int color = g_ColorsSettings.GetLayerColor(m_Layer); int color = g_ColorsSettings.GetLayerColor( m_Layer );
SetGLColor( color ); SetGLColor( color );
glNormal3f( 0.0, 0.0, (m_Layer == LAYER_N_BACK) ? -1.0 : 1.0 ); glNormal3f( 0.0, 0.0, (m_Layer == LAYER_N_BACK) ? -1.0 : 1.0 );
scale = g_Parm_3D_Visu.m_BoardScale;
dx = m_End.x; dx = m_End.x;
dy = m_End.y; dy = m_End.y;
...@@ -762,6 +749,26 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -762,6 +749,26 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
Draw3D_ArcSegment( x, -y, fx, -fy, (double) m_Angle, w, zpos ); Draw3D_ArcSegment( x, -y, fx, -fy, (double) m_Angle, w, zpos );
break; break;
case S_POLYGON:
{
// We must compute true coordinates from m_PolyPoints
// which are relative to module position and module orientation = 0
std::vector<wxPoint> points = m_PolyPoints;
MODULE* module = (MODULE*) m_Parent;
if( module == NULL )
break;
for( unsigned ii = 0; ii < points.size(); ii++ )
{
wxPoint& pt = points[ii];
RotatePoint( &pt.x, &pt.y, module->m_Orient );
pt += module->m_Pos;
}
glcanvas->Draw3D_Polygon( points, zpos );
}
break;
default: default:
s.Printf( wxT( "Error: Shape nr %d not implemented!\n" ), m_Shape ); s.Printf( wxT( "Error: Shape nr %d not implemented!\n" ), m_Shape );
D( printf( "%s", CONV_TO_UTF8( s ) ); ) D( printf( "%s", CONV_TO_UTF8( s ) ); )
...@@ -839,7 +846,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -839,7 +846,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
&& !Both ) && !Both )
continue; continue;
color = g_ColorsSettings.GetLayerColor(layer); color = g_ColorsSettings.GetLayerColor( layer );
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
false ) false )
continue; continue;
...@@ -891,7 +898,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -891,7 +898,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
if( (layer > FIRST_COPPER_LAYER) if( (layer > FIRST_COPPER_LAYER)
&& (layer < LAST_COPPER_LAYER) && !Both ) && (layer < LAST_COPPER_LAYER) && !Both )
continue; continue;
color = g_ColorsSettings.GetLayerColor(layer); color = g_ColorsSettings.GetLayerColor( layer );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 ); glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
false ) false )
...@@ -935,8 +942,8 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -935,8 +942,8 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
coord[ii][0] += ux0; coord[ii][0] += ux0;
coord[ii][1] += uy0; coord[ii][1] += uy0;
ll = ii * 2; ll = ii * 2;
fcoord[ll][0] = coord[ii][0] * scale; fcoord[ll][0] = coord[ii][0] *scale;
fcoord[ll][1] = coord[ii][1] * scale; fcoord[ll][1] = coord[ii][1] *scale;
} }
for( ii = 0; ii < 7; ii += 2 ) for( ii = 0; ii < 7; ii += 2 )
...@@ -969,7 +976,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -969,7 +976,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
&& !Both ) && !Both )
continue; continue;
color = g_ColorsSettings.GetLayerColor(layer); color = g_ColorsSettings.GetLayerColor( layer );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 ); glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
false ) false )
...@@ -1202,7 +1209,7 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex, ...@@ -1202,7 +1209,7 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,
int ii; int ii;
int slice = 36; // Number of segments to approximate a circle by segments int slice = 36; // Number of segments to approximate a circle by segments
double hole, rayon; double hole, rayon;
double arcStart_Angle; double arcStart_Angle;
arcStart_Angle = (atan2( startx - centrex, starty - centrey ) * 1800 / M_PI ); arcStart_Angle = (atan2( startx - centrex, starty - centrey ) * 1800 / M_PI );
rayon = hypot( startx - centrex, starty - centrey ) + ( width / 2); rayon = hypot( startx - centrex, starty - centrey ) + ( width / 2);
...@@ -1212,7 +1219,7 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex, ...@@ -1212,7 +1219,7 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,
int imax = (int) ( (double) arc_angle * slice / 3600.0 ); int imax = (int) ( (double) arc_angle * slice / 3600.0 );
if( imax < 0 ) if( imax < 0 )
imax = -imax; imax = -imax;
if (imax == 0 ) if( imax == 0 )
imax = 1; imax = 1;
// Adjust delta_angle to have exactly imax segments in arc_angle // Adjust delta_angle to have exactly imax segments in arc_angle
...@@ -1226,11 +1233,11 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex, ...@@ -1226,11 +1233,11 @@ static void Draw3D_ArcSegment( double startx, double starty, double centrex,
angle += arcStart_Angle + 900; angle += arcStart_Angle + 900;
double dx = hole; double dx = hole;
double dy = 0.0; double dy = 0.0;
RotatePoint( &dx, &dy, (int)angle ); RotatePoint( &dx, &dy, (int) angle );
glVertex3f( dx + startx, dy + starty, zpos ); glVertex3f( dx + startx, dy + starty, zpos );
dx = rayon; dx = rayon;
dy = 0.0; dy = 0.0;
RotatePoint( &dx, &dy, (int)angle ); RotatePoint( &dx, &dy, (int) angle );
glVertex3f( dx + startx, dy + starty, zpos ); glVertex3f( dx + startx, dy + starty, zpos );
} }
...@@ -1262,6 +1269,46 @@ static void Draw3D_CircleSegment( double startx, double starty, double endx, ...@@ -1262,6 +1269,46 @@ static void Draw3D_CircleSegment( double startx, double starty, double endx,
} }
/** Function Pcb3D_GLCanvas::Draw3D_Polygon
* draw one solid polygon
* @param aCornersList = a std::vector<wxPoint> liste of corners, in physical coordinates
* @param aZpos = the z position in 3D units
*/
void Pcb3D_GLCanvas::Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double aZpos )
{
g_Parm_3D_Visu.m_ActZpos = aZpos;
GLUtesselator* tess = gluNewTess();
gluTessCallback( tess, GLU_TESS_BEGIN, ( void (CALLBACK*)() )tessBeginCB );
gluTessCallback( tess, GLU_TESS_END, ( void (CALLBACK*)() )tessEndCB );
gluTessCallback( tess, GLU_TESS_ERROR, ( void (CALLBACK*)() )tessErrorCB );
gluTessCallback( tess, GLU_TESS_VERTEX, ( void (CALLBACK*)() )tesswxPoint2Vertex );
GLdouble v_data[3];
v_data[2] = aZpos;
//gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO);
// Draw solid polygon
gluTessBeginPolygon( tess, NULL );
gluTessBeginContour( tess );
for( unsigned ii = 0; ii < aCornersList.size(); ii++ )
{
v_data[0] = aCornersList[ii].x * g_Parm_3D_Visu.m_BoardScale;
v_data[1] = -aCornersList[ii].y * g_Parm_3D_Visu.m_BoardScale;
// gluTessVertex store pointers on data, not data, so do not store
// different corners values in a temporary variable
// but send pointer on each corner value in aCornersList
gluTessVertex( tess, v_data, &aCornersList[ii] );
}
gluTessEndContour( tess );
gluTessEndPolygon( tess );
gluDeleteTess( tess );
}
static int Get3DLayerEnable( int act_layer ) static int Get3DLayerEnable( int act_layer )
{ {
bool enablelayer; bool enablelayer;
...@@ -1302,32 +1349,32 @@ static GLfloat Get3DLayerSide( int act_layer ) ...@@ -1302,32 +1349,32 @@ static GLfloat Get3DLayerSide( int act_layer )
void CALLBACK tessBeginCB( GLenum which ) void CALLBACK tessBeginCB( GLenum which )
{ {
glBegin( which ); glBegin( which );
// DEBUG //
D( printf( "Tess glBegin()\n" ); )
} }
void CALLBACK tessEndCB() void CALLBACK tessEndCB()
{ {
glEnd(); glEnd();
// DEBUG //
D( printf( "Tess glEnd()\n" ); )
} }
void CALLBACK tessVertexCB( const GLvoid* data ) void CALLBACK tessCPolyPt2Vertex( const GLvoid* data )
{ {
// cast back to double type // cast back to double type
const CPolyPt* ptr = (const CPolyPt*) data; const CPolyPt* ptr = (const CPolyPt*) data;
glVertex3f( (*ptr).x * g_Parm_3D_Visu.m_BoardScale, glVertex3f( ptr->x * g_Parm_3D_Visu.m_BoardScale,
(*ptr).y * g_Parm_3D_Visu.m_BoardScale * -1, -ptr->y * g_Parm_3D_Visu.m_BoardScale,
g_Parm_3D_Visu.m_ActZpos ); g_Parm_3D_Visu.m_ActZpos );
}
void CALLBACK tesswxPoint2Vertex( const GLvoid* data )
{
const wxPoint* ptr = (const wxPoint*) data;
// DEBUG // glVertex3f( ptr->x * g_Parm_3D_Visu.m_BoardScale,
D( printf( "TessVertex glVertex3d(%d,%d,%f)\n", (*ptr).x, (*ptr).y, g_Parm_3D_Visu.m_ActZpos ); ) -ptr->y * g_Parm_3D_Visu.m_BoardScale,
g_Parm_3D_Visu.m_ActZpos );
} }
......
...@@ -171,6 +171,13 @@ public: ...@@ -171,6 +171,13 @@ public:
* @param aZone_c = the zone to draw * @param aZone_c = the zone to draw
*/ */
void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone_c ); void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone_c );
/** Function Draw3D_Polygon
* draw one solid polygon
* @param aCornersList = a std::vector<wxPoint> liste of corners, in physical coordinates
* @param aZpos = the z position in 3D units
*/
void Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double aZpos );
void Draw3D_Via( SEGVIA* via ); void Draw3D_Via( SEGVIA* via );
void Draw3D_DrawSegment( DRAWSEGMENT* segment ); void Draw3D_DrawSegment( DRAWSEGMENT* segment );
void Draw3D_DrawText( TEXTE_PCB* text ); void Draw3D_DrawText( TEXTE_PCB* text );
......
...@@ -115,7 +115,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent, ...@@ -115,7 +115,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent,
/* Sizer 1 creation */ /* Sizer 1 creation */
wxFlexGridSizer* fgSizer1; wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 1, 1, 0, 0 ); fgSizer1 = new wxFlexGridSizer( 7, 1, 0, 0 );
fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#include "dialog_edit_module_for_BoardEditor_base.h" #include "dialog_edit_module_for_BoardEditor_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
m_GeneralBoxSizer = new wxBoxSizer( wxVERTICAL ); m_GeneralBoxSizer = new wxBoxSizer( wxVERTICAL );
m_NoteBook = new wxNotebook( this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, 0 ); m_NoteBook = new wxNotebook( this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, 0 );
m_PanelProperties = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); m_PanelProperties = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* m_PanelPropertiesBoxSizer; wxBoxSizer* m_PanelPropertiesBoxSizer;
m_PanelPropertiesBoxSizer = new wxBoxSizer( wxHORIZONTAL ); m_PanelPropertiesBoxSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* PropLeftSizer; wxStaticBoxSizer* PropLeftSizer;
PropLeftSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Fields:") ), wxVERTICAL ); PropLeftSizer = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Fields:") ), wxVERTICAL );
wxStaticBoxSizer* sbSizerRef; wxStaticBoxSizer* sbSizerRef;
sbSizerRef = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Reference") ), wxHORIZONTAL ); sbSizerRef = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Reference") ), wxHORIZONTAL );
m_ReferenceCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_ReferenceCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
sbSizerRef->Add( m_ReferenceCtrl, 1, 0, 5 ); sbSizerRef->Add( m_ReferenceCtrl, 1, 0, 5 );
m_button4 = new wxButton( m_PanelProperties, wxID_ANY, _("Edit"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); m_button4 = new wxButton( m_PanelProperties, wxID_ANY, _("Edit"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
sbSizerRef->Add( m_button4, 0, 0, 5 ); sbSizerRef->Add( m_button4, 0, 0, 5 );
PropLeftSizer->Add( sbSizerRef, 0, wxEXPAND, 5 ); PropLeftSizer->Add( sbSizerRef, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerValue; wxStaticBoxSizer* sbSizerValue;
sbSizerValue = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Value") ), wxHORIZONTAL ); sbSizerValue = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Value") ), wxHORIZONTAL );
m_ValueCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); m_ValueCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
sbSizerValue->Add( m_ValueCtrl, 1, 0, 5 ); sbSizerValue->Add( m_ValueCtrl, 1, 0, 5 );
m_button5 = new wxButton( m_PanelProperties, wxID_ANY, _("Edit"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT ); m_button5 = new wxButton( m_PanelProperties, wxID_ANY, _("Edit"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT );
sbSizerValue->Add( m_button5, 0, 0, 5 ); sbSizerValue->Add( m_button5, 0, 0, 5 );
PropLeftSizer->Add( sbSizerValue, 0, wxEXPAND, 5 ); PropLeftSizer->Add( sbSizerValue, 0, wxEXPAND, 5 );
wxString m_LayerCtrlChoices[] = { _("Top"), _("Bottom") }; wxString m_LayerCtrlChoices[] = { _("Top"), _("Bottom") };
int m_LayerCtrlNChoices = sizeof( m_LayerCtrlChoices ) / sizeof( wxString ); int m_LayerCtrlNChoices = sizeof( m_LayerCtrlChoices ) / sizeof( wxString );
m_LayerCtrl = new wxRadioBox( m_PanelProperties, wxID_ANY, _("Side Select"), wxDefaultPosition, wxDefaultSize, m_LayerCtrlNChoices, m_LayerCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_LayerCtrl = new wxRadioBox( m_PanelProperties, wxID_ANY, _("Side Select"), wxDefaultPosition, wxDefaultSize, m_LayerCtrlNChoices, m_LayerCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_LayerCtrl->SetSelection( 0 ); m_LayerCtrl->SetSelection( 0 );
PropLeftSizer->Add( m_LayerCtrl, 0, wxALL|wxEXPAND, 5 ); PropLeftSizer->Add( m_LayerCtrl, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerOrientation; wxStaticBoxSizer* sbSizerOrientation;
sbSizerOrientation = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Orientation") ), wxVERTICAL ); sbSizerOrientation = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Orientation") ), wxVERTICAL );
wxString m_OrientCtrlChoices[] = { _("Normal"), _("+ 90.0"), _("- 90.0"), _("180.0"), _("User") }; wxString m_OrientCtrlChoices[] = { _("Normal"), _("+ 90.0"), _("- 90.0"), _("180.0"), _("User") };
int m_OrientCtrlNChoices = sizeof( m_OrientCtrlChoices ) / sizeof( wxString ); int m_OrientCtrlNChoices = sizeof( m_OrientCtrlChoices ) / sizeof( wxString );
m_OrientCtrl = new wxRadioBox( m_PanelProperties, ID_LISTBOX_ORIENT_SELECT, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_OrientCtrlNChoices, m_OrientCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_OrientCtrl = new wxRadioBox( m_PanelProperties, ID_LISTBOX_ORIENT_SELECT, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_OrientCtrlNChoices, m_OrientCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OrientCtrl->SetSelection( 0 ); m_OrientCtrl->SetSelection( 0 );
sbSizerOrientation->Add( m_OrientCtrl, 0, wxALL|wxEXPAND, 5 ); sbSizerOrientation->Add( m_OrientCtrl, 0, wxALL|wxEXPAND, 5 );
m_staticText4 = new wxStaticText( m_PanelProperties, wxID_ANY, _("Orientation (in 0.1 degrees)"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText4 = new wxStaticText( m_PanelProperties, wxID_ANY, _("Orientation (in 0.1 degrees)"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText4->Wrap( -1 ); m_staticText4->Wrap( -1 );
sbSizerOrientation->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbSizerOrientation->Add( m_staticText4, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_OrientValue = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_OrientValue = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerOrientation->Add( m_OrientValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); sbSizerOrientation->Add( m_OrientValue, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
PropLeftSizer->Add( sbSizerOrientation, 0, wxEXPAND, 5 ); PropLeftSizer->Add( sbSizerOrientation, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerPosition; wxStaticBoxSizer* sbSizerPosition;
sbSizerPosition = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Position") ), wxVERTICAL ); sbSizerPosition = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Position") ), wxVERTICAL );
XPositionStatic = new wxStaticText( m_PanelProperties, wxID_ANY, _("X"), wxDefaultPosition, wxDefaultSize, 0 ); XPositionStatic = new wxStaticText( m_PanelProperties, wxID_ANY, _("X"), wxDefaultPosition, wxDefaultSize, 0 );
XPositionStatic->Wrap( -1 ); XPositionStatic->Wrap( -1 );
sbSizerPosition->Add( XPositionStatic, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbSizerPosition->Add( XPositionStatic, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ModPositionX = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_ModPositionX = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerPosition->Add( m_ModPositionX, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizerPosition->Add( m_ModPositionX, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
YPositionStatic = new wxStaticText( m_PanelProperties, wxID_ANY, _("Y"), wxDefaultPosition, wxDefaultSize, 0 ); YPositionStatic = new wxStaticText( m_PanelProperties, wxID_ANY, _("Y"), wxDefaultPosition, wxDefaultSize, 0 );
YPositionStatic->Wrap( -1 ); YPositionStatic->Wrap( -1 );
sbSizerPosition->Add( YPositionStatic, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); sbSizerPosition->Add( YPositionStatic, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ModPositionY = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_ModPositionY = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerPosition->Add( m_ModPositionY, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); sbSizerPosition->Add( m_ModPositionY, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
PropLeftSizer->Add( sbSizerPosition, 0, wxEXPAND, 5 ); PropLeftSizer->Add( sbSizerPosition, 0, wxEXPAND, 5 );
m_PanelPropertiesBoxSizer->Add( PropLeftSizer, 1, wxEXPAND, 5 ); m_PanelPropertiesBoxSizer->Add( PropLeftSizer, 1, wxEXPAND, 5 );
m_PropRightSizer = new wxBoxSizer( wxVERTICAL ); m_PropRightSizer = new wxBoxSizer( wxVERTICAL );
m_buttonExchange = new wxButton( m_PanelProperties, ID_MODULE_PROPERTIES_EXCHANGE, _("Change Module(s)"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonExchange = new wxButton( m_PanelProperties, ID_MODULE_PROPERTIES_EXCHANGE, _("Change Module(s)"), wxDefaultPosition, wxDefaultSize, 0 );
m_PropRightSizer->Add( m_buttonExchange, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_PropRightSizer->Add( m_buttonExchange, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonModuleEditor = new wxButton( m_PanelProperties, ID_GOTO_MODULE_EDITOR, _("Module Editor"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonModuleEditor = new wxButton( m_PanelProperties, ID_GOTO_MODULE_EDITOR, _("Module Editor"), wxDefaultPosition, wxDefaultSize, 0 );
m_PropRightSizer->Add( m_buttonModuleEditor, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_PropRightSizer->Add( m_buttonModuleEditor, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
wxString m_AttributsCtrlChoices[] = { _("Normal"), _("Normal+Insert"), _("Virtual") }; wxString m_AttributsCtrlChoices[] = { _("Normal"), _("Normal+Insert"), _("Virtual") };
int m_AttributsCtrlNChoices = sizeof( m_AttributsCtrlChoices ) / sizeof( wxString ); int m_AttributsCtrlNChoices = sizeof( m_AttributsCtrlChoices ) / sizeof( wxString );
m_AttributsCtrl = new wxRadioBox( m_PanelProperties, wxID_ANY, _("Attributs:"), wxDefaultPosition, wxDefaultSize, m_AttributsCtrlNChoices, m_AttributsCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_AttributsCtrl = new wxRadioBox( m_PanelProperties, wxID_ANY, _("Attributs:"), wxDefaultPosition, wxDefaultSize, m_AttributsCtrlNChoices, m_AttributsCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_AttributsCtrl->SetSelection( 1 ); m_AttributsCtrl->SetSelection( 1 );
m_PropRightSizer->Add( m_AttributsCtrl, 0, wxALL|wxEXPAND, 5 ); m_PropRightSizer->Add( m_AttributsCtrl, 0, wxALL|wxEXPAND, 5 );
wxString m_AutoPlaceCtrlChoices[] = { _("Free"), _("Locked") }; wxString m_AutoPlaceCtrlChoices[] = { _("Free"), _("Locked") };
int m_AutoPlaceCtrlNChoices = sizeof( m_AutoPlaceCtrlChoices ) / sizeof( wxString ); int m_AutoPlaceCtrlNChoices = sizeof( m_AutoPlaceCtrlChoices ) / sizeof( wxString );
m_AutoPlaceCtrl = new wxRadioBox( m_PanelProperties, wxID_ANY, _("Move and Auto Place"), wxDefaultPosition, wxDefaultSize, m_AutoPlaceCtrlNChoices, m_AutoPlaceCtrlChoices, 1, wxRA_SPECIFY_COLS ); m_AutoPlaceCtrl = new wxRadioBox( m_PanelProperties, wxID_ANY, _("Move and Auto Place"), wxDefaultPosition, wxDefaultSize, m_AutoPlaceCtrlNChoices, m_AutoPlaceCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_AutoPlaceCtrl->SetSelection( 0 ); m_AutoPlaceCtrl->SetSelection( 0 );
m_PropRightSizer->Add( m_AutoPlaceCtrl, 0, wxALL|wxEXPAND, 5 ); m_PropRightSizer->Add( m_AutoPlaceCtrl, 0, wxALL|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizerAutoplace; wxStaticBoxSizer* sbSizerAutoplace;
sbSizerAutoplace = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Auto Move and Place") ), wxHORIZONTAL ); sbSizerAutoplace = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Auto Move and Place") ), wxHORIZONTAL );
wxBoxSizer* bSizerRotOpt; wxBoxSizer* bSizerRotOpt;
bSizerRotOpt = new wxBoxSizer( wxVERTICAL ); bSizerRotOpt = new wxBoxSizer( wxVERTICAL );
m_staticText11 = new wxStaticText( m_PanelProperties, wxID_ANY, _("Rotation 90 degree"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText11 = new wxStaticText( m_PanelProperties, wxID_ANY, _("Rotation 90 degree"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText11->Wrap( -1 ); m_staticText11->Wrap( -1 );
bSizerRotOpt->Add( m_staticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); bSizerRotOpt->Add( m_staticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_CostRot90Ctrl = new wxSlider( m_PanelProperties, wxID_ANY, 0, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); m_CostRot90Ctrl = new wxSlider( m_PanelProperties, wxID_ANY, 0, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS );
bSizerRotOpt->Add( m_CostRot90Ctrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bSizerRotOpt->Add( m_CostRot90Ctrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbSizerAutoplace->Add( bSizerRotOpt, 1, wxEXPAND, 5 ); sbSizerAutoplace->Add( bSizerRotOpt, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerMoveOpt; wxBoxSizer* bSizerMoveOpt;
bSizerMoveOpt = new wxBoxSizer( wxVERTICAL ); bSizerMoveOpt = new wxBoxSizer( wxVERTICAL );
m_staticText12 = new wxStaticText( m_PanelProperties, wxID_ANY, _("Rotation 180 degree"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText12 = new wxStaticText( m_PanelProperties, wxID_ANY, _("Rotation 180 degree"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText12->Wrap( -1 ); m_staticText12->Wrap( -1 );
bSizerMoveOpt->Add( m_staticText12, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); bSizerMoveOpt->Add( m_staticText12, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_CostRot180Ctrl = new wxSlider( m_PanelProperties, wxID_ANY, 0, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS ); m_CostRot180Ctrl = new wxSlider( m_PanelProperties, wxID_ANY, 0, 0, 10, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS );
bSizerMoveOpt->Add( m_CostRot180Ctrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bSizerMoveOpt->Add( m_CostRot180Ctrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
sbSizerAutoplace->Add( bSizerMoveOpt, 1, wxEXPAND, 5 ); sbSizerAutoplace->Add( bSizerMoveOpt, 1, wxEXPAND, 5 );
m_PropRightSizer->Add( sbSizerAutoplace, 1, wxEXPAND|wxALL, 5 ); m_PropRightSizer->Add( sbSizerAutoplace, 1, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizerLocalProperties; wxStaticBoxSizer* sbSizerLocalProperties;
sbSizerLocalProperties = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Masks clearances local values:") ), wxVERTICAL ); sbSizerLocalProperties = new wxStaticBoxSizer( new wxStaticBox( m_PanelProperties, wxID_ANY, _("Masks clearances local values:") ), wxVERTICAL );
m_staticTextInfo = new wxStaticText( m_PanelProperties, wxID_ANY, _("Set these values to 0 to use global values"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextInfo = new wxStaticText( m_PanelProperties, wxID_ANY, _("Set these values to 0 to use global values"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextInfo->Wrap( -1 ); m_staticTextInfo->Wrap( -1 );
m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); m_staticTextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
sbSizerLocalProperties->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); sbSizerLocalProperties->Add( m_staticTextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
wxFlexGridSizer* fgSizerClearances; wxFlexGridSizer* fgSizerClearances;
fgSizerClearances = new wxFlexGridSizer( 3, 3, 0, 0 ); fgSizerClearances = new wxFlexGridSizer( 5, 3, 0, 0 );
fgSizerClearances->SetFlexibleDirection( wxBOTH ); fgSizerClearances->SetFlexibleDirection( wxBOTH );
fgSizerClearances->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizerClearances->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_staticTextNetClearance = new wxStaticText( m_PanelProperties, wxID_ANY, _("All pads nets clearance"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextNetClearance = new wxStaticText( m_PanelProperties, wxID_ANY, _("All pads nets clearance"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextNetClearance->Wrap( -1 ); m_staticTextNetClearance->Wrap( -1 );
m_staticTextNetClearance->SetToolTip( _("This is the local net clearance for all pad of this footprint\nIf 0, the Netclass values are used\nThis value can be superseded by a pad local value.") ); m_staticTextNetClearance->SetToolTip( _("This is the local net clearance for all pad of this footprint\nIf 0, the Netclass values are used\nThis value can be superseded by a pad local value.") );
fgSizerClearances->Add( m_staticTextNetClearance, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); fgSizerClearances->Add( m_staticTextNetClearance, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_NetClearanceValueCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_NetClearanceValueCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_NetClearanceValueCtrl, 0, wxALL, 5 ); fgSizerClearances->Add( m_NetClearanceValueCtrl, 0, wxALL, 5 );
m_NetClearanceUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); m_NetClearanceUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_NetClearanceUnits->Wrap( -1 ); m_NetClearanceUnits->Wrap( -1 );
fgSizerClearances->Add( m_NetClearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); fgSizerClearances->Add( m_NetClearanceUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_staticline1 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline1 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizerClearances->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); fgSizerClearances->Add( m_staticline1, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticline2 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline2 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizerClearances->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); fgSizerClearances->Add( m_staticline2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_staticline3 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline3 = new wxStaticLine( m_PanelProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgSizerClearances->Add( m_staticline3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); fgSizerClearances->Add( m_staticline3, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_MaskClearanceTitle = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_MaskClearanceTitle = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_MaskClearanceTitle->Wrap( -1 ); m_MaskClearanceTitle->Wrap( -1 );
m_MaskClearanceTitle->SetToolTip( _("This is the local clearance between pads and the solder mask\nfor this footprint\nThis value can be superseded by a pad local value.\nIf 0, the global value is used") ); m_MaskClearanceTitle->SetToolTip( _("This is the local clearance between pads and the solder mask\nfor this footprint\nThis value can be superseded by a pad local value.\nIf 0, the global value is used") );
fgSizerClearances->Add( m_MaskClearanceTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerClearances->Add( m_MaskClearanceTitle, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_SolderMaskMarginCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_SolderMaskMarginCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_SolderMaskMarginCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerClearances->Add( m_SolderMaskMarginCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_SolderMaskMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); m_SolderMaskMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderMaskMarginUnits->Wrap( -1 ); m_SolderMaskMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderMaskMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); fgSizerClearances->Add( m_SolderMaskMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_staticTextSolderPaste = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder paste clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextSolderPaste = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder paste clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSolderPaste->Wrap( -1 ); m_staticTextSolderPaste->Wrap( -1 );
m_staticTextSolderPaste->SetToolTip( _("This is the local clearance between pads and the solder paste\nfor this footprint.\nThis value can be superseded by a pad local values.\nThe final clearance value is the sum of this value and the clearance value ratio\nA negative value means a smaller mask size than pad size") ); m_staticTextSolderPaste->SetToolTip( _("This is the local clearance between pads and the solder paste\nfor this footprint.\nThis value can be superseded by a pad local values.\nThe final clearance value is the sum of this value and the clearance value ratio\nA negative value means a smaller mask size than pad size") );
fgSizerClearances->Add( m_staticTextSolderPaste, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizerClearances->Add( m_staticTextSolderPaste, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_SolderPasteMarginCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_SolderPasteMarginCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_SolderPasteMarginCtrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); fgSizerClearances->Add( m_SolderPasteMarginCtrl, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_SolderPasteMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 ); m_SolderPasteMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteMarginUnits->Wrap( -1 ); m_SolderPasteMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderPasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 ); fgSizerClearances->Add( m_SolderPasteMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT, 5 );
m_staticTextRatio = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder mask ratio clearance:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRatio = new wxStaticText( m_PanelProperties, wxID_ANY, _("Solder mask ratio clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRatio->Wrap( -1 ); m_staticTextRatio->Wrap( -1 );
m_staticTextRatio->SetToolTip( _("This is the local clearance ratio in per cent between pads and the solder paste\nfor this footprint.\nA value of 10 means the clearance value is 10 per cent of the pad size\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value\nA negative value means a smaller mask size than pad size.") ); m_staticTextRatio->SetToolTip( _("This is the local clearance ratio in per cent between pads and the solder paste\nfor this footprint.\nA value of 10 means the clearance value is 10 per cent of the pad size\nThis value can be superseded by a pad local value.\nThe final clearance value is the sum of this value and the clearance value\nA negative value means a smaller mask size than pad size.") );
fgSizerClearances->Add( m_staticTextRatio, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizerClearances->Add( m_staticTextRatio, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_SolderPasteMarginRatioCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_SolderPasteMarginRatioCtrl = new wxTextCtrl( m_PanelProperties, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgSizerClearances->Add( m_SolderPasteMarginRatioCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizerClearances->Add( m_SolderPasteMarginRatioCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_SolderPasteRatioMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 ); m_SolderPasteRatioMarginUnits = new wxStaticText( m_PanelProperties, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteRatioMarginUnits->Wrap( -1 ); m_SolderPasteRatioMarginUnits->Wrap( -1 );
fgSizerClearances->Add( m_SolderPasteRatioMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); fgSizerClearances->Add( m_SolderPasteRatioMarginUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
sbSizerLocalProperties->Add( fgSizerClearances, 1, wxEXPAND, 5 ); sbSizerLocalProperties->Add( fgSizerClearances, 1, wxEXPAND, 5 );
m_PropRightSizer->Add( sbSizerLocalProperties, 0, wxEXPAND|wxALL, 5 ); m_PropRightSizer->Add( sbSizerLocalProperties, 0, wxEXPAND|wxALL, 5 );
m_PanelPropertiesBoxSizer->Add( m_PropRightSizer, 0, 0, 5 ); m_PanelPropertiesBoxSizer->Add( m_PropRightSizer, 0, 0, 5 );
m_PanelProperties->SetSizer( m_PanelPropertiesBoxSizer ); m_PanelProperties->SetSizer( m_PanelPropertiesBoxSizer );
m_PanelProperties->Layout(); m_PanelProperties->Layout();
m_PanelPropertiesBoxSizer->Fit( m_PanelProperties ); m_PanelPropertiesBoxSizer->Fit( m_PanelProperties );
m_NoteBook->AddPage( m_PanelProperties, _("Properties"), true ); m_NoteBook->AddPage( m_PanelProperties, _("Properties"), true );
m_Panel3D = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); m_Panel3D = new wxPanel( m_NoteBook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
wxBoxSizer* bSizerMain3D; wxBoxSizer* bSizerMain3D;
bSizerMain3D = new wxBoxSizer( wxVERTICAL ); bSizerMain3D = new wxBoxSizer( wxVERTICAL );
m_staticText3Dname = new wxStaticText( m_Panel3D, wxID_ANY, _("3D Shape Name"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3Dname = new wxStaticText( m_Panel3D, wxID_ANY, _("3D Shape Name"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3Dname->Wrap( -1 ); m_staticText3Dname->Wrap( -1 );
bSizerMain3D->Add( m_staticText3Dname, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerMain3D->Add( m_staticText3Dname, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_3D_ShapeNameListBox = new wxListBox( m_Panel3D, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE ); m_3D_ShapeNameListBox = new wxListBox( m_Panel3D, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE );
bSizerMain3D->Add( m_3D_ShapeNameListBox, 0, wxALL|wxEXPAND, 5 ); bSizerMain3D->Add( m_3D_ShapeNameListBox, 0, wxALL|wxEXPAND, 5 );
wxBoxSizer* bLowerSizer3D; wxBoxSizer* bLowerSizer3D;
bLowerSizer3D = new wxBoxSizer( wxHORIZONTAL ); bLowerSizer3D = new wxBoxSizer( wxHORIZONTAL );
m_Sizer3DValues = new wxStaticBoxSizer( new wxStaticBox( m_Panel3D, wxID_ANY, _("3D Scale and Pos") ), wxVERTICAL ); m_Sizer3DValues = new wxStaticBoxSizer( new wxStaticBox( m_Panel3D, wxID_ANY, _("3D Scale and Pos") ), wxVERTICAL );
bLowerSizer3D->Add( m_Sizer3DValues, 1, wxEXPAND, 5 ); bLowerSizer3D->Add( m_Sizer3DValues, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer3DButtons; wxBoxSizer* bSizer3DButtons;
bSizer3DButtons = new wxBoxSizer( wxVERTICAL ); bSizer3DButtons = new wxBoxSizer( wxVERTICAL );
m_buttonBrowse = new wxButton( m_Panel3D, ID_BROWSE_3D_LIB, _("Browse Shapes"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonBrowse = new wxButton( m_Panel3D, ID_BROWSE_3D_LIB, _("Browse Shapes"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3DButtons->Add( m_buttonBrowse, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bSizer3DButtons->Add( m_buttonBrowse, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonAdd = new wxButton( m_Panel3D, ID_ADD_3D_SHAPE, _("Add 3D Shape"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonAdd = new wxButton( m_Panel3D, ID_ADD_3D_SHAPE, _("Add 3D Shape"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3DButtons->Add( m_buttonAdd, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bSizer3DButtons->Add( m_buttonAdd, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonRemove = new wxButton( m_Panel3D, ID_REMOVE_3D_SHAPE, _("Remove 3D Shape"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonRemove = new wxButton( m_Panel3D, ID_REMOVE_3D_SHAPE, _("Remove 3D Shape"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3DButtons->Add( m_buttonRemove, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bSizer3DButtons->Add( m_buttonRemove, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bLowerSizer3D->Add( bSizer3DButtons, 0, wxALIGN_CENTER_VERTICAL, 5 ); bLowerSizer3D->Add( bSizer3DButtons, 0, wxALIGN_CENTER_VERTICAL, 5 );
bSizerMain3D->Add( bLowerSizer3D, 1, wxEXPAND, 5 ); bSizerMain3D->Add( bLowerSizer3D, 1, wxEXPAND, 5 );
m_Panel3D->SetSizer( bSizerMain3D ); m_Panel3D->SetSizer( bSizerMain3D );
m_Panel3D->Layout(); m_Panel3D->Layout();
bSizerMain3D->Fit( m_Panel3D ); bSizerMain3D->Fit( m_Panel3D );
m_NoteBook->AddPage( m_Panel3D, _("3D settings"), false ); m_NoteBook->AddPage( m_Panel3D, _("3D settings"), false );
m_GeneralBoxSizer->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 ); m_GeneralBoxSizer->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 );
m_sdbSizerStdButtons = new wxStdDialogButtonSizer(); m_sdbSizerStdButtons = new wxStdDialogButtonSizer();
m_sdbSizerStdButtonsOK = new wxButton( this, wxID_OK ); m_sdbSizerStdButtonsOK = new wxButton( this, wxID_OK );
m_sdbSizerStdButtons->AddButton( m_sdbSizerStdButtonsOK ); m_sdbSizerStdButtons->AddButton( m_sdbSizerStdButtonsOK );
m_sdbSizerStdButtonsCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizerStdButtonsCancel = new wxButton( this, wxID_CANCEL );
m_sdbSizerStdButtons->AddButton( m_sdbSizerStdButtonsCancel ); m_sdbSizerStdButtons->AddButton( m_sdbSizerStdButtonsCancel );
m_sdbSizerStdButtons->Realize(); m_sdbSizerStdButtons->Realize();
m_GeneralBoxSizer->Add( m_sdbSizerStdButtons, 0, wxEXPAND|wxALIGN_RIGHT|wxALL, 5 ); m_GeneralBoxSizer->Add( m_sdbSizerStdButtons, 0, wxEXPAND|wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( m_GeneralBoxSizer ); this->SetSizer( m_GeneralBoxSizer );
this->Layout(); this->Layout();
// Connect Events // Connect Events
m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditReference ), NULL, this ); m_button4->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditReference ), NULL, this );
m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditValue ), NULL, this ); m_button5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditValue ), NULL, this );
m_OrientCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ModuleOrientEvent ), NULL, this ); m_OrientCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ModuleOrientEvent ), NULL, this );
m_buttonExchange->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ExchangeModule ), NULL, this ); m_buttonExchange->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ExchangeModule ), NULL, this );
m_buttonModuleEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::GotoModuleEditor ), NULL, this ); m_buttonModuleEditor->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::GotoModuleEditor ), NULL, this );
m_3D_ShapeNameListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::On3DShapeNameSelected ), NULL, this ); m_3D_ShapeNameListBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::On3DShapeNameSelected ), NULL, this );
m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Browse3DLib ), NULL, this ); m_buttonBrowse->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Browse3DLib ), NULL, this );
m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Add3DShape ), NULL, this ); m_buttonAdd->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Add3DShape ), NULL, this );
m_buttonRemove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Remove3DShape ), NULL, this ); m_buttonRemove->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Remove3DShape ), NULL, this );
m_sdbSizerStdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnCancelClick ), NULL, this ); m_sdbSizerStdButtonsCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnCancelClick ), NULL, this );
m_sdbSizerStdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnOkClick ), NULL, this ); m_sdbSizerStdButtonsOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnOkClick ), NULL, this );
} }
DIALOG_MODULE_BOARD_EDITOR_BASE::~DIALOG_MODULE_BOARD_EDITOR_BASE() DIALOG_MODULE_BOARD_EDITOR_BASE::~DIALOG_MODULE_BOARD_EDITOR_BASE()
{ {
// Disconnect Events // Disconnect Events
m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditReference ), NULL, this ); m_button4->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditReference ), NULL, this );
m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditValue ), NULL, this ); m_button5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnEditValue ), NULL, this );
m_OrientCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ModuleOrientEvent ), NULL, this ); m_OrientCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ModuleOrientEvent ), NULL, this );
m_buttonExchange->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ExchangeModule ), NULL, this ); m_buttonExchange->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::ExchangeModule ), NULL, this );
m_buttonModuleEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::GotoModuleEditor ), NULL, this ); m_buttonModuleEditor->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::GotoModuleEditor ), NULL, this );
m_3D_ShapeNameListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::On3DShapeNameSelected ), NULL, this ); m_3D_ShapeNameListBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::On3DShapeNameSelected ), NULL, this );
m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Browse3DLib ), NULL, this ); m_buttonBrowse->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Browse3DLib ), NULL, this );
m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Add3DShape ), NULL, this ); m_buttonAdd->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Add3DShape ), NULL, this );
m_buttonRemove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Remove3DShape ), NULL, this ); m_buttonRemove->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::Remove3DShape ), NULL, this );
m_sdbSizerStdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnCancelClick ), NULL, this ); m_sdbSizerStdButtonsCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnCancelClick ), NULL, this );
m_sdbSizerStdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnOkClick ), NULL, this ); m_sdbSizerStdButtonsOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_MODULE_BOARD_EDITOR_BASE::OnOkClick ), NULL, this );
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008) // C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_edit_module_for_BoardEditor_base__ #ifndef __dialog_edit_module_for_BoardEditor_base__
#define __dialog_edit_module_for_BoardEditor_base__ #define __dialog_edit_module_for_BoardEditor_base__
#include <wx/intl.h> #include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/font.h> #include <wx/font.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/radiobox.h> #include <wx/radiobox.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/slider.h> #include <wx/slider.h>
#include <wx/statline.h> #include <wx/statline.h>
#include <wx/panel.h> #include <wx/panel.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/listbox.h> #include <wx/listbox.h>
#include <wx/notebook.h> #include <wx/notebook.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#define ID_NOTEBOOK 1000 #define ID_NOTEBOOK 1000
#define ID_LISTBOX_ORIENT_SELECT 1001 #define ID_LISTBOX_ORIENT_SELECT 1001
#define ID_MODULE_PROPERTIES_EXCHANGE 1002 #define ID_MODULE_PROPERTIES_EXCHANGE 1002
#define ID_GOTO_MODULE_EDITOR 1003 #define ID_GOTO_MODULE_EDITOR 1003
#define ID_BROWSE_3D_LIB 1004 #define ID_BROWSE_3D_LIB 1004
#define ID_ADD_3D_SHAPE 1005 #define ID_ADD_3D_SHAPE 1005
#define ID_REMOVE_3D_SHAPE 1006 #define ID_REMOVE_3D_SHAPE 1006
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_MODULE_BOARD_EDITOR_BASE /// Class DIALOG_MODULE_BOARD_EDITOR_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_MODULE_BOARD_EDITOR_BASE : public wxDialog class DIALOG_MODULE_BOARD_EDITOR_BASE : public wxDialog
{ {
private: private:
wxBoxSizer* m_GeneralBoxSizer; wxBoxSizer* m_GeneralBoxSizer;
wxBoxSizer* m_PropRightSizer; wxBoxSizer* m_PropRightSizer;
protected: protected:
wxNotebook* m_NoteBook; wxNotebook* m_NoteBook;
wxPanel* m_PanelProperties; wxPanel* m_PanelProperties;
wxTextCtrl* m_ReferenceCtrl; wxTextCtrl* m_ReferenceCtrl;
wxButton* m_button4; wxButton* m_button4;
wxTextCtrl* m_ValueCtrl; wxTextCtrl* m_ValueCtrl;
wxButton* m_button5; wxButton* m_button5;
wxRadioBox* m_LayerCtrl; wxRadioBox* m_LayerCtrl;
wxRadioBox* m_OrientCtrl; wxRadioBox* m_OrientCtrl;
wxStaticText* m_staticText4; wxStaticText* m_staticText4;
wxTextCtrl* m_OrientValue; wxTextCtrl* m_OrientValue;
wxStaticText* XPositionStatic; wxStaticText* XPositionStatic;
wxTextCtrl* m_ModPositionX; wxTextCtrl* m_ModPositionX;
wxStaticText* YPositionStatic; wxStaticText* YPositionStatic;
wxTextCtrl* m_ModPositionY; wxTextCtrl* m_ModPositionY;
wxButton* m_buttonExchange; wxButton* m_buttonExchange;
wxButton* m_buttonModuleEditor; wxButton* m_buttonModuleEditor;
wxRadioBox* m_AttributsCtrl; wxRadioBox* m_AttributsCtrl;
wxRadioBox* m_AutoPlaceCtrl; wxRadioBox* m_AutoPlaceCtrl;
wxStaticText* m_staticText11; wxStaticText* m_staticText11;
wxSlider* m_CostRot90Ctrl; wxSlider* m_CostRot90Ctrl;
wxStaticText* m_staticText12; wxStaticText* m_staticText12;
wxSlider* m_CostRot180Ctrl; wxSlider* m_CostRot180Ctrl;
wxStaticText* m_staticTextInfo; wxStaticText* m_staticTextInfo;
wxStaticText* m_staticTextNetClearance; wxStaticText* m_staticTextNetClearance;
wxTextCtrl* m_NetClearanceValueCtrl; wxTextCtrl* m_NetClearanceValueCtrl;
wxStaticText* m_NetClearanceUnits; wxStaticText* m_NetClearanceUnits;
wxStaticLine* m_staticline1; wxStaticLine* m_staticline1;
wxStaticLine* m_staticline2; wxStaticLine* m_staticline2;
wxStaticLine* m_staticline3; wxStaticLine* m_staticline3;
wxStaticText* m_MaskClearanceTitle; wxStaticText* m_MaskClearanceTitle;
wxTextCtrl* m_SolderMaskMarginCtrl; wxTextCtrl* m_SolderMaskMarginCtrl;
wxStaticText* m_SolderMaskMarginUnits; wxStaticText* m_SolderMaskMarginUnits;
wxStaticText* m_staticTextSolderPaste; wxStaticText* m_staticTextSolderPaste;
wxTextCtrl* m_SolderPasteMarginCtrl; wxTextCtrl* m_SolderPasteMarginCtrl;
wxStaticText* m_SolderPasteMarginUnits; wxStaticText* m_SolderPasteMarginUnits;
wxStaticText* m_staticTextRatio; wxStaticText* m_staticTextRatio;
wxTextCtrl* m_SolderPasteMarginRatioCtrl; wxTextCtrl* m_SolderPasteMarginRatioCtrl;
wxStaticText* m_SolderPasteRatioMarginUnits; wxStaticText* m_SolderPasteRatioMarginUnits;
wxPanel* m_Panel3D; wxPanel* m_Panel3D;
wxStaticText* m_staticText3Dname; wxStaticText* m_staticText3Dname;
wxListBox* m_3D_ShapeNameListBox; wxListBox* m_3D_ShapeNameListBox;
wxButton* m_buttonBrowse; wxButton* m_buttonBrowse;
wxButton* m_buttonAdd; wxButton* m_buttonAdd;
wxButton* m_buttonRemove; wxButton* m_buttonRemove;
wxStdDialogButtonSizer* m_sdbSizerStdButtons; wxStdDialogButtonSizer* m_sdbSizerStdButtons;
wxButton* m_sdbSizerStdButtonsOK; wxButton* m_sdbSizerStdButtonsOK;
wxButton* m_sdbSizerStdButtonsCancel; wxButton* m_sdbSizerStdButtonsCancel;
// Virtual event handlers, overide them in your derived class // Virtual event handlers, overide them in your derived class
virtual void OnEditReference( wxCommandEvent& event ){ event.Skip(); } virtual void OnEditReference( wxCommandEvent& event ){ event.Skip(); }
virtual void OnEditValue( wxCommandEvent& event ){ event.Skip(); } virtual void OnEditValue( wxCommandEvent& event ){ event.Skip(); }
virtual void ModuleOrientEvent( wxCommandEvent& event ){ event.Skip(); } virtual void ModuleOrientEvent( wxCommandEvent& event ){ event.Skip(); }
virtual void ExchangeModule( wxCommandEvent& event ){ event.Skip(); } virtual void ExchangeModule( wxCommandEvent& event ){ event.Skip(); }
virtual void GotoModuleEditor( wxCommandEvent& event ){ event.Skip(); } virtual void GotoModuleEditor( wxCommandEvent& event ){ event.Skip(); }
virtual void On3DShapeNameSelected( wxCommandEvent& event ){ event.Skip(); } virtual void On3DShapeNameSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void Browse3DLib( wxCommandEvent& event ){ event.Skip(); } virtual void Browse3DLib( wxCommandEvent& event ){ event.Skip(); }
virtual void Add3DShape( wxCommandEvent& event ){ event.Skip(); } virtual void Add3DShape( wxCommandEvent& event ){ event.Skip(); }
virtual void Remove3DShape( wxCommandEvent& event ){ event.Skip(); } virtual void Remove3DShape( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); } virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
public: public:
wxStaticBoxSizer* m_Sizer3DValues; wxStaticBoxSizer* m_Sizer3DValues;
DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 474,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 474,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_MODULE_BOARD_EDITOR_BASE(); ~DIALOG_MODULE_BOARD_EDITOR_BASE();
}; };
#endif //__dialog_edit_module_for_BoardEditor_base__ #endif //__dialog_edit_module_for_BoardEditor_base__
...@@ -24,7 +24,7 @@ DIALOG_EXPORT_3DFILE_BASE::DIALOG_EXPORT_3DFILE_BASE( wxWindow* parent, wxWindow ...@@ -24,7 +24,7 @@ DIALOG_EXPORT_3DFILE_BASE::DIALOG_EXPORT_3DFILE_BASE( wxWindow* parent, wxWindow
m_staticText1->Wrap( -1 ); m_staticText1->Wrap( -1 );
bUpperSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bUpperSizer->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_filePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Save VRML Board File"), wxT("*.wrl"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_SAVE ); m_filePicker = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Save VRML Board File"), wxT("*.wrl"), wxDefaultPosition, wxDefaultSize, wxFLP_SAVE|wxFLP_USE_TEXTCTRL );
bUpperSizer->Add( m_filePicker, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); bUpperSizer->Add( m_filePicker, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, _("Vrml 3D footprints shapes subdir:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText3 = new wxStaticText( this, wxID_ANY, _("Vrml 3D footprints shapes subdir:"), wxDefaultPosition, wxDefaultSize, 0 );
......
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<property name="permission">protected</property> <property name="permission">protected</property>
<property name="pos"></property> <property name="pos"></property>
<property name="size"></property> <property name="size"></property>
<property name="style">wxFLP_DEFAULT_STYLE|wxFLP_SAVE</property> <property name="style">wxFLP_SAVE|wxFLP_USE_TEXTCTRL</property>
<property name="subclass"></property> <property name="subclass"></property>
<property name="tooltip"></property> <property name="tooltip"></property>
<property name="value"></property> <property name="value"></property>
......
...@@ -1085,7 +1085,7 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule, ...@@ -1085,7 +1085,7 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule,
-vrmlm->m_MatPosition.y - aModule->m_Pos.y, -vrmlm->m_MatPosition.y - aModule->m_Pos.y,
vrmlm->m_MatPosition.z + layer_z[aModule->GetLayer()] ); vrmlm->m_MatPosition.z + layer_z[aModule->GetLayer()] );
fprintf( aOutputFile, fprintf( aOutputFile,
" children [\n Inline {\n url [ \"%s\" ]\n } ]\n", " children [\n Inline {\n url \"%s\"\n } ]\n",
CONV_TO_UTF8( fname ) ); CONV_TO_UTF8( fname ) );
fprintf( aOutputFile, " }\n" ); fprintf( aOutputFile, " }\n" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment