KiCad PCB EDA Suite
view_overlay.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-2017 CERN
5  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
6  * @author Maciej Suminski <maciej.suminski@cern.ch>
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, you may find one here:
20  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21  * or you may search the http://www.gnu.org website for the version 2 license,
22  * or you may write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24  */
25 
26 #ifndef __VIEW_OVERLAY_H
27 #define __VIEW_OVERLAY_H
28 
29 #include <view/view_item.h>
31 
32 #include <vector>
33 #include <deque>
34 
35 class SEG;
36 
37 namespace KIGFX
38 {
39 class VIEW;
40 
41 class VIEW_OVERLAY : public VIEW_ITEM
42 {
43 public:
44 
45  VIEW_OVERLAY();
46  virtual ~VIEW_OVERLAY();
47 
48  struct COMMAND;
49  struct COMMAND_ARC;
50  struct COMMAND_LINE;
51  struct COMMAND_CIRCLE;
52  struct COMMAND_SET_STROKE;
53  struct COMMAND_SET_FILL;
54  struct COMMAND_SET_COLOR;
55  struct COMMAND_SET_WIDTH;
56 
57  void Clear();
58 
59  virtual const BOX2I ViewBBox() const override;
60  virtual void ViewDraw( int aLayer, VIEW *aView ) const override;
61  virtual void ViewGetLayers( int aLayers[], int& aCount ) const override;
62 
63  void Line( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
64  void Line( const SEG& aSeg );
65  void Segment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint, double aWidth );
66  void Polyline( std::deque<VECTOR2D>& aPointList );
67  void Circle( const VECTOR2D& aCenterPoint, double aRadius );
68  void Arc( const VECTOR2D& aCenterPoint, double aRadius, double aStartAngle, double aEndAngle );
69  void Rectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
70  void Polygon( const std::deque<VECTOR2D>& aPointList );
71  void SetIsFill( bool aIsFillEnabled );
72  void SetIsStroke( bool aIsStrokeEnabled );
73  void SetFillColor( const COLOR4D& aColor );
74  void SetStrokeColor( const COLOR4D& aColor );
75 
76  void SetLineWidth( double aLineWidth );
77 
78 private:
79  void releaseCommands();
80 
81  std::vector<COMMAND*> m_commands;
82 };
83 
84 } // namespace KIGFX
85 
86 
87 #endif
void Polyline(std::deque< VECTOR2D > &aPointList)
std::vector< COMMAND * > m_commands
Definition: view_overlay.h:81
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
void Segment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth)
void SetFillColor(const COLOR4D &aColor)
virtual void ViewGetLayers(int aLayers[], int &aCount) const override
Function ViewGetLayers() Returns the all the layers within the VIEW the object is painted on...
Class VIEW_ITEM - is an abstract base class for deriving all objects that can be added to a VIEW...
Definition: view_item.h:84
void SetIsStroke(bool aIsStrokeEnabled)
void Line(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
void Arc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle)
void Polygon(const std::deque< VECTOR2D > &aPointList)
VIEW_ITEM class definition.
void SetStrokeColor(const COLOR4D &aColor)
void SetIsFill(bool aIsFillEnabled)
Definition: seg.h:36
virtual const BOX2I ViewBBox() const override
Function ViewBBox() returns the bounding box of the item covering all its layers. ...
void SetLineWidth(double aLineWidth)
void Circle(const VECTOR2D &aCenterPoint, double aRadius)
Class VIEW.
Definition: view.h:61
virtual void ViewDraw(int aLayer, VIEW *aView) const override
Function ViewDraw() Draws the parts of the object belonging to layer aLayer.
void Rectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39