Commit Graph

93 Commits

Author SHA1 Message Date
jean-pierre charras 4b916b42ed dialog_edit_module_for_BoardEditor.*: fix questionable code. 2017-04-16 20:52:41 +02:00
Wayne Stambaugh 5dbfc02334 Board editor footprint properties dialog 3D model viewer fix.
Move the dialog layout refresh from the ctor to TransferDataToWindow which
is called by event after the dialog object is constructed.  This was causing
the 3D view panel to be drawn incorrectly on windows builds.

Remove unnecessary wxT() macros.

Fixes lp:1665888

https://bugs.launchpad.net/kicad/+bug/1665888
2017-04-04 10:05:01 -04:00
John Beard a8eea6155a Move bitmaps.h out of base_struct.h
bitmaps.h was included in nearly every file in the project due to it
being included by base_struct.h

Only about 130 files actually use the XPM definitions defined there, and
many of those already included bitmaps.h themselves, or via
menu_helpers.h. However, touching bitmaps.h would result in over 400
rebuilt files for pcbnew alone.

This commit moves the bitmap-related types like BITMAT_DEF out to a new
header, which is still included by base_struct.h, which is less
avoidable for now, it's it's used in the interface.

The icon list is still in bitmaps.h. This has the side effect that's
it's now easier to automatically generate this file.

Many classes in pcbnew and eeschema needed some functions moved
to the implementaitons from the headers too.
2017-02-21 09:50:15 -05:00
Diogo Condeco 75ffcbcef5 MACOS Setfocus and CancelButtonIssue moved into dialog_shim.
Setfocus now works on macos dialogs by setting DLGSHIM_USE_SETFOCUS.
This option is only enabled __WXMAC__ is defined.

FixOSXCancelButtonIssue() is now called inside DIALOG_SHIM::SHOW.
All other calls from within the dialogs were removed.
2017-01-29 23:51:35 +01:00
Dick Hollenbeck 0c459ced97 EDA_TEXT object refactor.
Make all EDA_TEXT data private and rename accessors to avoid function
name collisions in derived classes.

Overload EDA_TEXT's SetTextAngle() and SetEffects() in TEXTE_PCB.

Add support for preserving Reference text position, size, orientation
during a netlist import into a BOARD, as well as the one off footprint
update dialog.
2017-01-25 08:03:32 -05:00
Chris Pavlina b9abcc309f Fix Validate hiding overloaded virtual in 3D viewer dialog 2016-09-30 22:32:24 -04:00
Maciej Suminski c4be379b31 Modified properties dialog to take advantage of BOARD_COMMIT class. 2016-09-12 11:50:06 +02:00
Maciej Suminski 09e0311d4e Replaced Copy() method with operator=. Removed Copy() where default copy ctor was enough. 2016-09-12 11:50:06 +02:00
Wayne Stambaugh cbcb3b896b Fix incorrect string translation macros.
* Replace _T() with _() for translatable strings.

* Don't translate debug messages.

* Don't translate copyright symbol.
2016-09-03 12:10:49 -04:00
Jon Neal 532a5fb827 Small grammar fix 2016-08-24 16:18:04 -04:00
jp-charras fdd434244c dialog footprint properties: better tool-tips 2016-08-24 18:20:20 +02:00
jp-charras d0fbd32bee dialog edit footprint properties: Generate an error message if a parameter is incorrect.
(previously when happens, no message but the dialog cannot be closed)
2016-08-24 17:18:51 +02:00
jean-pierre charras 7bc8cb56e0 Fix bug: Impossible to rescale 3D models 2016-08-05 21:30:23 +02:00
Mrio Luzeiro d8eab321f7 3D Viewer: complete refactor of the 3D viewer.
* Split and rewrite the preview window and canvas.
* Create a new class for handling the board information.
* Adds new render targets: openGL, legacy, and ray tracing.
* Render targets take full advantage of the new 3D plugins system and 3D cache
  for a fast 3D model loading.
