Commit Graph

127 Commits

Author SHA1 Message Date
jean-pierre charras 24f516f6ae Fix many doxygen warnings (due to missing info, old comments, typo ...) when building the doxygen doc. 2014-11-02 17:25:04 +01:00
Dick Hollenbeck 1e7495e634 merge 2014-06-30 00:46:18 -05:00
Dick Hollenbeck 8627684122 use LSET::any() whereever possible and avoid conversion to integral type 2014-06-25 12:01:50 -05: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
jean-pierre charras 52d2e7eb59 Fix a bug in ClassOf which crashes Pcbnew when its argument is NULL. It fixes bug #1329364. 2014-06-12 22:03:57 +02:00
Tomasz Wlostowski 4121c27269 Clang-alike lightweight RTTI for pcbnew + type casting cleanup. 2014-06-06 11:44:21 +02:00
Lorenzo Marcantonio 073a9e1724 TRACK::GetTrack can now be told to confine search to the netlist and/or force the sequential (restartable) algorithm
Reworked the collinear track routines. Cleanup should be faster given the above modification.
2014-05-17 19:36:02 +02:00
Lorenzo Marcantonio e4508a65ff Missing const caused unpickability of tracks 2014-05-06 17:14:47 +02:00
Lorenzo Marcantonio 342016b692 Constification of HitTest and GetParent
In particular HitTest for zones *do not* select the nearest vertex/edge as a side effect
2014-05-04 19:08:36 +02:00
Lorenzo Marcantonio fca1ba6755 Virtual split of TRACK/VIA::HitTest 2014-05-01 08:50:11 +02:00
Lorenzo Marcantonio 7b4b3297db - Better way to iterate on vias in the track list (GetFirstVia)
- Converted the Next/Prev C casts to static casts and removed the type
  unsafe ones
- Splitted as virtual the VIA::Flip member instead of using RTTI
- Heavily refactored the 'unconnected track' cleanup routine
- Misc constification
2014-04-30 21:16:22 +02:00
Lorenzo Marcantonio c2af94ac03 Reworked the endpoint designator constants FLG_BEGIN and FLG_END in a
ENDPOINT_T enum type
2014-04-25 19:13:33 +02:00
Lorenzo Marcantonio 948f22de6d Removed the ugly bit stuffing for the bottom via layer number
(just replaced it with a member)
2014-04-25 10:03:50 +02:00
Lorenzo Marcantonio 3f2c0e1a8d TRACK/SEGVIA cleanup
- SEGVIA becomes VIA
- Drill size moved from TRACK to VIA
- Removed shape from TRACK, becomes ViaType in VIA
- GetTrace becomes GetTrack, for uniformity
- Some minor constification and typo fixes
2014-04-25 08:00:04 +02: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 5f01f123de All: GetBoundingBox returns now a const EDA_RECT.
Pcbnew: Code cleaning and bug fix in autoplace functions
Dialog exchange footprints has now a separate button to update the .cmp file, only on request.
2013-11-24 18:48:14 +01:00
Maciej Suminski e13f862145 Merged upstream. 2013-10-28 21:34:06 +01:00
jean-pierre charras e9713bb291 Pcbnew: Block selection enhancement, from Bug #593997 (whishlist)
1. block created from-left-to-right selects only 100%inside selection objects (as it now does)
2.block created from-right-to-left selects all overlapping objects inside selection
From the patch sent by mathieulj (mathieulj), and some fixes and code cleaning.
2013-09-21 20:09:41 +02:00
Maciej Suminski 8753bef2fa Moved VIEW_ITEM::ViewGetRequiredLayers() functionality to the VIEW class. Now required layers are set per layer basis instead of per item. 2013-08-05 16:28:58 +02:00
Maciej Suminski 46eabaa44e Fixed 'disappearing via' issue. 2013-07-08 14:06:45 +02:00
Maciej Suminski 032ef3a74c Showing net names on tracks. 2013-07-08 09:57:23 +02:00
Maciej Suminski e9ebdf2583 Upstream merge. 2013-06-05 10:01:53 +02:00
Lorenzo Marcantonio af5a9a8de9 Removed Show code from BOARD_ITEM derived classes (as requested by Dick) 2013-05-05 12:23:18 +02:00
jean-pierre charras b2a76062c7 All: use CPOLYGONS_LIST, a typedef of std::vector<CPolyPt> to handle a Corners Polygons List.
This is a starting point of some code enhancements relative to polygons in Pcbew and 3D viewer.
2013-05-03 19:51:10 +02:00
jean-pierre charras 4ac7dd5845 3D viewer: Modify yhe way board items shapes are built:
* All items shapes  are converted to polygons.
* Polygons are merged layer by layer (for calculation time reasons,zones are not merged)
* for copper layers, vias and pads holes are substracted from polygons (but, for calculation time reasons,  not inside zones areas).
* the look is better, mainly when displaying the copper thickness
* solder and paste layers are now shown in 3D viewer.
* the code was seriously cleaned (but still needs to be enhanced).
* Note this is a work in progress which needs refinements.
2013-05-01 21:01:14 +02:00
Lorenzo Marcantonio 0e903dba5b Angle and distances cleanup (preparing for angles in doubles)
- Removed spurious int casts (these are truncated anyway and will break
  doubles)

