2014-10-21 18:36:45 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
|
2022-08-20 09:27:35 +00:00
|
|
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-21 18:36:45 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
/**
|
2018-01-29 12:26:58 +00:00
|
|
|
* @file gbr_layout.h
|
2018-09-28 08:10:08 +00:00
|
|
|
* @brief Class CLASS_GBR_LAYOUT to handle info to draw loaded Gerber images
|
2014-11-22 11:52:57 +00:00
|
|
|
* and page frame reference
|
2012-05-04 17:44:42 +00:00
|
|
|
*/
|
|
|
|
|
2018-01-29 12:26:58 +00:00
|
|
|
#ifndef GBR_LAYOUT_H
|
|
|
|
#define GBR_LAYOUT_H
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
|
2014-06-27 17:07:42 +00:00
|
|
|
#include <gerbview.h> // GERBER_DRAWLAYERS_COUNT
|
2018-01-29 10:37:29 +00:00
|
|
|
#include <title_block.h>
|
2018-01-29 12:26:58 +00:00
|
|
|
#include <gerber_draw_item.h>
|
2018-01-29 10:37:29 +00:00
|
|
|
#include <eda_rect.h>
|
2012-05-04 17:44:42 +00:00
|
|
|
|
2016-06-17 18:00:29 +00:00
|
|
|
class GERBER_FILE_IMAGE_LIST;
|
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* A list of #GERBER_DRAW_ITEM objects currently loaded.
|
2012-05-04 17:44:42 +00:00
|
|
|
*/
|
2017-09-17 22:43:20 +00:00
|
|
|
class GBR_LAYOUT : public EDA_ITEM
|
2012-05-04 17:44:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GBR_LAYOUT();
|
|
|
|
~GBR_LAYOUT();
|
|
|
|
|
2017-09-17 22:43:20 +00:00
|
|
|
wxString GetClass() const override
|
|
|
|
{
|
|
|
|
return wxT( "GBR_LAYOUT" );
|
|
|
|
}
|
|
|
|
|
2016-06-17 18:00:29 +00:00
|
|
|
// Accessor to the GERBER_FILE_IMAGE_LIST,
|
|
|
|
// which handles the list of gerber files (and drill files) images loaded
|
2017-09-17 22:43:20 +00:00
|
|
|
GERBER_FILE_IMAGE_LIST* GetImagesList() const;
|
2016-06-17 18:00:29 +00:00
|
|
|
|
2022-01-01 18:57:44 +00:00
|
|
|
const VECTOR2I& GetAuxOrigin() const { return m_originAxisPosition; }
|
|
|
|
void SetAuxOrigin( const VECTOR2I& aPosition ) { m_originAxisPosition = aPosition; }
|
2012-05-04 17:44:42 +00:00
|
|
|
|
2019-05-31 12:15:25 +00:00
|
|
|
TITLE_BLOCK& GetTitleBlock() { return m_titles; }
|
|
|
|
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; }
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Calculate the bounding box containing all Gerber items.
|
|
|
|
*
|
|
|
|
* @return the full item list bounding box.
|
2012-05-04 17:44:42 +00:00
|
|
|
*/
|
2017-09-17 22:43:20 +00:00
|
|
|
EDA_RECT ComputeBoundingBox() const;
|
2012-05-04 17:44:42 +00:00
|
|
|
|
2017-09-17 22:43:20 +00:00
|
|
|
const EDA_RECT GetBoundingBox() const override
|
|
|
|
{
|
|
|
|
return ComputeBoundingBox();
|
|
|
|
}
|
2012-05-04 17:44:42 +00:00
|
|
|
|
|
|
|
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
|
|
|
|
|
2021-01-26 15:23:37 +00:00
|
|
|
///< @copydoc EDA_ITEM::Visit()
|
2022-08-20 09:27:35 +00:00
|
|
|
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData,
|
2022-08-21 19:54:07 +00:00
|
|
|
const std::vector<KICAD_T>& aScanTypes ) override;
|
2017-09-17 22:43:20 +00:00
|
|
|
|
2012-05-04 17:44:42 +00:00
|
|
|
#if defined(DEBUG)
|
2019-05-31 12:15:25 +00:00
|
|
|
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }
|
2012-05-04 17:44:42 +00:00
|
|
|
#endif
|
2021-06-03 18:32:24 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
mutable EDA_RECT m_BoundingBox;
|
|
|
|
TITLE_BLOCK m_titles;
|
2022-01-01 18:57:44 +00:00
|
|
|
VECTOR2I m_originAxisPosition;
|
2012-05-04 17:44:42 +00:00
|
|
|
};
|
|
|
|
|
2018-01-29 12:26:58 +00:00
|
|
|
#endif // #ifndef GBR_LAYOUT_H
|