KiCad PCB EDA Suite
ws_proxy_view_item.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KICAD, a free EDA CAD application.
3  *
4  * Copyright (C) 2013 CERN
5  * @author Maciej Suminski <maciej.suminski@cern.ch>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef WS_PROXY_VIEW_ITEM_H
26 #define WS_PROXY_VIEW_ITEM_H
27 
28 #include <base_struct.h>
29 
30 class BOARD;
31 class PAGE_INFO;
32 class TITLE_BLOCK;
33 class WS_DRAW_ITEM_LINE;
34 class WS_DRAW_ITEM_RECT;
35 class WS_DRAW_ITEM_POLYGON;
36 class WS_DRAW_ITEM_TEXT;
38 
39 namespace KIGFX
40 {
41 class VIEW;
42 class GAL;
43 
45 {
46 public:
47  WS_PROXY_VIEW_ITEM( int aScaleFactor, const PAGE_INFO* aPageInfo, const TITLE_BLOCK* aTitleBlock );
48 
55  void SetFileName( const std::string& aFileName )
56  {
57  m_fileName = aFileName;
58  }
59 
66  void SetSheetName( const std::string& aSheetName )
67  {
68  m_sheetName = aSheetName;
69  }
70 
77  void SetPageInfo( const PAGE_INFO* aPageInfo );
78 
85  void SetTitleBlock( const TITLE_BLOCK* aTitleBlock );
86 
93  void SetSheetNumber( int aSheetNumber )
94  {
95  m_sheetNumber = aSheetNumber;
96  }
97 
104  void SetSheetCount( int aSheetCount )
105  {
106  m_sheetCount = aSheetCount;
107  }
108 
110  const BOX2I ViewBBox() const override;
111 
113  void ViewDraw( int aLayer, VIEW* aView ) const override;
114 
116  void ViewGetLayers( int aLayers[], int& aCount ) const override;
117 
118 #if defined(DEBUG)
119  void Show( int x, std::ostream& st ) const override { }
121 #endif
122 
126  virtual wxString GetClass() const override
127  {
128  return wxT( "WS_PROXY_VIEW_ITEM" );
129  }
130 
131 protected:
135 
137  std::string m_fileName;
138 
140  std::string m_sheetName;
141 
144 
147 
150 
153 };
154 }
155 
156 #endif /* WS_PROXY_VIEW_ITEM_H */
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
const TITLE_BLOCK * m_titleBlock
Title block that contains properties of the title block displayed in the worksheet.
void SetTitleBlock(const TITLE_BLOCK *aTitleBlock)
Function SetTitleBlock() Changes the TITLE_BLOCK object used to draw the worksheet.
void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on.
void SetSheetName(const std::string &aSheetName)
Function SetSheetName() Sets the sheet name displayed in the title block.
std::string m_sheetName
Sheet name displayed in the title block.
std::string m_fileName
File name displayed in the title block.
Class TITLE_BLOCK holds the information shown in the lower right corner of a plot,...
Definition: title_block.h:40
void SetFileName(const std::string &aFileName)
Function SetFileName() Sets the file name displayed in the title block.
void SetSheetCount(int aSheetCount)
Function SetSheetCount() Changes the sheets count number displayed in the title block.
const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers.
WS_PROXY_VIEW_ITEM(int aScaleFactor, const PAGE_INFO *aPageInfo, const TITLE_BLOCK *aTitleBlock)
Class PAGE_INFO describes the page size and margins of a paper page on which to eventually print or p...
Definition: page_info.h:54
int m_sheetCount
Sheets count number displayed in the title block.
void ViewDraw(int aLayer, VIEW *aView) const override
Function ViewDraw() Draws the parts of the object belonging to layer aLayer.
int m_mils2IUscalefactor
the factor between mils (units used in worksheet and internal units) it is the value IU_PER_MILS used...
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:161
Class EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boa...
Definition: base_struct.h:163
const PAGE_INFO * m_pageInfo
Worksheet page information.
Class VIEW.
Definition: view.h:61
virtual wxString GetClass() const override
Get class name.
void SetPageInfo(const PAGE_INFO *aPageInfo)
Function SetPageInfo() Changes the PAGE_INFO object used to draw the worksheet.
void SetSheetNumber(int aSheetNumber)
Function SetSheetNumber() Changes the sheet number displayed in the title block.
int m_sheetNumber
Sheet number displayed in the title block.