* Faster board loading.
* New OpenGL render is faster than the old one.
* New ray tracing render target with a post processing shader.
* Use of new 3D plugins (WRL, X3D, STEP and IGES) and 3D model caching.
* Preview of 3D model while browsing the file name.
* 3D preview of the footprint while adding / align 3D shapes.
* Render of 3D models according to attributes: Normal, Normal+Insert, Virtual.
* Pivot rotation centered in one point over the PCB board.
* Shortcuts keys improved for XYZ orientation..
* Animated camera.
2016-07-19 13:35:25 -04:00
jean-pierre charras defac5272b refinemenst in dialogs and OSX Cancel button fix 2016-07-18 17:54:41 +02:00
jean-pierre charras f83a76a970 Eeschema: dialogs: incorrect sizes fixes and osx copy text fix 2016-07-18 09:04:13 +02:00
jean-pierre charras e7bbe27e36 Fix double call of TransfertDataToWindows in 4 dialogs (fix a bug I created in rev 6962). Make change working on KDE. 2016-07-04 18:22:18 +02:00
jean-pierre charras 1fbb84fd98 Move call of SetSizeHints in dialogs in a wxInitDialogEvent event, because some widgets sizes are not fully initialized before this event.
It is especially true in some Window Managers like KDE, but can be true in any WM, when initializations are mage by TransferDataToWindow() method.
2016-07-02 14:44:36 +02:00
Maciej Suminski 7ff3dd0807 Make sure GL canvas is visible upon destruction in Module properties dialogs. 2016-06-14 12:08:35 +02:00
Chris Pavlina 445db7da58 Fix uninitialized fields
Coverity: CIDs 102698, 147347, 147349, 147350
2016-05-10 22:36:23 -04:00
jean-pierre charras fde2cfee27 Minor changes: remove a few local shadowed local variables detected using " -Wshadow" gcc compil option ( No bug, just a better code readability ) and fix minor coding style issues. 2016-04-18 20:15:44 +02:00
Cirilo Bernardo 6120472d60 3D file name resolver improvements.
* Paths defined via pcbnew->Preferences->Configure Paths are now included in
  the 3D file browser's drop-down list except for KICAD_PTEMPLATES, KIGITHUB,
  KISYSMOD, any paths resembling a URL, and any non-existent paths. When an
  absolute path is shortened using one of these path aliases, let's say
  'KISYS3DMOD' then the name appears in the pcb file as "${KISYS3DMOD}/blah.wrl".
  If a user defines and actual environment variable with the same name, then
  that user defined variable will have precedence over the internally defined
  variable.

* Paths relative to the current project directory are no longer represented
  as "some/path/to/file.wrl".  For compatibility with previous KiCad versions
  it shall always be stored as ${KIPRJMOD}/some/path/to/file.wrl.

* Various restrictions on alias path values have been removed since the
  imposed restrictions could result in corrupted user data as aliases are
  silently dropped.

* Overall the patch should improve back-compatibility by providing a ${ENV_VAR}
  mechanism for supporting different model root directories and ensuring that
  paths relative to KIPRJMOD are expressed in a way that is compatible with
  earlier KiCad versions. This allows users more flexibility and the ability
  to work in a way that ensures 3D model files can be correctly resolved in
  earlier versions of KiCad. Users who do not care about back-compatibility
  may prefer to use the newer alias system.
2016-04-17 18:35:32 -04:00
Chris Pavlina 4d77388216 Clean up wxValidator window association
wxValidator::SetWindow was used too many times due to me being a dunderhead who
can't read the docs.
2016-04-10 18:28:06 -04:00
Chris Pavlina 0a6583f902 Eliminate 0.1deg units in DIALOG_MODULE_BOARD_EDITOR 2016-04-10 08:59:23 -04:00
Cirilo Bernardo 4d20f32fd0 Added 'Configure Paths' button to Footprint Properties editors 2016-02-28 10:17:58 +11:00
Cirilo Bernardo 5776037a70 Flush model data upon exit of Footprint Properties dialogs 2016-02-21 11:54:34 +11:00
Cirilo Bernardo 8efd3642bc Fixed bug which allowed empty filenames to be added to the model list 2016-01-25 17:10:08 +11:00
Cirilo Bernardo 3eca3fe75d Implemented new 3D file selector with preview 2016-01-25 15:55:36 +11:00
Cirilo Bernardo 31af6d7dbc Fixed GUI issues related to setting scale/offset/rotation 2016-01-23 20:07:58 +11:00
Cirilo Bernardo 7c829c9e84 Added manual editing of 3D file name with alias tags 2016-01-23 14:52:54 +11:00
Cirilo Bernardo 5d82d9348d Fix bug: MSWin to UNIX file separator conversion was in the wrong place, leading to wrong separator shown in GUI 2016-01-18 08:33:39 +11:00
Cirilo Bernardo f3c56eff12 Work in progress: changed Footprint Properties editors to handle aliased 3D file names 2016-01-16 17:49:28 +11:00
Cirilo Bernardo a0597c4614 GUI improvements including interactive update of model orientation/position 2015-12-09 16:43:30 +11:00
Mario Luzeiro 69cc788e8e + Removed glm source from kicad tree (Maciej / Cirilo)
+ Added renderer for 3D model preview (Mario)
+ Added 3d_cache including name resolver and modifications to 3D model dialogs (Cirilo)
2015-12-08 18:31:57 +11:00
Wayne Stambaugh a6a9d8eedf Default and most recently used path fixes. (fixes: 1494210)
* Rename Eda_FileSelector to EDA_FILE_SELECTOR.
* Add optional pointer to wxString to save the most recently used path to EDA_FILE_SELECTOR.
* Rename Eda_DirectorySelector to EDA_PATH_SELECTOR.
* Replace wxGetCwd() with wxStandardPaths::GetDocumentsDir().  This fixes the windows issue
  where wxGetCwd() returns the path where the executable files are located.
