~kicad-product-committers/kicad/kicad-gal

« back to all changes in this revision

Viewing changes to gal/test/rubberbanding/pad.h

  • Committer: torstenhtr at gmx
  • Date: 2012-08-04 14:55:55 UTC
  • Revision ID: torstenhtr@gmx.de-20120804145555-jbm9k193p1tth439
Cleaned up the files.
Repaired and improved the test examples.
Added the wxDC backend.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * This program source code file is part of KICAD, a free EDA CAD application.
3
3
 *
4
 
 * Copyright (C) 2010 Virtenio GmbH, Torsten Hueter, torsten.hueter <at> virtenio.de
5
 
 * Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors.
 
4
 * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
 
5
 * Copyright (C) 2012 Kicad Developers, see change_log.txt for contributors.
6
6
 *
7
7
 * Test of the Graphics Abstraction Layer (GAL)
8
8
 * Class pad
55
55
    PAD_CIRCLE, PAD_OBLONG, PAD_RECTANGLE
56
56
} PadType;
57
57
 
58
 
class PAD : public BOARD_ITEM
 
58
class PAD: public BOARD_ITEM
59
59
{
60
60
public:
61
 
 
62
 
    // FIXME move to protected
63
 
    PadType type;              /// Type of the pad [PAD_CIRCLE, PAD_OBLONG, PAD_RECTANGLE, ..]
64
 
    VECTOR2D drillSize;        /// Size of the drill
65
 
    VECTOR2D offset;           /// Pad offset position relative to drill
66
 
    VECTOR2D size;             /// Size of the pad [width, height]
 
61
    /// @copydoc BOARD_ITEM::ComputeBoundingBox()
 
62
    virtual BOUNDING_BOX ComputeBoundingBox( MATRIX3x3D aTransformation );
67
63
 
68
64
    /**
69
 
     * Compute the bounding box using an provided transformation matrix
70
 
     * @param aTransformation The bounding box is calculated relative to this transformation matrix
71
 
     * @return Bounding box as two diagonal points
 
65
     * @brief Draw the pad
72
66
     */
73
 
    virtual BoundingBox ComputeBoundingBox( MATRIX3x3D aTransformation );
 
67
    void Draw();
 
68
 
 
69
    /// @copydoc BOARD_ITEM::HitTest()
 
70
    bool HitTest( VECTOR2D point );
74
71
 
75
72
    /**
76
73
     * @Draw the pad label
78
75
    void DrawLabel();
79
76
 
80
77
    /**
81
 
     * @brief Draw the pad
82
 
     */
83
 
    void Draw();
84
 
 
85
 
    bool HitTest(VECTOR2D point);
86
 
 
87
 
    /**
88
 
     * Set the label color
89
 
     * @param aLabelColor The label color
90
 
     */
91
 
    void SetLabelColor(COLOR4D aLabelColor);
 
78
     * Set the label color.
 
79
     *
 
80
     * @param aLabelColor is the label color.
 
81
     */
 
82
    void SetLabelColor( COLOR4D aLabelColor );
 
83
 
 
84
    /**
 
85
     * Get the size.
 
86
     *
 
87
     * @return the size.
 
88
     */
 
89
    inline VECTOR2D GetSize()
 
90
    {
 
91
        return size;
 
92
    }
 
93
 
 
94
    /**
 
95
     * Set the size.
 
96
     *
 
97
     * @param aSize the size.
 
98
     */
 
99
    inline void SetSize(VECTOR2D aSize)
 
100
    {
 
101
        size = aSize;
 
102
    }
 
103
 
 
104
    /**
 
105
     * Get the size.
 
106
     *
 
107
     * @return the size.
 
108
     */
 
109
    inline VECTOR2D GetDrillSize()
 
110
    {
 
111
        return size;
 
112
    }
 
113
 
 
114
    /**
 
115
     * Set the size.
 
116
     *
 
117
     * @param aSize the size.
 
118
     */
 
119
    inline void SetDrillSize(VECTOR2D aDrillSize)
 
120
    {
 
121
        drillSize = aDrillSize;
 
122
    }
 
123
 
 
124
    /**
 
125
     * Get the offset.
 
126
     *
 
127
     * @return the offset.
 
128
     */
 
129
    inline VECTOR2D GetOffset()
 
130
    {
 
131
        return offset;
 
132
    }
 
133
 
 
134
    /**
 
135
     * Set the offset.
 
136
     *
 
137
     * @param aOffset the offset.
 
138
     */
 
139
    inline void SetOffset(VECTOR2D aOffset)
 
140
    {
 
141
        offset = aOffset;
 
142
    }
 
143
 
 
144
    /**
 
145
     * Get the type.
 
146
     *
 
147
     * @return the type.
 
148
     */
 
149
    inline PadType GetType()
 
150
    {
 
151
        return type;
 
152
    }
 
153
 
 
154
    /**
 
155
     * Set the type.
 
156
     *
 
157
     * @param aType the type.
 
158
     */
 
159
    inline void SetType(PadType aType)
 
160
    {
 
161
        type = aType;
 
162
    }
 
163
 
92
164
 
93
165
private:
94
166
    COLOR4D labelColor;        /// Label color
 
167
    PadType  type;             /// Type of the pad [PAD_CIRCLE, PAD_OBLONG, PAD_RECTANGLE, ..]
 
168
    VECTOR2D drillSize;        /// Size of the drill
 
169
    VECTOR2D offset;           /// Pad offset position relative to drill
 
170
    VECTOR2D size;             /// Size of the pad [width, height]
95
171
};
96
172
 
97
173
#endif /* PAD_H_ */