class_gbr_layout.cpp 903 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/**
 * @file class_gbr_layout.cpp
 * @brief  GBR_LAYOUT class functions.
 */

#include <limits.h>
#include <algorithm>

#include <fctsys.h>
#include <common.h>
#include <class_gbr_layout.h>

GBR_LAYOUT::GBR_LAYOUT()
{
    PAGE_INFO pageInfo( wxT( "GERBER" ) );
    SetPageSettings( pageInfo );
17
    m_printLayersMask = FULL_LAYERS;
18 19 20 21 22 23 24 25 26
}


GBR_LAYOUT::~GBR_LAYOUT()
{
}

/* Function IsLayerVisible
 * tests whether a given layer is visible
27
 * param aLayer = The layer to be tested
28 29
 * return bool - true if the layer is visible.
 */
30
bool GBR_LAYOUT::IsLayerVisible( LAYER_NUM aLayer ) const
31
{
32
    return m_printLayersMask & GetLayerMask( aLayer );
33 34 35 36 37 38 39 40 41 42 43 44 45
}


EDA_RECT GBR_LAYOUT::ComputeBoundingBox()
{
    EDA_RECT bbox;

    for( GERBER_DRAW_ITEM* gerb_item = m_Drawings; gerb_item; gerb_item = gerb_item->Next() )
        bbox.Merge( gerb_item->GetBoundingBox() );

    SetBoundingBox( bbox );
    return bbox;
}