* Add code to handle most recently used path to EDA_BASE_FRAME.
* Fix string formatting error in kicad/files-io.cpp.
* Remove setting and restoring current working directory when launching GerbView.  Setting the CWD
  has no effect on the launched executable which starts with it's own CWD.
* Allow project path to be passed to GerbView when launched from KiCad.
* Note: this is a work in progress.  Do not expect every path and/or file selection dialog to properly
  update the most recently used path.  The correct solution to this problem requires a much more
  well though out solution which will not happen until after the next stable release.
2015-09-25 15:38:09 -04:00
jean-pierre charras 2605ab0984 Fixes related to exchage footprint dialog:
* The exchange dialog can be now called from the footprint popup menu.
* It can be (as before) called from the footprint properties menu, but in this case, the footprint properties menu is closed before calling the exchange menu.
* Changes in exchange dialog to avoid truncation of long FPIDs
* Changes in exchange dialog to make some texts translatable (Previously, the same English sentence was used in very different contexts)
2015-08-20 20:13:18 +02:00
unknown cc7549a2a5 * Python scripting: brings pad.GetZoneConnection() and in example pad.SetZoneConnection(pcbnew.PAD_ZONE_CONN_FULL) to full workable.
* Cleanup namespace  in enum ZoneConnection in pcbnew/zones.h to self-explained names unification:  PAD_ZONE_CONN_INHERITED, PAD_ZONE_CONN_NONE,PAD_ZONE_CONN_THERMAL,PAD_ZONE_CONN_FULL, PAD_ZONE_CONN_THT_THERMAL
2015-08-18 16:19:17 +02:00
jean-pierre charras 2427b40271 Fix Bug #1431423 (pcbnew: edited 3d model filename is not saved).
Eechema, libedit, pin dialog editor: show pin texts  in pin  preview canvas.
2015-03-12 18:43:39 +01:00
Maciej Suminski 4fb9bce354 Code formatting. 2015-02-18 17:53:46 +01:00
Tomasz Włostowski da9fc84421 improved module locking: lock pads only/lock whole module mode added 2015-02-18 00:58:14 +01:00
jean-pierre charras 5eb7b41fba Dialogs edit footprint in module editor and edit footprint in board editor: add button to edit the selected 3D shape filename.
Dialog edit component in library editor: add button to edit the selected footprint filter.
2015-02-02 17:43:34 +01:00
jean-pierre charras 5a38d2b657 Rework on env. variable KISYS3DMOD. Until now, was used in different files using different ways, so no consistency between files.
code cleanup.
2014-08-24 09:05:07 +02:00
Dick Hollenbeck 49538cafb9 https://lists.launchpad.net/kicad-developers/msg14286.html 2014-08-17 18:00:49 -05:00
Dick Hollenbeck 7e483f69bd Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
     get disassociated from their true PROJECT.
  *) Allow loading eeschema library editor from kicad.exe
  *) Allow loading pcbnew library editor from kicad.exe
  *) Rename LIB_COMPONENT to LIB_PART.
  *) Add class PART_LIBS, and PART_LIB.
  *) Make PART_LIBS non-global, i.e. PROJECT specific.
  *) Implement "data on demand" for PART_LIBS
  *) Implement "data on demand" for schematic SEARCH_STACK.
  *) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
  *) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
     a weak pointer.
  *) Remove all chdir() calls so projects don't need to be CWD.
  *) Romove APPEND support from OpenProjectFiles().
  *) Make OpenProjectFiles() robust, even for creating new projects.
  *) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
     and save them in the .eeschema config file, not in the project file.
  *) Fix bug with wxDir() while accessing protected dirs in kicad.exe
  *) Consolidate template copying into PROJECT class, not in kicad.exe source.
  *) Generally untangle eeschema, making its libraries not global but rather
     held in the PROJECT.
