Commit fc8e0bfb authored by jean-pierre charras's avatar jean-pierre charras
Browse files

3D viewer: Modify the 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.
parents 0e903dba 4ac7dd58
Loading
Loading
Loading
Loading
+9 −39
Original line number Original line Diff line number Diff line
@@ -100,7 +100,8 @@ public:


    /**
    /**
     * Function CreateDrawGL_List
     * Function CreateDrawGL_List
     * creates the OpenGL draw list items.
     * Prepares the parameters of the OpenGL draw list
     * creates the OpenGL draw list items (board, grid ...
     */
     */
    GLuint CreateDrawGL_List();
    GLuint CreateDrawGL_List();
    void   InitGL();
    void   InitGL();
@@ -111,47 +112,16 @@ public:
        m_draw3dOffset.y = aPosY;
        m_draw3dOffset.y = aPosY;
    }
    }


    void   DrawGrid( double aGriSizeMM );

    /**
     * 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
     * Function BuildBoard3DView
     * draws a 3D segment (line, arc or circle).
     * Called by CreateDrawGL_List()
     * Fills the OpenGL draw list with board items draw list.
     */
     */
    void   Draw3D_DrawSegment( DRAWSEGMENT* segment );
    void   BuildBoard3DView();


    /**
    void   DrawGrid( double aGriSizeMM );
     * Function Draw3D_Zone
    void   Draw3DViaHole( SEGVIA * aVia );
     * draw all solid areas in aZone
    void   Draw3DPadHole( D_PAD * aPad );
     * @param aZone = the zone to draw
    */
    void Draw3D_Zone( ZONE_CONTAINER* aZone );

    /**
     * Function Draw3D_DrawText
     * draws 3D segments to create text objects.
     * When DrawGraphicText is called to draw a text to an OpenGL DC
     * it calls Draw3dTextSegm to each segment to draw.
     * 2 parameters used by Draw3D_FilledSegment are not handled by DrawGraphicText
     * but are used in Draw3D_FilledSegment().
     * they are 2 local variables. This is an ugly, but trivial code.
     * Using DrawGraphicText to draw all texts ensure texts have the same shape
     * in all contexts
     */
    void   Draw3D_DrawText( TEXTE_PCB* text );

    //int Get3DLayerEnable(int act_layer);


    DECLARE_EVENT_TABLE()
    DECLARE_EVENT_TABLE()
};
};
Loading