Commit 0ebc3f06 authored by jean-pierre charras's avatar jean-pierre charras

3D-viewer: code cleanup.

Eeschema: annotate and netlist dialogs: enhancements.
Minor  coding policy fixes and  changes.
parent 898275fa
/* /*
* 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) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
#include <fctsys.h> #include <fctsys.h>
#if !wxUSE_GLCANVAS
#error Please set wxUSE_GLCANVAS to 1 in setup.h.
#endif
#include <common.h> #include <common.h>
#include <trigo.h> #include <trigo.h>
#include <wxBasePcbFrame.h> #include <wxBasePcbFrame.h>
...@@ -49,7 +45,7 @@ ...@@ -49,7 +45,7 @@
#include <trackball.h> #include <trackball.h>
void S3D_MASTER::Set_Object_Coords( std::vector< S3D_Vertex >& aVertices ) void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
{ {
unsigned ii; unsigned ii;
...@@ -79,7 +75,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_Vertex >& aVertices ) ...@@ -79,7 +75,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_Vertex >& aVertices )
} }
void Set_Object_Data( std::vector< S3D_Vertex >& aVertices ) void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices )
{ {
unsigned ii; unsigned ii;
GLfloat ax, ay, az, bx, by, bz, nx, ny, nz, r; GLfloat ax, ay, az, bx, by, bz, nx, ny, nz, r;
...@@ -271,9 +267,9 @@ VERTEX_VALUE_CTRL::~VERTEX_VALUE_CTRL() ...@@ -271,9 +267,9 @@ VERTEX_VALUE_CTRL::~VERTEX_VALUE_CTRL()
} }
S3D_Vertex VERTEX_VALUE_CTRL::GetValue() S3D_VERTEX VERTEX_VALUE_CTRL::GetValue()
{ {
S3D_Vertex value; S3D_VERTEX value;
double dtmp; double dtmp;
m_XValueCtrl->GetValue().ToDouble( &dtmp ); m_XValueCtrl->GetValue().ToDouble( &dtmp );
...@@ -286,7 +282,7 @@ S3D_Vertex VERTEX_VALUE_CTRL::GetValue() ...@@ -286,7 +282,7 @@ S3D_Vertex VERTEX_VALUE_CTRL::GetValue()
} }
void VERTEX_VALUE_CTRL::SetValue( S3D_Vertex vertex ) void VERTEX_VALUE_CTRL::SetValue( S3D_VERTEX vertex )
{ {
wxString text; wxString text;
......
///////////////////////////////////////////////////////////////////////////// /**
// Name: 3d_class.cpp * @file 3d_class.cpp
///////////////////////////////////////////////////////////////////////////// */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
...@@ -55,7 +79,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) : ...@@ -55,7 +79,7 @@ S3D_MASTER::S3D_MASTER( EDA_ITEM* aParent ) :
S3D_MASTER:: ~S3D_MASTER() S3D_MASTER:: ~S3D_MASTER()
{ {
Struct3D_Shape* next; STRUCT_3D_SHAPE* next;
S3D_MATERIAL* nextmat; S3D_MATERIAL* nextmat;
for( ; m_3D_Drawings != NULL; m_3D_Drawings = next ) for( ; m_3D_Drawings != NULL; m_3D_Drawings = next )
...@@ -72,7 +96,7 @@ S3D_MASTER:: ~S3D_MASTER() ...@@ -72,7 +96,7 @@ S3D_MASTER:: ~S3D_MASTER()
} }
Struct3D_Shape::Struct3D_Shape( EDA_ITEM* aParent ) : STRUCT_3D_SHAPE::STRUCT_3D_SHAPE( EDA_ITEM* aParent ) :
EDA_ITEM( aParent, NOT_USED ) EDA_ITEM( aParent, NOT_USED )
{ {
m_3D_Coord = NULL; m_3D_Coord = NULL;
...@@ -81,7 +105,7 @@ Struct3D_Shape::Struct3D_Shape( EDA_ITEM* aParent ) : ...@@ -81,7 +105,7 @@ Struct3D_Shape::Struct3D_Shape( EDA_ITEM* aParent ) :
} }
Struct3D_Shape:: ~Struct3D_Shape() STRUCT_3D_SHAPE:: ~STRUCT_3D_SHAPE()
{ {
delete m_3D_Coord; delete m_3D_Coord;
delete m_3D_CoordIndex; delete m_3D_CoordIndex;
......
This diff is collapsed.
...@@ -431,7 +431,7 @@ void EDA_3D_FRAME::OnActivate( wxActivateEvent& event ) ...@@ -431,7 +431,7 @@ void EDA_3D_FRAME::OnActivate( wxActivateEvent& event )
*/ */
void EDA_3D_FRAME::Set3DBgColor() void EDA_3D_FRAME::Set3DBgColor()
{ {
S3D_Color color; S3D_COLOR color;
wxColour newcolor, oldcolor; wxColour newcolor, oldcolor;
oldcolor.Set( KiROUND( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ), oldcolor.Set( KiROUND( g_Parm_3D_Visu.m_BgColor.m_Red * 255 ),
......
/* /*
* 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) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * 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-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include <3d_viewer.h> #include <3d_viewer.h>
// separator chars
static const char* sep_chars = " \t\n\r";
int S3D_MASTER::ReadData() int S3D_MASTER::ReadData()
{ {
...@@ -85,13 +87,13 @@ int S3D_MASTER::ReadData() ...@@ -85,13 +87,13 @@ int S3D_MASTER::ReadData()
while( GetLine( file, line, &LineNum, 512 ) ) while( GetLine( file, line, &LineNum, 512 ) )
{ {
text = strtok( line, " \t\n\r" ); text = strtok( line, sep_chars );
if( stricmp( text, "DEF" ) == 0 ) if( stricmp( text, "DEF" ) == 0 )
{ {
while( GetLine( file, line, &LineNum, 512 ) ) while( GetLine( file, line, &LineNum, 512 ) )
{ {
text = strtok( line, " \t\n\r" ); text = strtok( line, sep_chars );
if( text == NULL ) if( text == NULL )
continue; continue;
...@@ -119,8 +121,8 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum ) ...@@ -119,8 +121,8 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum )
wxString mat_name; wxString mat_name;
S3D_MATERIAL* material = NULL; S3D_MATERIAL* material = NULL;
command = strtok( NULL, " \t\n\r" ); command = strtok( NULL, sep_chars );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
mat_name = FROM_UTF8( text ); mat_name = FROM_UTF8( text );
if( stricmp( command, "USE" ) == 0 ) if( stricmp( command, "USE" ) == 0 )
...@@ -134,7 +136,7 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum ) ...@@ -134,7 +136,7 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum )
} }
} }
printf( "ReadMaterial error: material not found\n" ); D( printf( "ReadMaterial error: material not found\n" ) );
return 0; return 0;
} }
...@@ -146,7 +148,7 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum ) ...@@ -146,7 +148,7 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum )
while( GetLine( file, line, LineNum, 512 ) ) while( GetLine( file, line, LineNum, 512 ) )
{ {
text = strtok( line, " \t\n\r" ); text = strtok( line, sep_chars );
if( text == NULL ) if( text == NULL )
continue; continue;
...@@ -159,44 +161,44 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum ) ...@@ -159,44 +161,44 @@ int S3D_MASTER::ReadMaterial( FILE* file, int* LineNum )
if( stricmp( text, "diffuseColor" ) == 0 ) if( stricmp( text, "diffuseColor" ) == 0 )
{ {
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_DiffuseColor.x = atof( text ); material->m_DiffuseColor.x = atof( text );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_DiffuseColor.y = atof( text ); material->m_DiffuseColor.y = atof( text );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_DiffuseColor.z = atof( text ); material->m_DiffuseColor.z = atof( text );
} }
else if( stricmp( text, "emissiveColor" ) == 0 ) else if( stricmp( text, "emissiveColor" ) == 0 )
{ {
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_EmissiveColor.x = atof( text ); material->m_EmissiveColor.x = atof( text );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_EmissiveColor.y = atof( text ); material->m_EmissiveColor.y = atof( text );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_EmissiveColor.z = atof( text ); material->m_EmissiveColor.z = atof( text );
} }
else if( strnicmp( text, "specularColor", 13 ) == 0 ) else if( strnicmp( text, "specularColor", 13 ) == 0 )
{ {
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_SpecularColor.x = atof( text ); material->m_SpecularColor.x = atof( text );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_SpecularColor.y = atof( text ); material->m_SpecularColor.y = atof( text );
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_SpecularColor.z = atof( text ); material->m_SpecularColor.z = atof( text );
} }
else if( strnicmp( text, "ambientIntensity", 16 ) == 0 ) else if( strnicmp( text, "ambientIntensity", 16 ) == 0 )
{ {
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_AmbientIntensity = atof( text ); material->m_AmbientIntensity = atof( text );
} }
else if( strnicmp( text, "transparency", 12 ) == 0 ) else if( strnicmp( text, "transparency", 12 ) == 0 )
{ {
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_Transparency = atof( text ); material->m_Transparency = atof( text );
} }
else if( strnicmp( text, "shininess", 9 ) == 0 ) else if( strnicmp( text, "shininess", 9 ) == 0 )
{ {
text = strtok( NULL, " \t\n\r" ); text = strtok( NULL, sep_chars );
material->m_Shininess = atof( text ); material->m_Shininess = atof( text );
} }
} }
...@@ -212,7 +214,7 @@ int S3D_MASTER::ReadChildren( FILE* file, int* LineNum ) ...@@ -212,7 +214,7 @@ int S3D_MASTER::ReadChildren( FILE* file, int* LineNum )
while( GetLine( file, line, LineNum, 512 ) ) while( GetLine( file, line, LineNum, 512 ) )
{ {
text = strtok( line, " \t\n\r" ); text = strtok( line, sep_chars );
if( *text == ']' ) if( *text == ']' )
return 0; return 0;
...@@ -226,7 +228,7 @@ int S3D_MASTER::ReadChildren( FILE* file, int* LineNum ) ...@@ -226,7 +228,7 @@ int S3D_MASTER::ReadChildren( FILE* file, int* LineNum )
} }
else else
{ {
printf( "ReadChildren error line %d <%s> \n", *LineNum, text ); D( printf( "ReadChildren error line %d <%s> \n", *LineNum, text ) );
break; break;
} }
} }
...@@ -242,7 +244,7 @@ int S3D_MASTER::ReadShape( FILE* file, int* LineNum ) ...@@ -242,7 +244,7 @@ int S3D_MASTER::ReadShape( FILE* file, int* LineNum )
while( GetLine( file, line, LineNum, 512 ) ) while( GetLine( file, line, LineNum, 512 ) )
{ {
text = strtok( line, " \t\n\r" ); text = strtok( line, sep_chars );
if( *text == '}' ) if( *text == '}' )
{ {
...@@ -260,7 +262,7 @@ int S3D_MASTER::ReadShape( FILE* file, int* LineNum ) ...@@ -260,7 +262,7 @@ int S3D_MASTER::ReadShape( FILE* file, int* LineNum )
} }
else else
{ {
printf( "ReadShape error line %d <%s> \n", *LineNum, text ); D( printf( "ReadShape error line %d <%s> \n", *LineNum, text ) );
break; break;
} }
} }
...@@ -276,7 +278,7 @@ int S3D_MASTER::ReadAppearance( FILE* file, int* LineNum ) ...@@ -276,7 +278,7 @@ int S3D_MASTER::ReadAppearance( FILE* file, int* LineNum )
while( GetLine( file, line, LineNum, 512 ) ) while( GetLine( file, line, LineNum, 512 ) )
{ {
text = strtok( line, " \t\n\r" ); text = strtok( line, sep_chars );
if( *text == '}' ) if( *text == '}' )
{ {
...@@ -289,7 +291,7 @@ int S3D_MASTER::ReadAppearance( FILE* file, int* LineNum ) ...@@ -289,7 +291,7 @@ int S3D_MASTER::ReadAppearance( FILE* file, int* LineNum )
} }
else else
{ {
printf( "ReadAppearance error line %d <%s> \n", *LineNum, text ); D( printf( "ReadAppearance error line %d <%s> \n", *LineNum, text ) );
break; break;
} }
} }
...@@ -402,7 +404,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum ) ...@@ -402,7 +404,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
while( GetLine( file, line, LineNum, 512 ) ) while( GetLine( file, line, LineNum, 512 ) )
{ {
strcpy( buffer, line ); strcpy( buffer, line );
text = strtok( buffer, " \t\n\r" ); text = strtok( buffer, sep_chars );
if( *text == '}' ) if( *text == '}' )
{ {
...@@ -507,7 +509,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum ) ...@@ -507,7 +509,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
} }
std::vector< int > coordIndex; std::vector< int > coordIndex;
std::vector< S3D_Vertex > vertices; std::vector< S3D_VERTEX > vertices;
while( GetLine( file, line, LineNum, 512 ) ) while( GetLine( file, line, LineNum, 512 ) )
{ {
...@@ -535,7 +537,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum ) ...@@ -535,7 +537,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
break; break;
} }
S3D_Vertex vertex; S3D_VERTEX vertex;
vertex.x = points[kk]; vertex.x = points[kk];
vertex.y = points[kk + 1]; vertex.y = points[kk + 1];
vertex.z = points[kk + 2]; vertex.z = points[kk + 2];
...@@ -572,7 +574,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum ) ...@@ -572,7 +574,7 @@ int S3D_MASTER::ReadGeometry( FILE* file, int* LineNum )
} }
int Struct3D_Shape::ReadData( FILE* file, int* LineNum ) int STRUCT_3D_SHAPE::ReadData( FILE* file, int* LineNum )
{ {
char line[512]; char line[512];
......
...@@ -41,32 +41,21 @@ ...@@ -41,32 +41,21 @@
class S3D_MASTER; class S3D_MASTER;
class Struct3D_Shape; class STRUCT_3D_SHAPE;
class S3D_Color /* 3D color (R, G, G) 3 floats range 0 to 1.0*/ /* S3D_VERTEX manages a 3D coordinate (3 float numbers: x,y,z coordinates)*/
{ class S3D_VERTEX
public:
double m_Red, m_Green, m_Blue;
public: S3D_Color()
{
m_Red = m_Green = m_Blue = 0;
}
};
/* S3D_Vertex manage a 3D coordinate (3 float numbers: x,y,z coordinates)*/
class S3D_Vertex
{ {
public: public:
double x, y, z; double x, y, z;
public: public:
S3D_Vertex() S3D_VERTEX()
{ {
x = y = z = 0.0; x = y = z = 0.0;
} }
S3D_Vertex( double px, double py, double pz) S3D_VERTEX( double px, double py, double pz)
{ {
x = px; x = px;
y = py; y = py;
...@@ -78,9 +67,9 @@ class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/ ...@@ -78,9 +67,9 @@ class S3D_MATERIAL : public EDA_ITEM /* openGL "material" data*/
{ {
public: public:
wxString m_Name; wxString m_Name;
S3D_Vertex m_DiffuseColor; S3D_VERTEX m_DiffuseColor;
S3D_Vertex m_EmissiveColor; S3D_VERTEX m_EmissiveColor;
S3D_Vertex m_SpecularColor; S3D_VERTEX m_SpecularColor;
float m_AmbientIntensity; float m_AmbientIntensity;
float m_Transparency; float m_Transparency;
float m_Shininess; float m_Shininess;
...@@ -104,10 +93,10 @@ class S3D_MASTER : public EDA_ITEM ...@@ -104,10 +93,10 @@ class S3D_MASTER : public EDA_ITEM
{ {
public: public:
wxString m_Shape3DName; /* 3D shape name in 3D library */ wxString m_Shape3DName; /* 3D shape name in 3D library */
S3D_Vertex m_MatScale; S3D_VERTEX m_MatScale;
S3D_Vertex m_MatRotation; S3D_VERTEX m_MatRotation;
S3D_Vertex m_MatPosition; S3D_VERTEX m_MatPosition;
Struct3D_Shape* m_3D_Drawings; STRUCT_3D_SHAPE* m_3D_Drawings;
S3D_MATERIAL* m_Materials; S3D_MATERIAL* m_Materials;
public: public:
...@@ -146,7 +135,7 @@ public: ...@@ -146,7 +135,7 @@ public:
int ReadShape( FILE* file, int* LineNum ); int ReadShape( FILE* file, int* LineNum );
int ReadAppearance( FILE* file, int* LineNum ); int ReadAppearance( FILE* file, int* LineNum );
int ReadGeometry( FILE* file, int* LineNum ); int ReadGeometry( FILE* file, int* LineNum );
void Set_Object_Coords( std::vector< S3D_Vertex >& aVertices ); void Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices );
#if defined(DEBUG) #if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override void Show( int nestLevel, std::ostream& os ) const { ShowDummy( os ); } // override
...@@ -155,19 +144,19 @@ public: ...@@ -155,19 +144,19 @@ public:
/* Describes a complex 3D */ /* Describes a complex 3D */
class Struct3D_Shape : public EDA_ITEM class STRUCT_3D_SHAPE : public EDA_ITEM
{ {
public: public:
S3D_Vertex* m_3D_Coord; S3D_VERTEX* m_3D_Coord;
int* m_3D_CoordIndex; int* m_3D_CoordIndex;
int m_3D_Points; int m_3D_Points;
public: public:
Struct3D_Shape( EDA_ITEM* aParent ); STRUCT_3D_SHAPE( EDA_ITEM* aParent );
~Struct3D_Shape(); ~STRUCT_3D_SHAPE();
Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; } STRUCT_3D_SHAPE* Next() const { return (STRUCT_3D_SHAPE*) Pnext; }
Struct3D_Shape* Back() const { return (Struct3D_Shape*) Pback; } STRUCT_3D_SHAPE* Back() const { return (STRUCT_3D_SHAPE*) Pback; }
int ReadData( FILE* file, int* LineNum ); int ReadData( FILE* file, int* LineNum );
...@@ -197,8 +186,8 @@ public: ...@@ -197,8 +186,8 @@ public:
* Function GetValue * Function GetValue
* @return the vertex in internal units. * @return the vertex in internal units.
*/ */
S3D_Vertex GetValue(); S3D_VERTEX GetValue();
void SetValue( S3D_Vertex vertex ); void SetValue( S3D_VERTEX vertex );
void Enable( bool enbl ); void Enable( bool enbl );
void SetToolTip( const wxString& text ); void SetToolTip( const wxString& text );
}; };
......
/* /*
* 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) 2004 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
* *
...@@ -63,10 +63,8 @@ class ZONE_CONTAINER; ...@@ -63,10 +63,8 @@ class ZONE_CONTAINER;
#define LIB3D_PATH wxT( "packages3d" ) #define LIB3D_PATH wxT( "packages3d" )
class EDA_3D_CANVAS;
class EDA_3D_FRAME; class EDA_3D_FRAME;
class S3D_Vertex; class S3D_VERTEX;
class SEGVIA; class SEGVIA;
...@@ -126,11 +124,37 @@ public: ...@@ -126,11 +124,37 @@ public:
void DrawGrid( double aGriSizeMM ); void DrawGrid( double aGriSizeMM );
void Draw3D_Track( TRACK* track ); /**
* Function Draw3D_Track
* @param aTrack = the aTrack to draw
*/
void Draw3D_Track( TRACK* aTrack );
/**
* Function Draw3D_Via
* draws 3D via as a cylinder and filled circles.
*/
void Draw3D_Via( SEGVIA* via );
/**
* Function Draw3D_DrawSegment
* draws a 3D segment (line, arc or circle).
*/
void Draw3D_DrawSegment( DRAWSEGMENT* segment );
/**
* Function Draw3D_Zone
* draw all solid areas in aZone
* @param aZone = the zone to draw
*/
void Draw3D_Zone( ZONE_CONTAINER* aZone );
/** /**
* Function Draw3D_SolidPolygonsInZones * Function Draw3D_SolidPolygonsInZones
* draw all solid polygons used as filled areas in a zone * draw all solid polygons used as filled areas in a zone
* Function used by Draw3D_Zone
* Note: polygons are drawn, but not the thick polygon outlines
* Use Draw3D_Zone to draw aZone
* @param aZone = the zone to draw * @param aZone = the zone to draw
*/ */
void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone ); void Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* aZone );
...@@ -143,13 +167,6 @@ public: ...@@ -143,13 +167,6 @@ public:
*/ */
void Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double aZpos ); void Draw3D_Polygon( std::vector<wxPoint>& aCornersList, double aZpos );
/**
* Function Draw3D_Via
* draws 3D via as a cylinder and filled circles.
*/
void Draw3D_Via( SEGVIA* via );
void Draw3D_DrawSegment( DRAWSEGMENT* segment );
/** /**
* Function Draw3D_DrawText * Function Draw3D_DrawText
* draws 3D segments to create text objects. * draws 3D segments to create text objects.
...@@ -242,6 +259,6 @@ private: ...@@ -242,6 +259,6 @@ private:
}; };
void SetGLColor( int color ); void SetGLColor( int color );
void Set_Object_Data( std::vector< S3D_Vertex >& aVertices ); void Set_Object_Data( std::vector< S3D_VERTEX >& aVertices );
#endif /* __3D_VIEWER_H__ */ #endif /* __3D_VIEWER_H__ */
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef __INFO3D_VISU_H__ #ifndef __INFO3D_VISU_H__
#define __INFO3D_VISU_H__ #define __INFO3D_VISU_H__
#include <wxBasePcbFrame.h> // m_auimanager member. #include <wxBasePcbFrame.h> // m_auimanager member.
#include <layers_id_colors_and_visibility.h> // Layers id definitions #include <layers_id_colors_and_visibility.h> // Layers id definitions
#if !wxUSE_GLCANVAS #if !wxUSE_GLCANVAS
...@@ -51,44 +51,52 @@ ...@@ -51,44 +51,52 @@
#include <3d_struct.h> #include <3d_struct.h>
#define m_ROTX m_Rot[0] #define m_ROTX m_Rot[0]
#define m_ROTY m_Rot[1] #define m_ROTY m_Rot[1]
#define m_ROTZ m_Rot[2] #define m_ROTZ m_Rot[2]
class S3D_COLOR /* 3D color (R, G, B) 3 floats range 0 to 1.0*/
{
public:
double m_Red, m_Green, m_Blue;
public: S3D_COLOR()
{
m_Red = m_Green = m_Blue = 0;
}
};
/* information needed to display 3D board */ /* information needed to display 3D board */
class INFO3D_VISU class INFO3D_VISU
{ {
public: public:
enum DISPLAY3D_FLG enum DISPLAY3D_FLG {
{ FL_AXIS=0, FL_MODULE, FL_ZONE,
FL_AXIS=0, FL_MODULE, FL_ZONE, FL_COMMENTS, FL_DRAWINGS, FL_ECO1, FL_ECO2,
FL_COMMENTS, FL_DRAWINGS, FL_ECO1, FL_ECO2,
FL_GRID, FL_GRID,
FL_LAST FL_LAST
}; };
double m_Beginx, m_Beginy; // position of mouse double m_Beginx, m_Beginy; // position of mouse
double m_Quat[4]; // orientation of object double m_Quat[4]; // orientation of object
double m_Rot[4]; // man rotation of object double m_Rot[4]; // man rotation of object
double m_Zoom; // field of view in degrees double m_Zoom; // field of view in degrees
double m_3D_Grid; // 3D grid valmue, in mm double m_3D_Grid; // 3D grid valmue, in mm
S3D_Color m_BgColor; S3D_COLOR m_BgColor;
bool m_DrawFlags[FL_LAST]; // show these special items bool m_DrawFlags[FL_LAST]; // show these special items
wxPoint m_BoardPos; wxPoint m_BoardPos;
wxSize m_BoardSize; wxSize m_BoardSize;
int m_CopperLayersCount; // Number of copper layers actually used by the board int m_CopperLayersCount; // Number of copper layers actually used by the board
const BOARD_DESIGN_SETTINGS* m_BoardSettings; // Link to current board design settings const BOARD_DESIGN_SETTINGS* m_BoardSettings; // Link to current board design settings
double m_EpoxyThickness; // Epoxy thickness (normalized) double m_EpoxyThickness; // Epoxy thickness (normalized)
double m_NonCopperLayerThickness; // Non copper layers thickness double m_NonCopperLayerThickness; // Non copper layers thickness
double m_BoardScale; /* Normalization scale for coordinates:
* when scaled between -1.0 and +1.0 */
double m_LayerZcoord[LAYER_COUNT]; // Z position of each layer (normalized)
double m_ActZpos;
double m_BoardScale; /* Normalization scale for coordinates:
* when scaled between -1.0 and +1.0 */
double m_LayerZcoord[LAYER_COUNT]; // Z position of each layer (normalized)
double m_ActZpos;
public: INFO3D_VISU(); public: INFO3D_VISU();
~INFO3D_VISU(); ~INFO3D_VISU();
}; };
...@@ -96,4 +104,4 @@ public: INFO3D_VISU(); ...@@ -96,4 +104,4 @@ public: INFO3D_VISU();
extern INFO3D_VISU g_Parm_3D_Visu; extern INFO3D_VISU g_Parm_3D_Visu;
extern double DataScale3D; // 3D scale units. extern double DataScale3D; // 3D scale units.
#endif /* __INFO3D_VISU_H__ */ #endif /* __INFO3D_VISU_H__ */
...@@ -10,25 +10,7 @@ include_directories( ...@@ -10,25 +10,7 @@ include_directories(
${INC_AFTER} ${INC_AFTER}
) )
set(EESCHEMA_SRCS set(EESCHEMA_DLGS
annotate.cpp
backanno.cpp
block.cpp
block_libedit.cpp
build_BOM.cpp
busentry.cpp
bus-wire-junction.cpp
class_drc_erc_item.cpp
class_libentry.cpp
class_library.cpp
class_netlist_object.cpp
cmp_library_keywords.cpp
cmp_library_lexer.cpp
component_references_lister.cpp
controle.cpp
cross-probing.cpp
dangling_ends.cpp
database.cpp
dialogs/dialog_color_config.cpp dialogs/dialog_color_config.cpp
dialogs/dialog_plot_schematic_DXF.cpp dialogs/dialog_plot_schematic_DXF.cpp
dialogs/dialog_plot_schematic_DXF_base.cpp dialogs/dialog_plot_schematic_DXF_base.cpp
...@@ -67,6 +49,7 @@ set(EESCHEMA_SRCS ...@@ -67,6 +49,7 @@ set(EESCHEMA_SRCS
dialogs/dialog_lib_edit_pin_base.cpp dialogs/dialog_lib_edit_pin_base.cpp
dialogs/dialog_lib_new_component.cpp dialogs/dialog_lib_new_component.cpp
dialogs/dialog_lib_new_component_base.cpp dialogs/dialog_lib_new_component_base.cpp
dialogs/dialog_netlist_base.cpp
dialogs/dialog_print_using_printer_base.cpp dialogs/dialog_print_using_printer_base.cpp
dialogs/dialog_print_using_printer.cpp dialogs/dialog_print_using_printer.cpp
dialogs/dialog_sch_edit_sheet_pin.cpp dialogs/dialog_sch_edit_sheet_pin.cpp
...@@ -77,6 +60,28 @@ set(EESCHEMA_SRCS ...@@ -77,6 +60,28 @@ set(EESCHEMA_SRCS
dialogs/dialog_schematic_find_base.cpp dialogs/dialog_schematic_find_base.cpp
dialogs/dialog_SVG_print.cpp dialogs/dialog_SVG_print.cpp
dialogs/dialog_SVG_print_base.cpp dialogs/dialog_SVG_print_base.cpp
)
set(EESCHEMA_SRCS
annotate.cpp
backanno.cpp
block.cpp
block_libedit.cpp
build_BOM.cpp
busentry.cpp
bus-wire-junction.cpp
class_drc_erc_item.cpp
class_libentry.cpp
class_library.cpp
class_netlist_object.cpp
cmp_library_keywords.cpp
cmp_library_lexer.cpp
component_references_lister.cpp
controle.cpp
cross-probing.cpp
dangling_ends.cpp
database.cpp
${EESCHEMA_DLGS}
edit_component_in_schematic.cpp edit_component_in_schematic.cpp
edit_bitmap.cpp edit_bitmap.cpp
edit_label.cpp edit_label.cpp
......
...@@ -204,6 +204,10 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -204,6 +204,10 @@ void SCH_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( !aHotKey && wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_CONTROL ) ) if( !aHotKey && wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_CONTROL ) )
snapToGrid = false; snapToGrid = false;
// Cursor is left off grid only if no block in progress
if( GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK )
snapToGrid = true;
if( snapToGrid ) if( snapToGrid )
pos = screen->GetNearestGridPosition( pos ); pos = screen->GetNearestGridPosition( pos );
...@@ -298,6 +302,10 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -298,6 +302,10 @@ void LIB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
if( !aHotKey && wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_CONTROL ) ) if( !aHotKey && wxGetKeyState( WXK_SHIFT ) && wxGetKeyState( WXK_CONTROL ) )
snapToGrid = false; snapToGrid = false;
// Cursor is left off grid only if no block in progress
if( GetScreen()->m_BlockLocate.GetState() != STATE_NO_BLOCK )
snapToGrid = true;
if( snapToGrid ) if( snapToGrid )
pos = screen->GetNearestGridPosition( pos ); pos = screen->GetNearestGridPosition( pos );
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
/* /*
* 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) 1992-2011 jean-pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr> * Copyright (C) 1992-2012 jean-pierre Charras <jean-pierre.charras@ujf-grenoble.fr>
* Copyright (C) 1992-2011 Kicad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2012 Kicad Developers, see change_log.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
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption") #define KEY_ANNOTATE_SORT_OPTION wxT("AnnotateSortOption")
#define KEY_ANNOTATE_ALGO_OPTION wxT("AnnotateAlgoOption") #define KEY_ANNOTATE_ALGO_OPTION wxT("AnnotateAlgoOption")
#define KEY_ANNOTATE_AUTOCLOSE_OPTION wxT("AnnotateAutoCloseOption")
#define KEY_ANNOTATE_USE_SILENTMODE wxT("AnnotateSilentMode")
DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent ) DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent )
...@@ -92,6 +94,14 @@ void DIALOG_ANNOTATE::InitValues() ...@@ -92,6 +94,14 @@ void DIALOG_ANNOTATE::InitValues()
m_rbStartSheetNumLarge->SetValue(1); m_rbStartSheetNumLarge->SetValue(1);
break; break;
} }
m_Config->Read(KEY_ANNOTATE_AUTOCLOSE_OPTION, &option, 0l);
if( option )
m_cbAutoCloseDlg->SetValue(1);
m_Config->Read(KEY_ANNOTATE_USE_SILENTMODE, &option, 0l);
if( option )
m_cbUseSilentMode->SetValue(1);
} }
annotate_down_right_bitmap->SetBitmap( KiBitmap( annotate_down_right_xpm ) ); annotate_down_right_bitmap->SetBitmap( KiBitmap( annotate_down_right_xpm ) );
...@@ -112,10 +122,19 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) ...@@ -112,10 +122,19 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
{ {
m_Config->Write(KEY_ANNOTATE_SORT_OPTION, GetSortOrder()); m_Config->Write(KEY_ANNOTATE_SORT_OPTION, GetSortOrder());
m_Config->Write(KEY_ANNOTATE_ALGO_OPTION, GetAnnotateAlgo()); m_Config->Write(KEY_ANNOTATE_ALGO_OPTION, GetAnnotateAlgo());
m_Config->Write(KEY_ANNOTATE_AUTOCLOSE_OPTION, GetAnnotateAutoCloseOpt());
m_Config->Write(KEY_ANNOTATE_USE_SILENTMODE, GetAnnotateSilentMode());
} }
// Display a message info in verbose mode,
// or if a reset of the previous annotation is asked.
bool promptUser = ! GetAnnotateSilentMode();
if( GetResetItems() ) if( GetResetItems() )
{
message = _( "Clear and annotate all of the components " ); message = _( "Clear and annotate all of the components " );
promptUser = true;
}
else else
message = _( "Annotate only the unannotated components " ); message = _( "Annotate only the unannotated components " );
...@@ -125,10 +144,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) ...@@ -125,10 +144,14 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
message += _( "on the current sheet?" ); message += _( "on the current sheet?" );
message += _( "\n\nThis operation will change the current annotation and cannot be undone." ); message += _( "\n\nThis operation will change the current annotation and cannot be undone." );
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL) if( promptUser )
return; {
response = wxMessageBox( message, wxT( "" ), wxICON_EXCLAMATION | wxOK | wxCANCEL );
if (response == wxCANCEL)
return;
}
m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(), m_Parent->AnnotateComponents( GetLevel(), (ANNOTATE_ORDER_T) GetSortOrder(),
(ANNOTATE_OPTION_T) GetAnnotateAlgo(), (ANNOTATE_OPTION_T) GetAnnotateAlgo(),
...@@ -136,6 +159,17 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event ) ...@@ -136,6 +159,17 @@ void DIALOG_ANNOTATE::OnApplyClick( wxCommandEvent& event )
m_Parent->GetCanvas()->Refresh(); m_Parent->GetCanvas()->Refresh();
m_btnClear->Enable(); m_btnClear->Enable();
if( GetAnnotateAutoCloseOpt() )
{
if( IsModal() )
EndModal( wxID_OK );
else
{
SetReturnCode( wxID_OK );
this->Show( false );
}
}
} }
......
/* /*
* 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) 1992-2009 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2012 KiCad Developers, see change_log.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,6 +45,7 @@ public: ...@@ -45,6 +45,7 @@ public:
DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent ); DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent );
~DIALOG_ANNOTATE(){}; ~DIALOG_ANNOTATE(){};
private:
/// Initialises member variables /// Initialises member variables
void InitValues(); void InitValues();
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
...@@ -56,6 +57,14 @@ public: ...@@ -56,6 +57,14 @@ public:
bool GetResetItems( void ); bool GetResetItems( void );
int GetSortOrder( void ); int GetSortOrder( void );
int GetAnnotateAlgo( void ); int GetAnnotateAlgo( void );
bool GetAnnotateAutoCloseOpt()
{
return m_cbAutoCloseDlg->GetValue();
}
bool GetAnnotateSilentMode()
{
return m_cbUseSilentMode->GetValue();
}
}; };
#endif #endif
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_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 );
...@@ -43,6 +43,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -43,6 +43,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
m_rbResetAnnotation = new wxRadioButton( this, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_rbResetAnnotation = new wxRadioButton( this, ID_RESET_ANNOTATION, _("&Reset existing annotation"), wxDefaultPosition, wxDefaultSize, 0 );
bscopeOptSizer->Add( m_rbResetAnnotation, 0, wxALL, 3 ); bscopeOptSizer->Add( m_rbResetAnnotation, 0, wxALL, 3 );
bupperSizer->Add( bscopeOptSizer, 0, wxEXPAND|wxLEFT|wxALIGN_RIGHT, 25 ); bupperSizer->Add( bscopeOptSizer, 0, wxEXPAND|wxLEFT|wxALIGN_RIGHT, 25 );
m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
...@@ -69,6 +70,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -69,6 +70,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
annotate_down_right_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); annotate_down_right_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerXpos->Add( annotate_down_right_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 12 ); bSizerXpos->Add( annotate_down_right_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxRIGHT, 12 );
b_orderOptSizer->Add( bSizerXpos, 0, wxEXPAND|wxRIGHT, 5 ); b_orderOptSizer->Add( bSizerXpos, 0, wxEXPAND|wxRIGHT, 5 );
wxBoxSizer* bSizerYpos; wxBoxSizer* bSizerYpos;
...@@ -83,8 +85,10 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -83,8 +85,10 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
annotate_right_down_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); annotate_right_down_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
bSizerYpos->Add( annotate_right_down_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 12 ); bSizerYpos->Add( annotate_right_down_bitmap, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 12 );
b_orderOptSizer->Add( bSizerYpos, 0, wxEXPAND|wxRIGHT, 5 ); b_orderOptSizer->Add( bSizerYpos, 0, wxEXPAND|wxRIGHT, 5 );
bupperSizer->Add( b_orderOptSizer, 0, wxEXPAND|wxLEFT, 25 ); bupperSizer->Add( b_orderOptSizer, 0, wxEXPAND|wxLEFT, 25 );
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
...@@ -111,6 +115,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -111,6 +115,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
bSizerChoiceInc->Add( 0, 0, 1, wxEXPAND, 5 ); bSizerChoiceInc->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer1AlgoChoice->Add( bSizerChoiceInc, 0, wxEXPAND|wxRIGHT, 5 ); bSizer1AlgoChoice->Add( bSizerChoiceInc, 0, wxEXPAND|wxRIGHT, 5 );
wxBoxSizer* bSizerChoiceIncBySheet; wxBoxSizer* bSizerChoiceIncBySheet;
...@@ -122,6 +127,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -122,6 +127,7 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
bSizerChoiceIncBySheet->Add( 0, 0, 1, wxEXPAND, 5 ); bSizerChoiceIncBySheet->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer1AlgoChoice->Add( bSizerChoiceIncBySheet, 1, wxEXPAND, 5 ); bSizer1AlgoChoice->Add( bSizerChoiceIncBySheet, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerChoiceIncBySheetLarge; wxBoxSizer* bSizerChoiceIncBySheetLarge;
...@@ -133,15 +139,63 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -133,15 +139,63 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
bSizerChoiceIncBySheetLarge->Add( 0, 0, 1, wxEXPAND, 5 ); bSizerChoiceIncBySheetLarge->Add( 0, 0, 1, wxEXPAND, 5 );
bSizer1AlgoChoice->Add( bSizerChoiceIncBySheetLarge, 1, wxEXPAND, 5 ); bSizer1AlgoChoice->Add( bSizerChoiceIncBySheetLarge, 1, wxEXPAND, 5 );
bSizerAnnotAlgo->Add( bSizer1AlgoChoice, 1, wxEXPAND|wxLEFT, 25 ); bSizerAnnotAlgo->Add( bSizer1AlgoChoice, 1, wxEXPAND|wxLEFT, 25 );
bupperSizer->Add( bSizerAnnotAlgo, 0, wxEXPAND|wxRIGHT, 5 ); bupperSizer->Add( bSizerAnnotAlgo, 0, wxEXPAND|wxRIGHT, 5 );
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bupperSizer->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 ); bupperSizer->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 );
wxBoxSizer* bSizerDldOptions;
bSizerDldOptions = new wxBoxSizer( wxVERTICAL );
m_staticTextDlgOpts = new wxStaticText( this, wxID_ANY, _("Dialog"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDlgOpts->Wrap( -1 );
m_staticTextDlgOpts->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) );
bSizerDldOptions->Add( m_staticTextDlgOpts, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerDlgChoices;
bSizerDlgChoices = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizerChoiceClose;
bSizerChoiceClose = new wxBoxSizer( wxHORIZONTAL );
m_cbAutoCloseDlg = new wxCheckBox( this, wxID_ANY, _("Automatically close this dialog"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChoiceClose->Add( m_cbAutoCloseDlg, 0, wxALL, 5 );
bSizerChoiceClose->Add( 0, 0, 1, wxEXPAND, 5 );
bSizerDlgChoices->Add( bSizerChoiceClose, 0, wxEXPAND|wxRIGHT, 5 );
wxBoxSizer* bSizerChoiceSilentMode;
bSizerChoiceSilentMode = new wxBoxSizer( wxHORIZONTAL );
m_cbUseSilentMode = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerChoiceSilentMode->Add( m_cbUseSilentMode, 0, wxALL, 5 );
bSizerChoiceSilentMode->Add( 0, 0, 1, wxEXPAND, 5 );
bSizerDlgChoices->Add( bSizerChoiceSilentMode, 1, wxEXPAND, 5 );
bSizerDldOptions->Add( bSizerDlgChoices, 1, wxEXPAND|wxLEFT, 25 );
m_staticline41 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerDldOptions->Add( m_staticline41, 0, wxEXPAND | wxALL, 5 );
bupperSizer->Add( bSizerDldOptions, 0, wxEXPAND|wxRIGHT, 5 );
wxBoxSizer* bButtonsSizer; wxBoxSizer* bButtonsSizer;
bButtonsSizer = new wxBoxSizer( wxHORIZONTAL ); bButtonsSizer = new wxBoxSizer( wxHORIZONTAL );
...@@ -154,10 +208,13 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con ...@@ -154,10 +208,13 @@ DIALOG_ANNOTATE_BASE::DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id, con
m_btnApply = new wxButton( this, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnApply = new wxButton( this, wxID_APPLY, _("Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
bButtonsSizer->Add( m_btnApply, 0, wxALL|wxEXPAND, 5 ); bButtonsSizer->Add( m_btnApply, 0, wxALL|wxEXPAND, 5 );
bupperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 6 ); bupperSizer->Add( bButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL, 6 );
bmainSizer->Add( bupperSizer, 1, wxALL|wxEXPAND, 6 ); bmainSizer->Add( bupperSizer, 1, wxALL|wxEXPAND, 6 );
this->SetSizer( bmainSizer ); this->SetSizer( bmainSizer );
this->Layout(); this->Layout();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010) // C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_annotate_base__ #ifndef __DIALOG_ANNOTATE_BASE_H__
#define __dialog_annotate_base__ #define __DIALOG_ANNOTATE_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h> #include <wx/intl.h>
#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>
...@@ -23,6 +25,7 @@ ...@@ -23,6 +25,7 @@
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/statbmp.h> #include <wx/statbmp.h>
#include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -39,7 +42,7 @@ ...@@ -39,7 +42,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_ANNOTATE_BASE /// Class DIALOG_ANNOTATE_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_ANNOTATE_BASE : public wxDialog class DIALOG_ANNOTATE_BASE : public DIALOG_SHIM
{ {
private: private:
...@@ -53,20 +56,19 @@ class DIALOG_ANNOTATE_BASE : public wxDialog ...@@ -53,20 +56,19 @@ class DIALOG_ANNOTATE_BASE : public wxDialog
wxStaticLine* m_staticline2; wxStaticLine* m_staticline2;
wxStaticText* m_staticTextOrder; wxStaticText* m_staticTextOrder;
wxRadioButton* m_rbSortBy_X_Position; wxRadioButton* m_rbSortBy_X_Position;
wxStaticBitmap* annotate_down_right_bitmap; wxStaticBitmap* annotate_down_right_bitmap;
wxRadioButton* m_rbSortBy_Y_Position; wxRadioButton* m_rbSortBy_Y_Position;
wxStaticBitmap* annotate_right_down_bitmap; wxStaticBitmap* annotate_right_down_bitmap;
wxStaticLine* m_staticline5; wxStaticLine* m_staticline5;
wxStaticText* m_staticTextAnnotateAlgo; wxStaticText* m_staticTextAnnotateAlgo;
wxRadioButton* m_rbUseIncremental; wxRadioButton* m_rbUseIncremental;
wxRadioButton* m_rbUseSheetNum; wxRadioButton* m_rbUseSheetNum;
wxRadioButton* m_rbStartSheetNumLarge; wxRadioButton* m_rbStartSheetNumLarge;
wxStaticLine* m_staticline4; wxStaticLine* m_staticline4;
wxStaticText* m_staticTextDlgOpts;
wxCheckBox* m_cbAutoCloseDlg;
wxCheckBox* m_cbUseSilentMode;
wxStaticLine* m_staticline41;
wxButton* m_btnClose; wxButton* m_btnClose;
wxButton* m_btnClear; wxButton* m_btnClear;
wxButton* m_btnApply; wxButton* m_btnApply;
...@@ -79,9 +81,9 @@ class DIALOG_ANNOTATE_BASE : public wxDialog ...@@ -79,9 +81,9 @@ class DIALOG_ANNOTATE_BASE : public wxDialog
public: public:
DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Annotate Schematic"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 432,382 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); DIALOG_ANNOTATE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Annotate Schematic"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 432,454 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_ANNOTATE_BASE(); ~DIALOG_ANNOTATE_BASE();
}; };
#endif //__dialog_annotate_base__ #endif //__DIALOG_ANNOTATE_BASE_H__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_netlist_base.h"
///////////////////////////////////////////////////////////////////////////
BEGIN_EVENT_TABLE( NETLIST_DIALOG_BASE, DIALOG_SHIM )
EVT_NOTEBOOK_PAGE_CHANGED( ID_CHANGE_NOTEBOOK_PAGE, NETLIST_DIALOG_BASE::_wxFB_OnNetlistTypeSelection )
EVT_BUTTON( ID_CREATE_NETLIST, NETLIST_DIALOG_BASE::_wxFB_GenNetlist )
EVT_BUTTON( wxID_CANCEL, NETLIST_DIALOG_BASE::_wxFB_OnCancelClick )
EVT_BUTTON( ID_ADD_PLUGIN, NETLIST_DIALOG_BASE::_wxFB_OnAddPlugin )
EVT_BUTTON( ID_DEL_PLUGIN, NETLIST_DIALOG_BASE::_wxFB_OnDelPlugin )
END_EVENT_TABLE()
NETLIST_DIALOG_BASE::NETLIST_DIALOG_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 );
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer;
bUpperSizer = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
m_NoteBook = new wxNotebook( this, ID_CHANGE_NOTEBOOK_PAGE, wxDefaultPosition, wxDefaultSize, 0 );
bRightSizer->Add( m_NoteBook, 1, wxEXPAND | wxALL, 5 );
bUpperSizer->Add( bRightSizer, 1, wxEXPAND, 5 );
wxBoxSizer* bLeftSizer;
bLeftSizer = new wxBoxSizer( wxVERTICAL );
bLeftSizer->Add( 0, 0, 0, wxTOP, 15 );
m_buttonNetlist = new wxButton( this, ID_CREATE_NETLIST, _("Netlist"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_buttonNetlist, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonAddPlugin = new wxButton( this, ID_ADD_PLUGIN, _("Add Plugin"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_buttonAddPlugin, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_buttonDelPlugin = new wxButton( this, ID_DEL_PLUGIN, _("Remove Plugin"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_buttonDelPlugin, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bLeftSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_cbUseDefaultNetlistName = new wxCheckBox( this, wxID_ANY, _("Use default netname"), wxDefaultPosition, wxDefaultSize, 0 );
bLeftSizer->Add( m_cbUseDefaultNetlistName, 0, wxALL, 5 );
bUpperSizer->Add( bLeftSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
m_staticTextDefaultFN = new wxStaticText( this, wxID_ANY, _("Default Netlist Filename:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDefaultFN->Wrap( -1 );
bMainSizer->Add( m_staticTextDefaultFN, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textCtrlDefaultFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
bMainSizer->Add( m_textCtrlDefaultFileName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
this->Centre( wxBOTH );
}
NETLIST_DIALOG_BASE::~NETLIST_DIALOG_BASE()
{
}
BEGIN_EVENT_TABLE( NETLIST_DIALOG_ADD_PLUGIN_BASE, DIALOG_SHIM )
EVT_BUTTON( wxID_OK, NETLIST_DIALOG_ADD_PLUGIN_BASE::_wxFB_OnOKClick )
EVT_BUTTON( wxID_CANCEL, NETLIST_DIALOG_ADD_PLUGIN_BASE::_wxFB_OnCancelClick )
EVT_BUTTON( wxID_BROWSE_PLUGINS, NETLIST_DIALOG_ADD_PLUGIN_BASE::_wxFB_OnBrowsePlugins )
END_EVENT_TABLE()
NETLIST_DIALOG_ADD_PLUGIN_BASE::NETLIST_DIALOG_ADD_PLUGIN_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 );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizerLeft;
bSizerLeft = new wxBoxSizer( wxVERTICAL );
m_staticTextCmd = new wxStaticText( this, wxID_ANY, _("Netlist command:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextCmd->Wrap( -1 );
bSizerLeft->Add( m_staticTextCmd, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textCtrlCommand = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_textCtrlCommand->SetMinSize( wxSize( 300,-1 ) );
bSizerLeft->Add( m_textCtrlCommand, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_staticTextName = new wxStaticText( this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextName->Wrap( -1 );
bSizerLeft->Add( m_staticTextName, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textCtrlName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizerLeft->Add( m_textCtrlName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerMain->Add( bSizerLeft, 1, wxEXPAND, 5 );
wxBoxSizer* bSizerRight;
bSizerRight = new wxBoxSizer( wxVERTICAL );
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOK->SetDefault();
bSizerRight->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 );
m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_buttonCancel, 0, wxALL|wxEXPAND, 5 );
m_buttonPlugin = new wxButton( this, wxID_BROWSE_PLUGINS, _("Browse Plugins"), wxDefaultPosition, wxDefaultSize, 0 );
bSizerRight->Add( m_buttonPlugin, 0, wxALL|wxEXPAND, 5 );
bSizerMain->Add( bSizerRight, 0, wxEXPAND, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
}
NETLIST_DIALOG_ADD_PLUGIN_BASE::~NETLIST_DIALOG_ADD_PLUGIN_BASE()
{
}
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 10 2012)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __DIALOG_NETLIST_BASE_H__
#define __DIALOG_NETLIST_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include "dialog_shim.h"
#include <wx/gdicmn.h>
#include <wx/notebook.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/sizer.h>
#include <wx/button.h>
#include <wx/statline.h>
#include <wx/checkbox.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class NETLIST_DIALOG_BASE
///////////////////////////////////////////////////////////////////////////////
class NETLIST_DIALOG_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnNetlistTypeSelection( wxNotebookEvent& event ){ OnNetlistTypeSelection( event ); }
void _wxFB_GenNetlist( wxCommandEvent& event ){ GenNetlist( event ); }
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
void _wxFB_OnAddPlugin( wxCommandEvent& event ){ OnAddPlugin( event ); }
void _wxFB_OnDelPlugin( wxCommandEvent& event ){ OnDelPlugin( event ); }
protected:
enum
{
ID_CHANGE_NOTEBOOK_PAGE = 1000,
ID_CREATE_NETLIST,
ID_ADD_PLUGIN,
ID_DEL_PLUGIN
};
wxNotebook* m_NoteBook;
wxButton* m_buttonNetlist;
wxButton* m_buttonCancel;
wxButton* m_buttonAddPlugin;
wxButton* m_buttonDelPlugin;
wxStaticLine* m_staticline1;
wxCheckBox* m_cbUseDefaultNetlistName;
wxStaticText* m_staticTextDefaultFN;
wxTextCtrl* m_textCtrlDefaultFileName;
// Virtual event handlers, overide them in your derived class
virtual void OnNetlistTypeSelection( wxNotebookEvent& event ) { event.Skip(); }
virtual void GenNetlist( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAddPlugin( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDelPlugin( wxCommandEvent& event ) { event.Skip(); }
public:
NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Netlist"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 404,334 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~NETLIST_DIALOG_BASE();
};
///////////////////////////////////////////////////////////////////////////////
/// Class NETLIST_DIALOG_ADD_PLUGIN_BASE
///////////////////////////////////////////////////////////////////////////////
class NETLIST_DIALOG_ADD_PLUGIN_BASE : public DIALOG_SHIM
{
DECLARE_EVENT_TABLE()
private:
// Private event handlers
void _wxFB_OnOKClick( wxCommandEvent& event ){ OnOKClick( event ); }
void _wxFB_OnCancelClick( wxCommandEvent& event ){ OnCancelClick( event ); }
void _wxFB_OnBrowsePlugins( wxCommandEvent& event ){ OnBrowsePlugins( event ); }
protected:
enum
{
wxID_BROWSE_PLUGINS = 1000
};
wxStaticText* m_staticTextCmd;
wxTextCtrl* m_textCtrlCommand;
wxStaticText* m_staticTextName;
wxTextCtrl* m_textCtrlName;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxButton* m_buttonPlugin;
// Virtual event handlers, overide them in your derived class
virtual void OnOKClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnBrowsePlugins( wxCommandEvent& event ) { event.Skip(); }
public:
NETLIST_DIALOG_ADD_PLUGIN_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Plugins:"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 312,144 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~NETLIST_DIALOG_ADD_PLUGIN_BASE();
};
#endif //__DIALOG_NETLIST_BASE_H__
...@@ -248,7 +248,9 @@ enum id_eeschema_frm ...@@ -248,7 +248,9 @@ enum id_eeschema_frm
ID_LIBVIEW_LIBWINDOW, ID_LIBVIEW_LIBWINDOW,
ID_LIBVIEW_CMPWINDOW, ID_LIBVIEW_CMPWINDOW,
ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
ID_SET_RELATIVE_OFFSET ID_SET_RELATIVE_OFFSET,
ID_END_EESCHEMA_ID_LIST
}; };
......
This diff is collapsed.
/***************************************************************************** /**
* @file netlist_control.h
*/
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 Jean-Pierre Charras, jp.charras@wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
* *
* netlist_control.h * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* *
*****************************************************************************/ * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef _NETLIST_CONTROL_H_ #ifndef _NETLIST_CONTROL_H_
#define _NETLIST_CONTROL_H_ #define _NETLIST_CONTROL_H_
#include <dialogs/dialog_netlist_base.h>
/* Event id for notebook page buttons: */ #define CUSTOMPANEL_COUNTMAX 8 // Max number of netlist plugins
enum id_netlist {
ID_CREATE_NETLIST = 1550, // Id to select netlist type
ID_CURRENT_FORMAT_IS_DEFAULT, enum NETLIST_TYPE_ID {
ID_RUN_SIMULATOR, NET_TYPE_UNINIT = 0,
ID_SETUP_PLUGIN, NET_TYPE_PCBNEW,
ID_VALIDATE_PLUGIN, NET_TYPE_ORCADPCB2,
ID_DELETE_PLUGIN, NET_TYPE_CADSTAR,
ID_NETLIST_NOTEBOOK, NET_TYPE_SPICE,
ID_CHANGE_NOTEBOOK_PAGE, NET_TYPE_CUSTOM1, /* NET_TYPE_CUSTOM1
ID_ADD_SUBCIRCUIT_PREFIX, * is the first id for user netlist format
* NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
* is the last id for user netlist format
*/
NET_TYPE_CUSTOM_MAX = NET_TYPE_CUSTOM1 + CUSTOMPANEL_COUNTMAX - 1
}; };
/* panel (notebook page) identifiers */ /* panel (notebook page) identifiers */
...@@ -31,19 +59,17 @@ enum panel_netlist_index { ...@@ -31,19 +59,17 @@ enum panel_netlist_index {
* others use PANELCUSTOMBASE+1, PANELCUSTOMBASE+2.. */ * others use PANELCUSTOMBASE+1, PANELCUSTOMBASE+2.. */
}; };
/* Values returned when the netlist dialog is demiss */ // Values returned when the netlist dialog is demiss
enum gen_netlist_diag { #define NET_PLUGIN_CHANGE 1
NET_OK, // other values in use are wxID_OK and wxID_CANCEL
NET_ABORT,
NET_PLUGIN_CHANGE
};
/* wxPanels for creating the NoteBook pages for each netlist format: */ /* wxPanels for creating the NoteBook pages for each netlist format: */
class NETLIST_PAGE_DIALOG : public wxPanel class NETLIST_PAGE_DIALOG : public wxPanel
{ {
public: public:
int m_IdNetType; NETLIST_TYPE_ID m_IdNetType;
wxCheckBox* m_IsCurrentFormat; wxCheckBox* m_IsCurrentFormat;
wxCheckBox* m_AddSubPrefix; wxCheckBox* m_AddSubPrefix;
wxTextCtrl* m_CommandStringCtrl; wxTextCtrl* m_CommandStringCtrl;
...@@ -63,11 +89,9 @@ public: ...@@ -63,11 +89,9 @@ public:
* @param parent = wxNotebook * parent * @param parent = wxNotebook * parent
* @param title = title (name) of the notebook page * @param title = title (name) of the notebook page
* @param id_NetType = netlist type id * @param id_NetType = netlist type id
* @param idCheckBox = event ID attached to the "format is default" check box
* @param idCreateFile = event ID attached to the "create netlist" button
*/ */
NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title, NETLIST_PAGE_DIALOG( wxNotebook* parent, const wxString& title,
int id_NetType, int idCheckBox, int idCreateFile ); NETLIST_TYPE_ID id_NetType );
~NETLIST_PAGE_DIALOG() { }; ~NETLIST_PAGE_DIALOG() { };
/** /**
...@@ -79,27 +103,10 @@ public: ...@@ -79,27 +103,10 @@ public:
*/ */
const wxString GetPageNetFmtName(); const wxString GetPageNetFmtName();
void SetPageNetFmtName( const wxString &aName ) { m_pageNetFmtName =aName; } void SetPageNetFmtName( const wxString &aName ) { m_pageNetFmtName = aName; }
}; };
#define CUSTOMPANEL_COUNTMAX 8 // Max number of netlist plugins
// Id to select netlist type
enum TypeNetForm {
NET_TYPE_UNINIT = 0,
NET_TYPE_PCBNEW,
NET_TYPE_ORCADPCB2,
NET_TYPE_CADSTAR,
NET_TYPE_SPICE,
NET_TYPE_CUSTOM1, /* NET_TYPE_CUSTOM1
* is the first id for user netlist format
* NET_TYPE_CUSTOM1+CUSTOMPANEL_COUNTMAX-1
* is the last id for user netlist format
*/
NET_TYPE_CUSTOM_MAX = NET_TYPE_CUSTOM1 + CUSTOMPANEL_COUNTMAX - 1
};
// Options for Spice netlist generation (OR'ed bits // Options for Spice netlist generation (OR'ed bits
enum netlistOptions { enum netlistOptions {
NET_USE_NETNAMES = 1, // for Spice netlist : use netnames instead of numbers NET_USE_NETNAMES = 1, // for Spice netlist : use netnames instead of numbers
...@@ -108,14 +115,16 @@ enum netlistOptions { ...@@ -108,14 +115,16 @@ enum netlistOptions {
}; };
/* Dialog frame for creating netlists */ /* Dialog frame for creating netlists */
class NETLIST_DIALOG : public wxDialog class NETLIST_DIALOG : public NETLIST_DIALOG_BASE
{ {
public: public:
SCH_EDIT_FRAME* m_Parent; SCH_EDIT_FRAME* m_Parent;
wxString m_NetFmtName; wxString m_NetFmtName;
wxNotebook* m_NoteBook;
NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX]; NETLIST_PAGE_DIALOG* m_PanelNetType[4 + CUSTOMPANEL_COUNTMAX];
private:
wxConfig* m_Config;
public: public:
// Constructor and destructor // Constructor and destructor
...@@ -124,20 +133,73 @@ public: ...@@ -124,20 +133,73 @@ public:
private: private:
void InstallCustomPages(); void InstallCustomPages();
NETLIST_PAGE_DIALOG* AddOneCustomPage( const wxString & aTitle,
const wxString & aCommandString,
NETLIST_TYPE_ID aNetTypeId );
void InstallPageSpice(); void InstallPageSpice();
void GenNetlist( wxCommandEvent& event ); void GenNetlist( wxCommandEvent& event );
void RunSimulator( wxCommandEvent& event ); void RunSimulator( wxCommandEvent& event );
void NetlistUpdateOpt(); void NetlistUpdateOpt();
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
void SelectNetlistType( wxCommandEvent& event ); void OnNetlistTypeSelection( wxNotebookEvent& event );
void SelectDefaultNetlistType( wxCommandEvent& event );
void EnableSubcircuitPrefix( wxCommandEvent& event ); void EnableSubcircuitPrefix( wxCommandEvent& event );
void AddNewPluginPanel( wxCommandEvent& event ); void OnAddPlugin( wxCommandEvent& event );
void DeletePluginPanel( wxCommandEvent& event ); void OnDelPlugin( wxCommandEvent& event );
void ValidatePluginPanel( wxCommandEvent& event );
void WriteCurrentNetlistSetup( void ); void WriteCurrentNetlistSetup( void );
bool GetUseDefaultNetlistName()
{
return m_cbUseDefaultNetlistName->IsChecked();
}
/**
* Function ReturnUserNetlistTypeName
* to retrieve user netlist type names
* @param first_item = true: return first name of the list, false = return next
* @return a wxString : name of the type netlist or empty string
* this function must be called first with "first_item" = true
* and after with "first_item" = false to get all the other existing netlist names
*/
const wxString ReturnUserNetlistTypeName( bool first_item );
/**
* Function ReturnFilenamePrms
* returns the filename extension and the wildcard string for this curr
* or a void name if there is no default name
* @param aNetTypeId = the netlist type ( NET_TYPE_PCBNEW ... )
* @param aExt = a reference to a wxString to return the defaut file ext.
* @param aWildCard = reference to a wxString to return the defaut wildcard.
* @return true for known netlist type, false for custom formats
*/
bool ReturnFilenamePrms( NETLIST_TYPE_ID aNetTypeId,
wxString * aExt, wxString * aWildCard );
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
class NETLIST_DIALOG_ADD_PLUGIN : public NETLIST_DIALOG_ADD_PLUGIN_BASE
{
private:
NETLIST_DIALOG* m_Parent;
public:
NETLIST_DIALOG_ADD_PLUGIN( NETLIST_DIALOG* parent );
const wxString GetPluginTitle()
{
return m_textCtrlName->GetValue();
}
const wxString GetPluginTCommandLine()
{
return m_textCtrlCommand->GetValue();
}
private:
void OnOKClick( wxCommandEvent& event );
void OnCancelClick( wxCommandEvent& event );
void OnBrowsePlugins( wxCommandEvent& event );
};
#endif /* _NETLIST_CONTROL_H_ */ #endif /* _NETLIST_CONTROL_H_ */
...@@ -338,22 +338,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -338,22 +338,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
int delta = 3600 / aCircleToSegmentsCount; // rot angle in 0.1 degree int delta = 3600 / aCircleToSegmentsCount; // rot angle in 0.1 degree
// Compute the outlines of the segment, and creates a polygon // Compute the outlines of the segment, and creates a polygon
corner = wxPoint( 0, radius );
RotatePoint( &corner, -delta_angle );
corner += startp;
polypoint.x = corner.x;
polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint );
corner = wxPoint( seg_len, radius );
RotatePoint( &corner, -delta_angle );
corner += startp;
polypoint.x = corner.x;
polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint );
// add right rounded end: // add right rounded end:
for( int ii = delta; ii < 1800; ii += delta ) for( int ii = 0; ii < 1800; ii += delta )
{ {
corner = wxPoint( 0, radius ); corner = wxPoint( 0, radius );
RotatePoint( &corner, ii ); RotatePoint( &corner, ii );
...@@ -365,6 +351,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -365,6 +351,7 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
aCornerBuffer.push_back( polypoint ); aCornerBuffer.push_back( polypoint );
} }
// Finish arc:
corner = wxPoint( seg_len, -radius ); corner = wxPoint( seg_len, -radius );
RotatePoint( &corner, -delta_angle ); RotatePoint( &corner, -delta_angle );
corner += startp; corner += startp;
...@@ -372,15 +359,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -372,15 +359,8 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
polypoint.y = corner.y; polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint ); aCornerBuffer.push_back( polypoint );
corner = wxPoint( 0, -radius );
RotatePoint( &corner, -delta_angle );
corner += startp;
polypoint.x = corner.x;
polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint );
// add left rounded end: // add left rounded end:
for( int ii = delta; ii < 1800; ii += delta ) for( int ii = 0; ii < 1800; ii += delta )
{ {
corner = wxPoint( 0, -radius ); corner = wxPoint( 0, -radius );
RotatePoint( &corner, ii ); RotatePoint( &corner, ii );
...@@ -391,6 +371,14 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer, ...@@ -391,6 +371,14 @@ void TransformRoundedEndsSegmentToPolygon( std::vector <CPolyPt>& aCornerBuffer,
aCornerBuffer.push_back( polypoint ); aCornerBuffer.push_back( polypoint );
} }
// Finish arc:
corner = wxPoint( 0, radius );
RotatePoint( &corner, -delta_angle );
corner += startp;
polypoint.x = corner.x;
polypoint.y = corner.y;
aCornerBuffer.push_back( polypoint );
aCornerBuffer.back().end_contour = true; aCornerBuffer.back().end_contour = true;
} }
......
...@@ -335,10 +335,10 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -335,10 +335,10 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
{ {
// If there's no intrusion and DRC is active, we pass the cursor // If there's no intrusion and DRC is active, we pass the cursor
// "as is", and let ShowNewTrackWhenMovingCursor figure out what to do. // "as is", and let ShowNewTrackWhenMovingCursor figure out what to do.
if( !Drc_On || !g_CurrentTrackSegment if( !Drc_On || !g_CurrentTrackSegment ||
|| (BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem() (BOARD_ITEM*)g_CurrentTrackSegment != this->GetCurItem() ||
|| !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment, !LocateIntrusion( m_Pcb->m_Track, g_CurrentTrackSegment,
GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) ) GetScreen()->m_Active_Layer, GetScreen()->RefPos( true ) ) )
{ {
GetScreen()->SetCrossHairPosition( curs_pos, snapToGrid ); GetScreen()->SetCrossHairPosition( curs_pos, snapToGrid );
} }
...@@ -350,7 +350,7 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH ...@@ -350,7 +350,7 @@ void PCB_EDIT_FRAME::GeneralControl( wxDC* aDC, const wxPoint& aPosition, int aH
pos = GetScreen()->GetCrossHairPosition(); pos = GetScreen()->GetCrossHairPosition();
GetScreen()->SetCrossHairPosition( oldpos, false ); GetScreen()->SetCrossHairPosition( oldpos, false );
m_canvas->CrossHairOff( aDC ); m_canvas->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( pos, false ); GetScreen()->SetCrossHairPosition( pos, snapToGrid );
m_canvas->CrossHairOn( aDC ); m_canvas->CrossHairOn( aDC );
if( m_canvas->IsMouseCaptured() ) if( m_canvas->IsMouseCaptured() )
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,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) 2011 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com * Copyright (C) 2011 Jean-Pierre Charras
* Copyright (C) 2012 Dick Hollenbeck, dick@softplc.com * Copyright (C) 2012 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
* *
...@@ -267,15 +267,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties() ...@@ -267,15 +267,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
m_ReferenceCtrl->SetValue( m_ReferenceCopy->m_Text ); m_ReferenceCtrl->SetValue( m_ReferenceCopy->m_Text );
m_ValueCtrl->SetValue( m_ValueCopy->m_Text ); m_ValueCtrl->SetValue( m_ValueCopy->m_Text );
#if wxCHECK_VERSION( 2, 8, 0 )
m_AttributsCtrl->SetItemToolTip( 0, m_AttributsCtrl->SetItemToolTip( 0,
_( "Use this attribute for most non smd components" ) ); _( "Use this attribute for most non smd components" ) );
m_AttributsCtrl->SetItemToolTip( 1, m_AttributsCtrl->SetItemToolTip( 1,
_( "Use this attribute for smd components.\nOnly components with this option are put in the footprint position list file" ) ); _( "Use this attribute for smd components.\nOnly components with this option are put in the footprint position list file" ) );
m_AttributsCtrl->SetItemToolTip( 2, m_AttributsCtrl->SetItemToolTip( 2,
_( "Use this attribute for \"virtual\" components drawn on board (like a old ISA PC bus connector)" ) ); _( "Use this attribute for \"virtual\" components drawn on board (like a old ISA PC bus connector)" ) );
#endif
/* Controls on right side of the dialog */ /* Controls on right side of the dialog */
switch( m_CurrentModule->m_Attributs & 255 ) switch( m_CurrentModule->m_Attributs & 255 )
...@@ -299,12 +296,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties() ...@@ -299,12 +296,12 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
m_AutoPlaceCtrl->SetSelection( m_AutoPlaceCtrl->SetSelection(
(m_CurrentModule->m_ModuleStatus & MODULE_is_LOCKED) ? 1 : 0 ); (m_CurrentModule->m_ModuleStatus & MODULE_is_LOCKED) ? 1 : 0 );
#if wxCHECK_VERSION( 2, 8, 0 )
m_AutoPlaceCtrl->SetItemToolTip( 0, m_AutoPlaceCtrl->SetItemToolTip( 0,
_( "Enable hotkey move commands and Auto Placement" ) ); _( "Enable hotkey move commands and Auto Placement" ) );
m_AutoPlaceCtrl->SetItemToolTip( 1, m_AutoPlaceCtrl->SetItemToolTip( 1,
_( "Disable hotkey move commands and Auto Placement" ) ); _( "Disable hotkey move commands and Auto Placement" ) );
#endif
m_CostRot90Ctrl->SetValue( m_CurrentModule->m_CntRot90 ); m_CostRot90Ctrl->SetValue( m_CurrentModule->m_CntRot90 );
m_CostRot180Ctrl->SetValue( m_CurrentModule->m_CntRot180 ); m_CostRot180Ctrl->SetValue( m_CurrentModule->m_CntRot180 );
...@@ -349,7 +346,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Transfert3DValuesToDisplay( ...@@ -349,7 +346,7 @@ void DIALOG_MODULE_BOARD_EDITOR::Transfert3DValuesToDisplay(
} }
else else
{ {
S3D_Vertex dummy_vertex; S3D_VERTEX dummy_vertex;
dummy_vertex.x = dummy_vertex.y = dummy_vertex.z = 1.0; dummy_vertex.x = dummy_vertex.y = dummy_vertex.z = 1.0;
m_3D_Scale->SetValue( dummy_vertex ); m_3D_Scale->SetValue( dummy_vertex );
} }
...@@ -474,6 +471,10 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event ) ...@@ -474,6 +471,10 @@ void DIALOG_MODULE_BOARD_EDITOR::Browse3DLib( wxCommandEvent& event )
} }
S3D_MASTER* new3DShape = new S3D_MASTER( NULL ); S3D_MASTER* new3DShape = new S3D_MASTER( NULL );
#ifdef __WINDOWS__
// Store filename in Unix notation
shortfilename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif
new3DShape->m_Shape3DName = shortfilename; new3DShape->m_Shape3DName = shortfilename;
m_Shapes3D_list.push_back( new3DShape ); m_Shapes3D_list.push_back( new3DShape );
m_3D_ShapeNameListBox->Append( shortfilename ); m_3D_ShapeNameListBox->Append( shortfilename );
......
...@@ -4,6 +4,32 @@ ...@@ -4,6 +4,32 @@
* @brief Dialog for editing a module properties in module editor (modedit) * @brief Dialog for editing a module properties in module editor (modedit)
*/ */
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2011 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
* Copyright (C) 2012 Dick Hollenbeck, dick@softplc.com
* Copyright (C) 2004-2011 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h> #include <fctsys.h>
#include <class_drawpanel.h> #include <class_drawpanel.h>
#include <confirm.h> #include <confirm.h>
...@@ -199,7 +225,7 @@ void DIALOG_MODULE_MODULE_EDITOR::Transfert3DValuesToDisplay( S3D_MASTER * aStru ...@@ -199,7 +225,7 @@ void DIALOG_MODULE_MODULE_EDITOR::Transfert3DValuesToDisplay( S3D_MASTER * aStru
} }
else else
{ {
S3D_Vertex dummy_vertex; S3D_VERTEX dummy_vertex;
dummy_vertex.x = dummy_vertex.y = dummy_vertex.z = 1.0; dummy_vertex.x = dummy_vertex.y = dummy_vertex.z = 1.0;
m_3D_Scale->SetValue( dummy_vertex ); m_3D_Scale->SetValue( dummy_vertex );
} }
...@@ -316,6 +342,11 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event ) ...@@ -316,6 +342,11 @@ void DIALOG_MODULE_MODULE_EDITOR::BrowseAndAdd3DLib( wxCommandEvent& event )
} }
S3D_MASTER* new3DShape = new S3D_MASTER(NULL); S3D_MASTER* new3DShape = new S3D_MASTER(NULL);
#ifdef __WINDOWS__
// Store filename in Unix notation
shortfilename.Replace( wxT( "\\" ), wxT( "/" ) );
#endif
new3DShape->m_Shape3DName = shortfilename; new3DShape->m_Shape3DName = shortfilename;
m_Shapes3D_list.push_back( new3DShape ); m_Shapes3D_list.push_back( new3DShape );
m_3D_ShapeNameListBox->Append( shortfilename ); m_3D_ShapeNameListBox->Append( shortfilename );
......
<?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="10" /> <FileVersion major="1" minor="11" />
<object class="Project" expanded="1"> <object class="Project" expanded="1">
<property name="class_decoration" /> <property name="class_decoration" />
<property name="code_generation">C++</property> <property name="code_generation">C++</property>
......
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