- Applied the Distance, GetLineLength, EuclideanNorm, DEG2RAD, RAD2DEG
  ArcTangente and NORMALIZE* functions where possible

- ArcTangente now returns double and handles the 0,0 case like atan2, so
  it's no longer necessary to check for it before calling

- Small functions in trigo moved as inline
2013-05-01 19:32:36 +02:00
Maciej Suminski 07cd3bcb56 Upstream merged 2013-04-10 15:03:35 +02:00
Lorenzo Marcantonio 20eaf66d5b Hunted down hardcoded pixel size thresholds for drawing
Dynamic contrast for netname and pin numbers ('halo' text)
Handle netname drawing even on diagonal tracks
2013-04-09 19:16:53 +02:00
Maciej Suminski e262b32198 Introduction of Graphics Abstraction Layer based rendering for pcbnew.
New classes:
    - VIEW - represents view that is seen by user, takes care of layer ordering & visibility and how it is displayed (which location, how much zoomed, etc.)
    - VIEW_ITEM - Base class for every item that can be displayed on VIEW (the biggest change is that now it may be necessary to override ViewBBox & ViewGetLayers method for derived classes).
    - EDA_DRAW_PANEL_GAL - Inherits after EDA_DRAW_PANEL, displays VIEW output, right now it is not editable (in opposite to usual EDA_DRAW_PANEL).
    - GAL/OPENGL_GAL/CAIRO_GAL - Base Graphics Abstraction Layer class + two different flavours (Cairo is not fully supported yet), that offers methods to draw primitives using different libraries.
    - WX_VIEW_CONTROLS - Controller for VIEW, handles user events, allows zooming, panning, etc.
    - PAINTER/PCB_PAINTER - Classes that uses GAL interface to draw items (as you may have already guessed - PCB_PAINTER is a class for drawing PCB specific object, PAINTER is an abstract class). Its methods are invoked by VIEW, when an item has to be drawn. To display a new type of item - you need to implement draw(ITEM_TYPE*) method that draws it using GAL methods.
    - STROKE_FONT - Implements stroke font drawing using GAL methods.
                          
Most important changes to Kicad original code:
    * EDA_ITEM now inherits from VIEW_ITEM, which is a base class for all drawable objects.
    * EDA_DRAW_FRAME contains both usual EDA_DRAW_PANEL and new EDA_DRAW_PANEL_GAL, that can be switched anytime.
    * There are some new layers for displaying multilayer pads, vias & pads holes (these are not shown yet on the right sidebar in pcbnew)
    * Display order of layers is different than in previous versions (if you are curious - you may check m_galLayerOrder@pcbnew/basepcbframe.cpp). Preserving usual order would result in not very natural display, such as showing silkscreen texts on the bottom.
    * Introduced new hotkey (Alt+F12) and new menu option (View->Switch canvas) for switching canvas during runtime.
    * Some of classes (mostly derived from BOARD_ITEM) now includes ViewBBox & ViewGetLayers methods.
    * Removed tools/class_painter.h, as now it is extended and included in source code.
                         
Build changes:
    * GAL-based rendering option is turned on by a new compilation CMake option KICAD_GAL.
    * When compiling with CMake option KICAD_GAL=ON, GLEW and Cairo libraries are required.
    * GAL-related code is compiled into a static library (common/libgal).
    * Build with KICAD_GAL=OFF should not need any new libraries and should come out as a standard version of Kicad
                            
