Commit 8d4a9b51 authored by dickelbeck's avatar dickelbeck
Browse files

gerbview polygon erasures added, comment tweaks

parent 0d790e57
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -13,8 +13,10 @@ email address.
    polygon code to use wxPoints since that is what the underlying wxWidgets
    API uses.
++gerbview
    More work on drawing polygons, erasure still work in progress.  Will
    probably switch to ZONEs from SEG_ZONEs for polygons.
  * More work on drawing polygons, erasure of polygons completed.
  * Added full support for aperture macro 6, MOIRE.
  * Example 2 in RS274xrevd_e.pdf almost draws properly now.  Need ARC support
    in polygons, and need polygon aperture type support to complete.


2008-Dec-28 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
+4 −0
Original line number Diff line number Diff line
@@ -38,6 +38,10 @@ asked by: Dick Hollenbeck
4) Expose layer name editing in pcbnew (anyone), should dove tail with net
   class editor from a UI perspective.

** Should probably switch gerbview to use ZONE instead of SEGZONE for polygons.
** Need to add ARC support to gerber polygons.
** Need to add polygon aperture type.  Then example 2 in RS274xrevd_e.pdf will draw properly.


2008-Feb-8 Assigned To: dick
asked by: dick
+1 −2
Original line number Diff line number Diff line
@@ -311,8 +311,7 @@ void BASE_SCREEN::AddGrid( const GRID_TYPE& grid )
        }
    }

    wxLogDebug( wxT( "Adding grid ID %d size( %d, %d ) to grid list." ),
                grid.m_Id, grid.m_Size.x, grid.m_Size.y );
    // wxLogDebug( wxT( "Adding grid ID %d size( %d, %d ) to grid list." ), grid.m_Id, grid.m_Size.x, grid.m_Size.y );

    m_GridList.Add( grid );
}
+6 −5
Original line number Diff line number Diff line
@@ -108,8 +108,9 @@ class D_CODE;
/**
 * Class DCODE_PARAM
 * holds a parameter for a DCODE or an "aperture macro" as defined within standard RS274X.
 * The \a value field can be either a constant or a place holder for a DCODE
 * parameter.
 * The \a value field can be a constant, i.e. "immediate" parameter or it may not be used
 * if this param is going to defer to the referencing aperture macro.  In that case, the
 * \a index field is an index into the aperture macro's paramters.
 */
class DCODE_PARAM
{
@@ -145,7 +146,7 @@ public:

private:
    int     index;      ///< if -1, then \a value field is an immediate value, else this is an index into parent's D_CODE.m_am_params.
    double  value;      ///< if IsImmediate()==true then the value, else not used.
    double  value;      ///< if IsImmediate()==true then use the value, else not used.
};


@@ -378,8 +379,8 @@ public:
                                   char*& text, int D_commande );

   /**
    * size of single line of a text line from a gerber file.
    * warning: some files can have very long lines, so the buffer must be large
    * size of single line of a text from a gerber file.
    * warning: some files can have very long lines, so the buffer must be large.
    */
#define GERBER_BUFZ     4000

+30 −39
Original line number Diff line number Diff line
@@ -238,43 +238,31 @@ static void fillLineTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
}


#if 0 // @todo get it into the doxygen function comment for fillArcTRACK below
/*****************************************************************/
static void Append_1_SEG_ARC_GERBER( int Dcode_index,
                                     WinEDA_GerberFrame* frame, wxDC* DC,
                                     const wxPoint& startpoint, const wxPoint& endpoint,
                                     const wxPoint& rel_center, int largeur,
                                     bool trigo_sens, bool multiquadrant, bool isDark )
/*****************************************************************/

/*
  * Creates an arc:
/**
 * Function fillArcTRACK
 * initializes a given TRACK so that it can draw an arc G code.
 * <p>
 * if multiquadrant == true : arc can be 0 to 360 degres
  *   and rel_center is the center coordiante relative to startpoint.
 *
 *   and \a rel_center is the center coordiante relative to startpoint.
 * <p>
 * if multiquadrant == false arc can be only 0 to 90 deg,
 *     and only in the same quadrant :
  *         absolute angle 0 to 90 (quadrant 1) or
  *         absolute angle 90 to 180 (quadrant 2) or
  *         absolute angle 180 to 270 (quadrant 3) or
  *         absolute angle 270 to 0 (quadrant 4)
  *   rel_center is the center coordiante relative to startpoint,
 * <ul>
 * <li> absolute angle 0 to 90 (quadrant 1) or
 * <li> absolute angle 90 to 180 (quadrant 2) or
 * <li> absolute angle 180 to 270 (quadrant 3) or
 * <li> absolute angle 270 to 0 (quadrant 4)
 * </ul><p>
 * @param aTrack is the TRACK to fill in.
 * @param Dcode_index is the DCODE value, like D14
 * @param aLayer is the layer index to set into the TRACK
 * @param aStart is the starting point
 * @param aEnd is the ending point
 * @param rel_center is the center coordiante relative to startpoint,
 *   given in ABSOLUE VALUE and the signe of values x et y de rel_center
  *   must be calculated from the previously given constraint: arc only in the same quadrant
 */

#endif


/**
 * Function fillArcTRACK
 * initializes a given TRACK so that it can draw an arc G code.
 *
 * @param aTrack The TRACK to fill in.
 * @param Dcode_index The DCODE value, like D14
 * @param aLayer The layer index to set into the TRACK
 * @param aPos The center point of the flash
 *   must be calculated from the previously given constraint: arc only in the same quadrant.
 * @param aDiameter The diameter of the round flash
 * @param aWidth is the pen width.
 * @param isDark True if flash is positive and should use a drawing
 *   color other than the background color, else use the background color
 *   when drawing so that an erasure happens.
@@ -682,8 +670,9 @@ int GERBER::ReturnDCodeNumber( char*& Text )
/******************************************************************/
bool GERBER::Execute_G_Command( char*& text, int G_commande )
/******************************************************************/

{
    D(printf( "%22s: G_CODE<%d>\n", __func__, G_commande );)

    switch( G_commande )
    {
    case GC_PHOTO_MODE:                 // can starts a D03 flash command: redundant, can be safely ignored
@@ -858,6 +847,8 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
    D_CODE*     tool = NULL;
    wxString    msg;

    D(printf( "%22s: D_CODE<%d>\n", __func__, D_commande );)

    if( D_commande >= FIRST_DCODE )  // This is a "Set tool" command
    {
        if( D_commande > (MAX_TOOLS - 1) )
Loading