2014-08-13 15:28:54 -05:00
jean-pierre charras cd85ee626b Cosmetic enhancement: change plot icon in menus.
3dviewer: back to double (from float) in class S3D_MASTER for 3 members (m_MatScale, m_MatRotation, m_MatPosition) which are used in dialogs and r/w file functions, which expect double.
Using float create minor but unwanted issues in  r/w file functions.
S3D_MATERIAL: enable all color options: if a 3d shape has bad color parameters, the shape must be modified, not the 3d rendering.
The rendering now matches what we see in other vrml viewer like FreeCAD.
Some minor coding style fixes.
2014-08-09 20:18:04 +02:00
Dick Hollenbeck 4578ea8b9e 1) Add 32 Cu Layers.
2) Change from legacy Cu stack to counting down from top=(F_Cu or 0).
   The old Cu stack required knowing the count of Cu layers to make
   sense of the layer number when converting to many exported file types.
   The new Cu stack is more commonly used, although ours still gives
   B_Cu a fixed number.
3) Introduce class LSET and enum LAYER_ID.
4) Change *.kicad_pcb file format version to 4 from 3.
5) Change fixed names Inner1_Cu-Inner14_Cu to In1_Cu-In30_Cu and their
   meanings are typically flipped.
6) Moved the #define LAYER_N_* stuff into legacy_plugin.cpp where they
   can die a quiet death, and switch to enum LAYER_ID symbols throughout.
7) Removed the LEGACY_PLUGIN::Save() and FootprintSave() functions.
   You will need to convert to the format immediately, *.kicad_pcb and
   *.kicad_mod (=pretty) since legacy format was never going to know
   about 32 Cu layers and additional technical layers and the reversed Cu
   stack.
2014-06-24 11:17:18 -05:00
Dick Hollenbeck 8cb3423262 Remove class RETAINED_PATH, put is main member function into SEARCH_STACK.
Change class PROJECT to use a generalized wxString in place of the
RETAINED_PATH items, so that new session and project specific strings
of any purpose can be saved there, for the life of a session.
2014-06-10 10:56:43 -05:00
Dick Hollenbeck 6bfff89fe5 merge tip in, resolve. 2014-03-20 01:24:33 -05:00
Dick Hollenbeck 2c67c3ff80 * KIWAY Milestone A): Make major modules into DLL/DSOs.
!   The initial testing of this commit should be done using a Debug build so that
    all the wxASSERT()s are enabled.  Also, be sure and keep enabled the
    USE_KIWAY_DLLs option.  The tree won't likely build without it.  Turning it
    off is senseless anyways.  If you want stable code, go back to a prior version,
    the one tagged with "stable".

*   Relocate all functionality out of the wxApp derivative into more finely
    targeted purposes:
    a) DLL/DSO specific
    b) PROJECT specific
    c) EXE or process specific
    d) configuration file specific data
    e) configuration file manipulations functions.

    All of this functionality was blended into an extremely large wxApp derivative
    and that was incompatible with the desire to support multiple concurrently
    loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
    An amazing amount of organization come from simply sorting each bit of
    functionality into the proper box.

*   Switch to wxConfigBase from wxConfig everywhere except instantiation.
*   Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
    PGM_SINGLE_TOP,
*   Remove "Return" prefix on many function names.
*   Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
*   Fix building boost for use in a DSO on linux.
*   Remove some of the assumptions in the CMakeLists.txt files that windows had
    to be the host platform when building windows binaries.
*   Reduce the number of wxStrings being constructed at program load time via
    static construction.
*   Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
    these functions are useful even when the wxConfigBase comes from another
    source, as is the case in the KICAD_MANAGER_FRAME.
*   Move the setting of the KIPRJMOD environment variable into class PROJECT,
    so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
*   Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
    its child wxFrames and wxDialogs now have a Kiway() member function which
    returns a KIWAY& that that window tree branch is in support of.  This is like
    wxWindows DNA in that child windows get this member with proper value at time
    of construction.
*   Anticipate some of the needs for milestones B) and C) and make code
    adjustments now in an effort to reduce work in those milestones.
*   No testing has been done for python scripting, since milestone C) has that
    being largely reworked and re-thought-out.
2014-03-19 19:42:08 -05:00
jean-pierre charras c935624779 Use environment KISYS3DMOD to know defaut path for 3D shapes in footprint editors dialogs. 2014-02-10 10:30:08 +01:00