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 
113  void SetColorLayer( int aLayerId )
114  {
115  m_colorLayer = aLayerId;
116  }
117 
119  const BOX2I ViewBBox() const override;
120 
122  void ViewDraw( int aLayer, VIEW* aView ) const override;
123 
125  void ViewGetLayers( int aLayers[], int& aCount ) const override;
126 
127 #if defined(DEBUG)
128  void Show( int x, std::ostream& st ) const override { }
130 #endif
131 
135  virtual wxString GetClass() const override
136  {
137  return wxT( "WS_PROXY_VIEW_ITEM" );
138  }
139 
140 protected:
144 
146  std::string m_fileName;
147 
149  std::string m_sheetName;
150 
153 
156 
159 
162 
165 };
166 }
167 
168 #endif /* WS_PROXY_VIEW_ITEM_H */
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:131
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.
void SetColorLayer(int aLayerId)
Can be used to override which layer ID is used for worksheet item colors.
TITLE_BLOCK holds the information shown in the lower right corner of a plot, printout,...
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)
PAGE_INFO describes the page size and margins of a paper page on which to eventually print or plot.
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...
BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:163
EDA_ITEM is a base class for most all the KiCad significant classes, used in schematics and boards.
Definition: base_struct.h:166
const PAGE_INFO * m_pageInfo
Worksheet page information.
VIEW.
Definition: view.h:61
int m_colorLayer
Layer that is used for worksheet color (LAYER_WORKSHEET is always used for visibility)
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.