Currently most of items in pcbnew can be displayed using OpenGL (to be done are DIMENSIONS and MARKERS).
More details about GAL can be found in: http://www.ohwr.org/attachments/1884/view-spec.pdf
2013-04-02 08:54:03 +02:00
Lorenzo Marcantonio 9fd79dfa91 Implemented the LAYER_NUM typedef (LAYER was already taken as a class name...) to represent a layer number. 2013-03-31 15:27:46 +02:00
Lorenzo Marcantonio e0303a4558 - New typedef LAYER_MSK to encapsulate a layer bitmap
- Renamed ReturnMaskLayer to GetLayerMask (since it's a plain getter)
2013-03-30 18:24:04 +01:00
Lorenzo Marcantonio 675f8d4a0b Typedef STATUS_FLAGS to encapsulate EDA_ITEM bitmapped flags 2013-03-28 20:12:46 +01:00
Heikki Pulkkinen 3e18fa422c protect data in class_track.h, switch to using member accessors 2013-01-12 18:04:00 -06:00
Wayne Stambaugh f8a56d446f Base object decoupling improvements.
* Improve MSG_PANEL_ITEM to handle message panel information.
* Create containers for passing message panel items between objects and
  the message panel.
* Rename EDA_ITEM::DisplayInfo to EDA_ITEM::GetMsgPanelInfo.
* Remove all direct manipulation of EDA_DRAW_FRAME from all objects derived
  from EDA_ITEM.
2013-01-12 12:32:24 -05:00
Lorenzo Marcantonio 082d901d60 Encapsulated drawmode as an enum for type checking 2012-09-01 15:38:27 +02:00
Wayne Stambaugh d8b60a14e1 Pcbnew s-expression file format improvements.
* Move board item object Format() functions into PCB_IO object.
* Change file format to use layer names instead of numbers.
* Change file extension to kicad_pcb.
2012-04-22 11:16:39 -04:00
Dick Hollenbeck 3341669fc6 more footprint support for LEGACY_PLUGIN 2012-04-16 20:35:43 -05:00
Wayne Stambaugh d7feb9ab45 Initial Pcbnew s-expression file format commit.
* Add s-expression Format() function to all objects derived from
  BOARD_ITEM.
* Add s-expression Format() function to base objects as required.
* Add functions to convert coordinates from base internal units
  (nanometers) to millimeter string for writing to s-expression
  file.
* Add temporary dummy conversion functions to prevent link errors
  until schematic and board object and action code can be separated
  into DSO/DLL.
* Add CMake build option to build Pcbnew with nanometer internal
  units.
2012-04-01 16:51:56 -04:00
Wayne Stambaugh 45445dd88f Minor code improvements and coding policy fixes.
* BLOCK_SELECTOR class is not longer derived from EDA_ITEM.
* Encapsulate BLOCK_SELECTOR class member variables and add access methods.
* Move HandleBlockBegin() function from block_commande.cpp to drawframe.cpp.
* Remove virtual methods from top level derived objects per future
  coding policy change.
* Remove Doxygen copydoc statement from objects derived from EDA_ITEM
  since the comments are automatically copied to the derived object.
* Removed copy and pasted Doxygen comments from objects derived from
  EDA_ITEM.
2012-03-26 19:47:08 -04:00
Wayne Stambaugh 058e17edf7 Minor code and Doxygen comment improvements.
* Remove double Clone() function calls from all classes derived from
  EDA_ITEM.
* Lots of Doxygen comment warning fixes.
2012-03-17 10:39:27 -04:00
Wayne Stambaugh 6375497825 Hit test method rationalization and other minor improvements.
* All objects derived from EDA_ITEM now have consistent hit test method
  definitions.
* Remove double function calls from all classes derived from SCH_ITEM.
* Lots of Doxygen comment fixes.
2012-03-15 10:31:16 -04:00
Dick Hollenbeck 107ef8f102 see CHANGELOG.txt 2012-02-19 22:33:54 -06:00
Dick Hollenbeck b8a0ab4c52 switch to <> for includes from "" per conversation with Jean-Pierre and Wayne, adjust search paths 2012-01-22 22:33:36 -06:00
Wayne Stambaugh 5289c22087 Pcbnew object improvements.
* Remove unnecessary copy constructors from board and module library
  objects.
* Add doClone() method to board and library objects.
* Add comment to class definitions where the default copy constructor
  generated by the compiler was adequate.
* Replace copy method with clone method where applicable.
* Remove DuplicateStruct() function.
* Remove track object copy function.
2012-01-14 14:50:32 -05:00
Dick Hollenbeck dd091fc6b9 merge in mainline into KICAD_PLUGIN work, which is for the PCBNEW nanometer support 2012-01-05 10:30:58 -06:00
Wayne Stambaugh 8985a1807b Encapsulation and other minor improvements.
* EDA_DRAW_PANEL completely encapsulated.
* Moved OSX m_overlay member from EDA_DRAW_PANEL to EDA_DRAW_FRAME where
  it is used.
* Doxygen comment warning fixes.
2011-12-29 15:11:42 -05:00
Dick Hollenbeck 0d4598656b rename Ki_PageDescr to PAGE_INFO, encapsulate it in accessors, and move it into the BOARD 2011-12-22 15:57:50 -06:00
Dick Hollenbeck 463c17b807 fix EDA_ITEM::Show() prototype bug, fix KICAD_PLUGIN::Save() problem with netclasses. 2011-12-14 11:25:42 -06:00
Dick Hollenbeck 74ccc4b558 ++common
* changed all the RotatePoint() functions in trigo.{h,cpp} to take a double as the
    angle, which is still in tenths of degrees for now.
  * EDA_TEXT::m_Orient is now double, still in tenths of degrees (for a short while),
    but the double means parsing files and saving them use a different format string.
++pcbnew
  * DRAWSEGMENT::GetStart() and GetEnd() do not operate for S_ARC like they used to.
    They are now simply accessors for m_Start and m_End.  Use DRAWSEGMENT::GetArcStart()
    and GetArcEnd() and GetCenter() for arcs.  specctra_export.cpp was the only
    source file dependent on the old behavior.
  * DIMENSION::m_Text is now contained, not dynamically allocated.
  * more kicad_plugin work.
2011-12-13 22:43:51 -06:00
Dick Hollenbeck 96bb90dee1 kicad_plugin 2011-12-13 22:29:25 -06:00