]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pFigure.h
85ca33f69168bd60d4155c6b59ef33949193eb55
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pFigure.h
1 #ifndef __pFIGURE__
2 #define __pFIGURE__
3
4 // ----------------------------------------------------------------------------
5 // WX headers inclusion.
6 // For compilers that support precompilation, includes <wx/wx.h>.
7 // ----------------------------------------------------------------------------
8 #include <wx/wxprec.h>
9 #ifdef __BORLANDC__
10 #pragma hdrstop
11 #endif
12 #ifndef WX_PRECOMP
13 #include <wx/wx.h>
14 #endif
15
16 /** @file pFigure.h */
17 class pFigure :public  wxObject{
18
19 public:
20
21         //------------------------------------------------------------------------------------------------------------
22         // Constructors & Destructors
23         //------------------------------------------------------------------------------------------------------------
24         /**
25         * Create a figure with edges_n edges
26         * @param edges_n The number of edges of the new figure
27         * @param _w The width to set
28         * @param _h The height to set
29         * @param _orientation The figure orientation to set
30         * @param bar_orientation The figure orientation to set
31         */
32         pFigure(int edges_n, int _w, int _h,int _orientation, bool bar_orientation);
33         ~pFigure();
34
35         //------------------------------------------------------------------------------------------------------------
36         // Methods
37         //------------------------------------------------------------------------------------------------------------
38
39         /**
40         * Gets the number of edges of the figure
41         * @retval edges Number of edges in the figure
42         */
43         int getNumberEdges();
44
45         /**
46         * Sets the vertex points of the figure
47         * @param edges Number of edges in the figure to set
48         */
49         void setNumberEdges(int n_edges);
50         
51         /**
52         * Gets the vertex points of the figure
53         * @param wxPoint The vector to get the points
54         * @retval points Vertex points distribution in the figure
55         */
56         void getVertexPoints(wxPoint thePoints[]);
57
58         /**
59         * Sets the vertex points of the figure
60         * @param edges Vertex points distribution in the figure to set
61         */
62         void setVertexPoints(wxPoint * n_points);
63
64         /*
65         * Sets the heigth of the figure
66         * @param _h The heigth to set
67         */
68         void setHeigth(int _h);
69
70         /*
71         * Gets the heigth of the figure
72         * @retval heigth The heigth of the figure
73         */
74         int getHeigth();
75
76         /*
77         * Sets the width of the figure
78         * @param _w The width to set
79         */
80         void setWidth(int _w);
81
82         /*
83         * Gets the width of the figure
84         * @retval width The width of the figure
85         */
86         int getWidth();
87
88         /*
89         * Indicates if a pixel point is inside the figure
90         * @param xFig_PixelPoint The known reference point inside the figure
91         * @param xPixel The x-pixel coord asking for
92         * @retval Returns true if the point is inside
93         */
94         bool isPointInside(int xFig_PixelPoint, int xPixel);
95
96         /*
97         * Sets the bar orientation 
98         * @ bar_orientation The orientation to set (true for horizontal, false for vertical)
99         */
100         void setBarOrientation(bool bar_orientation);
101
102         /*
103         * Sets the bar orientation used for triangles
104         * @ bar_orientation The orientation to set (LEFT = -4, RIGHT = -6, UP = -8, DOWN = -2)
105         */
106         void setFigureOrientation(int fig_orientation);
107         
108         //------------------------------------------------------------------------------------------------------------
109         // Constants
110         //------------------------------------------------------------------------------------------------------------
111         
112         enum
113         {
114                 TRIANGLE = 3,
115                 RECTANGLE = 4,
116                 LEFT = -4,
117                 RIGHT = -6,
118                 UP = -8,
119                 DOWN = -2,
120         };
121
122 private:
123
124         //------------------------------------------------------------------------------------------------------------
125         // Attributes
126         //------------------------------------------------------------------------------------------------------------
127
128         /*
129         * Represents the heigth of the figure
130         */
131         int heigth;
132
133         /*
134         * Represents the width of the figure
135         */
136         int width;
137
138         /*
139         * Represents the edges of the figure
140         */
141         int edges;
142
143         /**
144         * Represents the orientation UP, DOWN, LEFT, RIGTH of the figure
145         */
146         int orientation;
147
148         /*
149         * Is the bar orientation (true for HORIZONTAL, false VERTICAL)
150         */
151         bool barOrientation;
152
153         /*
154         * Represents the vertex points distribution of the figure in pixels scale
155         */
156         wxPoint *v_points;
157
158 DECLARE_CLASS(pColorBar)
159
160 };
161 #endif
162
163